/* Reyal Studio · follows the reyaldesign.com system: black surfaces, crimson pill actions,
   heavy geometric display type, and round line badges in transit colors. */
:root {
  --bg: #09090b;
  --bg-2: #0f0f12;
  --surface: #141417;
  --surface-2: #1b1b1f;
  --surface-3: #25252b;
  --ink: #f6f6f7;
  --ink-2: #c7c7cd;
  --muted: #8b8b95;
  --line: #222227;
  --line-2: #32323a;
  --accent: #a20e26;
  --accent-hi: #c4132f;
  --accent-soft: rgba(162, 14, 38, .2);
  --accent-ink: #ffffff;
  --yellow: #ffd308;
  --pink: #cc3366;
  --focus: #ffd308;
  --ok: #3ddc97;   --ok-bg: rgba(61, 220, 151, .12);
  --warn: #ffd308; --warn-bg: rgba(255, 211, 8, .12);
  --bad: #ff5c6c;  --bad-bg: rgba(255, 92, 108, .12);
  --info: #6aa9ff; --info-bg: rgba(106, 169, 255, .12);
  --k-website: #a20e26; --k-social: #ff6319; --k-menu: #fccc0a; --k-card: #0039a6; --k-book: #00933c;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 40px -18px rgba(0,0,0,.8);
  --paper-shadow: 0 2px 4px rgba(0,0,0,.35), 0 22px 44px -18px rgba(0,0,0,.9);
  --display: Poppins, "Urbanist", system-ui, sans-serif;
  --sans: Urbanist, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  --side-w: 228px;
  color-scheme: dark;
}
html.side-collapsed { --side-w: 68px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 500 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 17px; }
p { margin: 0; }
code { font: 11.5px var(--mono); color: var(--ink-2); background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }
.i { flex: none; display: inline-block; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.grow { flex: 1; }
.label, .eyebrow { font: 700 11px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.eyebrow { color: var(--accent-hi); margin-bottom: 6px; }
.h1 { font: 800 clamp(30px, 3.4vw, 44px)/1 var(--display); letter-spacing: -.03em; }
.h1.xl { font-size: clamp(36px, 5vw, 64px); }
.count { font: 600 .45em/1 var(--sans); color: var(--muted); vertical-align: super; margin-left: 4px; letter-spacing: 0; }
.tag { font: 700 10px/1.6 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 99px; padding: 0 7px; white-space: nowrap; }
.n { font: 700 11px/1 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------- controls ---------- */
input, select, textarea { font: inherit; color: inherit; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink-2); background: var(--surface-3); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 14px/1 var(--display); padding: 11px 20px; border-radius: 99px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s; }
.btn:hover { background: var(--surface-3); border-color: #45454e; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-2); color: var(--ink); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-sm .i { width: 16px; height: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .ibtn[disabled], .chip[disabled] { opacity: .4; pointer-events: none; }
.btn-google { background: #fff; color: #1f1f1f; border-color: #fff; width: 100%; padding: 14px 22px; font-size: 15px; }
.btn-google:hover { background: #ececec; border-color: #ececec; }
.ibtn { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; padding: 0; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.ibtn:hover { background: var(--surface-3); color: var(--ink); border-color: var(--line-2); }
.ibtn.danger:hover { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); font: 700 11.5px/1 var(--sans); cursor: pointer; }
.chip .i { width: 14px; height: 14px; }
.chip:hover { color: var(--ink); border-color: #4a4a53; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); font: 700 11px/1.5 var(--sans); white-space: nowrap; }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; }
.link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.search:focus-within { border-color: var(--ink-2); color: var(--ink); }
.search input { border: 0; background: transparent; padding: 9px 0; width: 190px; }
.search input:focus { background: transparent; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.seg > button, .seg > a { display: inline-flex; align-items: center; gap: 6px; font: 600 12.5px/1 var(--sans); background: none; border: 0; padding: 7px 12px; border-radius: 99px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg > button:hover, .seg > a:hover { color: var(--ink); }
.seg > .on { background: var(--surface-3); color: var(--ink); }
.seg .i { width: 16px; height: 16px; }
.seg-icons > button { padding: 6px 9px; }
.seg-pills > .on, .seg-pills > .on:hover { background: var(--ink); color: var(--bg); }
.seg-pills .n { margin-left: 2px; color: inherit; opacity: .6; }

[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); z-index: 200;
  padding: 5px 9px; border-radius: 7px; background: #fff; color: #111; font: 700 11px/1.2 var(--sans); white-space: nowrap; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.4); }

/* Round kind badge, like the line markers on reyaldesign.com. */
.kb { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; font: 800 13px/1 var(--display); color: #fff; background: var(--k-website); }
.kb-sm { width: 20px; height: 20px; font-size: 10.5px; }
.kb-social { background: var(--k-social); }
.kb-menu { background: var(--k-menu); color: #111; }
.kb-card { background: var(--k-card); }
.kb-book { background: var(--k-book); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.dot-approved { background: var(--ok); }
.dot-working { background: var(--info); animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .3 } to { opacity: 1 } }
.st { display: inline-flex; align-items: center; gap: 6px; font: 700 11.5px/1.4 var(--sans); color: var(--ink-2); white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.st-review::before, .st-r-awaiting_approval::before, .st-c-sent::before { background: var(--info); }
.st-changes::before, .st-r-queued::before, .st-r-needs_human::before, .st-c-open::before { background: var(--warn); }
.st-working::before, .st-r-running::before { background: var(--info); animation: pulse 1s infinite alternate; }
.st-approved::before, .st-r-done::before, .st-c-resolved::before { background: var(--ok); }
.st-r-failed { color: var(--bad); }
.st-r-failed::before { background: var(--bad); }
.live { display: inline-flex; align-items: center; font: 800 10px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: #111; background: var(--yellow); padding: 3px 7px; border-radius: 99px; }
.live-lg { padding: 7px 12px; font-size: 11px; }

/* ---------- app shell: collapsible left sidebar ---------- */
body.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px; background: #000; border-right: 1px solid var(--line); z-index: 30; overflow: visible; }
.side-top { padding: 4px 4px 14px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: #fff; color: #000; font: 800 18px/1 var(--display); }
.brand-word { font: 700 18px/1 var(--display); letter-spacing: -.02em; white-space: nowrap; }
.brand-word b { font-weight: 700; color: var(--accent-hi); }
.side-nav { display: grid; gap: 2px; }
.side-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 9px 11px; border-radius: 11px; color: var(--ink-2); font: 600 14px/1 var(--sans); background: none; border: 0; cursor: pointer; text-align: left; }
.side-item .i { width: 20px; height: 20px; }
.side-item:hover { background: var(--surface-2); color: var(--ink); }
.side-item.on { background: var(--surface-3); color: #fff; }
.side-item.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-hi); }
.side-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; background: var(--accent); color: #fff; font: 800 11px/1 var(--sans); }
.side-badge.is-running { box-shadow: 0 0 0 0 rgba(196, 19, 47, .7); animation: ring 1.6s infinite; }
@keyframes ring { 70% { box-shadow: 0 0 0 8px rgba(196, 19, 47, 0); } 100% { box-shadow: 0 0 0 0 rgba(196, 19, 47, 0); } }
.side-bottom { margin-top: auto; display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.side-bottom form { margin: 0; }
.side-live { display: flex; align-items: center; gap: 12px; padding: 6px 11px; color: var(--muted); font: 700 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.live-dot { width: 8px; height: 8px; margin: 0 6px; border-radius: 50%; background: var(--line-2); flex: none; }
.side-live.on .live-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px 7px; min-width: 0; }
.side-user img, .avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.avatar { display: inline-grid; place-items: center; background: var(--surface-3); font: 700 12px/1 var(--sans); color: var(--ink); }
.side-user .side-label { display: grid; min-width: 0; line-height: 1.25; }
.side-user small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-toggle { justify-self: end; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); cursor: pointer; transition: transform .2s; }
.side-toggle:hover { color: var(--ink); }
.side-label { min-width: 0; overflow: hidden; white-space: nowrap; }
.side [data-tip]:hover::after { display: none; }
html.side-collapsed .side { padding-left: 10px; padding-right: 10px; }
html.side-collapsed .side-label, html.side-collapsed .brand-word { display: none; }
html.side-collapsed .side-item { justify-content: center; padding: 10px; }
html.side-collapsed .side-item.on::before { left: -10px; }
html.side-collapsed .side-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 16px; font-size: 10px; }
html.side-collapsed .side-live, html.side-collapsed .side-user { justify-content: center; }
html.side-collapsed .side-toggle { justify-self: center; transform: rotate(180deg); }
html.side-collapsed .side-top { display: flex; justify-content: center; }
html.side-collapsed .side [data-tip]:hover::after { display: block; left: calc(100% + 10px); bottom: auto; top: 50%; transform: translateY(-50%); }
.main { min-width: 0; }

/* ---------- pages ---------- */
.page { max-width: 1480px; margin: 0 auto; padding: 32px 32px 72px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin-bottom: 26px; flex-wrap: wrap; }
.head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.head-note { max-width: 46ch; }
.crumbs { margin-bottom: 14px; }
.crumbs a, .crumb { color: var(--muted); font: 600 13px/1.2 var(--sans); }
.crumbs a:hover, .crumb:hover { color: var(--ink); }
.crumbs a::after { content: " /"; }
.empty-state { padding: 64px 24px; text-align: center; grid-column: 1 / -1; }
.empty-state h2 { font-size: 26px; margin-bottom: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { font-size: 17px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 22px; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.error { color: var(--bad); font-weight: 600; }

/* scaled thumbnails */
.fit { position: relative; overflow: hidden; width: 100%; }
.fit iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.fit-contain, .fit-cover { height: 100%; }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.client-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .2s, border-color .2s; }
.client-card:hover { transform: translateY(-3px); border-color: #3a3a42; }
.cc-thumb { aspect-ratio: 16 / 10; background: var(--surface-2); position: relative; overflow: hidden; }
.cc-thumb .fit { position: absolute; inset: 0; }
.cc-mono { position: absolute; inset: 0; display: grid; place-items: center; font: 800 64px/1 var(--display); color: var(--surface-3); }
.cc-body { display: grid; gap: 6px; padding: 12px 14px 14px; }
.cc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.cc-name { font: 700 16px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-kinds { display: inline-flex; gap: 4px; }
.dash-side { display: grid; gap: 16px; position: sticky; top: 24px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 4px; }
.stat-n { font: 800 26px/1 var(--display); }
.stat-l { font: 600 11px/1.2 var(--sans); color: var(--muted); }
.queue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.queue-list a { display: grid; gap: 3px; padding: 10px; margin: 0 -10px; border-radius: 10px; }
.queue-list a:hover { background: var(--surface-2); }
.q-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.queue-empty { display: flex; gap: 8px; align-items: center; }

/* ---------- client profile ---------- */
.profile-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; color: var(--ink-2); }
.profile-meta a:hover { color: var(--ink); text-decoration: underline; }
.notes { margin: 18px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); color: var(--ink-2); white-space: pre-wrap; max-width: 90ch; display: grid; gap: 6px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .2s, border-color .2s; color: inherit; font: inherit; text-align: left; padding: 0; cursor: pointer; }
.project-card:hover { transform: translateY(-3px); border-color: #3a3a42; }
.pc-visual { height: 210px; padding: 18px; background: var(--bg-2); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pc-visual > * { width: 100%; }
.pc-body { display: grid; gap: 6px; padding: 12px 14px 14px; }
.pc-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.pc-title strong { font: 700 16px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-flags { display: flex; gap: 6px; flex-wrap: wrap; min-height: 0; }
.pc-flags:empty { display: none; }
.project-new { align-items: center; justify-content: center; gap: 6px; min-height: 280px; border-style: dashed; border-color: var(--line-2); background: transparent; }
.project-new:hover { background: var(--surface); border-color: var(--accent); }
.pn-plus { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; margin-bottom: 6px; }
.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; margin-top: 24px; align-items: start; }
.two-col .card > p.small { margin: -6px 0 10px; }

.browser { border-radius: 8px; overflow: hidden; background: #fff; box-shadow: var(--paper-shadow); }
.browser-bar { display: flex; align-items: center; gap: 5px; height: 18px; padding: 0 9px; background: #1f1f24; }
.browser-bar i { width: 6px; height: 6px; border-radius: 50%; background: #45454e; }
.sheets { position: relative; height: 180px; }
.sheet { position: absolute; top: 4px; width: 38%; background: #fff; box-shadow: var(--paper-shadow); transition: transform .35s; }
.sheet.s0 { left: 6%; transform: rotate(-4deg); z-index: 3; }
.sheet.s1 { left: 31%; transform: rotate(1deg); z-index: 2; top: 10px; }
.sheet.s2 { left: 56%; transform: rotate(5deg); z-index: 1; top: 16px; }
.project-card:hover .sheet.s0 { transform: rotate(-6deg) translateX(-8px); }
.project-card:hover .sheet.s2 { transform: rotate(7deg) translateX(8px); }
.cards-stack { position: relative; height: 170px; }
.biz { position: absolute; width: 62%; border-radius: 4px; overflow: hidden; box-shadow: var(--paper-shadow); transition: transform .35s; }
.biz.c0 { left: 4%; top: 6%; transform: rotate(-5deg); z-index: 2; }
.biz.c1 { left: 32%; top: 34%; transform: rotate(4deg); z-index: 1; }
.feed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.feed-cell { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface-2); display: block; }
.feed-mini { border-radius: 8px; overflow: hidden; max-width: 250px; margin: 0 auto; }
.play { position: absolute; top: 6px; right: 6px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.7)); }
.play .i { width: 14px; height: 14px; fill: #fff; }
.ghost { padding: 32px 0; color: var(--muted); text-align: center; }

.files-table { width: 100%; border-collapse: collapse; }
.files-table td { padding: 9px 10px 9px 0; border-top: 1px solid var(--line); vertical-align: middle; white-space: normal; }
.f-thumb { width: 50px; }
.f-thumb img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; display: block; }
.ficon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--surface-3); font: 800 10px/1 var(--sans); letter-spacing: .04em; color: var(--ink-2); }
.files-table .fname { font-weight: 700; }
.files-table .fname:hover { text-decoration: underline; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; white-space: nowrap; }
td.row-actions { display: table-cell; text-align: right; }
td.row-actions > * { vertical-align: middle; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li a { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 10px 8px; margin: 0 -8px; border-radius: 10px; }
.timeline li a:hover { background: var(--surface-2); }
.act-time { font-size: 12px; color: var(--muted); padding-top: 1px; }
.act-text { color: var(--ink-2); margin-top: 3px; }

/* ---------- project workspace ---------- */
body.is-work { height: 100vh; overflow: hidden; }
body.is-work .main { height: 100vh; display: flex; flex-direction: column; min-height: 0; }
.work { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.work-bar { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--bg); }
.work-id { display: grid; gap: 2px; min-width: 0; }
.work-title { display: flex; align-items: center; gap: 10px; font: 700 20px/1.1 var(--display); min-width: 0; }
.work-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.vpick { position: relative; }
.vpick-btn { display: inline-flex; align-items: center; gap: 9px; max-width: min(620px, 60vw); padding: 7px 10px 7px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font: 600 13px/1.2 var(--sans); cursor: pointer; }
.vpick-btn:hover, .vpick.is-open .vpick-btn { border-color: var(--ink-2); background: var(--surface-3); }
.vpick-btn strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--display); font-size: 14px; }
.vpick-k { font: 800 10px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.vpick-n { color: var(--muted); font-size: 12px; padding-left: 8px; border-left: 1px solid var(--line-2); white-space: nowrap; }
.vpick.is-open .vpick-btn > .i { transform: rotate(180deg); }
.vpick-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; width: min(640px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 60px -12px rgba(0,0,0,.85); overflow: hidden; }
.vpick-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px; border-bottom: 1px solid var(--line); }
.vpick-head .search { flex: 1; }
.vpick-head .search input { width: 100%; }
.vpick-scroll { max-height: min(420px, 60vh); overflow: auto; }
.vtable { width: 100%; border-collapse: collapse; }
.vtable th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.vtable td, .vtable th { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.vtable tbody tr { cursor: pointer; }
.vtable tbody tr:hover { background: var(--surface-2); }
.vtable tr.on { background: var(--accent-soft); }
.vtable tr.on td:first-child { box-shadow: inset 3px 0 0 var(--accent-hi); }
.v-name { display: block; font: 700 14px/1.3 var(--display); }
.v-sub { display: block; margin-top: 2px; font-size: 12px; }
.num { text-align: center !important; }

.work-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w, 440px); min-height: 0; }
.work-body.is-dragging { cursor: col-resize; user-select: none; }
.work-body.is-dragging iframe { pointer-events: none; }
.stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-2); }
.stage-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--bg-2); }
.stage-note { display: flex; align-items: center; gap: 10px; margin: 10px 14px 0; padding: 10px 14px; border-radius: 12px; background: var(--info-bg); color: var(--info); font-weight: 600; }
.frame-wrap { flex: 1; overflow: auto; display: flex; justify-content: center; padding: 12px; min-height: 0; }
.frame-wrap iframe { width: 100%; height: 100%; min-height: 420px; border: 0; border-radius: 8px; background: #fff; box-shadow: var(--paper-shadow); }
.stage-web .frame-wrap { position: relative; overflow: hidden; }
.frame-box { position: relative; width: 100%; height: 100%; }
.frame-box.is-sized { position: absolute; left: 50%; top: 16px; transform-origin: top center; }
.frame-box.is-sized iframe { min-height: 0; }
.frame-wrap[data-device="phone"] .frame-box iframe { border-radius: 34px; box-shadow: 0 0 0 10px #1b1b1f, 0 0 0 11px #3a3a42, var(--paper-shadow); }
.frame-wrap[data-device="tablet"] .frame-box iframe { border-radius: 22px; box-shadow: 0 0 0 12px #1b1b1f, 0 0 0 13px #3a3a42, var(--paper-shadow); }
.frame-handle { position: absolute; top: 50%; right: -24px; width: 12px; height: 64px; margin-top: -32px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--line-2); cursor: ew-resize; }
.frame-handle::before { content: ""; position: absolute; inset: 20px 3px; border-left: 1px solid var(--muted); border-right: 1px solid var(--muted); }
.frame-handle:hover, .is-dragging .frame-handle { background: var(--accent); border-color: var(--accent); }
.frame-box:not(.is-sized) .frame-handle { right: 4px; opacity: 0; }
.frame-box:not(.is-sized):hover .frame-handle { opacity: 1; }
.frame-wrap.is-dragging { cursor: ew-resize; user-select: none; }
.frame-wrap.is-dragging iframe { pointer-events: none; }
.frame-size { font: 700 11.5px/1 var(--sans); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.devices > button small { font: 600 10.5px/1 var(--sans); color: var(--muted); margin-left: -2px; }
.devices > button.on small { color: var(--ink-2); }
.compare { position: absolute; inset: 0; display: flex; gap: 20px; align-items: flex-start; justify-content: center; padding: 16px; overflow: auto; }
.cmp { margin: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; flex: none; }
.cmp .fit { border-radius: 8px; box-shadow: var(--paper-shadow); background: #fff; }
.cmp figcaption { font: 700 12px/1.2 var(--sans); }
.stage-scroll { flex: 1; overflow: auto; min-height: 0; display: flex; flex-direction: column; }
.stage-empty { margin: auto; max-width: 520px; padding: 48px 24px; display: grid; gap: 10px; text-align: center; }
.stage-empty h2 { font-size: 24px; }

.pieces { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 32px 28px; padding: 28px; }
.piece { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.piece-art { position: relative; display: block; height: var(--h, 300px); aspect-ratio: var(--ar); transition: transform .25s; }
.piece-art:hover { transform: translateY(-4px); }
.piece-social .piece-art { --h: 320px; border-radius: 8px; overflow: hidden; box-shadow: var(--paper-shadow); }
.piece-menu .piece-art { --h: 400px; background: #fff; box-shadow: var(--paper-shadow); }
.piece-card .piece-art { --h: 170px; border-radius: 4px; overflow: hidden; box-shadow: var(--paper-shadow); }
.piece .fit { height: 100%; }
.piece figcaption { display: grid; gap: 2px; max-width: 300px; }
.piece figcaption > a { font: 700 14px/1.3 var(--display); }
.dl { display: inline-flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; align-items: center; }
.pin-count { position: absolute; top: 8px; left: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px 11px 11px 2px; background: var(--accent); color: #fff; font: 800 11px/1 var(--sans); display: grid; place-items: center; z-index: 2; box-shadow: 0 0 0 2px #fff; }
.social-stage { padding: 16px 28px 40px; }
.social-stage > .seg { margin-bottom: 8px; }
.social-stage .pieces { padding: 16px 0; }
.phone { width: min(400px, 100%); margin: 16px auto; background: #000; border: 1px solid var(--line-2); border-radius: 34px; padding: 18px 10px 24px; box-shadow: var(--paper-shadow); }
.phone-head { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; }
.phone-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font: 800 16px var(--display); }

/* books */
.book-spreads { display: grid; gap: 40px; padding: 28px; justify-items: center; }
.spread { display: flex; justify-content: center; width: min(100%, 1200px, calc((100vh - 200px) * 2 * var(--ar, .75))); filter: drop-shadow(0 24px 30px rgba(0,0,0,.6)); }
.spread .bpage { flex: 0 1 50%; margin: 0; }
.spread-cover { justify-content: flex-end; padding-left: 50%; }
.spread-cover .bpage { flex-basis: 100%; }
.spread-last { justify-content: flex-start; padding-right: 50%; }
.spread-last .bpage { flex-basis: 100%; }
.spread:not(.spread-cover):not(.spread-last) .bpage:first-child .bpage-art { box-shadow: inset -18px 0 24px -18px rgba(0,0,0,.45); }
.bpage { display: grid; gap: 8px; }
.bpage-art { position: relative; display: block; background: #fff; overflow: hidden; }
.bpage-art .fit { pointer-events: none; }
.bpage figcaption { display: flex; gap: 8px; align-items: baseline; justify-content: center; font-size: 12px; }
.bpage figcaption a { font-weight: 800; }
.spread .bpage:first-child figcaption { justify-content: flex-end; padding-right: 8px; }
.spread .bpage:last-child:not(:first-child) figcaption { justify-content: flex-start; padding-left: 8px; }
.book-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 24px 18px; padding: 24px 28px; }
.book-pages .bpage-art { box-shadow: var(--paper-shadow); border-radius: 2px; transition: transform .2s; }
.book-pages .bpage-art:hover { transform: translateY(-3px); }

.focus { flex: 1; display: flex; flex-direction: column; min-height: 0; height: 100%; }
.focus-title { font: 700 14px/1.3 var(--display); display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.focus-stage { flex: 1; min-height: 0; padding: 20px; display: flex; justify-content: center; align-items: center; }
.focus-stage .fit { box-shadow: var(--paper-shadow); }

.panel { position: relative; border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.panel-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 5; }
.panel-resize::after { content: ""; position: absolute; left: 3px; top: 50%; width: 2px; height: 44px; margin-top: -22px; border-radius: 2px; background: var(--line-2); transition: background .15s, height .15s; }
.panel-resize:hover::after, .work-body.is-dragging .panel-resize::after, .panel-resize:focus-visible::after { background: var(--accent-hi); height: 88px; margin-top: -44px; }
.tabs { display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { display: inline-flex; align-items: center; gap: 7px; font: 600 13px/1 var(--sans); background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 10px 12px; margin-bottom: -1px; color: var(--muted); cursor: pointer; }
.tabs button .i { width: 16px; height: 16px; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent-hi); }
.tabs .n { min-width: 18px; padding: 3px 5px; border-radius: 99px; background: var(--surface-3); text-align: center; }
.tabs .n-hot { background: var(--accent); color: #fff; }
.tab-body { overflow-y: auto; padding: 4px 16px 24px; flex: 1; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list.files li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; }
.empty-li { padding: 24px 0 !important; }
.c-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment p, .request p { margin: 6px 0 4px; white-space: pre-wrap; }
.comment { transition: background .3s; cursor: pointer; }
.comment.flash { background: var(--warn-bg); }
.pin-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 11px 11px 11px 2px; background: var(--accent); color: #fff; font: 800 11px/1 var(--sans); flex: none; }
.shot { display: block; max-width: 100%; margin-top: 10px; border-radius: 8px; border: 1px solid var(--line); }
.attach { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.attach li { display: flex; align-items: center; gap: 6px; }
.attach li a { flex: 1; min-width: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.attach img, .attach .ficon { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; font-size: 9px; }
.attach .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach li a:hover .fname { text-decoration: underline; }
.summary { background: var(--surface-2); border-left: 3px solid var(--ok); padding: 9px 12px; margin: 10px 0 !important; font-size: 13px; border-radius: 0 8px 8px 0; }
.summary.bad { border-left-color: var(--bad); }
.request.is-running { background: linear-gradient(90deg, var(--info-bg), transparent 60%); margin: 0 -16px; padding-left: 16px !important; padding-right: 16px !important; }
.r-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.strong-link code { color: var(--ink); background: var(--accent-soft); }
details { margin-top: 10px; }
summary { cursor: pointer; font: 600 12px/1.3 var(--sans); color: var(--muted); }
summary:hover { color: var(--ink); }
pre.log { max-height: 280px; overflow: auto; background: #000; color: #d8d6cf; border: 1px solid var(--line); font: 11px/1.55 var(--mono); padding: 12px; border-radius: 10px; white-space: pre-wrap; word-break: break-word; }
.instruct { display: grid; gap: 10px; padding: 14px 0 16px; border-bottom: 1px solid var(--line); }
.instruct-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.agent-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.agent-options label { display: grid; gap: 4px; font: 700 10.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); min-width: 0; }
.request-settings { display: grid; gap: 8px; margin-top: 10px; justify-items: start; }
.request-settings .agent-options { width: 100%; }
.run-settings { margin-top: 6px; }
.agent-line { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; }
.upload-row { display: flex; gap: 8px; margin: 14px 0 6px; flex-wrap: wrap; }

/* ---------- dialogs and toasts ---------- */
dialog { border: 1px solid var(--line-2); border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--ink); box-shadow: 0 40px 90px rgba(0,0,0,.7); }
dialog.dlg-wide { width: min(720px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(4px); }
dialog form { padding: 26px; display: grid; gap: 16px; min-width: 0; }
dialog { overflow-x: hidden; }
dialog h2 { font-size: 26px; font-weight: 800; }
dialog label { display: grid; gap: 6px; font: 700 13px/1.2 var(--sans); }
dialog label small { font-weight: 500; color: var(--muted); }
dialog input, dialog textarea { width: 100%; }
.dlg-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kind-pick { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.kind-pick legend { margin-bottom: 8px; }
.kind-opt { display: flex !important; grid-template-columns: none; align-items: flex-start; gap: 10px !important; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; }
.kind-opt input { position: absolute; opacity: 0; pointer-events: none; }
.kind-opt span:last-child { display: grid; gap: 3px; }
.kind-opt small { font-weight: 500; line-height: 1.35; }
.kind-opt:has(input:checked) { border-color: var(--accent-hi); background: var(--accent-soft); }
.kind-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: grid; gap: 8px; justify-items: end; max-width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #fff; color: #111; padding: 12px 16px; border-radius: 14px; font: 600 13px/1.4 var(--sans); box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: toast-in .25s ease; transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast.bad { background: var(--bad); color: #fff; }
.toast a { flex: none; padding: 6px 12px; border-radius: 99px; background: var(--accent); color: #fff; font-weight: 700; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 11px 14px 11px 0; border-bottom: 1px solid var(--line); }
th { font: 800 10.5px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.rtable td, .rtable th { padding: 12px 16px; white-space: nowrap; }
.rtable tbody tr { cursor: pointer; }
.rtable tbody tr:hover { background: var(--surface-2); }
.r-client { display: inline-flex; align-items: center; gap: 10px; }
.r-client > span { display: grid; line-height: 1.25; }
.r-body { white-space: normal !important; max-width: 420px; color: var(--ink-2); }

/* ---------- connections ---------- */
.connect-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.connect-main, .connect-side { display: grid; gap: 16px; min-width: 0; }
.conn-list { list-style: none; margin: 0; padding: 0; }
.conn { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.conn:first-child { border-top: 0; }
.conn-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); flex: none; }
.conn-icon.on { background: var(--ok-bg); color: var(--ok); }
.conn-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.conn-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-state { font: 700 11px/1 var(--sans); color: var(--muted); white-space: nowrap; }
.conn-state.on { color: var(--ok); }
.conn-state.on::before { content: "●"; margin-right: 5px; }
.empty-inline { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); }
.empty-inline > .i { width: 28px; height: 28px; color: var(--accent-hi); }
.agent-pane { display: grid; gap: 14px; margin-top: 16px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }
.steps strong, .steps em { color: var(--ink); }
.msg { background: #000; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0; max-height: 300px; overflow: auto; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }
.tok { color: var(--yellow); }
.agent-pane .btn { justify-self: start; }
.key-gate { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid rgba(196,19,47,.4); flex-wrap: wrap; }
.runner-list { display: grid; gap: 8px; margin-bottom: 10px; }
.runner { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.runner-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); flex: none; }
.runner-main { display: grid; gap: 1px; flex: 1; min-width: 0; }
.runner-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); flex: none; }
.runner[data-state="connected"] .connection-dot, .runner[data-state="online"] .connection-dot, .runner[data-state="seen"] .connection-dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.runner[data-state="signed_out"] .connection-dot, .runner[data-state="waiting"] .connection-dot { background: var(--warn); }
.runner[data-state="missing"] .connection-dot, .runner[data-state="error"] .connection-dot, .runner[data-state="offline"] .connection-dot { background: var(--bad); }
.runner[data-state="checking"] .connection-dot { animation: pulse 1s infinite alternate; background: var(--info); }
.examples { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--ink-2); }
.who { display: inline-flex; align-items: center; gap: 10px; }
.who img, .who .avatar { width: 26px; height: 26px; border-radius: 50%; }
.who > span:last-child { display: grid; line-height: 1.25; }

/* ---------- sign in and consent ---------- */
body.login { min-height: 100vh; background: radial-gradient(900px 500px at 85% -10%, rgba(162,14,38,.35), transparent 60%), #000; }
.login-wrap { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 24px 32px; gap: 24px; }
.login-top { display: flex; justify-content: space-between; align-items: center; }
.login-tag { font: 700 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.login-card { align-self: center; justify-self: center; width: min(480px, 100%); display: grid; gap: 18px; padding: 36px; border-radius: 24px; background: rgba(20,20,23,.9); border: 1px solid var(--line-2); box-shadow: 0 40px 100px -30px rgba(0,0,0,.9); }
.lines { display: flex; gap: 6px; }
.lines .kb { width: 30px; height: 30px; font-size: 14px; }
.login-title { font: 800 clamp(48px, 7vw, 76px)/.95 var(--display); letter-spacing: -.04em; }
.login-title.sm { font-size: clamp(30px, 4vw, 40px); }
.login-intro { color: var(--ink-2); font-size: 15px; }
.login-intro strong { color: var(--ink); }
.field-row { display: flex; gap: 8px; }
.field-row input { flex: 1; }
.login-foot { color: var(--muted); font-size: 12px; text-align: center; }
.consent-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; }
.consent-icon .i { width: 24px; height: 24px; }
.consent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--ink-2); }
.consent-list li { display: flex; gap: 10px; align-items: flex-start; }
.consent-list .i { color: var(--ok); margin-top: 1px; }
.consent-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0; }

/* ---------- client review ---------- */
body.review { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.rv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: #000; }
.rv-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rv-left strong { font-family: var(--display); }
.rv-center, .rv-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.banner { padding: 11px 20px; background: var(--info-bg); color: var(--info); display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; text-align: center; font-weight: 600; }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner a { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.rv-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.rv-main .frame-wrap { background: var(--bg-2); padding: 14px; }
.frame-piece { align-items: center; overflow: hidden; position: relative; }
.frame-piece iframe { flex: none; min-height: 0; position: absolute; left: 50%; top: 50%; transform-origin: 0 0; border-radius: 2px; transition: none; }
.rv-panel { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.rv-panel-head { padding: 18px 18px 10px; display: grid; gap: 8px; justify-items: start; }
.rv-panel-head h2 { font-size: 22px; }
.rv-panel .list { flex: 1; overflow-y: auto; padding: 0 18px; }
.rv-send { padding: 14px 18px 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.rv-send p { text-align: center; }
.rv-toggle { display: none; }
.comment .del { margin-left: auto; width: 30px; height: 30px; }
.comment-target { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: #ff8a96; font-size: 11.5px; font-weight: 700; }
.comment-target .i { width: 14px; height: 14px; }
body.mode-comment #preview { outline: 2px solid rgba(196, 19, 47, .55); outline-offset: 0; }

/* The comment box keeps its buttons in view: the middle scrolls, the header and footer stay put. */
.pop { position: fixed; z-index: 80; width: 348px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 28px 70px rgba(0,0,0,.75); overflow: hidden; }
.pop-selection { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 10px 10px 12px; background: var(--accent-soft); border-bottom: 1px solid var(--line); flex: none; }
.pop-selection-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--accent); color: #fff; }
.pop-selection-icon .i { width: 16px; height: 16px; }
.pop-selection-text { min-width: 0; flex: 1; }
.pop-selection-text small { display: block; margin-bottom: 1px; color: #ff9aa6; font: 800 9.5px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.pop-selection-text strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.pop-selection-nav { display: inline-flex; gap: 2px; }
.pop-selection-nav .ibtn { width: 30px; height: 30px; background: rgba(0,0,0,.25); }
.pop-selection-nav [data-tip]:hover::after { left: auto; right: 0; transform: none; }
.pop-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px; display: grid; gap: 10px; align-content: start; }
.pop textarea { min-height: 84px; }
.pop-shot { position: relative; }
.pop-shot img { display: block; width: 100%; border-radius: 10px; max-height: 150px; object-fit: cover; object-position: top; border: 1px solid var(--line); }
.ibtn-overlay { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.7); color: #fff; }
.ibtn-overlay[data-tip]:hover::after { left: auto; right: 0; transform: none; }
.pop-foot { flex: none; display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface-2); }
.pop-foot label.ibtn { cursor: pointer; }
.pop-foot [data-tip]:hover::after, .composer [data-tip]:hover::after, .rv-send [data-tip]:hover::after { top: auto; bottom: calc(100% + 8px); }
.pop-foot [data-tip]:first-child:hover::after { left: 0; transform: none; }
.work-actions [data-tip]:last-child:hover::after, .work-actions [data-tip]:hover::after { left: auto; right: 0; transform: none; }

/* ---------- custom select (dropdowns.js) ---------- */
.ui-select { position: relative; display: inline-flex; width: auto; min-width: 0; vertical-align: middle; }
.ui-select-native { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: 0 !important; opacity: 0 !important; pointer-events: none !important; }
.ui-select-trigger { width: 100%; min-height: 36px; display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: 600 13px/1.2 var(--sans); text-align: left; white-space: nowrap; cursor: pointer; transition: border-color .15s, background .15s; }
.ui-select-text { overflow: hidden; text-overflow: ellipsis; }
.ui-select-trigger:hover, .ui-select.is-open .ui-select-trigger { border-color: var(--ink-2); background: var(--surface-3); }
.ui-select-chevron { width: 7px; height: 7px; flex: none; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s; opacity: .7; }
.ui-select.is-open .ui-select-chevron { transform: translateY(2px) rotate(225deg); }
.ui-select-bare .ui-select-trigger { border-radius: 99px; min-height: 34px; padding: 7px 13px; }
.rv-center .ui-select { max-width: 220px; }
.work-actions .ui-select[data-value="approved"] .ui-select-trigger { box-shadow: inset 3px 0 0 var(--ok); }
.work-actions .ui-select[data-value="review"] .ui-select-trigger { box-shadow: inset 3px 0 0 var(--info); }
.work-actions .ui-select[data-value="changes"] .ui-select-trigger { box-shadow: inset 3px 0 0 var(--warn); }
.work-actions .ui-select[data-value="working"] .ui-select-trigger { box-shadow: inset 3px 0 0 var(--info); }
.agent-options .ui-select, dialog .ui-select { width: 100%; }
.agent-options .ui-select-trigger { min-height: 36px; font-size: 12.5px; text-transform: none; letter-spacing: 0; }
.ui-select-menu { position: fixed; z-index: 1000; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); box-shadow: 0 24px 50px rgba(0,0,0,.7); }
.ui-select-option { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 10px; border-radius: 8px; color: var(--ink); font: 600 13px/1.35 var(--sans); cursor: pointer; outline: none; }
.ui-select-option:hover, .ui-select-option:focus-visible { background: var(--surface-3); }
.ui-select-option[aria-selected="true"] { background: var(--accent-soft); }
.ui-select-option[aria-disabled="true"] { opacity: .45; cursor: default; }
.ui-option-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--line-2); }
.ui-select-option[data-value="claude"] .ui-option-dot { background: #d97757; }
.ui-select-option[data-value="codex"] .ui-option-dot { background: var(--info); }
.ui-select-option[data-value="approved"] .ui-option-dot { background: var(--ok); }
.ui-select-option[data-value="working"] .ui-option-dot, .ui-select-option[data-value="review"] .ui-option-dot { background: var(--info); }
.ui-select-option[data-value="changes"] .ui-option-dot { background: var(--warn); }
.ui-option-check { margin-left: auto; opacity: 0; font-size: 14px; color: var(--accent-hi); }
.ui-select-option[aria-selected="true"] .ui-option-check { opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .dash { grid-template-columns: 1fr; }
  .dash-side { position: static; grid-template-columns: 1fr 1fr; align-items: start; }
  .connect-grid, .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  body.is-work { height: auto; overflow: visible; }
  body.is-work .main { height: auto; }
  .work-body { grid-template-columns: 1fr !important; }
  .stage { min-height: 70vh; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .work-actions { margin-left: 0; }
}
@media (max-width: 760px) {
  body.app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-top { padding: 0; }
  .brand-word, .side-label, .side-toggle, .side-live, .side-user { display: none !important; }
  .side-nav { display: flex; gap: 2px; margin-left: auto; }
  .side-item { padding: 9px; }
  .side-item.on::before { display: none; }
  .side-bottom { margin: 0; padding: 0; border: 0; display: flex; }
  .side-badge { position: absolute; top: 0; right: -2px; min-width: 16px; height: 16px; font-size: 10px; }
  .page { padding: 20px 16px 56px; }
  .work-bar { padding: 10px 16px; }
  .vpick-btn { max-width: calc(100vw - 32px); }
  .vpick-n, .vpick-k, .vpick-btn .st { display: none; }
  .dash-side { grid-template-columns: 1fr; }
  .search input { width: 140px; }
  .agent-options { grid-template-columns: 1fr; }
  .pieces { padding: 20px 16px; gap: 24px 16px; }
  .piece-social .piece-art { --h: 240px; }
  .piece-menu .piece-art { --h: 300px; }
  .book-spreads, .book-pages { padding: 16px; }
  .timeline li a { grid-template-columns: 1fr; gap: 2px; }
  .rv-main { grid-template-columns: 1fr; }
  .rv-panel { position: fixed; inset: auto 0 0 0; max-height: 72vh; border-left: 0; border-top: 1px solid var(--line); box-shadow: 0 -10px 30px rgba(0,0,0,.5); transform: translateY(100%); transition: transform .25s; z-index: 40; }
  .rv-panel.open { transform: none; }
  .rv-toggle { display: inline-flex; }
  .rv-center { order: 3; width: 100%; justify-content: space-between; }
  .pop { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-height: 78vh; border-radius: 18px 18px 0 0; }
  .login-wrap { padding: 16px; }
  .login-card { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- requests feed and composer ---------- */
.composer { position: sticky; top: 0; z-index: 3; display: grid; gap: 8px; margin: 10px -6px 12px; padding: 12px; border-radius: 16px; background: var(--surface-2);
  border: 1px solid rgba(196, 19, 47, .55); box-shadow: 0 0 0 4px rgba(162, 14, 38, .12), 0 18px 30px -20px rgba(0,0,0,.9); }
.composer:focus-within { border-color: var(--accent-hi); box-shadow: 0 0 0 4px rgba(196, 19, 47, .25), 0 18px 30px -20px rgba(0,0,0,.9); }
.composer textarea { border: 0; background: transparent; padding: 4px 2px; font-size: 14.5px; min-height: 76px; resize: vertical; }
.composer textarea:focus { background: transparent; }
.composer-foot { display: flex; align-items: center; gap: 8px; }
.composer-note { padding: 0 2px; }
.apick { position: relative; min-width: 0; }
.apick-btn, .apick-static { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface-3); color: var(--ink); font: 600 12.5px/1 var(--sans); cursor: pointer; white-space: nowrap; max-width: 100%; }
.apick-static { cursor: default; background: transparent; }
.apick-btn:hover, .apick.is-open .apick-btn { border-color: var(--ink-2); }
.apick-btn .i { width: 14px; height: 14px; color: var(--muted); }
.apick-agent { color: var(--muted); }
.apick-effort { padding: 3px 7px; border-radius: 99px; background: rgba(255,255,255,.08); font-size: 11.5px; }
.apick-pop { position: fixed; z-index: 400; display: grid; gap: 14px; padding: 14px; border-radius: 16px; background: #1f1f24; border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(0,0,0,.8); }
.apick-row { display: grid; gap: 8px; }
.apick-k { font: 700 12px/1 var(--sans); color: var(--muted); }
.apick-list { display: flex; flex-wrap: wrap; gap: 6px; }
.apick-list button { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 11px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font: 600 13px/1 var(--sans); cursor: pointer; }
.apick-list button small { color: var(--muted); font-size: 10.5px; }
.apick-list button:hover { color: var(--ink); border-color: #4a4a53; }
.apick-list button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.apick-list button.on small { color: #555; }
.apick-effort-head { display: flex; align-items: baseline; gap: 8px; }
.apick-effort-head strong { font: 700 15px/1 var(--display); }
.apick-slider { position: relative; height: 34px; border-radius: 12px; background: #2c2c33; }
.apick-dots { position: absolute; inset: 0 17px; pointer-events: none; }
.apick-dots i { position: absolute; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #6b6b75; }
.apick-slider input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0 3px; background: transparent; border: 0; -webkit-appearance: none; appearance: none; cursor: pointer; }
.apick-slider input:focus { background: transparent; }
.apick-slider input::-webkit-slider-runnable-track { height: 34px; background: transparent; }
.apick-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: 3px; border-radius: 9px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.apick-slider input::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 9px; background: #fff; }
.apick-slider input::-moz-range-track { background: transparent; }
.apick-scale { display: flex; justify-content: space-between; font: 600 12px/1 var(--sans); color: var(--muted); }

.rfeed { display: grid; gap: 12px; padding-bottom: 12px; }
.empty-feed { padding: 20px 4px; }
.rcard { border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); padding: 12px 14px; display: grid; gap: 10px; }
.rcard.is-here { border-color: rgba(106, 169, 255, .45); }
.rcard.is-running { border-color: rgba(106, 169, 255, .6); background: linear-gradient(180deg, var(--info-bg), var(--bg-2) 70%); }
.rcard-new { border-color: rgba(255, 211, 8, .4); background: linear-gradient(180deg, var(--warn-bg), var(--bg-2) 70%); }
.rcard-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rstep { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.rstep-k { display: inline-flex; align-items: center; gap: 6px; font: 800 10.5px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rstep-k .i { width: 14px; height: 14px; }
.rstep-text { white-space: pre-wrap; }
.rstep-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rcard-comments > li { padding: 10px 0; }
.rcard-comments > li:first-child { padding-top: 2px; }
.rcard details { margin-top: 2px; }
.rcard .summary { margin: 0 !important; }
.pin-off { background: var(--surface-3); color: var(--muted); }
.pin-off .i { width: 12px; height: 12px; }
.viewing { display: inline-flex; align-items: center; gap: 6px; font: 700 12.5px/1 var(--sans); color: var(--info); }

/* ---------- simple connections ---------- */
.connect-simple { max-width: 760px; display: grid; gap: 16px; }
.connect-simple .page-head { margin-bottom: 4px; }
.conn-status { display: flex; align-items: center; gap: 14px; }
.conn-status strong { font: 700 17px/1.2 var(--display); }
.conn-status-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none; background: var(--surface-3); color: var(--ink-2); }
.conn-status.on .conn-status-icon { background: var(--ok-bg); color: var(--ok); box-shadow: 0 0 0 5px rgba(61,220,151,.08); }
.conn-status.on strong { color: var(--ok); }
.conn-status.wait .conn-status-icon { background: var(--warn-bg); color: var(--warn); }
.cstep { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding-top: 18px; }
.cstep + .cstep { border-top: 1px solid var(--line); margin-top: 18px; }
.cstep-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font: 800 14px/1 var(--display); }
.cstep-body { display: grid; gap: 10px; justify-items: start; min-width: 0; }
.cstep-body .msg { width: 100%; }
.team-details summary { font: 700 14px/1.2 var(--display); color: var(--ink); }
.team-details[open] summary { margin-bottom: 12px; }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.team-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
@media (max-width: 1000px) {
  .panel-resize { display: none; }
  .work-body { grid-template-columns: 1fr !important; }
  .devices > button span, .devices > button small { display: none; }
}

/* Keep the preview toolbar on one line; drop labels as the stage narrows. */
.stage-web { container-type: inline-size; }
.stage-web .stage-bar { flex-wrap: nowrap; }
@container (max-width: 980px) { .devices > button small, .frame-size { display: none; } }
@container (max-width: 760px) { .devices > button span { display: none; } }

/* ---------- first version prompt ---------- */
body.is-start .main { display: flex; flex-direction: column; min-height: 100vh; }
.start { flex: 1; display: flex; flex-direction: column; }
.start-top { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.start-top .btn { margin-left: auto; }
.start-title { display: inline-flex; align-items: center; gap: 10px; font: 700 16px/1 var(--display); }
.start-inner { flex: 1; width: min(760px, 100%); margin: 0 auto; padding: 8vh 24px 48px; display: grid; align-content: center; gap: 16px; }
.start-h { font: 800 clamp(34px, 5vw, 56px)/1 var(--display); letter-spacing: -.03em; text-align: center; }
.start-sub { text-align: center; max-width: 58ch; margin: 0 auto; }
.composer-lg { position: static; margin: 12px 0 0; padding: 16px; border-radius: 22px; }
.composer-lg textarea { min-height: 130px; font-size: 16px; }
.start-ideas { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.start-ideas .chip { font-size: 12.5px; padding: 8px 12px; text-align: left; white-space: normal; line-height: 1.35; }
.start-notes { text-align: center; }
.composer-files:empty { display: none; }
.composer-files { margin: 0; }
.composer.is-drop { border-style: dashed; border-color: var(--yellow); }

/* ---------- client general comment ---------- */
.rv-quick { width: 100%; display: grid; gap: 8px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); }
.rv-quick:focus-within { border-color: var(--accent-hi); }
.rv-quick textarea { border: 0; background: transparent; padding: 2px; min-height: 48px; }
.rv-quick textarea:focus { background: transparent; }
.rv-quick .attach:empty { display: none; }
.rv-quick-foot { display: flex; align-items: center; gap: 6px; }
.rv-quick-foot [data-tip]:hover::after { top: auto; bottom: calc(100% + 8px); left: 0; transform: none; }

/* Picker fields: plain labeled dropdowns. */
.apick-field { display: grid; gap: 6px; font: 700 12px/1 var(--sans); color: var(--muted); }
.apick-field .ui-select { width: 100%; }
.apick-pop { gap: 12px; }

/* ---------- print setup ---------- */
.print-now { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.print-now strong { font: 700 16px/1.2 var(--display); }
dialog label.check { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; row-gap: 2px; cursor: pointer; }
dialog label.check input { width: 18px; height: 18px; accent-color: var(--accent-hi); }
dialog label.check small { grid-column: 2; }
.stage-pieces .stage-bar { position: sticky; top: 0; z-index: 2; }

/* ---------- connection check ---------- */
.check-result { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); animation: toast-in .2s ease; }
.check-result > div { display: grid; gap: 2px; }
.check-result strong { font: 700 14.5px/1.3 var(--display); }
.check-result span:not(.check-dot) { color: var(--ink-2); font-size: 13px; }
.check-dot { position: relative; flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--muted); }
.check-result.is-checking .check-dot { background: var(--info); animation: pulse .7s infinite alternate; }
.check-result.is-ok { border-color: rgba(61, 220, 151, .45); background: var(--ok-bg); }
.check-result.is-ok strong { color: var(--ok); }
.check-result.is-ok .check-dot, .live-pulse { background: var(--ok); }
.check-result.is-ok .check-dot::after, .live-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ok); animation: live-ring 1.6s ease-out infinite; }
.check-result.is-wait { border-color: rgba(255, 211, 8, .4); background: var(--warn-bg); }
.check-result.is-wait .check-dot { background: var(--warn); }
.check-result.is-bad { border-color: rgba(255, 92, 108, .4); background: var(--bad-bg); }
.check-result.is-bad .check-dot { background: var(--bad); }
@keyframes live-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(2.4); opacity: 0; } }
.conn-status.on .conn-status-icon.live-pulse { position: relative; background: var(--ok-bg); }
.conn-status-icon.live-pulse::after { animation-name: live-ring-sm; }
@keyframes live-ring-sm { from { transform: scale(1); opacity: .8; } to { transform: scale(1.45); opacity: 0; } }
.live-tag { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; padding: 3px 8px; border-radius: 99px; background: var(--ok-bg); color: var(--ok); font: 800 10px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; vertical-align: 3px; }
.live-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: pulse .8s infinite alternate; }
.apick-effort-head strong { color: var(--ink); }

/* ---------- per-agent status boxes ---------- */
.agent-boxes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.agent-box { display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px 9px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); }
.agent-box-text { display: grid; gap: 1px; line-height: 1.2; }
.agent-box strong { font: 700 13.5px/1.2 var(--display); }
.agent-box small { color: var(--muted); font-size: 11.5px; }
.agent-dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); flex: none; }
.agent-box.on { border-color: rgba(61, 220, 151, .4); background: var(--ok-bg); }
.agent-box.on small { color: var(--ok); }
.agent-box.on .agent-dot { background: var(--ok); }
.agent-box.on .agent-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ok); animation: live-ring 1.6s ease-out infinite; }
.agent-revoke { margin-left: auto; }

/* ---------- client review on phones ---------- */
.rv-close { display: none; }
.rv-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
@media (max-width: 760px) {
  body.review { height: 100dvh; }
  .rv-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 8px 12px; }
  .rv-left { min-width: 0; gap: 10px; }
  .rv-left .brand-mark { width: 30px; height: 30px; font-size: 15px; }
  .rv-left > div { min-width: 0; }
  .rv-left strong, .rv-left .muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rv-right { gap: 6px; }
  .rv-right #mode > button { padding: 8px 10px; font-size: 12px; }
  .rv-center { grid-column: 1 / -1; order: 3; display: flex; gap: 6px; width: 100%; flex-wrap: nowrap; }
  .rv-center .ui-select { flex: 1; min-width: 0; max-width: none; }
  .rv-center #device, .rv-center .devices { display: none; }
  .banner { padding: 8px 12px; font-size: 13px; }
  .rv-main .frame-wrap { padding: 8px; }
  /* A floating button opens the comments; the panel is a bottom sheet. */
  .rv-toggle { position: fixed; left: 50%; bottom: calc(16px + var(--kb, 0px)); transform: translateX(-50%); z-index: 45; display: inline-flex; padding: 12px 18px; border-radius: 99px;
    background: var(--accent); border-color: var(--accent); color: #fff; font-size: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.55); }
  .rv-toggle .n { background: rgba(255,255,255,.2); color: #fff; padding: 3px 7px; border-radius: 99px; }
  .rv-panel { max-height: 82dvh; bottom: var(--kb, 0px); border-radius: 20px 20px 0 0; z-index: 50; }
  .rv-panel::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line-2); }
  .rv-panel-head { padding-top: 22px; }
  .rv-close { display: inline-grid; }
  .rv-send { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .pop { bottom: var(--kb, 0px); max-height: calc(82dvh - var(--kb, 0px)); z-index: 60; }
  .pop-body textarea, .rv-quick textarea, #me-name { font-size: 16px; }  /* 16px keeps iOS from zooming in on focus */
  .ibtn { width: 40px; height: 40px; }
  .pop-selection-nav .ibtn { width: 38px; height: 38px; }
  [data-tip]:hover::after { display: none; }
}
@media (max-width: 760px) { body.has-pop .rv-toggle, .rv-panel.open ~ .rv-toggle { display: none; } }
@media (max-width: 760px) { body.panel-open .rv-toggle { display: none; } }
