/* DESIGN WITH PRODUCTS — the marketplace panel.
 *
 * Every colour, radius and font here comes from app.css's tokens, so the panel is the studio
 * and not a store bolted to the side of one. The only loud thing on the screen stays the 3D
 * view; the product photography supplies the warmth.
 *
 * Nothing in this file touches an existing selector. Everything is under `#market`, `.mk-` or
 * `body.market-open`, which is also why it can be removed by deleting one <link>.
 */

/* ── the column ──────────────────────────────────────────────────────────── */

#market {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0; overflow: hidden;
}
#market[hidden] { display: none; }

/* ── header ──────────────────────────────────────────────────────────────── */

.mk-head { flex: 0 0 auto; padding: 16px 16px 12px; }
.mk-title-row { display: flex; align-items: center; gap: 8px; }
.mk-title-row h2 {
  flex: 1 1 auto; margin: 0;
  /* THE ONE DISPLAY FACE IN THE PANEL. A catalogue of furniture read as a settings screen when
   * its title was 13px of the same UI font as everything else; the range it carries is the
   * product, and the product deserves a masthead. Unbounded is already loaded by the studio. */
  font: 500 19px/1.1 "Unbounded", var(--sans);
  letter-spacing: -.01em; color: var(--text);
}
.mk-x {
  width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-3); font-size: 20px; line-height: 1; cursor: pointer;
  transition: background .12s, color .12s;
}
.mk-x:hover { background: var(--panel-2); color: var(--text); }

.mk-search {
  display: flex; align-items: center; gap: 8px; margin-top: 13px;
  padding: 0 6px 0 13px; height: 40px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line);
  transition: border-color .14s, background .14s;
}
.mk-search:focus-within { border-color: var(--accent); background: var(--bg); }
.mk-search > svg { flex: 0 0 auto; color: var(--text-3); }
.mk-search input {
  flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: transparent;
  color: var(--text); font: 400 13px var(--sans); outline: none;
}
.mk-search input::placeholder { color: var(--text-3); }
.mk-search input::-webkit-search-cancel-button { filter: invert(.6); }

.mk-listbtn {
  position: relative; flex: 0 0 auto; width: 30px; height: 30px;
  border: 0; border-radius: 999px; background: var(--panel-2); color: var(--text-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.mk-listbtn:hover { background: var(--line); color: var(--text); }
.mk-listbtn.has { background: var(--accent); color: #fff; }
.mk-dot {
  position: absolute; top: -4px; right: -4px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px; background: var(--accent); color: #fff;
  border: 2px solid var(--panel);
  font: 600 9px/13px var(--mono); text-align: center;
}

/* ── scrolling body ──────────────────────────────────────────────────────── */

.mk-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 16px 20px; }

/* ── categories ──────────────────────────────────────────────────────────── */

.mk-cats {
  display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden;
  padding: 6px 0 10px; scrollbar-width: none;
}
.mk-cats::-webkit-scrollbar { display: none; }
.mk-chip {
  flex: 0 0 auto; height: 30px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--text-2);
  font: 500 12px var(--sans); white-space: nowrap; cursor: pointer;
  transition: background .14s, color .14s, border-color .14s;
}
.mk-chip:hover { border-color: var(--line-2); color: var(--text); }
/* White on --accent measured 4.01:1 at 12px — under the line for body text, and this is the
 * one control that says which shelf you are standing in. A deeper fill, not a lighter label. */
.mk-chip.is-on { background: var(--on-paper); border-color: var(--on-paper); color: #fff; }

/* ── the contextual line ─────────────────────────────────────────────────── */

.mk-ctx {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin: 2px 0 10px; padding: 8px 11px; border-radius: 10px;
  background: rgba(109,123,255,.08); border: 1px solid rgba(109,123,255,.18);
  font: 400 11.5px var(--sans); color: var(--text-2);
}
.mk-ctx-why { color: var(--accent-soft); font-weight: 500; }
.mk-ctx-hint { color: var(--text-3); }
.mk-ctx-off {
  margin-left: auto; border: 0; background: transparent; color: var(--text-3);
  font: 500 11px var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.mk-ctx-off:hover { color: var(--text); }

.mk-count-row {
  font: 500 10.5px var(--sans); letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); margin: 0 0 10px;
}

/* ── THE GRID, AND WHY THE CARDS ARE LIGHT ───────────────────────────────────
 *
 * The panel is dark because the studio is dark and the 3D view has to stay the brightest thing
 * on screen. The CARDS are not: a sofa photographed on white, dropped onto a navy tile, reads
 * as a screenshot of a website. On a warm stone plate inside a pale card it reads as a product
 * in a catalogue, which is what it is.
 *
 * That inversion is the whole look. It costs one rule and it is the difference between a
 * furniture range and a settings panel.
 */

.mk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.mk-card {
  display: flex; flex-direction: column; min-width: 0;
  border-radius: 16px; overflow: hidden; cursor: pointer;
  background: var(--paper);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 2px 10px -4px rgba(0,0,0,.5);
  transition: transform .16s ease, box-shadow .16s ease;
}
.mk-card:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -12px rgba(0,0,0,.72); }
.mk-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mk-card.is-on { box-shadow: 0 0 0 2px var(--accent); }

/* THE PLATE. Barely a gradient — the product has to be the only thing with shape on it, and a
 * plate with its own direction competes with the photograph sitting on it. */
.mk-shot {
  position: relative; aspect-ratio: 4 / 3; max-width: 100%;
  background: linear-gradient(180deg, var(--paper-2) 0%, var(--paper-3) 100%);
  display: grid; place-items: center; overflow: hidden;
}
.mk-shot img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 8%; }
.mk-shot-wait {
  width: 36%; aspect-ratio: 1; border-radius: 10px;
  background: linear-gradient(100deg, var(--paper-3) 20%, var(--paper-2) 40%, var(--paper-3) 60%);
  background-size: 300% 100%; animation: mk-shimmer 1.4s ease-in-out infinite;
}
@keyframes mk-shimmer { to { background-position: -150% 0; } }

