/* Direction C, "Proof" (Austin, Nov 4): black and white, hairlines, Inter Tight for the UI, JetBrains Mono for data only.
   One red (#d9381e) and only for crop marks and things that need attention. Radius 6px at most, no pills, no tiles, no colored chips.
   App chrome only: agent brand colors inside designs are untouched. */
:root {
  --bg: #ffffff; --surface: #ffffff; --side: #fbfbfa; --wall: #f3f3f1; --hover: #f4f4f2; --sel-bg: #efefed;
  --line: #e2e2e2; --line-2: #c4c4c4;
  --ink: #0a0a0a; --ink-2: #333333; --ink-3: #4d4d4d; --ink-4: #5e5e5e;
  --mark: #d9381e;
  --accent: #345BEA; --on-accent: #ffffff; --pin-top: #345BEA; --pin-bot: #7BDFC6;
  --f: "Inter Tight", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --r: 6px; --r-sm: 5px;
  --lift: 0 1px 2px rgba(0,0,0,.08), 0 18px 40px -14px rgba(0,0,0,.3);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121212; --surface: #161616; --side: #171717; --wall: #1b1b1b; --hover: #1f1f1f; --sel-bg: #262626;
  --line: #2a2a2a; --line-2: #3a3a3a; --ink: #f1f1f1; --ink-2: #c8c8c8; --ink-3: #a6a6a6; --ink-4: #8a8a8a; --mark: #ff6a50;
  --accent: #7BDFC6; --on-accent: #0D1C3B; --pin-top: #4F78F7; --pin-bot: #7BDFC6;
  --lift: 0 1px 2px rgba(0,0,0,.5), 0 18px 40px -14px rgba(0,0,0,.7); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #121212; --surface: #161616; --side: #171717; --wall: #1b1b1b; --hover: #1f1f1f; --sel-bg: #262626;
  --line: #2a2a2a; --line-2: #3a3a3a; --ink: #f1f1f1; --ink-2: #c8c8c8; --ink-3: #a6a6a6; --ink-4: #8a8a8a; --mark: #ff6a50;
  --accent: #7BDFC6; --on-accent: #0D1C3B; --pin-top: #4F78F7; --pin-bot: #7BDFC6;
  --lift: 0 1px 2px rgba(0,0,0,.5), 0 18px 40px -14px rgba(0,0,0,.7); color-scheme: dark }

