/* Static Studio — the Airr Digital style kit (airr-style-kit, onboarding v16): navy ink, one action blue, a pale-blue frame
   around a white rounded panel, white bordered cards, DM Sans headings over Switzer body text. Kept quiet: one primary
   action per screen, status as small pills, nothing on screen that isn't needed for the step the reviewer is on. */
:root {
  --ink: #011833;
  --blue: #0371ee;
  --blue-hover: #0559c9;
  --pale: #e9f3ff;
  --pale-line: #cfe2fa;
  --secondary: #4b6685;
  --tertiary: #8597ad;
  --surface: #f5f9fe;
  --border: #d3dde8;
  --hairline: #e1e6eb;
  --success: #1f7a45; --success-bg: #e7f5ec;
  --warn: #8a5300; --warn-bg: #fff3dc;
  --danger: #b3261e; --danger-bg: #fdecea;
  --marker: #ff3d7f;
  --font: Switzer, Arial, sans-serif;
  --display: "DM Sans", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --top: 64px;
  --frame: 12px;
  --bar: 76px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--surface); color: var(--ink); }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--pale); }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid var(--pale-line); outline-offset: 2px; }
h1 { font-family: var(--display); font-weight: 500; font-size: 32px; line-height: 1.18; letter-spacing: -.02em; margin: 0; }
h2 { font-family: var(--display); font-weight: 500; font-size: 19px; letter-spacing: -.01em; margin: 0; }
.muted { color: var(--secondary); }
.faint { color: var(--tertiary); }
.mono { font-family: var(--mono); font-size: .92em; }