.mk-badge {
  display: inline-block; padding: 3px 7px; border-radius: 6px; vertical-align: middle;
  font: 600 9px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase;
}
.mk-shot .mk-badge { position: absolute; top: 8px; left: 8px; }
.mk-badge-sample { background: var(--sample); color: var(--sample-ink); }

.mk-fav {
  position: absolute; top: 9px; right: 9px; width: 28px; height: 28px;
  display: grid; place-items: center; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.88); color: var(--paper-ink-3);
  box-shadow: 0 2px 6px -2px rgba(0,0,0,.25);
  opacity: 0; transition: opacity .14s, color .14s;
}
.mk-fav { opacity: .82; }
.mk-card:hover .mk-fav, .mk-fav[aria-pressed="true"] { opacity: 1; }
.mk-fav[aria-pressed="true"] { color: var(--bad); }
.mk-fav:hover { color: var(--paper-ink); }

/* THE TEXT BLOCK, IN THE ORDER SHE DECIDES IN.
 * House first and loudest, the piece under it in the quiet colour, the code and the size as the
 * fine print, and the price as the second-loudest thing on the card. A price set in the same
 * weight as a model number is a price nobody sees. */
.mk-meta { padding: 12px 13px 13px; display: flex; flex-direction: column; min-width: 0; }
.mk-house {
  font: 600 12.5px/1.3 var(--sans); color: var(--paper-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mk-name {
  /* The quiet line, but quiet is a ratio and not a feeling: var(--paper-ink-2) measured 4.2:1 on the
   * card and the probe refused it. Secondary text still has to be text. */
  font: 400 12px/1.35 var(--sans); color: var(--paper-ink-2); margin-top: 1px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mk-sub {
  /* 2.51:1 at 9.5px when this was var(--paper-ink-3) — the code a designer orders by, unreadable. */
  font: 400 9.5px/1.35 var(--mono); color: var(--paper-ink-3); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.mk-foot { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.mk-price {
  flex: 1 1 auto; min-width: 0; font: 600 16px/1 var(--sans); color: var(--paper-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.mk-price-none { font: 400 11.5px/1.3 var(--sans); color: var(--paper-ink-2); letter-spacing: 0; }

/* THE ACTION IS A CIRCLE, and it is the only lavender on a cream card — one place for the eye
 * to land, and it lands on the thing that puts the product in the room. */
.mk-add {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--paper-line); background: var(--on-paper-2); color: var(--on-paper);
  display: grid; place-items: center;
  transition: background .14s, color .14s, transform .14s, border-color .14s;
}
.mk-add:hover { background: var(--on-paper); border-color: var(--on-paper); color: #fff; transform: scale(1.06); }
.mk-add:active { transform: scale(.96); }

.mk-more {
  display: block; width: 100%; margin-top: 12px; height: 34px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--text-2); font: 500 12px var(--sans);
}
.mk-more:hover { border-color: var(--line-2); color: var(--text); }

/* skeletons wear the card's own colours, so the grid does not flash dark then light */
.mk-skel { pointer-events: none; box-shadow: none; }
.mk-skel .mk-shot { background: var(--paper-2); }
.mk-skel .mk-meta span { height: 9px; border-radius: 4px; background: var(--paper-3); display: block; }
.mk-skel .mk-meta span:last-child { width: 60%; }

/* ── empty / notes ───────────────────────────────────────────────────────── */

.mk-empty { padding: 26px 8px; text-align: center; color: var(--text-2); font-size: 12px; }
.mk-empty p { margin-bottom: 8px; }
.mk-empty-acts { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.mk-note { font: 400 11px/1.5 var(--sans); color: var(--text-3); margin-top: 7px; }
.mk-warn-note {
  font: 400 11px/1.5 var(--sans); color: var(--warn); margin-top: 8px;
  padding: 7px 9px; border-radius: 7px;
  background: rgba(255,196,107,.07); border: 1px solid rgba(255,196,107,.2);
}
.mk-unknown { color: var(--text-3); font-style: italic; }
.mk-bad { color: var(--bad); }

/* ── details ─────────────────────────────────────────────────────────────── */

.mk-back {
  display: inline-flex; align-items: center; gap: 5px; margin-bottom: 9px;
  border: 0; background: transparent; color: var(--text-3); cursor: pointer;
  font: 500 11.5px var(--sans); padding: 2px 0;
}
.mk-back:hover { color: var(--text); }

.mk-viewer { position: relative; border-radius: 11px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.mk-stage { height: 258px; width: 100%; touch-action: none; cursor: grab; }
.mk-stage:active { cursor: grabbing; }
.mk-canvas { display: block; width: 100%; height: 100%; }
.mk-stage-bar {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-top: 1px solid var(--line); background: rgba(11,14,29,.55);
}
.mk-hint { flex: 1 1 auto; font: 400 10px var(--sans); color: var(--text-3); }
.mk-ghost {
  flex: 0 0 auto; height: 23px; padding: 0 9px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--text-2); font: 500 11px var(--sans);
}
.mk-ghost:hover { border-color: var(--line-2); color: var(--text); }
.mk-stage-wait, .mk-stage-fail {
  position: absolute; left: 0; right: 0; top: 0; height: 258px;
  display: grid; place-items: center; padding: 20px; text-align: center;
  font: 400 11.5px/1.6 var(--sans); color: var(--text-3);
  background: rgba(15,20,48,.86); pointer-events: none;
}
.mk-stage-fail { color: var(--warn); }
/* MEASURED: the sofa was loading, framed and rendering 4,244 triangles, and the panel showed a
 * blank rectangle. These two overlays sit ON the canvas at 86% opacity, and a class selector
 * setting `display: grid` beats the browser's own `[hidden] { display: none }` — so setting
 * .hidden in JavaScript did exactly nothing and the "Loading the model…" plate stayed over a
 * finished render. A blank 3D view and a covered 3D view look identical; this is the difference. */
.mk-stage-wait[hidden], .mk-stage-fail[hidden] { display: none; }

.mk-dhead { margin: 12px 0 2px; }
.mk-dhead h3 { font: 600 14px/1.3 var(--sans); color: var(--text); margin: 0; }
.mk-dhead p { font: 400 11px var(--sans); color: var(--text-3); margin: 3px 0 0; }

.mk-block { margin-top: 15px; }
.mk-block h4 {
  display: flex; align-items: center; gap: 6px; margin: 0 0 7px;
  font: 700 9.5px var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--text-3);
}
.mk-count { font: 400 9.5px var(--mono); color: var(--text-3); letter-spacing: 0; }

.mk-vars { display: flex; flex-wrap: wrap; gap: 5px; }
.mk-var {
  height: 26px; padding: 0 10px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2);
  font: 500 11px var(--mono); transition: border-color .12s, color .12s, background .12s;
}
.mk-var:hover { border-color: var(--line-2); color: var(--text); }
.mk-var.is-on { border-color: var(--accent); background: rgba(109,123,255,.14); color: var(--accent-soft); }
.mk-vars-colour { gap: 6px; }
.mk-swatch {
  width: 26px; height: 26px; padding: 2px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-2);
}
.mk-swatch span { display: block; width: 100%; height: 100%; border-radius: 5px; }
.mk-swatch.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

.mk-spec { width: 100%; border-collapse: collapse; }
.mk-spec th, .mk-spec td {
  text-align: left; vertical-align: top; padding: 5px 0;
  border-bottom: 1px solid rgba(42,51,99,.5); font: 400 11.5px/1.45 var(--sans);
}
.mk-spec th { width: 46%; color: var(--text-3); font-weight: 400; padding-right: 8px; }
.mk-spec td { color: var(--text); font-variant-numeric: tabular-nums; }
.mk-spec tr:last-child th, .mk-spec tr:last-child td { border-bottom: 0; }

.mk-acc { font: 500 10.5px var(--sans); padding: 1px 6px; border-radius: 5px; }
.mk-acc-official { color: var(--good); background: rgba(74,217,145,.12); }
.mk-acc-validated { color: var(--accent-soft); background: rgba(109,123,255,.13); }
.mk-acc-approximate { color: var(--warn); background: rgba(255,196,107,.12); }
.mk-acc-none { color: var(--bad); background: rgba(255,107,107,.12); }

.mk-link {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 9px;
  font: 500 11.5px var(--sans); color: var(--accent-soft); text-decoration: none;
}
.mk-link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ── the action bar ──────────────────────────────────────────────────────── */

.mk-actions {
  flex: 0 0 auto; display: flex; gap: 6px; align-items: center;
  padding: 9px 12px; border-top: 1px solid var(--line); background: var(--panel);
}
.mk-actions-inline { padding: 14px 0 0; border-top: 0; background: transparent; }
.mk-primary {
  flex: 1 1 auto; height: 32px; border: 0; border-radius: 9px; cursor: pointer;
  background: var(--grad); color: var(--accent-ink); font: 600 12.5px var(--sans);
  transition: filter .12s, opacity .12s;
}
.mk-primary:hover:not(:disabled) { filter: brightness(1.08); }
.mk-primary:disabled { opacity: .35; cursor: default; background: var(--panel-2); color: var(--text-3); }
.mk-secondary {
  flex: 0 0 auto; height: 32px; padding: 0 11px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--text-2);
  font: 500 12px var(--sans); transition: background .12s, color .12s;
}
.mk-secondary:hover { background: var(--panel-2); color: var(--text); }
.mk-icon { width: 34px; padding: 0; display: grid; place-items: center; }
.mk-place-hint {
  flex: 0 0 auto; padding: 0 12px 9px; font: 400 10.5px var(--sans); color: var(--text-3);
  background: var(--panel);
}

/* ── the product list ────────────────────────────────────────────────────── */

.mk-list h3 { font: 600 13px var(--sans); color: var(--text); margin: 0 0 4px; }
.mk-l-group { margin-top: 16px; }
.mk-l-group h4 {
  display: flex; align-items: center; gap: 7px; margin: 0 0 6px;
  font: 700 9.5px var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--text-3);
}
.mk-ltable { width: 100%; border-collapse: collapse; }
.mk-ltable td {
  padding: 7px 0; border-bottom: 1px solid rgba(42,51,99,.5); vertical-align: top;
  font: 400 11.5px/1.4 var(--sans);
}
.mk-l-name { width: 56%; padding-right: 8px !important; }
.mk-linkish {
  border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left;
  color: var(--text); font: 500 11.5px/1.4 var(--sans);
}
.mk-linkish:hover { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 2px; }
.mk-l-sub { display: block; font: 400 10px var(--mono); color: var(--text-3); }
.mk-l-qty { width: 22%; font-variant-numeric: tabular-nums; color: var(--text-2); }
.mk-l-qty input {
  width: 52px; height: 24px; padding: 0 6px; border-radius: 6px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  font: 500 11.5px var(--mono); text-align: right;
}
.mk-l-price { width: 18%; text-align: right; font: 500 11.5px var(--mono); color: var(--text); }
.mk-l-x { width: 24px; text-align: right; }
.mk-l-x button {
  width: 20px; height: 20px; border: 0; border-radius: 5px; cursor: pointer;
  background: transparent; color: var(--text-3); font-size: 15px; line-height: 1;
}
.mk-l-x button:hover { background: rgba(255,107,107,.14); color: var(--bad); }
.mk-total { margin-top: 14px; }
.mk-total-sum { font: 400 12px var(--sans); color: var(--text-2); }

/* ── the discovery popover ───────────────────────────────────────────────── */

.mk-pop {
  position: fixed; z-index: 120; width: 248px;
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: 12px; cursor: pointer;
  background: rgba(21,26,56,.97); border: 1px solid var(--line-2);
  box-shadow: 0 18px 44px -14px rgba(0,0,0,.8);
  animation: mk-pop-in .22s ease both;
}
@keyframes mk-pop-in { from { opacity: 0; transform: translateY(-5px); } }
.mk-pop-arrow {
  position: absolute; top: -6px; left: var(--mk-arrow, 50%); margin-left: -6px;
  width: 11px; height: 11px; transform: rotate(45deg);
  background: rgba(21,26,56,.97);
  border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2);
}
.mk-pop-art {
  flex: 0 0 auto; width: 54px; height: 44px; border-radius: 8px; overflow: hidden;
  background: linear-gradient(160deg, var(--panel-2), var(--bg-2));
  position: relative;
}
.mk-pop-chip { position: absolute; border-radius: 3px; }
.mk-pop-chip-a { left: 6px; bottom: 7px; width: 26px; height: 13px; background: var(--paper-3); }
.mk-pop-chip-b { left: 34px; bottom: 7px; width: 13px; height: 20px; background: var(--accent-soft); }
.mk-pop-chip-c { left: 15px; top: 7px; width: 9px;  height: 9px;  background: var(--sample); border-radius: 999px; }
.mk-pop-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mk-pop-body strong { font: 600 12px var(--sans); color: var(--text); }
.mk-pop-body span { font: 400 10.5px var(--sans); color: var(--text-3); }
.mk-pop-x {
  position: absolute; top: 3px; right: 5px; width: 18px; height: 18px;
  border: 0; background: transparent; color: var(--text-3); font-size: 15px; line-height: 1; cursor: pointer;
}
.mk-pop-x:hover { color: var(--text); }

/* ── narrow screens: an overlay with an obvious way back ─────────────────── */

@media (max-width: 1179px) {
  #market {
    position: absolute; z-index: 78; top: 0; right: 0; bottom: 0;
    width: min(380px, 92vw); border-radius: var(--r-lg) 0 0 var(--r-lg);
    box-shadow: -24px 0 50px -22px rgba(0,0,0,.8);
    animation: mk-slide .2s ease both;
  }
  @keyframes mk-slide { from { transform: translateX(14px); opacity: 0; } }
}