html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--f); -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 16px; } h2 { font-size: 15px; }
h3 { font: 600 13px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
p { margin: 0; } a { color: inherit; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--ink-2); font-weight: 500; } .faint { color: var(--ink-3); font-weight: 500; }
.tnum { font-variant-numeric: tabular-nums; }
svg.i { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* status = a tiny square: filled = ready for review, gray = in edits, outlined = sent */
.sq { display: inline-block; width: 7px; height: 7px; flex: none; vertical-align: 1px; }
.sq.ready { background: var(--ink); }
.sq.edit { background: #c9c9c9; outline: 1px solid #999; outline-offset: -1px; }
.sq.sent { background: var(--bg); outline: 1.5px solid var(--ink); outline-offset: -1.5px; }
.stl { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- Sign in ---------- */
#root { min-height: 100%; }
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); }
.si-form { display: flex; align-items: center; justify-content: center; padding: 48px max(32px, env(safe-area-inset-left, 0px)); border-right: 1px solid var(--line); }
.si-box { width: min(320px, 100%); display: flex; flex-direction: column; gap: 18px; }
.si-box h1 { font-size: 16px; }
.si-wall { background: var(--wall); display: flex; flex-direction: column; justify-content: center; padding: 48px max(40px, env(safe-area-inset-right, 0px)); gap: 18px; min-width: 0; overflow: hidden; }
.si-row { display: flex; gap: 28px; align-items: flex-end; }
.si-row figure { margin: 0; min-width: 0; }
.si-row canvas { display: block; box-shadow: var(--lift); background: #fff; max-width: 100%; height: auto; }
.si-row figcaption { margin-top: 10px; font: 500 13px var(--mono); color: var(--ink-3); }
.oauth { display: flex; align-items: center; justify-content: center; gap: 10px; height: 38px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); font-weight: 600; font-size: 15px; }
.oauth:hover { background: var(--hover); }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 15px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.si-foot { font: 500 13px var(--mono); color: var(--ink-3); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; font-weight: 700; letter-spacing: -0.03em; font-size: 15px; color: var(--ink); }
.mark { height: 24px; width: auto; display: block; flex: none; color: inherit; overflow: visible; }
.mark .pin-top { fill: var(--pin-top); } .mark .pin-bot { fill: var(--pin-bot); }
.mark .wm-a { fill: currentColor; } .mark .wm-b { fill: var(--accent); }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 15px; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--hover); }
.btn.primary, .btn.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover, .btn.accent:hover { opacity: .88; background: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 15px; }
.btn.icon { width: 30px; padding: 0; }
.btn.block { width: 100%; height: 38px; font-size: 15px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  height: 34px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 0 10px; font-size: 15px; font-weight: 400; color: var(--ink); width: 100%; min-width: 0; }
textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 64px; line-height: 1.45; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 28px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=color] { width: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 3px; background: var(--surface); cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; border-right: 1px solid var(--line-2); background: transparent; height: 26px; padding: 0 10px; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 3px; font: 500 13px var(--mono); color: var(--ink-2); white-space: nowrap; background: transparent; }
.badge.attn { color: var(--mark); border-color: var(--mark); }
.field { font-family: var(--mono); font-size: 13px; padding: 1px 5px; border: 1px solid var(--line-2); border-radius: 3px; color: var(--ink); white-space: nowrap; }
.sw { width: 14px; height: 14px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); display: inline-block; flex: none; }
.swg { display: inline-flex; gap: 3px; }
.swg .sw { width: 16px; height: 16px; }
.av { display: block; flex: none; border-radius: 3px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.pad { padding: 18px; }
.hr { height: 1px; background: var(--line); }
.empty { padding: 20px 18px; color: var(--ink-3); font: 500 13px var(--mono); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100%; }
.side { position: sticky; top: env(safe-area-inset-top, 0px); height: calc(100vh - env(safe-area-inset-top, 0px)); background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; padding-left: max(14px, env(safe-area-inset-left, 0px)); gap: 2px; }
.side .logo { padding: 2px 8px 4px; }
.ws { padding: 0 8px 16px; font: 500 13px var(--mono); color: var(--ink-3); }
.search { margin: 0 0 10px; }
.search input { height: 30px; font-size: 15px; background: var(--surface); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-size: 15px; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.on { background: var(--sel-bg); color: var(--ink); font-weight: 600; }
.nav .n { margin-left: auto; font: 500 13px var(--mono); color: var(--ink-3); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding: 12px 8px 0; }
.sample { font: 500 13px/1.5 var(--mono); color: var(--ink-3); }
.sample button { border: 0; background: none; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; font: inherit; }
.me { font-size: 15px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.me button { font: inherit; background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.me button:hover { color: var(--ink); }
.sug { border: 1px solid var(--line); border-radius: var(--r); margin: 4px 0 8px; overflow: hidden; background: var(--surface); }
.sug button { display: flex; gap: 10px; width: 100%; text-align: left; background: var(--surface); border: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; align-items: center; font-size: 15px; }
.sug button:last-child { border-bottom: 0; } .sug button:hover { background: var(--hover); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 12px; height: 52px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); background: var(--bg); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-3); min-width: 0; }
.crumbs b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .spacer { flex: 1; }
.page { padding-block: 24px 56px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); width: 100%; max-width: 1480px; }
.page.flush { padding: 0; max-width: none; }

/* ---------- New request ---------- */
.req { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 32px; align-items: start; }
.req-form { position: sticky; top: 76px; border: 0; border-right: 1px solid var(--line); border-radius: 0; padding-right: 32px; }
.req-form .pad { padding: 0; display: flex; flex-direction: column; gap: 16px; }
.picked { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.picked canvas { width: 60px; height: 40px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 28px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); font-weight: 500; font-size: 15px; }
.chip:hover { background: var(--hover); }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.tcard { position: relative; border: 0; background: transparent; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.tcard .frame { background: var(--wall); display: grid; place-items: center; padding: 20px; aspect-ratio: 1 / 1; outline: 1px solid transparent; }
.tcard .frame canvas { max-width: 100%; max-height: 100%; width: auto; height: auto; box-shadow: var(--lift); }
.tcard.on .frame { outline: 2px solid var(--ink); outline-offset: -2px; }
.tcard .meta b { font-size: 15px; display: block; font-weight: 600; } .tcard .meta span { font-size: 15px; color: var(--ink-3); }
.tick { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); display: grid; place-items: center; color: transparent; border-radius: 3px; }
.tcard.on .tick { background: var(--ink); box-shadow: none; color: var(--bg); }
.tick svg { width: 12px; height: 12px; stroke-width: 3; }

/* build sheet */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.4); display: grid; place-items: center; padding: 16px; }
.sheet { width: min(520px, 100%); background: var(--surface); border-radius: var(--r); border: 1px solid var(--line-2); overflow: hidden; }
.sheet-h { padding: 18px 20px 4px; }
.sheet-h p { font: 500 13px var(--mono); color: var(--ink-3); margin-top: 6px; }
.sheet-b { padding: 12px 20px 8px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li { display: grid; grid-template-columns: 16px 1fr auto; gap: 12px; align-items: center; padding: 6px 0; color: var(--ink-4); font-size: 15px; }
.steps li.done, .steps li.now { color: var(--ink); }
.steps .st { width: 7px; height: 7px; justify-self: center; border: 1px solid var(--line-2); }
.steps li.done .st { background: var(--ink); border-color: var(--ink); }
.steps li.done .st svg { display: none; }
.steps li.now .st { border-color: var(--ink); animation: blink .8s steps(2) infinite; }
.steps .ms { font: 500 13px var(--mono); color: var(--ink-3); }
@keyframes blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .steps li.now .st { animation: none; } }
.sheet-thumbs { display: flex; gap: 12px; padding: 14px 20px; background: var(--wall); min-height: 130px; align-items: center; overflow-x: auto; }
.sheet-thumbs canvas { height: 100px; width: auto; box-shadow: var(--lift); }
.sheet-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* ---------- Requests: split view ---------- */
.rq-split { display: grid; grid-template-columns: 380px minmax(0, 1fr); height: calc(100vh - 52px); min-height: 520px; }
.rq-list { border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; }
.rq-sec { display: flex; gap: 10px; font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 16px 18px 8px; border-bottom: 1px solid var(--line); }
.rq-sec:first-child { padding-top: 18px; }
.rq-sec span { color: var(--ink-4); }
.rq-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; padding: 11px 18px; border: 0; border-bottom: 1px solid var(--line); align-items: center; width: 100%; text-align: left; background: transparent; border-radius: 0; }
.rq-item:hover { background: var(--hover); }
.rq-item canvas { width: 44px; height: 44px; object-fit: cover; border: 1px solid var(--line); display: block; background: #fff; }
.rq-item b { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 15px; }
.rq-item .sub { display: block; color: var(--ink-3); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-item .mono { color: var(--ink-3); }
.rq-item.cur { background: var(--ink); color: var(--bg); }
.rq-item.cur .sub, .rq-item.cur .mono { color: #bbb; }
.rq-item.cur .sq.ready { background: var(--bg); }
.rq-item.cur .sq.sent { background: transparent; outline-color: var(--bg); }
.rq-proof { background: var(--wall); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.rq-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--bg); flex-wrap: wrap; }
.rq-bar .t { min-width: 0; }
.rq-bar .t b { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.rq-bar .t span { display: block; font-size: 15px; color: var(--ink-3); }
.rq-act { display: flex; gap: 8px; flex-wrap: wrap; }
.rq-stage { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 260px 28px 28px; gap: 14px; overflow: hidden; }
.crop { position: relative; padding: 26px; flex: none; }
.crop canvas { display: block; box-shadow: var(--lift); background: #fff; }
.crop i { position: absolute; width: 18px; height: 18px; border: 0 solid var(--mark); }
.crop i:nth-child(1) { left: 0; top: 0; border-right-width: 1px; border-bottom-width: 1px; }
.crop i:nth-child(2) { right: 0; top: 0; border-left-width: 1px; border-bottom-width: 1px; }
.crop i:nth-child(3) { left: 0; bottom: 0; border-right-width: 1px; border-top-width: 1px; }
.crop i:nth-child(4) { right: 0; bottom: 0; border-left-width: 1px; border-top-width: 1px; }
.pf-cap { font: 500 13px var(--mono); color: var(--ink-3); }
.pf-note { position: absolute; right: 24px; top: 24px; width: 216px; background: var(--surface); border: 1px solid var(--line); padding: 12px 14px; font-size: 15px; }
.pf-note .mono { display: block; margin-bottom: 4px; color: var(--ink-3); }
.pf-changes { position: absolute; left: 24px; right: 24px; bottom: 16px; display: flex; gap: 8px; max-width: 560px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line-2); padding: 8px; border-radius: var(--r); z-index: 2; }
.pf-changes input { flex: 1; }
.rq-meta { display: flex; gap: 28px; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--bg); align-items: center; flex-wrap: wrap; font-size: 15px; }
.rq-meta .k { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.rq-meta .mono { color: var(--ink-3); }
.rq-meta .push { margin-left: auto; }
.rq-empty { display: grid; place-items: center; height: 100%; color: var(--ink-3); font: 500 13.5px var(--mono); }

/* ---------- Editor ---------- */
.ed-shell { position: fixed; inset: 0; z-index: 30; background: var(--wall); display: grid; grid-template-rows: auto minmax(0, 1fr); padding-top: env(safe-area-inset-top, 0px); }
.ed-top { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px)); background: var(--bg); border-bottom: 1px solid var(--line); overflow-x: auto; }
.ed-top .ttl { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ed-top .ttl b { font-size: 15px; white-space: nowrap; font-weight: 600; } .ed-top .ttl span { font-size: 15px; color: var(--ink-3); white-space: nowrap; }
.ed-top .vr { width: 1px; height: 22px; background: var(--line); flex: none; }
.ed-top select { height: 30px; font-size: 15px; width: auto; min-width: 0; max-width: 190px; }
.ed-body { display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px; min-height: 0; }
.ed-left, .ed-right { background: var(--bg); overflow-y: auto; min-height: 0; }
.ed-left { border-right: 1px solid var(--line); padding: 14px 10px; }
.ed-right { border-left: 1px solid var(--line); }
.ed-sec { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.ed-stage { position: relative; overflow: auto; display: grid; place-items: center; padding: 40px; min-height: 0; }
.stage-inner { position: relative; touch-action: none; }
.stage-inner canvas { display: block; box-shadow: var(--lift); user-select: none; }
.sel { position: absolute; border: 1.5px solid #111; box-shadow: 0 0 0 1px #fff; pointer-events: none; }
.sel .h { position: absolute; width: 9px; height: 9px; background: #fff; border: 1.5px solid #111; pointer-events: auto; }
.sel .h[data-h=nw] { left: -6px; top: -6px; cursor: nwse-resize; } .sel .h[data-h=ne] { right: -6px; top: -6px; cursor: nesw-resize; }
.sel .h[data-h=sw] { left: -6px; bottom: -6px; cursor: nesw-resize; } .sel .h[data-h=se] { right: -6px; bottom: -6px; cursor: nwse-resize; }
.sel .lbl { position: absolute; left: -1.5px; top: -22px; background: #111; color: #fff; font: 500 13px var(--mono); padding: 2px 6px; border-radius: 3px; white-space: nowrap; }
.inline-edit { position: absolute; background: #fff; color: #111; border: 1.5px solid #111; border-radius: 2px; padding: 2px 4px; resize: none; z-index: 5; line-height: 1.2; height: auto; }
.zoombar { position: absolute; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 2px; font-size: 15px; }
.zoombar span { min-width: 44px; text-align: center; font-family: var(--mono); color: var(--ink-2); font-size: 13px; }
.layers { display: flex; flex-direction: column; gap: 1px; }
.layer { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: var(--r-sm); font-size: 15px; border: 0; background: transparent; width: 100%; text-align: left; color: var(--ink-2); }
.layer:hover { background: var(--hover); }
.layer.on { background: var(--sel-bg); color: var(--ink); font-weight: 600; }
.layer .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer .lk { width: 6px; height: 6px; background: var(--ink); flex: none; }
.layer .eye { opacity: 0; border: 0; background: transparent; padding: 2px; color: var(--ink-3); display: grid; }
.layer:hover .eye, .layer .eye.off { opacity: 1; }
.layer.hid .nm { opacity: .4; }
.kit { display: flex; gap: 6px; }
.kit .sw { width: 28px; height: 28px; }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tok { width: 26px; height: 26px; border: 0; border-radius: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.tok.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.grid4 label { display: flex; flex-direction: column; gap: 3px; font: 500 13px var(--mono); color: var(--ink-3); }
.grid4 input { height: 28px; padding: 0 6px; font-size: 13.5px; font-family: var(--mono); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 4px; min-width: 230px; z-index: 40; }
.menu button { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: transparent; padding: 7px 9px; border-radius: var(--r-sm); text-align: left; font-size: 15px; }
.menu button:hover { background: var(--hover); }
.menu button small { display: block; color: var(--ink-3); font: 500 13px var(--mono); }
.menu button:disabled { opacity: .4; }

/* ---------- Tables & detail ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font: 500 13px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--hover); }
.tbl tr.on td { background: var(--sel-bg); }
.tbl .nm b { display: block; font-weight: 600; white-space: nowrap; } .tbl .nm span { font-size: 15px; color: var(--ink-3); white-space: nowrap; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0; align-items: start; border-top: 1px solid var(--line); }
.split > :first-child { padding: 20px 24px 0 0; min-width: 0; }
.split .tbl-wrap { border: 0; }
.drawer { position: sticky; top: 76px; border: 0; border-left: 1px solid var(--line); border-radius: 0; }
.drawer .pad { display: flex; flex-direction: column; gap: 14px; padding: 20px 0 20px 24px; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.lc { overflow: hidden; text-align: left; padding: 0; cursor: pointer; display: flex; flex-direction: column; border: 0; background: transparent; border-radius: 0; gap: 8px; }
.lc canvas { width: 100%; height: auto; aspect-ratio: 3 / 2; display: block; border: 1px solid var(--line); }
.lc.on canvas { outline: 2px solid var(--ink); outline-offset: -2px; }
.lc .bd { display: flex; flex-direction: column; gap: 2px; }
.lc .pr { font: 500 15px var(--mono); }
.photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.drop { position: relative; overflow: hidden; cursor: pointer; display: block; }
.drop canvas { width: 100%; aspect-ratio: 3/2; display: block; }
.drop span { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.72); color: #fff; font: 500 13px var(--mono); padding: 2px 6px; border-radius: 3px; }
.drop:hover::after { content: "Replace"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-weight: 600; font-size: 15px; }
.drop.over { outline: 2px dashed var(--ink); outline-offset: -2px; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: none; height: 36px; padding: 0; font-size: 15px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); font-weight: 600; border-color: var(--accent); }
.tpl-detail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.big-stage { background: var(--wall); display: grid; place-items: center; padding: 32px; }
.big-stage canvas { max-width: 100%; height: auto; box-shadow: var(--lift); }
.bgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.bgrid figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.bgrid canvas { width: 100%; height: auto; box-shadow: 0 0 0 1px var(--line); }
.bgrid figcaption { font-size: 15px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }

/* ---------- Insights ---------- */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.flow > div { padding: 12px 14px 12px 0; position: relative; }
.flow b { display: block; font-size: 15px; font-weight: 600; } .flow span { font-size: 15px; color: var(--ink-3); }
.flow .us b { text-decoration: underline; text-underline-offset: 3px; }
.flow i { font-style: normal; font: 500 13px var(--mono); color: var(--ink-4); display: block; margin-bottom: 6px; }
.dl { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.dl div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.dl dd, .dl b { margin: 0; font: 500 15px var(--mono); }
.cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
ul.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: 15px; border-top: 1px solid var(--line); }
ul.ticks li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
ul.ticks li svg { margin-top: 2px; color: var(--ink); }
ul.ticks.later li svg { color: var(--ink-4); }

.toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: var(--r); font-weight: 500; font-size: 15px; z-index: 60; display: flex; gap: 8px; align-items: center; max-width: calc(100% - 32px); }

@media (max-width: 1180px) {
  .ed-body { grid-template-columns: minmax(0, 1fr) 260px; } .ed-left { display: none; }
  .split, .tpl-detail { grid-template-columns: minmax(0, 1fr); } .drawer, .req-form { position: static; }
  .drawer { border-left: 0; border-top: 1px solid var(--line); } .drawer .pad { padding: 20px 0; }
  .split > :first-child { padding-right: 0; }
  .bgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rq-stage { padding-right: 28px; padding-top: 150px; } .pf-note { width: auto; left: 24px; }
}
@media (max-width: 900px) {
  .signin { grid-template-columns: minmax(0, 1fr); } .si-form { border-right: 0; border-bottom: 1px solid var(--line); } .si-wall { padding: 28px 20px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
  .side .ws, .search, .side-foot { display: none; }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; }
  .nav a { white-space: nowrap; }
  .top { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .page { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 20px 48px; }
  .req, .cols2 { grid-template-columns: minmax(0, 1fr); } .req-form { border-right: 0; padding-right: 0; }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .bgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rq-split { grid-template-columns: minmax(0, 1fr); height: auto; } .rq-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 46vh; }
  .rq-stage { padding: 150px 16px 28px; min-height: 520px; }
  .ed-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(320px, 1fr) auto; overflow-y: auto; }
  .ed-stage { padding: 20px; } .ed-right { border-left: 0; border-top: 1px solid var(--line); }
  .ed-top .ttl { display: none; }
}
/* Nov 5: tabs never show their own scrollbar */
.tabs, .cat-tabs { overflow-y: hidden; scrollbar-width: none; } .tabs::-webkit-scrollbar, .cat-tabs::-webkit-scrollbar { display: none; }