/* ---------- frame: top bar + white panel ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top); display: flex; align-items: center; gap: 22px; padding: 0 calc(var(--frame) + 10px); z-index: 5; }
.brand { display: flex; align-items: baseline; gap: 10px; flex: none; }
.brand-logo { width: 96px; height: auto; filter: brightness(0); align-self: center; }
.brand-text { font-family: var(--display); font-size: 18px; }
.brand span { font-size: 13px; color: var(--secondary); padding-left: 10px; border-left: 1px solid var(--border); line-height: 1.2; }
.nav { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; color: var(--secondary); white-space: nowrap; }
.nav a:hover { background: rgba(3, 113, 238, .05); }
.nav a.on { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 47, 121, .06), inset 0 0 0 1px var(--pale-line); }
.n { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--pale); color: var(--blue); font-size: 12px; font-weight: 600; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.n:empty { display: none; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.scope { width: 170px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 0 10px; }
.codex { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--secondary); font-size: 13px; white-space: nowrap; }
.codex:hover { background: rgba(3, 113, 238, .05); }
.codex .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tertiary); flex: none; }
.codex.on .dot { background: var(--success); }
.codex.busy .dot { background: var(--blue); }
.settings-link { height: 38px; padding: 0 12px; border-radius: 10px; font-size: 13px; color: var(--secondary); display: flex; align-items: center; }
.settings-link:hover { background: rgba(3, 113, 238, .05); }
.settings-link.on { color: var(--blue); }
main#app { position: fixed; top: var(--top); right: var(--frame); bottom: var(--frame); left: var(--frame); background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(1, 24, 51, .05), 0 2px 8px rgba(0, 47, 121, .04); display: flex; flex-direction: column; }
body.has-bar main#app { bottom: var(--bar); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 44px 44px 56px; }

/* ---------- buttons, pills ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--pale); color: var(--blue); font-weight: 500; white-space: nowrap; }
.btn:hover:not(:disabled) { background: #dcebfd; }
.btn.primary { height: 44px; padding: 0 22px; border-radius: 12px; border: 1px solid #0757c8; color: #fff; font-family: var(--display); font-weight: 600;
  background: linear-gradient(#126be3 0%, #075bd3 55%, #0552c4 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 3px rgba(0, 47, 121, .08), 0 6px 14px rgba(0, 72, 173, .11); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(#0f62d4 0%, #0652c2 55%, #044ab3 100%); }
.btn.ghost { background: transparent; color: var(--secondary); }
.btn.ghost:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.icon-btn { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--tertiary); display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface); color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface); color: var(--secondary); white-space: nowrap; }
.pill.blue { background: var(--pale); color: var(--blue); }
.pill.green { background: var(--success-bg); color: var(--success); }
.pill.amber { background: var(--warn-bg); color: var(--warn); }
.pill.red { background: var(--danger-bg); color: var(--danger); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: #fff; border: 1px solid var(--hairline); }
.seg button { height: 28px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; color: var(--secondary); font-size: 13px; }
.seg button.on { background: var(--pale); color: var(--blue); font-weight: 500; }
.seg button.failing { color: var(--danger); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- lists ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head .titles { flex: 1; min-width: 260px; }
.page-head .lead { color: var(--secondary); margin: 8px 0 0; max-width: 620px; }
.search { height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; width: 220px; background: #fff; outline: none; }
.search:focus { border-color: var(--blue); }
.sort { height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 0 8px; background: #fff; }
.work-list > h2 { margin: 18px 0 10px; font-size: 17px; }
.job .thumb { display: grid; place-items: center; border-bottom: 1px dashed var(--border); }
.job-progress { display: grid; justify-items: center; gap: 8px; padding: 12px; color: var(--secondary); text-align: center; overflow-wrap: anywhere; }
.group + .group { margin-top: 36px; }
.group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.group-head .sub { color: var(--tertiary); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.card { display: block; border-radius: 16px; background: #fff; border: 1px solid var(--hairline); overflow: hidden; transition: border-color .15s, box-shadow .15s; position: relative; }
.card:hover { border-color: var(--pale-line); box-shadow: 0 2px 3px rgba(0, 47, 121, .05), 0 6px 14px rgba(0, 72, 173, .07); }
.card .thumb { aspect-ratio: 1; background: var(--surface); position: relative; }
.card .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .tags { position: absolute; left: 10px; top: 10px; right: 44px; display: flex; gap: 5px; flex-wrap: wrap; }
.card .tags .pill { box-shadow: 0 1px 3px rgba(1, 24, 51, .12); background: #fff; }
.card .tags .pill.red { background: var(--danger-bg); }
.card .meta { padding: 12px 14px 14px; }
.card .t { font-family: var(--display); font-weight: 500; display: flex; gap: 6px; align-items: baseline; }
.card .t .v { color: var(--tertiary); font-family: var(--font); font-size: 12px; font-weight: 400; }
.card .t .score { margin-left: auto; color: var(--secondary); font-family: var(--font); font-size: 13px; font-weight: 400; }
.card .s { color: var(--secondary); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick { position: absolute; right: 10px; top: 10px; width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--border); background: #fff; display: grid; place-items: center; }
.pick svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 2; }
.pick.on { background: var(--blue); border-color: var(--blue); }
.empty { color: var(--secondary); padding: 56px 0; text-align: center; }
.empty.small { padding: 20px 0; font-size: 14px; }

/* ---------- action bar (in the pale frame, under the panel) ---------- */
.action-bar { position: fixed; left: var(--frame); right: var(--frame); bottom: 0; height: var(--bar); display: flex; align-items: center; gap: 12px; padding: 0 8px; z-index: 4; }
.action-bar .spacer { flex: 1; }
.action-bar .where { font-size: 13px; color: var(--secondary); font-variant-numeric: tabular-nums; }
.action-bar .note { font-size: 13px; color: var(--secondary); display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.action-bar .note b { color: var(--ink); font-weight: 500; }
.action-bar .warn { color: var(--warn); }

/* ---------- review ---------- */
.review { flex: 1; min-height: 0; display: grid; grid-template-columns: 236px minmax(0, 1fr) 340px; }
/* the other ads in this list, beside the canvas */
.queue { border-right: 1px solid var(--hairline); display: flex; flex-direction: column; min-height: 0; background: #fff; }
.queue-head { display: flex; align-items: baseline; gap: 8px; padding: 18px 16px 10px; font-size: 13px; }
.queue-head a { font-family: var(--display); font-weight: 500; font-size: 15px; color: var(--ink); }
.queue-head a:hover { color: var(--blue); }
.q-list { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; grid-template-columns: minmax(0, 1fr); padding: 0 10px 14px; display: grid; align-content: start; gap: 4px; scrollbar-width: thin; }
.q-item { display: flex; align-items: center; gap: 11px; padding: 7px; border-radius: 12px; min-width: 0; }
.q-item:hover { background: var(--surface); }
.q-item.on { background: var(--pale); box-shadow: inset 0 0 0 1px var(--pale-line); }
.q-thumb { position: relative; width: 52px; height: 52px; flex: none; border-radius: 8px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px rgba(1, 24, 51, .06); }
.q-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.q-dot { position: absolute; right: 4px; top: 4px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.q-dot.amber { background: #f2994a; }
.q-dot.red { background: var(--danger); }
.q-text { display: flex; flex-direction: column; min-width: 0; }
.q-t { font-family: var(--display); font-weight: 500; font-size: 14px; color: var(--ink); }
.q-v { font-family: var(--font); font-weight: 400; font-size: 12px; color: var(--tertiary); }
.q-s { font-size: 12.5px; color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-item.on .q-s { color: var(--ink); }
.canvas { position: relative; min-width: 0; min-height: 0; background: var(--surface); display: flex; flex-direction: column; }
.canvas-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; flex-wrap: wrap; }
.canvas-head h2 { white-space: nowrap; }
.canvas-head .sub { color: var(--secondary); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.canvas-head .spacer { flex: 1; }
.stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; padding: 8px 24px 12px 72px; }
.frame { position: relative; background: #fff; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px rgba(1, 24, 51, .06), 0 10px 30px rgba(0, 47, 121, .10); }
.frame iframe { position: absolute; left: 0; top: 0; width: 1080px; height: 1080px; border: 0; transform-origin: 0 0; background: #fff; pointer-events: none; }
.frame.editing iframe { pointer-events: auto; }
.overlay { position: absolute; inset: 0; z-index: 2; cursor: default; }
.frame.editing .overlay { pointer-events: none; }
.overlay.select { cursor: pointer; }
.overlay.marker { cursor: crosshair; }
.overlay.area { cursor: crosshair; }
.spot { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0, 47, 121, .35); pointer-events: none; }
.spot .tag { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); height: 22px; padding: 0 7px; border-radius: 6px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; white-space: nowrap; }
.spot.draft { background: var(--blue); animation: spotin .18s ease-out; }
.spot.done { background: var(--success); opacity: .7; } .spot.done .tag { background: var(--success); }
.spot.sent { opacity: .6; }
@keyframes spotin { from { transform: scale(.4); } to { transform: scale(1); } }
.overlay svg.ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.overlay svg.ink path { fill: none; stroke: var(--marker); stroke-linecap: round; stroke-linejoin: round; opacity: .85; vector-effect: non-scaling-stroke; stroke-width: 4; }
.overlay svg.ink path.done { stroke: var(--success); opacity: .5; }
.overlay svg.ink path.sent { stroke: var(--blue); opacity: .6; }
.box { position: absolute; border: 2px solid var(--blue); border-radius: 4px; pointer-events: none; }
.box.hover { border-style: dashed; border-color: rgba(3, 113, 238, .7); background: rgba(3, 113, 238, .04); }
.box.draft { background: rgba(3, 113, 238, .06); }
.box.done { border-color: var(--success); opacity: .6; }
.box.sent { border-color: var(--blue); opacity: .6; }
.box .tag, .pin-n { position: absolute; left: -2px; top: -24px; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.box.done .tag { background: var(--success); }
.box.hover .tag { background: rgba(3, 113, 238, .85); font-weight: 500; }
.box.inside .tag { top: 2px; left: 2px; }
.pin-n { top: auto; left: auto; transform: translate(-50%, -115%); background: var(--marker); }
.pin-n.done { background: var(--success); }
/* floating tools on the canvas */
.tools { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); z-index: 3; display: flex; flex-direction: column; gap: 4px; padding: 5px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px var(--hairline), 0 6px 18px rgba(0, 47, 121, .10); }
.tools button { width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--secondary); display: grid; place-items: center; }
.tools button:hover { background: var(--surface); color: var(--ink); }
.tools button.on { background: var(--pale); color: var(--blue); }
.tools svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.canvas-foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 18px 10px 72px; flex-wrap: wrap; }
.canvas-foot select { height: 36px; border: 1px solid var(--hairline); border-radius: 10px; background: #fff; padding: 0 10px; font-size: 13px; color: var(--secondary); }
.hint { font-size: 12.5px; color: var(--tertiary); text-align: center; padding: 0 18px 14px 72px; min-height: 20px; }
/* the format bar while editing text on the ad */
.fmt { position: absolute; z-index: 4; display: flex; gap: 2px; padding: 4px; border-radius: 10px; background: var(--ink); box-shadow: 0 6px 18px rgba(1, 24, 51, .25); transform: translateY(calc(-100% - 8px)); }
.fmt button { height: 30px; min-width: 30px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: #fff; font-size: 13px; }
.fmt button:hover { background: rgba(255, 255, 255, .14); }
.fmt .acc { color: #9cc7ff; font-weight: 600; }
.fmt .b { font-weight: 700; }
.fmt .u { text-decoration: underline; text-underline-offset: 3px; }
.fmt .sep { width: 1px; background: rgba(255, 255, 255, .2); margin: 4px 2px; }

/* side: summary, comments, composer */
.side { border-left: 1px solid var(--hairline); display: flex; flex-direction: column; min-height: 0; background: #fff; }
.summary { padding: 16px 18px 14px; border-bottom: 1px solid var(--hairline); }
.summary .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.summary .score { font-family: var(--display); font-size: 22px; font-weight: 500; margin-right: 2px; }
.summary .score small { font-size: 13px; color: var(--tertiary); font-family: var(--font); font-weight: 400; }
.summary .angle { color: var(--secondary); font-size: 13px; margin-top: 4px; }
.summary details { margin-top: 8px; font-size: 13px; }
.summary summary { cursor: pointer; color: var(--blue); width: fit-content; list-style: none; }
.summary summary::-webkit-details-marker { display: none; }
.summary summary:before { content: '▸ '; font-size: 10px; }
.summary details[open] summary:before { content: '▾ '; }
.summary dl { margin: 8px 0 0; display: grid; gap: 6px; }
.summary dt { color: var(--tertiary); font-size: 12px; }
.summary dd { margin: 0; color: var(--secondary); }
.checks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.checks li { display: flex; gap: 8px; align-items: baseline; color: var(--secondary); }
.checks .pill { flex: none; }
.banner { margin: 12px 18px 0; padding: 10px 12px; border-radius: 12px; background: var(--pale); color: var(--ink); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner a { color: var(--blue); font-weight: 500; margin-left: auto; white-space: nowrap; }
.list-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px 6px; font-size: 13px; color: var(--secondary); }
.list-head .spacer { flex: 1; }
.list-head label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.notes { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 12px; display: grid; align-content: start; gap: 4px; }
.note { padding: 10px 10px 6px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; }
.note:hover { background: var(--surface); }
.note.focus { border-color: var(--pale-line); background: #fbfdff; }
.note.done { opacity: .72; }
.prev-notes { margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px dashed var(--border); }
.prev-head { display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 2px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.prev-head .faint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note[data-old] { opacity: 1; }
.note-top { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--secondary); }
.note-n { width: 20px; height: 20px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; flex: none; }
.note.marker .note-n { background: var(--marker); }
.note.done .note-n { background: var(--success); }
.note-on { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.note-top .spacer { flex: 1; }
.note-body { margin: 5px 0 0 27px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-reply { margin: 6px 0 0 27px; padding: 7px 10px; border-radius: 10px; background: var(--surface); color: var(--secondary); font-size: 13px; }
.note-reply b { color: var(--ink); font-weight: 500; }
.note-foot { margin: 2px 0 0 21px; display: flex; align-items: center; gap: 2px; min-height: 28px; }
.note-foot .spacer { flex: 1; }
.note:not(:hover):not(.focus) .note-foot .icon-btn { visibility: hidden; }
.skill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px 0 6px; border: 0; border-radius: 7px; background: transparent; color: var(--tertiary); font-size: 12px; }
.skill:hover { background: var(--surface); color: var(--secondary); }
.skill .box2 { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--border); display: grid; place-items: center; }
.skill.on { color: var(--blue); }
.skill.on .box2 { background: var(--blue); border-color: var(--blue); }
.skill .box2 svg { width: 9px; height: 9px; stroke: #fff; stroke-width: 2.4; fill: none; }
.edit-area { width: 100%; min-height: 60px; border: 1px solid var(--blue); border-radius: 8px; padding: 6px 8px; outline: none; resize: vertical; }
.prev-head { border: 0; background: none; color: var(--secondary); font-size: 13px; padding: 4px 6px; }
.composer { border-top: 1px solid var(--hairline); padding: 12px 14px 14px; }
.composer .on { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--secondary); margin-bottom: 8px; min-height: 22px; }
.composer .on .pill { max-width: 250px; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 24px; }
.composer .on .x { border: 0; background: none; color: var(--tertiary); padding: 0 4px; }
.composer .box-in { display: flex; gap: 8px; align-items: flex-end; border: 1px solid var(--border); border-radius: 12px; padding: 6px 6px 6px 12px; background: #fff; transition: border-color .15s; }
.composer .box-in:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--pale); }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; min-height: 24px; max-height: 160px; padding: 5px 0; line-height: 1.45; background: transparent; }
.composer textarea::placeholder { color: var(--tertiary); }

/* ---------- Codex drawer, modal, toasts ---------- */
.drawer { position: fixed; right: calc(var(--frame) + 8px); top: calc(var(--top) - 4px); width: min(440px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; z-index: 20; background: #fff; border-radius: 16px; padding: 18px; box-shadow: 0 0 0 1px var(--hairline), 0 16px 40px rgba(0, 47, 121, .16); font-size: 13px; }
.drawer h3 { font-family: var(--display); font-weight: 500; margin: 0 0 6px; font-size: 16px; }
.drawer .sess { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.drawer pre { white-space: pre-wrap; font-family: var(--mono); font-size: 11px; color: var(--secondary); background: var(--surface); padding: 8px; border-radius: 8px; max-height: 120px; overflow: auto; margin: 6px 0 0; }
.drawer .msg { margin-top: 14px; }
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(1, 24, 51, .28); display: grid; place-items: center; padding: 20px; }
.modal-card { width: min(600px, 100%); max-height: 86vh; overflow: auto; background: #fff; border-radius: 20px; padding: 26px; box-shadow: 0 24px 60px rgba(1, 24, 51, .25); }
.modal-card h3 { font-family: var(--display); font-weight: 500; font-size: 21px; margin: 0 0 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.where-opts { display: grid; gap: 10px; margin-top: 16px; }
.radio { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.radio.on { background: var(--pale); border-color: var(--blue); }
.radio div { flex: 1; min-width: 0; }
.radio .mono { color: var(--secondary); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.field { margin-top: 14px; }
.field label { display: block; font-size: 13px; color: var(--secondary); margin-bottom: 5px; }
.field input { width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; outline: none; }
.field input:focus { border-color: var(--blue); }
label.field { display: grid; gap: 5px; font-size: 13px; color: var(--secondary); }
.field select, .field textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; color: var(--ink); background: #fff; }
.plan { margin-top: 16px; display: grid; gap: 6px; }
.plan-row { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.plan-row .pd { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--secondary); }
.plan-why { font-size: 12px; color: var(--danger); margin: -2px 0 4px; }
.crumbs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.crumb { border: 0; background: none; color: var(--blue); padding: 2px 4px; }
.folders { display: grid; gap: 2px; max-height: 300px; overflow: auto; }
.folder { display: flex; gap: 10px; align-items: center; border: 0; background: none; padding: 8px 10px; border-radius: 8px; text-align: left; }
.folder:hover { background: var(--surface); }
.folder svg { width: 18px; height: 18px; fill: var(--pale-line); }
.newfolder { display: flex; gap: 8px; margin-top: 12px; }
.newfolder input { flex: 1; height: 36px; border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; }
#toasts { position: fixed; right: 24px; bottom: 90px; z-index: 40; display: grid; gap: 8px; justify-items: end; }
.toast { max-width: 420px; padding: 11px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 8px 24px rgba(1, 24, 51, .25); }
.toast.err { background: var(--danger); }

/* settings */
.settings { max-width: 640px; }
.settings .suggest { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.settings .chip { border: 1px solid var(--border); border-radius: 999px; background: #fff; padding: 5px 12px; font-size: 13px; color: var(--secondary); }
.settings .chip:hover { border-color: var(--blue); color: var(--blue); }
.settings .help { font-size: 13px; color: var(--secondary); margin-top: 6px; }
.settings .actions { margin-top: 24px; display: flex; justify-content: flex-end; }
.sign-page { display: grid; min-height: 100vh; place-items: center; padding: 16px; }
.sign { width: min(380px, 100%); display: grid; gap: 12px; }
.sign h1, .sign p { margin: 0; }
.sign-brand { color: var(--secondary); font-weight: 600; }
.form-error { min-height: 1.2em; color: var(--danger); }
.test-batch { display: flex; align-items: center; gap: 6px; margin-top: 10px; }

/* ---------- narrow panes (680px review pane) ---------- */
@media (max-width: 1080px) {
  :root { --frame: 8px; --top: 58px; }
  .topbar { gap: 14px; }
  .brand span { display: none; }
  .brand-logo { width: 84px; }
  .nav a { height: 36px; padding: 0 10px; font-size: 14px; }
  .scope { width: 130px; height: 34px; }
  .codex .label { display: none; }
  .settings-link { font-size: 0; padding: 0 10px; }
  .settings-link:before { content: '⚙'; font-size: 17px; }
  .scroll { padding: 28px 22px 40px; }
}
@media (max-width: 860px) {
  .brand { display: none; }
}
@media (max-width: 1180px) {
  .review { grid-template-columns: 80px minmax(0, 1fr) 320px; }
  .queue-head { justify-content: center; padding: 14px 4px 8px; }
  .queue-head a { display: none; }
  .q-list { padding: 0 8px 12px; }
  .q-item { justify-content: center; padding: 5px; }
  .q-text { display: none; }
}
@media (max-width: 820px) {
  .review { grid-template-columns: 72px minmax(0, 1fr) 260px; }
  .q-thumb { width: 46px; height: 46px; }
  .stage, .canvas-foot, .hint { padding-left: 60px; }
  .tools { left: 10px; }
  .action-bar .where { display: none; }
  .scope { width: 110px; }
}
@media (max-width: 640px) {
  .review { grid-template-columns: 1fr; grid-template-rows: minmax(340px, 1fr) auto; overflow-y: auto; }
  .queue { display: none; }
  .side { border-left: 0; border-top: 1px solid var(--hairline); }
  .stage, .canvas-foot, .hint { padding-left: 16px; }
  .tools { flex-direction: row; top: auto; bottom: 10px; left: 50%; transform: translateX(-50%); }
  .stage { padding-bottom: 60px; }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { animation: none !important; transition: none !important; } }