@media (prefers-reduced-motion: reduce) {
  .mk-pop, #market { animation: none; }
  .mk-shot-wait { animation: none; }
}

.mk-chosen { color: var(--accent-soft); }

/* ── GETTING IT IN ───────────────────────────────────────────────────────────
 * Three tones, and the bad one is allowed to be loud: a sofa that will not turn the landing is
 * the single most expensive thing on this page, and it has to interrupt. */
.mk-access-line { font: 500 12px/1.5 var(--sans); margin-bottom: 2px; }
.mk-access-ok   .mk-access-line { color: var(--good); }
.mk-access-warn .mk-access-line { color: var(--warn); }
.mk-access-bad  .mk-access-line { color: var(--bad); }
.mk-access-unknown .mk-access-line { color: var(--text-3); font-weight: 400; font-style: italic; }
.mk-access-bad {
  padding: 9px 10px; border-radius: 9px;
  background: rgba(255,107,107,.07); border: 1px solid rgba(255,107,107,.22);
}
/* Measured on the wall, and what to buy. Two different numbers, and the second one is the one
   that goes to the merchant — so it is the one that gets the colour. */
.mk-measured { display: block; color: var(--text-3); font: 400 10.5px var(--mono); }
.mk-order { display: block; color: var(--accent-soft); font: 600 11px var(--mono); margin-top: 1px; }

/* ── WHAT IS ALREADY IN THE ROOM ─────────────────────────────────────────────
 * The running total, made visible. Specifying is cumulative, and the only evidence used to be a
 * number on a button at the top of a panel she had scrolled away from. */
.mk-inroom {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px;
  padding: 11px 14px 12px; border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(21,26,56,0) 0%, rgba(13,16,36,.6) 100%);
}
.mk-inroom-head { display: flex; }
.mk-inroom-head span {
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 10px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3);
}
.mk-inroom-head b {
  font: 600 10px/1 var(--mono); letter-spacing: 0; color: var(--text-2);
  background: var(--panel-2); border-radius: 999px; padding: 3px 7px;
}
/* THE BUTTON SITS ON THE LEFT. The bottom-right corner of the window belongs to the support
   bubble, which floats over everything — measured in a screenshot, where it was covering the
   word this button is made of. */
.mk-inroom-row { display: flex; align-items: center; gap: 10px; flex-direction: row-reverse; }
.mk-inroom-row .mk-inroom-shots { justify-content: flex-end; }
.mk-inroom-shots { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.mk-inroom-shot {
  width: 34px; height: 34px; flex: 0 0 auto; margin-right: -7px;
  border-radius: 9px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--paper-2) 0%, var(--paper-3) 100%);
  border: 2px solid var(--panel); box-shadow: 0 2px 6px -2px rgba(0,0,0,.5);
}
.mk-inroom-shot img { width: 100%; height: 100%; object-fit: contain; padding: 10%; display: block; }
.mk-inroom-more {
  width: 34px; height: 34px; flex: 0 0 auto; margin-right: -7px;
  border-radius: 9px; display: grid; place-items: center;
  background: var(--panel-2); border: 2px solid var(--panel);
  font: 600 10.5px var(--mono); color: var(--text-2);
}
.mk-inroom-go {
  /* nowrap, because the strip beside it will take every pixel it is offered and the label is
   * the half that matters: "2 in this ro…" is a button that has stopped saying anything. */
  flex: 0 0 auto; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 13px; border-radius: 999px; cursor: pointer;
  border: 0; background: var(--grad); color: var(--accent-ink); font: 600 11.5px var(--sans);
  transition: filter .12s;
}
.mk-inroom-go:hover { filter: brightness(1.08); }

/* ── THE BAND AT THE TOP OF THE CATALOGUE ────────────────────────────────────
 *
 * The one large thing in the panel, and the only cream surface that is not a product. It reads
 * as the front of a catalogue because that is what it is: a range, a number, and a way in.
 * See ui/market/hero.js for why its copy is counted rather than written.
 */
.mk-hero {
  position: relative; display: block; overflow: hidden;
  margin: 2px 0 14px; border-radius: 18px; min-height: 196px;
  background: linear-gradient(135deg, var(--paper) 0%, var(--paper-2) 58%, var(--paper-3) 100%);
  box-shadow: 0 10px 28px -16px rgba(0,0,0,.6);
}
.mk-hero-art {
  position: absolute; right: -6%; top: 0; bottom: 0; width: 56%;
  display: grid; place-items: center; pointer-events: none;
}
.mk-hero-art img {
  width: 100%; height: 100%; object-fit: contain; padding: 14% 8%;
  /* It is a piece in a window, not a cut-out pasted on: a soft ground shadow sits it down. */
  filter: drop-shadow(0 14px 18px rgba(70,54,34,.22));
}
/* The copy must stay readable over whatever picture lands behind it. */
.mk-hero-copy {
  position: relative; z-index: 1; max-width: 62%;
  padding: 18px 16px 17px;
  background: linear-gradient(90deg, rgba(248,243,234,.96) 55%, rgba(248,243,234,0) 100%);
}
.mk-hero-eyebrow {
  display: block; font: 600 9.5px var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--sample-ink);
}
.mk-hero h3 {
  margin: 7px 0 0; font: 500 19px/1.15 "Unbounded", var(--sans);
  letter-spacing: -.015em; color: var(--paper-ink); text-wrap: balance;
}
.mk-hero p {
  margin: 8px 0 0; font: 400 11.5px/1.55 var(--sans); color: var(--paper-ink-2); max-width: 34ch;
}
.mk-hero-cta {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 13px;
  height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 0; background: var(--paper-ink); color: var(--paper); font: 600 11.5px var(--sans);
  transition: background .14s, transform .14s;
}
.mk-hero-cta:hover { background: var(--on-paper); transform: translateX(2px); }

.mk-hero-dots {
  position: absolute; z-index: 2; right: 13px; bottom: 11px; display: flex; gap: 5px;
}
.mk-hero-dot {
  width: 6px; height: 6px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(50,40,26,.26); transition: background .14s, width .14s;
}
.mk-hero-dot:hover { background: rgba(50,40,26,.5); }
.mk-hero-dot.is-on { width: 17px; background: var(--paper-ink); }

@media (max-width: 1179px) { .mk-hero { min-height: 172px; } .mk-hero h3 { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .mk-hero-cta { transition: none; } }

/* ── THE PROJECT LIST ────────────────────────────────────────────────────────
 * Lives here rather than in app.css because it belongs to the refocus: a list of chat rows
 * became a list of projects. See ui/conversations.js for the reasoning.
 */
#convo-list .cv-row {
  position: relative; display: flex; align-items: stretch;
  border-radius: 11px; margin: 0 0 3px;
  transition: background .12s;
}
#convo-list .cv-row:hover { background: rgba(255,255,255,.035); }
#convo-list .cv-row.on { background: rgba(109,123,255,.1); border-color: transparent; }
#convo-list .cv-row.on::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2.5px;
  border-radius: 999px; background: var(--accent);
}

/* NO PLATE ON THE ROW. There was a 42px thumbnail here — the last frame, or initials on a tinted
   square — and a column of forty of them read as stamps rather than as a list of work. The row is
   the name and what is in the project, and it gets the whole width. */
#convo-list .cv-item {
  flex: 1 1 auto; min-width: 0; display: flex; flex-direction: row;
  align-items: center;
  padding: 7px 10px; border: 0; background: transparent; cursor: pointer; text-align: left;
}
#convo-list .cv-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#convo-list .cv-name {
  font: 500 12.5px/1.35 var(--sans); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#convo-list .cv-row.on .cv-name { color: var(--accent-soft); }
#convo-list .cv-meta {
  display: flex; align-items: baseline; gap: 6px;
  /* --text-3 measured 4.1:1 at 10.5px on this row. The line that says what is IN a project is
   * the one she scans the list with; it does not get to be decoration. */
  font: 400 10.5px/1.3 var(--sans); color: var(--text-3);
  overflow: hidden; white-space: nowrap;
}
#convo-list .cv-meta i { font-style: normal; color: var(--text-3); flex: 0 0 auto; }

/* THE HANDLES ONLY EXIST UNDER THE POINTER. Three buttons on every row, always, is what was
   taking the name's width away and truncating it — and they are things you do to a project
   occasionally, not things you read. */
#convo-list .cv-handles {
  display: flex; align-items: center; gap: 1px; padding-right: 5px;
  opacity: 0; transition: opacity .12s;
}
#convo-list .cv-row:hover .cv-handles, #convo-list .cv-row:focus-within .cv-handles { opacity: 1; }
#convo-list .cv-borrow {
  opacity: 1; width: 24px; height: 24px; display: grid; place-items: center;
  border: 0; border-radius: 6px; background: transparent; color: var(--text-3);
  cursor: pointer; font-size: 13px; line-height: 1;
}
#convo-list .cv-borrow:hover { background: var(--panel-2); color: var(--text); }
#convo-list .cv-del:hover { background: rgba(255,107,107,.15); color: var(--bad); }

/* ── THE PROJECT DRAWER TAKES ITS PLACE IN THE ROW ───────────────────────────
 *
 * It used to overlay the conversation, and that was wrong, which a screenshot settles faster
 * than an argument: a panel standing ON the thread, with the words still legible beside it and
 * behind it, reads as a dropdown that failed to open rather than as a drawer. A professional
 * tool makes room for what it opens.
 *
 * So the rail is back IN THE FLOW and the conversation narrows to fit it, which is what pressing
 * a list button is supposed to do. Measured at 1500px: the thread goes 732px → 465px, and the
 * rail overlaps it by exactly 0.
 *
 * THE ONE GUARD IS A FLOOR. The drawer and the marketplace can both be open on a laptop, and
 * two things taking width out of one column is how a conversation ends up a gutter. So the
 * column grows to hold the rail plus 300px rather than letting the thread go under it.
 */
:root { --rail-w: 0px; }
body.convo-open { --rail-w: 268px; }
@media (max-width: 1279px) { body.convo-open { --rail-w: 236px; } }

#left .cv-rail {
  position: static; flex: 0 0 auto; width: 0; overflow: hidden;
  background: transparent; box-shadow: none;
  /* app.css leaves a TRANSPARENT 1px border on the closed rail so the line can fade in with the
   * width. In the flow that invisible border is still a px of layout: measured, the shut drawer
   * held the thread 1px off the edge of its own column. Nothing about it is visible and all of
   * it is wrong. */
  border-right-width: 0;
}
#left .cv-rail.open { width: var(--rail-w); border-right: 1px solid var(--line); }

@media (min-width: 821px) {
  body.studio-split.convo-open {
    --left-w: max(340px, (100vw - 30px) * .5, calc(var(--rail-w) + 300px));
  }
  body.studio-split.convo-open.market-open {
    --left-w: max(320px, (100vw - 30px - var(--market-w)) * .42, calc(var(--rail-w) + 300px));
  }
}

/* ── WHAT THE REVIEW FOUND ───────────────────────────────────────────────────
 * A card in the thread, not a paragraph in a bubble. See ui/findings.js for what was there
 * before and why a list of coordinates is the engine talking to itself in front of the client.
 */
.fd-card {
  margin: 10px 0 4px; padding: 0; border-radius: 13px;
  background: var(--bg-2); border: 1px solid var(--line); overflow: hidden;
}
.fd-head {
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  padding: 12px 14px 10px; border-bottom: 1px solid var(--line);
}
.fd-head b { font: 600 12.5px/1.3 var(--sans); color: var(--bad); }
.fd-head span { font: 400 11.5px var(--sans); color: var(--warn); }

.fd-rows { display: flex; flex-direction: column; }
.fd-row {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  padding: 10px 14px; border: 0; background: transparent; cursor: pointer;
  border-bottom: 1px solid rgba(42,51,99,.4);
  transition: background .12s;
}
.fd-row:last-child { border-bottom: 0; }
.fd-row:hover:not(:disabled) { background: var(--panel-2); }
.fd-row:disabled { cursor: default; opacity: .72; }
.fd-row.is-on { background: rgba(109,123,255,.14); }
.fd-dot {
  flex: 0 0 auto; width: 7px; height: 7px; margin-top: 5px; border-radius: 999px;
  background: var(--warn);
}
.fd-row.is-hard .fd-dot { background: var(--bad); }
.fd-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fd-said { font: 500 12px/1.45 var(--sans); color: var(--text); }
.fd-fix { font: 400 11px/1.45 var(--sans); color: var(--text-3); }

.fd-more {
  width: 100%; padding: 9px 14px; border: 0; border-top: 1px solid var(--line);
  background: transparent; color: var(--text-2); font: 500 11.5px var(--sans); cursor: pointer;
}
.fd-more:hover { background: var(--panel-2); color: var(--text); }
.fd-note { padding: 9px 14px 11px; font: 400 10.5px/1.5 var(--sans); color: var(--text-3); }
