/* Nexas Studio: interface styles.
   One family (Geist, with Noto Sans Arabic for Arabic script), three weights (400, 500, 600).
   Type scale 12 / 13 / 14 / 16 / 20 / 24 / 30. Spacing on a 4px grid. Four radii. Three shadows.
   One accent (deep teal) kept for the main action, the current selection, links and focus. */
@font-face { font-family: "Geist"; src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; src: url("/fonts/geist-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "UI Arabic"; src: url("/fonts/noto-sans-arabic-arabic-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  /* surfaces */
  --bg: #f4f5f4; --surface: #ffffff; --surface-2: #f9faf9; --sunk: #eceeed;
  /* text */
  --ink: #141917; --ink-2: #434a47; --muted: #5f6663;
  /* lines: hairlines divide, --border outlines a control (3:1 against the surface) */
  --line: #dfe3e1; --line-2: #eaedeb; --border: #868d8a;
  /* accent */
  --accent: #0b7566; --accent-fill: #0b7566; --accent-hover: #095e52; --accent-ink: #ffffff; --accent-soft: #dff1ed; --accent-text: #0a6a5c;
  /* status */
  --ok: #17703f; --ok-soft: #e0f3e7; --warn: #8f5405; --warn-soft: #fbefd4; --bad: #b3261e; --bad-soft: #fbe5e3; --info: #1d53c2; --info-soft: #e2ebfb;
  --bad-fill: #b3261e;
  --heart: #c62a3a;
  /* the calm panel beside the sign-in form */
  --panel: #0c1f1c; --panel-ink: #e9f1ef; --panel-muted: #9fb4af; --panel-line: #24403b;
  /* shape */
  --r-1: 6px; --r-2: 8px; --r-3: 12px; --r-4: 16px; --r-full: 999px;
  --sh-1: 0 1px 2px rgba(16, 24, 22, 0.06), 0 1px 1px rgba(16, 24, 22, 0.04);
  --sh-2: 0 8px 24px rgba(16, 24, 22, 0.10), 0 2px 6px rgba(16, 24, 22, 0.06);
  --sh-3: 0 24px 64px rgba(16, 24, 22, 0.22), 0 6px 16px rgba(16, 24, 22, 0.10);
  --side-w: 236px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --font: "Geist", "UI Arabic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  /* older names still used by a few inline styles */
  --paper: var(--bg); --brand: var(--accent); --brand-soft: var(--accent-soft);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0d0c; --surface: #111615; --surface-2: #171d1b; --sunk: #0c100f;
  --ink: #edf1ef; --ink-2: #c5cbc8; --muted: #949c98;
  --line: #242b29; --line-2: #1b2120; --border: #6b7370;
  --accent: #3fd9bc; --accent-fill: #33d1b3; --accent-hover: #5ae0c7; --accent-ink: #03211c; --accent-soft: #0f2f29; --accent-text: #62dcc5;
  --ok: #5ccf8e; --ok-soft: #122e1f; --warn: #e7b256; --warn-soft: #31260e; --bad: #f28b80; --bad-soft: #391a17; --info: #86aef6; --info-soft: #15223d;
  --bad-fill: #c9382e;
  --heart: #f0727f;
  --panel: #0a1513; --panel-ink: #e9f1ef; --panel-muted: #94a8a3; --panel-line: #1d302c;
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(0, 0, 0, 0.3);
  --sh-2: 0 8px 24px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
  --sh-3: 0 24px 64px rgba(0, 0, 0, 0.65), 0 6px 16px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
a { color: var(--accent-text); text-underline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-1); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
[hidden] { display: none !important; }
:lang(ar), [dir="rtl"] { letter-spacing: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; inset-block-start: 8px; inset-inline-start: 8px; z-index: 200; padding: 8px 12px; border-radius: var(--r-2); background: var(--ink); color: var(--surface); font-weight: 500; text-decoration: none; transform: translateY(-200%); }
.skip:focus { transform: none; }

.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.fill { fill: currentColor; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; background: var(--sunk); border-radius: 4px; padding: 1px 4px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.push { margin-inline-start: auto; }
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* ---------- shell ---------- */
#app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; }
#app.collapsed { --side-w: 64px; }
#view { min-width: 0; height: 100vh; overflow: hidden; outline: none; }

.side { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-inline-end: 1px solid var(--line); }
.side-head { display: flex; align-items: center; gap: 12px; padding: 16px 12px 12px 16px; min-height: 64px; }
.mark { width: 32px; height: 32px; flex: none; display: block; }
.mark .ico, svg.mark { width: 32px; height: 32px; stroke: none; }
.side-brand { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.side-brand b { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.side-ws { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 12px; display: flex; flex-direction: column; gap: 16px; }
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-label { padding: 4px 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.side-link { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 8px; border: 0; border-radius: var(--r-2); background: transparent; color: var(--ink-2); font-weight: 500; font-size: 14px; text-decoration: none; text-align: start; white-space: nowrap; transition: background-color 0.12s, color 0.12s; }
.side-link .ico { width: 20px; height: 20px; }
.side-link:hover { background: var(--sunk); color: var(--ink); }
.side-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.side-link .count { margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full); background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.side-foot { padding: 8px; border-block-start: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; position: relative; }
.side-status { text-decoration: none; display: flex; align-items: center; gap: 12px; padding: 4px 8px; font-size: 12px; color: var(--muted); border: 0; background: transparent; border-radius: var(--r-1); text-align: start; min-height: 28px; }
.side-status:hover { background: var(--sunk); color: var(--ink); }
.side-status span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.side-user { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; border-radius: var(--r-2); background: transparent; text-align: start; min-height: 48px; }
.side-user:hover, .side-user[aria-expanded="true"] { background: var(--sunk); }
.side-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; flex: 1; }
.side-user-text b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text span { font-size: 12px; color: var(--muted); }
.side-user > .ico { color: var(--muted); width: 16px; height: 16px; transform: rotate(180deg); }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }
.side-toggle { margin-inline-start: auto; }

#app.collapsed .side-head { padding: 16px 0 12px; justify-content: center; }
#app.collapsed .side-brand, #app.collapsed .side-label, #app.collapsed .side-link span, #app.collapsed .side-user-text, #app.collapsed .side-user > .ico, #app.collapsed .side-status span b, #app.collapsed .side-toggle { display: none; }
#app.collapsed .side-link { justify-content: center; padding: 0; }
#app.collapsed .side-link .count { position: absolute; margin: -20px 0 0 20px; min-width: 16px; height: 16px; padding: 0 4px; }
#app.collapsed .side-user { justify-content: center; padding: 8px 0; }
#app.collapsed .side-status { flex-direction: column; gap: 6px; padding: 8px 0; align-items: center; }
#app.collapsed .side-nav { padding-inline: 12px; }

.menu { position: absolute; inset-inline: 8px; inset-block-end: calc(100% - 52px); z-index: 50; min-width: 208px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--sh-2); animation: pop 0.14s var(--ease) both; }
#app.collapsed .menu { inset-inline: 8px auto; }
.menu-head { padding: 8px 8px 8px; border-block-end: 1px solid var(--line-2); margin-block-end: 4px; }
.menu-head b { display: block; font-size: 13px; font-weight: 600; }
.menu-head span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.menu-item { text-decoration: none; display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 8px; border: 0; border-radius: var(--r-1); background: transparent; font-size: 14px; text-align: start; color: var(--ink); }
.menu-item:hover { background: var(--sunk); }
.menu-item .ico { color: var(--muted); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; min-width: 36px; padding: 0 12px; border-radius: var(--r-2); border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none; transition: background-color 0.12s, border-color 0.12s, transform 0.08s; }
.btn:hover { background: var(--sunk); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; transform: none; }
.btn-primary { border-color: transparent; background: var(--accent-fill); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunk); color: var(--ink); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-danger-solid { border-color: transparent; background: var(--bad-fill); color: #fff; font-weight: 600; }
.btn-danger-solid:hover { background: color-mix(in srgb, var(--bad-fill) 86%, #000); }
.btn-sm { height: 28px; min-width: 28px; padding: 0 8px; font-size: 13px; border-radius: var(--r-1); gap: 6px; }
.btn-sm .ico { width: 16px; height: 16px; }
.btn-lg { height: 44px; font-size: 16px; padding: 0 16px; }
.btn-block { width: 100%; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; flex: none; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); transition: background-color 0.12s, color 0.12s; }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.ghost:hover { background: var(--sunk); }
.icon-btn.on { color: var(--heart); }
.icon-btn.on .ico { fill: currentColor; }
.linklike { border: 0; background: none; padding: 0; color: var(--accent-text); font-weight: 500; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.linklike:hover { color: var(--ink); }

.label { display: block; font-size: 13px; font-weight: 500; color: var(--ink); margin-block-end: 4px; }
.hint { font-size: 12px; color: var(--muted); margin-block-start: 4px; }
.field { margin-block-end: 16px; }
.field-error { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--bad); margin-block-start: 4px; }
.field-error .ico { width: 16px; height: 16px; margin-block-start: 2px; }
.input, .textarea, .select { width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-2); padding: 0 12px; font-size: 14px; transition: border-color 0.12s, box-shadow 0.12s; }
.input, .select { height: 36px; }
.textarea { resize: vertical; min-height: 72px; line-height: 1.5; padding-block: 8px; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--ink-2); }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); border-radius: var(--r-2); }
.input:disabled, .textarea:disabled, .select:disabled { background: var(--sunk); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.input[aria-invalid="true"] { border-color: var(--bad); }
.select { appearance: none; padding-inline-end: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23767d7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 18px; cursor: pointer; }
[dir="rtl"] .select, .select[dir="rtl"] { background-position: left 8px center; }
[dir="rtl"].input, [dir="rtl"].textarea { font-family: "UI Arabic", var(--font); font-size: 16px; line-height: 1.7; }
.input-wrap { position: relative; }
.input-wrap .input { padding-inline-end: 64px; }
.input-wrap .peek { position: absolute; inset-block: 4px; inset-inline-end: 4px; height: 28px; padding: 0 8px; border: 0; border-radius: var(--r-1); background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.input-wrap .peek:hover { background: var(--sunk); color: var(--ink); }

.seg { display: flex; gap: 2px; padding: 2px; background: var(--sunk); border-radius: var(--r-2); }
.seg button { flex: 1; height: 32px; min-width: 0; padding: 0 8px; border: 0; background: transparent; border-radius: var(--r-1); font-weight: 500; font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--sh-1); }
.shape { display: inline-block; border: 1.5px solid currentColor; border-radius: 2px; }

.chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: var(--r-full); font-size: 12px; font-weight: 500; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.chip .ico { width: 12px; height: 12px; stroke-width: 2.2; }
.chip-accent { background: var(--accent-soft); color: var(--accent-text); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.chip-info { background: var(--info-soft); color: var(--info); }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--r-2); font-size: 13px; background: var(--warn-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); margin-block-end: 16px; }
.banner > .ico { margin-block-start: 1px; color: var(--warn); }
.banner b { font-weight: 600; }
.banner-info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.banner-info > .ico { color: var(--accent-text); }
.banner-bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.banner-bad > .ico { color: var(--bad); }
.banner .btn { flex: none; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: spin 0.7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; border-radius: var(--r-full); background: var(--sunk); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 100%; background: var(--accent-fill); border-radius: inherit; transform-origin: left center; transition: transform 0.25s var(--ease); }
[dir="rtl"] .progress > i { transform-origin: right center; }

/* ---------- studio ---------- */
.studio { display: grid; grid-template-columns: 384px minmax(0, 1fr); height: 100%; }
.brief { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-inline-end: 1px solid var(--line); }
.brief-head { padding: 20px 24px 4px; }
.brief-head h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.brief-head p { color: var(--muted); font-size: 13px; margin-block-start: 2px; }
.brief-scroll { flex: 1; overflow-y: auto; padding: 16px 24px 8px; }
.brief-foot { padding: 12px 24px 16px; border-block-start: 1px solid var(--line-2); background: var(--surface); }
.brief-foot .hint { text-align: center; margin-block-start: 8px; }
.step { margin-block-end: 24px; }
.step-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); margin-block-end: 8px; }
.step-num { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.step-num::after { content: "."; }
.step-title .chip { margin-inline-start: auto; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.brand-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.brand-tile { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-3); padding: 12px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; transition: border-color 0.12s, background-color 0.12s; }
.brand-tile:hover { border-color: var(--border); background: var(--surface-2); }
.brand-tile.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.brand-dot { width: 36px; height: 36px; border-radius: var(--r-2); display: grid; place-items: center; font-weight: 600; font-size: 16px; color: var(--tile-ink, #fff); background: var(--tile); overflow: hidden; margin-block-end: 4px; flex: none; }
.brand-dot img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 4px; }
.brand-name { font-size: 13px; font-weight: 600; line-height: 1.25; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-cat { font-size: 12px; color: var(--muted); line-height: 1.3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-tile .tick { position: absolute; inset-block-start: 6px; inset-inline-end: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-fill); color: var(--accent-ink); display: none; place-items: center; }
.brand-tile .tick .ico { width: 10px; height: 10px; stroke-width: 3; }
.brand-tile.active .tick { display: grid; }

.combo { width: 100%; display: flex; align-items: center; gap: 12px; text-align: start; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-2); padding: 8px 8px 8px 12px; min-height: 52px; transition: border-color 0.12s; }
.combo:hover { border-color: var(--ink-2); }
.combo.open { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 0; }
.combo > .ico:last-child { color: var(--muted); }
.combo-ico { width: 32px; height: 32px; border-radius: var(--r-2); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.combo-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stage { height: 100%; overflow-y: auto; padding: 24px 32px 64px; }
.stage-head { display: flex; align-items: flex-end; gap: 16px; margin-block-end: 16px; }
.stage-title { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.stage-sub { color: var(--muted); font-size: 13px; margin-block-start: 2px; }
.job { display: flex; align-items: center; gap: 16px; padding: 12px 16px; margin-block-end: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); }
.job-text { flex: 1; min-width: 0; }
.job-text b { display: block; font-size: 14px; font-weight: 600; }
.job-text span { font-size: 13px; color: var(--muted); }
.job .progress { margin-block-start: 8px; }
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; align-items: start; }
.ad-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; transition: border-color 0.12s, box-shadow 0.15s; content-visibility: auto; contain-intrinsic-size: auto 360px; }
.ad-card:hover, .ad-card:focus-within { border-color: var(--border); box-shadow: var(--sh-1); }
.ad-art { position: relative; background: var(--sunk); line-height: 0; }
.ad-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; line-height: 0; }
.ad-open:focus-visible { outline-offset: -2px; border-radius: var(--r-3) var(--r-3) 0 0; }
.ad-art canvas, .ad-art img { width: 100%; height: auto; display: block; }
.ad-veil { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; text-align: center; padding: 16px; line-height: 1.4; color: #fff; font-weight: 500; font-size: 13px; background: rgba(10, 18, 16, 0.66); }
.ad-veil .spinner { width: 24px; height: 24px; }
.ad-actions { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.12s; }
.ad-card:hover .ad-actions, .ad-card:focus-within .ad-actions { opacity: 1; }
@media (hover: none) { .ad-actions { opacity: 1; } }
.ad-actions .icon-btn { border: 0; box-shadow: var(--sh-2); background: #ffffff; color: #1a211f; }
.ad-actions .icon-btn:hover { background: #eef1ef; }
.ad-actions .icon-btn.on { color: #c62a3a; }
.ad-meta { padding: 12px; }
.ad-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-by { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-block-start: 2px; }
.ad-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-block-start: 8px; }

.skeleton { border-radius: var(--r-3); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.skeleton .ph { display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); font-weight: 500; font-size: 13px; background: var(--sunk); }
.skeleton .ph div { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.skeleton .ph .spinner { width: 20px; height: 20px; color: var(--accent); }
.skeleton .ln { height: 12px; border-radius: var(--r-1); background: var(--sunk); margin: 12px; }
.skeleton .ln.s { width: 45%; }

.empty { max-width: 640px; margin: 8vh 0 0; }
.empty.center { margin-inline: auto; text-align: center; }
.empty h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.empty > p { color: var(--ink-2); font-size: 16px; margin: 8px 0 24px; max-width: 520px; }
.empty.center > p { margin-inline: auto; }
.empty-steps { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); }
.empty-step { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; padding: 16px; }
.empty-step + .empty-step { border-block-start: 1px solid var(--line-2); }
.empty-step .n { grid-row: span 2; font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty-step .n::after { content: "."; }
.empty-step h3 { font-size: 14px; font-weight: 600; }
.empty-step p { font-size: 13px; color: var(--muted); }

/* ---------- concept picker ---------- */
#popover { position: fixed; inset: 0; z-index: 60; display: none; }
#popover.show { display: block; }
.pop { position: absolute; width: 520px; max-width: calc(100vw - 24px); max-height: min(640px, calc(100vh - 32px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--sh-3); overflow: hidden; animation: pop 0.16s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(0.97); } }
.pop-search, .pop-fams, .pop-foot { flex: none; }
.pop-search { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-block-end: 1px solid var(--line-2); color: var(--muted); }
.pop-search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); }
.pop-search:focus-within { box-shadow: inset 0 -2px 0 var(--accent); }
.pop-fams { display: flex; gap: 4px; padding: 8px 12px; overflow-x: auto; border-block-end: 1px solid var(--line-2); scrollbar-width: none; }
.pop-fams button { flex: none; height: 28px; padding: 0 12px; border-radius: var(--r-full); border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 500; color: var(--ink-2); }
.pop-fams button:hover { background: var(--sunk); }
.pop-fams button.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pop-list { overflow-y: auto; padding: 4px 8px 8px; flex: 1; }
.pop-group { position: sticky; inset-block-start: -4px; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 12px 8px 4px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); }
.pop-item { width: 100%; display: flex; gap: 12px; align-items: flex-start; text-align: start; border: 0; background: transparent; border-radius: var(--r-2); padding: 8px; }
.pop-item:hover, .pop-item.focus { background: var(--sunk); }
.pop-item.active { background: var(--accent-soft); }
.pop-thumb { width: 32px; height: 40px; border-radius: var(--r-1); flex: none; background: var(--sunk); border: 1px solid var(--line); position: relative; overflow: hidden; }
.pop-thumb i { position: absolute; background: var(--muted); opacity: 0.55; border-radius: 2px; }
.pop-item-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pop-item-desc { font-size: 13px; color: var(--muted); margin-block-start: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pop-star { margin-inline-start: auto; border: 0; background: none; color: var(--border); padding: 4px; border-radius: var(--r-1); }
.pop-star:hover { color: var(--warn); }
.pop-star.on { color: var(--warn); }
.pop-star.on .ico { fill: currentColor; }
.pop-empty { padding: 32px 24px; text-align: center; color: var(--muted); }
.pop-foot { padding: 8px 16px; border-block-start: 1px solid var(--line-2); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }

/* ---------- workspace (one ad) ---------- */
#overlay { position: fixed; inset: 0; z-index: 40; display: none; }
#overlay.show { display: block; }
.ws { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) 440px; background: var(--bg); animation: fade 0.16s ease both; }
@keyframes fade { from { opacity: 0; } }
.ws-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ws-top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; }
.ws-title { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-canvas { flex: 1; min-height: 0; display: grid; place-items: center; padding: 8px 32px 8px; position: relative; overflow: hidden; }
.ws-canvas canvas { border-radius: var(--r-2); box-shadow: var(--sh-2); }
.ws-busy { position: absolute; inset-inline-start: 50%; inset-block-end: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--r-full); background: var(--ink); color: var(--surface); font-weight: 500; font-size: 13px; box-shadow: var(--sh-2); white-space: nowrap; }
.ws-bottom { display: flex; align-items: center; gap: 8px; padding: 12px 24px 16px; flex-wrap: wrap; }
.ws-note { margin: 0 24px 0; }
.versions { display: flex; gap: 4px; align-items: center; color: var(--muted); }
.ver { height: 28px; min-width: 32px; padding: 0 8px; border-radius: var(--r-1); border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ver:hover { color: var(--ink); border-color: var(--border); }
.ver.active { background: var(--ink); border-color: var(--ink); color: var(--surface); font-weight: 600; }
.ws-side { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-inline-start: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-block-end: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 0; background: none; font-weight: 500; font-size: 14px; color: var(--ink-2); border-block-end: 2px solid transparent; margin-block-end: -1px; border-radius: var(--r-1) var(--r-1) 0 0; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent-text); border-block-end-color: var(--accent); font-weight: 600; }
.tab-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.tab-body.flush { padding: 0; display: flex; flex-direction: column; overflow: hidden; }

.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-intro { color: var(--muted); padding: 24px 8px 8px; font-size: 14px; max-width: 360px; }
.chat-intro b { display: block; color: var(--ink); font-size: 16px; font-weight: 600; margin: 12px 0 4px; }
.chat-intro .combo-ico { width: 40px; height: 40px; }
.msg { max-width: 88%; padding: 8px 12px; border-radius: var(--r-3); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--accent-fill); color: var(--accent-ink); border-end-end-radius: 4px; }
.msg.engine { align-self: flex-start; background: var(--sunk); border-end-start-radius: 4px; }
.msg.error { background: var(--bad-soft); color: var(--bad); }
.msg-meta { display: flex; gap: 4px; margin-block-start: 8px; flex-wrap: wrap; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px; background: var(--sunk); border-radius: var(--r-3); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.quicks { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 16px 8px; }
.quick { height: 28px; padding: 0 12px; border-radius: var(--r-full); border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.quick:hover { border-color: var(--border); color: var(--ink); background: var(--sunk); }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 12px 16px 16px; border-block-start: 1px solid var(--line-2); }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; }
.composer .btn { width: 44px; height: 44px; padding: 0; }

.block { border: 1px solid var(--line); border-radius: var(--r-3); margin-block-end: 12px; overflow: hidden; }
.block-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; min-height: 44px; background: var(--surface-2); border-block-end: 1px solid var(--line-2); font-weight: 600; font-size: 13px; }
.block-head > .ico { color: var(--muted); }
.block-head .btn, .block-head .chip { margin-inline-start: auto; }
.block-body { padding: 12px; font-size: 14px; }
.block-body + .block-body { border-block-start: 1px solid var(--line-2); }
.block-body .textarea { border: 0; padding: 0; border-radius: 0; min-height: 150px; font-size: 13px; }
.block-body .textarea:focus-visible { outline: 0; }
.block:has(.textarea:focus-visible) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.code { margin: 0; padding: 12px; font-family: var(--mono); font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow-y: auto; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
details.block > summary { list-style: none; cursor: pointer; }
details.block > summary::-webkit-details-marker { display: none; }
details.block:not([open]) > summary { border-block-end: 0; }
.color-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.color-field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--r-2); padding: 4px 8px 4px 4px; font-size: 13px; font-weight: 500; }
.color-field input { width: 28px; height: 28px; padding: 0; border: 0; background: none; border-radius: var(--r-1); cursor: pointer; }
.score { display: flex; align-items: center; gap: 16px; margin-block-end: 16px; }
.score b { width: 56px; height: 56px; border-radius: var(--r-3); display: grid; place-items: center; font-size: 24px; font-weight: 600; background: var(--ok-soft); color: var(--ok); font-variant-numeric: tabular-nums; }
.score.fix b { background: var(--warn-soft); color: var(--warn); }
.score.redo b { background: var(--bad-soft); color: var(--bad); }
.list { margin: 0; padding-inline-start: 20px; font-size: 14px; }
.list li { margin-block-end: 4px; }
.list li::marker { color: var(--muted); }

/* ---------- pages ---------- */
.page { height: 100%; overflow-y: auto; padding: 24px 32px 72px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-block-end: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.page-head p { color: var(--muted); margin-block-start: 4px; max-width: 68ch; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-block-end: 16px; }
.toolbar .select, .toolbar .input { width: auto; min-width: 160px; }
.toolbar .search { position: relative; }
.toolbar .search .ico { position: absolute; inset-inline-start: 10px; inset-block-start: 9px; color: var(--muted); pointer-events: none; }
.toolbar .search .input { padding-inline-start: 36px; min-width: 240px; }
.toolbar .search .input::-webkit-search-cancel-button { cursor: pointer; }
.filters { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-block-end: 16px; font-size: 13px; }
.filters .chip { height: 24px; gap: 2px; padding-inline-end: 2px; }
.filters .chip button { width: 20px; height: 20px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%; color: inherit; }
.filters .chip button:hover { background: var(--line); }
.filters .chip button .ico { width: 12px; height: 12px; }
.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 24px; margin-block-end: 16px; }
.section h2 { font-size: 16px; font-weight: 600; line-height: 1.4; margin-block-end: 4px; }
.section h2 .chip { vertical-align: middle; margin-inline-start: 4px; }
.section > .muted, .section > p.muted { margin-block-end: 16px; font-size: 13px; max-width: 72ch; }
.section-head { display: flex; align-items: flex-start; gap: 16px; margin-block-end: 16px; }
.section-head h2 { margin: 0; }
.section-head p { font-size: 13px; color: var(--muted); max-width: 72ch; }
.narrow { max-width: 780px; }
.brands { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 24px; align-items: start; }
.brand-list { position: sticky; inset-block-start: 0; display: flex; flex-direction: column; gap: 4px; }
.brand-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-2); border: 1px solid transparent; background: transparent; text-align: start; }
.brand-row:hover { background: var(--sunk); }
.brand-row.active { background: var(--surface); border-color: var(--line); box-shadow: var(--sh-1); }
.brand-row .brand-dot { width: 32px; height: 32px; font-size: 14px; margin: 0; }
.brand-row b { display: block; font-size: 14px; font-weight: 600; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 500; padding: 0 12px 8px 0; white-space: nowrap; }
.table td { padding: 8px 12px 8px 0; border-block-start: 1px solid var(--line-2); vertical-align: middle; }
.table th.r, .table td.r { text-align: end; font-variant-numeric: tabular-nums; }
.table th:last-child, .table td:last-child { padding-inline-end: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table img { width: 40px; height: 40px; border-radius: var(--r-2); object-fit: cover; background: var(--sunk); display: block; }
.thumb-empty { width: 40px; height: 40px; border-radius: var(--r-2); background: var(--sunk); display: grid; place-items: center; color: var(--muted); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.savebar { position: sticky; inset-block-end: -72px; margin: 0 -4px; padding: 12px 4px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; background: var(--bg); border-block-start: 1px solid var(--line); }
.readonly-note { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }

/* ---------- team ---------- */
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-text { min-width: 0; line-height: 1.35; }
.person-text b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-text b i { font-style: normal; font-weight: 400; }
.person-text span { font-size: 13px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table .select { height: 32px; width: auto; min-width: 128px; font-size: 13px; }
.table .actions { display: flex; gap: 8px; justify-content: flex-end; }
.steps-list { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.steps-list li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-block-end: 16px; }
@media (min-width: 1500px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 700px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 16px; min-width: 0; }
.tile-label { font-size: 13px; color: var(--muted); }
.tile-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tile-delta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dash { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.dash .section { margin: 0; padding: 16px; }
.dash .wide { grid-column: 1 / -1; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 96px; padding-block-start: 8px; border-block-end: 1px solid var(--line); }
.bars > span { flex: 1; min-width: 2px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bars > span > i { display: block; background: var(--accent-fill); border-radius: 2px 2px 0 0; min-height: 0; }
.bars > span:hover > i { background: var(--accent-hover); }
.bars-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-block-start: 4px; font-variant-numeric: tabular-nums; }
.meter { display: flex; align-items: center; gap: 8px; }
.meter > span { flex: 1; height: 6px; border-radius: var(--r-full); background: var(--sunk); overflow: hidden; min-width: 48px; }
.meter > span > i { display: block; height: 100%; background: var(--accent-fill); border-radius: inherit; }
.meter > b { font-weight: 500; font-variant-numeric: tabular-nums; min-width: 24px; text-align: end; }

/* ---------- sign-in and status screens ---------- */
#auth { height: 100vh; overflow-y: auto; }
.auth { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-main { display: flex; flex-direction: column; padding: 24px 48px 32px; min-height: 100vh; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.auth-card { width: 100%; max-width: 384px; margin-block: auto; padding-block: 32px; }
.auth-card h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.auth-card .lead { color: var(--ink-2); font-size: 16px; margin: 8px 0 24px; }
.auth-card .btn-lg { margin-block-start: 8px; }
.auth-card .input { height: 44px; font-size: 16px; }
.auth-card .input-wrap .peek { inset-block: 8px; }
.auth-alt { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; margin-block-start: 16px; font-size: 14px; }
.auth-foot { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.auth-help { margin-block-start: 24px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); font-size: 13px; }
.auth-help b { display: block; font-size: 14px; font-weight: 600; margin-block-end: 8px; }
.auth-help ol { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--ink-2); }
.status-badge { width: 48px; height: 48px; border-radius: var(--r-3); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-block-end: 16px; }
.status-badge .ico { width: 24px; height: 24px; }
.status-badge.warn { background: var(--warn-soft); color: var(--warn); }
.auth-aside { background: var(--panel); color: var(--panel-ink); display: flex; flex-direction: column; justify-content: space-between; padding: 48px; min-height: 100vh; position: sticky; inset-block-start: 0; overflow: hidden; }
.auth-aside h2 { font-size: 30px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; max-width: 14em; }
.auth-aside p { color: var(--panel-muted); font-size: 16px; margin-block-start: 12px; max-width: 30em; }
.frames { display: flex; align-items: flex-end; gap: 16px; }
.frame { border: 1px solid var(--panel-line); border-radius: var(--r-2); background: rgba(255, 255, 255, 0.03); display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; color: var(--panel-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.frame i { display: block; height: 6px; border-radius: 3px; background: var(--panel-line); margin-block-end: 6px; }
.frame i.a { background: #2fc4a8; width: 56%; height: 8px; }
.frame.f11 { width: 128px; aspect-ratio: 1 / 1; }
.frame.f45 { width: 128px; aspect-ratio: 4 / 5; }
.frame.f916 { width: 96px; aspect-ratio: 9 / 16; }
.facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 32px; margin: 0; }
.facts dt { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts dd { margin: 0; color: var(--panel-muted); font-size: 13px; }

/* ---------- dialog ---------- */
.dialog { border: 0; padding: 0; background: transparent; max-width: min(440px, calc(100vw - 32px)); width: 100%; color: var(--ink); }
.dialog::backdrop { background: rgba(8, 14, 12, 0.5); }
.dialog-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-4); box-shadow: var(--sh-3); padding: 24px; animation: pop 0.2s var(--ease) both; }
.dialog-box h2 { font-size: 16px; font-weight: 600; line-height: 1.4; }
.dialog-box p { color: var(--ink-2); margin-block-start: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-block-start: 24px; flex-wrap: wrap; }

/* ---------- toasts ---------- */
#toasts { position: fixed; inset-inline-start: 50%; inset-block-end: 24px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; max-width: min(560px, 92vw); display: flex; gap: 8px; align-items: flex-start; padding: 12px 8px 12px 12px; border-radius: var(--r-3); background: var(--ink); color: var(--surface); font-weight: 500; font-size: 14px; box-shadow: var(--sh-3); animation: rise 0.24s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.toast.bad { background: var(--bad-fill); color: #fff; }
.toast > .ico { margin-block-start: 2px; }
.toast-act { border: 0; background: transparent; color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; padding: 0 8px; height: 24px; border-radius: var(--r-1); flex: none; }
.toast-x { border: 0; background: transparent; color: inherit; opacity: 0.75; width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--r-1); flex: none; }
.toast-x:hover, .toast-act:hover { opacity: 1; background: rgba(127, 127, 127, 0.25); }
.toast-x .ico { width: 14px; height: 14px; }
.toast :focus-visible { outline-color: currentColor; }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .studio { grid-template-columns: 344px minmax(0, 1fr); }
  .ws { grid-template-columns: minmax(0, 1fr) 400px; }
  .dash { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  #app, #app.collapsed { grid-template-columns: 1fr; height: auto; --side-w: 100%; }
  .side { flex-direction: row; align-items: center; padding: 4px 8px; border-inline-end: 0; border-block-end: 1px solid var(--line); position: sticky; inset-block-start: 0; z-index: 30; }
  .side-head { padding: 4px 8px 4px 4px; min-height: 0; }
  .side-brand, .side-label, .side-toggle, .side-status, .side-user-text, .side-user > .ico, .side [data-act="side-toggle"] { display: none; }
  .side-nav { flex-direction: row; gap: 4px; padding: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .side-group { flex-direction: row; gap: 4px; }
  .side-link { height: 44px; padding: 0 12px; }
  .side-link span { display: none; }
  .side-link[aria-current="page"] span { display: inline; }
  .side-foot { border: 0; padding: 0; }
  .side-user { padding: 4px; min-height: 44px; }
  .menu { inset-block-end: auto; inset-block-start: calc(100% + 4px); inset-inline: auto 0; }
  #view { height: auto; overflow: visible; }
  .studio { grid-template-columns: 1fr; height: auto; }
  .brief { border-inline-end: 0; }
  .brief-scroll { overflow: visible; }
  .brief-foot { position: sticky; inset-block-end: 0; z-index: 5; }
  .stage { scroll-margin-top: 72px; min-height: 60vh; padding: 24px 16px 64px; }
  .stage, .page { height: auto; overflow: visible; }
  .page { padding: 24px 16px 72px; }
  .ws { grid-template-columns: 1fr; grid-template-rows: 55vh 1fr; overflow-y: auto; }
  .brands { grid-template-columns: 1fr; }
  .brand-list { position: static; flex-direction: row; flex-wrap: wrap; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { padding: 16px 16px 24px; }
  .btn, .input, .select { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .input, .select, .textarea { font-size: 16px; }
  .two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; scroll-behavior: auto !important; }
  .spinner { animation: none; border-top-color: transparent; }
  .typing i { animation: none; opacity: 0.6; }
}

/* ---------- shoot library: real people and real objects ---------- */
.shoot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 16px; align-items: start; }
.shoot-card { display: flex; flex-direction: column; text-align: start; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; transition: border-color 0.12s, box-shadow 0.15s; }
.shoot-card:hover { border-color: var(--border); box-shadow: var(--sh-1); }
.shoot-photo { position: relative; display: grid; place-items: center; aspect-ratio: 1; background: var(--sunk); color: var(--muted); }
.shoot-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shoot-photo > .ico { width: 32px; height: 32px; }
.shoot-count { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; padding: 0 8px; height: 20px; border-radius: var(--r-full); background: rgba(12, 20, 18, 0.72); color: #fff; font-size: 12px; font-weight: 500; line-height: 20px; }
.shoot-meta { display: grid; gap: 2px; padding: 12px; min-width: 0; }
.shoot-meta b { font-weight: 600; font-size: 14px; }
.shoot-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-block-start: 8px; }
.shoot-tags .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* the editor of one item: a taller dialog with a fixed head and foot */
.dialog.sheet { max-width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.sheet-box { display: flex; flex-direction: column; padding: 0; max-height: calc(100dvh - 32px); overflow: hidden; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 24px; border-block-end: 1px solid var(--line); }
.sheet-head h2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { padding: 24px; overflow-y: auto; min-height: 0; }
.sheet-foot { display: flex; align-items: center; gap: 8px; padding: 16px 24px; border-block-start: 1px solid var(--line); background: var(--surface-2); }
.sheet-status { font-size: 13px; color: var(--ink-2); min-width: 0; }
.sheet-status.bad { color: var(--bad); font-weight: 500; }
.photo-row { display: flex; flex-wrap: wrap; gap: 8px; }
.photo { position: relative; width: 104px; height: 104px; border-radius: var(--r-2); overflow: hidden; background: var(--sunk); border: 1px solid var(--line); flex: none; }
.photo.main { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tag { position: absolute; inset-block-start: 6px; inset-inline-start: 6px; padding: 0 6px; height: 18px; line-height: 18px; border-radius: var(--r-full); background: var(--accent-fill); color: var(--accent-ink); font-size: 12px; font-weight: 600; }
.photo-acts { position: absolute; inset-block-end: 4px; inset-inline-end: 4px; display: flex; gap: 4px; }
.photo-acts .icon-btn { width: 28px; height: 28px; background: var(--surface); }
.photo-add { display: grid; place-items: center; align-content: center; gap: 4px; border: 1px dashed var(--border); background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 500; cursor: pointer; }
.photo-add:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-2); }
.photo-add:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--accent-fill); flex: none; }
.consent { border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); background: var(--accent-soft); border-radius: var(--r-3); padding: 16px; margin-block-end: 16px; }
.consent .check b { font-weight: 600; }
.consent .field { margin-block-end: 0; }
.consent .hint { color: var(--ink-2); }

/* the Studio brief: who and what from the shoot library */
.cast-pick { display: flex; gap: 12px; align-items: center; margin-block-start: 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-2); font-size: 12px; color: var(--muted); }
.cast-pick img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; background: var(--sunk); }
.cast-pick b { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.obj-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.obj-pick { display: grid; gap: 4px; padding: 4px 4px 6px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); font-size: 12px; font-weight: 500; color: var(--ink-2); text-align: center; min-width: 0; }
.obj-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-1); background: var(--sunk); display: block; }
.obj-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obj-pick:hover { border-color: var(--border); }
.obj-pick.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent); }
.hint .ico { width: 12px; height: 12px; vertical-align: -1px; }
.hint.warn { color: var(--warn); }

/* review, results and the budget */
.block-body.plain .textarea { border: 1px solid var(--border); padding: 8px 12px; border-radius: var(--r-2); min-height: 64px; font-size: 14px; }
.block-body.plain .textarea:focus-visible { outline: 2px solid var(--accent); }
.block:has(.block-body.plain .textarea:focus-visible) { border-color: var(--line); box-shadow: none; }
.block-body.plain .field:last-of-type { margin-block-end: 12px; }
.quote { margin-block-start: 8px; padding: 8px 12px; border-inline-start: 3px solid var(--bad); background: var(--bad-soft); border-radius: var(--r-1); white-space: pre-wrap; overflow-wrap: anywhere; }
.budget-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-block-end: 8px; }
.budget-line b { font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.budget.near .progress > i { background: var(--warn); }
.budget.full .progress > i { background: var(--bad-fill); }
.budget.full .budget-line span:last-child { color: var(--bad); font-weight: 500; }
.budget .progress > i { transform-origin: left center; }
.wide-kv { grid-template-columns: minmax(140px, auto) 1fr; }
a.bad { color: var(--bad); }

/* the library: choosing several ads for a hand-off pack */
.sel-bar { position: sticky; inset-block-start: -24px; z-index: 3; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 8px 8px 16px; margin-block-end: 16px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: var(--r-3); font-size: 13px; }
.sel-bar b { font-weight: 600; }
.sel-mark { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--border); color: transparent; pointer-events: none; }
.sel-mark .ico { width: 14px; height: 14px; stroke-width: 3; }
.ad-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ad-card.selected .sel-mark { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs { gap: 2px; }
.tabs .tab { flex: none; padding: 0 8px; gap: 6px; }

@media (max-width: 900px) {
  .sheet-body { padding: 16px; }
  .sheet-foot { padding: 12px 16px; flex-wrap: wrap; }
  .sel-bar { position: static; }
}


/* ---------- v2.2: the Studio, denser and visual ---------- */
.side-link { height: 34px; font-size: 13px; gap: 10px; }
.side-link .ico { width: 18px; height: 18px; }
.side-label { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.studio { grid-template-columns: 368px minmax(0, 1fr); }
.brief-head { padding: 16px 20px 0; }
.brief-head h1 { font-size: 18px; }
.brief-head p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brief-scroll { padding: 14px 20px 8px; }
.brief-foot { padding: 12px 20px 14px; }
.sec { margin-block-end: 18px; }
.sec-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-block-end: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.sec-note { font-weight: 500; letter-spacing: 0; text-transform: none; }
.mini-label { display: block; font-size: 12px; color: var(--muted); margin-block-end: 4px; }

/* brand tiles: a product photo, the name under it */
.brand-grid { gap: 8px; }
.brand-tile { padding: 0; gap: 0; overflow: hidden; align-items: stretch; }
.brand-pic { display: grid; place-items: center; aspect-ratio: 16 / 10; background: color-mix(in srgb, var(--tile) 18%, var(--sunk)); overflow: hidden; }
.brand-pic img { width: 100%; height: 100%; object-fit: cover; display: block; background: #fff; }
.brand-pic b { font-size: 20px; font-weight: 600; color: var(--ink); }
.brand-tile .brand-name { padding: 6px 6px 7px; font-size: 12px; }
.brand-tile.active { background: var(--surface); box-shadow: 0 0 0 1px var(--accent); }
.brand-tile.active .brand-name { color: var(--accent-text); }
.brand-tile .tick { inset-block-start: 4px; inset-inline-end: 4px; }

/* products: a strip of small cards */
.prod-strip { display: flex; gap: 8px; overflow-x: auto; padding: 1px 1px 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.prod { flex: none; width: 88px; display: flex; flex-direction: column; gap: 2px; padding: 4px 4px 6px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); text-align: start; scroll-snap-align: start; min-width: 0; }
.prod img, .prod-none { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-1); background: #fff; display: block; }
.prod-none { display: grid; place-items: center; background: var(--sunk); color: var(--muted); }
.prod-name { font-size: 12px; line-height: 1.25; font-weight: 500; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 30px; }
.prod-price { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prod:hover { border-color: var(--border); }
.prod.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.prod.active .prod-name { color: var(--ink); font-weight: 600; }
.prod:disabled { opacity: 0.45; }

/* chips that choose */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn { height: 32px; padding: 0 12px; border-radius: var(--r-full); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 500; }
.chipbtn:hover { border-color: var(--border); color: var(--ink); }
.chipbtn.active { background: var(--ink); border-color: var(--ink); color: var(--surface); font-weight: 600; }

/* combos, tighter, with the sketch of the ad type */
.combo { min-height: 48px; padding: 6px 8px; gap: 10px; border-color: var(--line); }
.combo .grow { min-width: 0; display: grid; }
.combo-ico { width: 34px; height: 34px; }
.tz { flex: none; width: 34px; height: 42px; padding: 3px; border-radius: var(--r-1); background: var(--sunk); border: 1px solid var(--line); display: grid; grid-auto-rows: 1fr; gap: 2px; }
.tz-row { display: flex; gap: 2px; min-height: 0; }
.tz-row i { flex: 1; border-radius: 2px; background: var(--muted); opacity: 0.45; }
.tz-row i.tz-pic { background: var(--accent); opacity: 0.6; }
.tz-row i.tz-pop { background: var(--warn); opacity: 0.9; }
.tz-free { place-items: center; color: var(--accent-text); }
.tz-free .ico { width: 16px; height: 16px; }
.type-checks { margin-block-start: 8px; font-size: 12px; color: var(--muted); }
.type-checks summary { cursor: pointer; font-weight: 500; color: var(--ink-2); }
.type-checks .list { margin-block-start: 6px; font-size: 12px; }

/* the ad-type picker */
.pop-types .pop-list { padding: 8px; }
.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.type-card { display: flex; gap: 10px; align-items: flex-start; text-align: start; padding: 8px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); min-width: 0; }
.type-card:hover { border-color: var(--border); background: var(--surface-2); }
.type-card.active { border-color: var(--accent); background: var(--accent-soft); }
.type-card:disabled { opacity: 0.45; }
.type-card .tz { width: 40px; height: 50px; }
.type-text { min-width: 0; display: grid; gap: 2px; }
.type-name { font-size: 13px; font-weight: 600; display: flex; gap: 6px; align-items: baseline; }
.type-num { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.type-desc { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.type-auto { grid-column: 1 / -1; }

/* shoots: when there is nothing yet, one quiet link */
.shoot-empty { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px dashed var(--line); border-radius: var(--r-2); color: var(--muted); font-size: 12px; text-decoration: none; }
.shoot-empty:hover { border-color: var(--border); color: var(--ink-2); }
.shoot-empty b { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.shoot-empty .ico { color: var(--accent-text); margin-block-start: 2px; }

/* the stage before anything is generated: the brand, then its latest ads */
.stage { padding: 20px 24px 56px; }
.board-hero { display: flex; align-items: stretch; gap: 16px; padding: 20px 24px; margin-block-end: 24px; border-radius: var(--r-4); border: 1px solid var(--line); background: linear-gradient(120deg, color-mix(in srgb, var(--tile) 24%, var(--surface)) 0%, var(--surface) 64%); overflow: hidden; min-height: 168px; }
.board-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.board-kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.board-hero h2 { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.board-hero p { color: var(--ink-2); margin-block-start: 4px; max-width: 52ch; }
.board-facts { display: flex; flex-wrap: wrap; gap: 20px; margin-block-start: 16px; font-size: 12px; color: var(--muted); }
.board-facts span { display: grid; }
.board-facts b { font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.board-pack { flex: none; display: flex; align-items: center; padding-inline-end: 8px; }
.board-pack img { width: 128px; height: 128px; object-fit: cover; border-radius: var(--r-3); border: 2px solid var(--surface); box-shadow: var(--sh-2); background: #fff; }
.board-pack img + img { margin-inline-start: -40px; }
.board-pack img:nth-child(2) { transform: translateY(8px) rotate(3deg); }
.board-pack img:nth-child(3) { transform: translateY(-6px) rotate(-2deg); }
.board-tip { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px dashed var(--line); border-radius: var(--r-3); color: var(--ink-2); max-width: 640px; }
.board-tip b { color: var(--ink); font-weight: 600; }
.board-tip .ico { color: var(--accent-text); margin-block-start: 2px; }

/* the main action gets a little depth */
.btn-primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent-fill) 90%, #fff) 0%, var(--accent-fill) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.25); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { box-shadow: none; }

/* cards a little smaller, so more of the work is in view */
.ad-grid { grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 14px; }
.ad-meta { padding: 10px 12px 12px; }
.ad-name { font-size: 13px; }

@media (max-width: 1180px) { .studio { grid-template-columns: 340px minmax(0, 1fr); } .board-pack img { width: 96px; height: 96px; } }
@media (max-width: 900px) { .board-hero { flex-direction: column; } .type-grid { grid-template-columns: 1fr; } }


/* ---------- the verdict: good, or not good and why ---------- */
.verdict-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.vbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; border: 0; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.vbtn .ico { width: 16px; height: 16px; stroke-width: 2.4; }
.vbtn.good { color: var(--ok); }
.vbtn.bad { color: var(--bad); }
.vbtn.good:hover { background: var(--ok-soft); }
.vbtn.bad:hover { background: var(--bad-soft); }
.btn.vbtn { border: 1px solid var(--line); height: 28px; padding: 0 10px; border-radius: var(--r-1); }
.trash-why { padding: 10px 12px; background: var(--bad-soft); border-block-end: 1px solid var(--line); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.trash-why b { flex-basis: 100%; font-size: 12px; font-weight: 600; color: var(--bad); }
.trash-why p { flex-basis: 100%; margin: 4px 0 0; color: var(--ink); overflow-wrap: anywhere; }
.trash-why .row { flex-basis: 100%; flex-wrap: wrap; gap: 6px; }
.trash-why .row .btn { flex: 1 1 auto; justify-content: center; }
.trash-why .chip { max-width: 100%; height: auto; min-height: 20px; padding-block: 2px; white-space: normal; line-height: 1.3; }
.dialog.verdict { max-width: min(560px, calc(100vw - 32px)); }
.verdict-top { display: flex; gap: 12px; align-items: flex-start; margin-block-end: 16px; }
.verdict-top img { width: 72px; border-radius: var(--r-2); border: 1px solid var(--line); flex: none; }
.verdict-top p { font-size: 13px; }
.reason-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check.reason { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-2); font-size: 13px; }
.check.reason:has(input:checked) { border-color: var(--bad); background: var(--bad-soft); }
.verdict-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.mini-h { font-size: 13px; font-weight: 600; margin-block-end: 8px; }
@media (max-width: 900px) { .reason-grid, .verdict-cols { grid-template-columns: 1fr; } }

/* ---------- the Studio as numbered steps: the message (what the ad says) and the format (what it looks like) ---------- */
.sec-label > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.sec-n { flex: none; width: 20px; height: 20px; border-radius: var(--r-full); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700; font-style: normal; letter-spacing: 0; }
.sec-q { font-size: 13px; color: var(--ink-2); margin-block: -2px 8px; }
.recap { display: grid; gap: 2px; margin-block-end: 10px; padding: 8px 12px; border-radius: var(--r-2); background: var(--sunk); font-size: 12px; color: var(--ink-2); }
.recap span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recap b { color: var(--ink); font-weight: 600; }
.ad-format { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-block-start: 2px; }

.pop-title { flex: none; display: grid; gap: 2px; padding: 14px 16px 10px; }
.pop-title b { font-size: 16px; font-weight: 600; color: var(--ink); }
.pop-title span { font-size: 13px; color: var(--muted); }
.pop-title + .pop-search { border-block-start: 1px solid var(--line-2); }
.pop-head { display: grid; gap: 2px; padding: 4px 8px 8px; }
.pop-head b { font-size: 15px; font-weight: 600; }
.pop-head span { font-size: 13px; color: var(--muted); }
.pop-back { display: inline-flex; align-items: center; gap: 6px; height: 32px; margin: 4px 0; padding: 0 10px 0 6px; border: 0; border-radius: var(--r-2); background: transparent; color: var(--accent-text); font-size: 13px; font-weight: 600; }
.pop-back:hover { background: var(--sunk); }
.pop-back .ico { width: 16px; height: 16px; transform: rotate(90deg); }
.pop-back.fwd { margin-block-start: 8px; color: var(--ink-2); }
.pop-back.fwd .ico { transform: none; }
.pop-auto { border: 1px solid var(--line-2); margin-block-start: 4px; }
.pop-item-title .chip, .type-name .chip { font-weight: 500; }
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.theme-card { position: relative; display: flex; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); min-width: 0; }
.theme-card:hover { border-color: var(--border); background: var(--surface-2); }
.theme-card.active { border-color: var(--accent); background: var(--accent-soft); }
.theme-main { flex: 1; display: grid; gap: 2px; align-content: start; text-align: start; padding: 10px 12px; border: 0; background: transparent; border-radius: var(--r-2); color: inherit; min-width: 0; }
.theme-title { font-size: 14px; font-weight: 600; color: var(--ink); padding-inline-end: 76px; }
.theme-desc { font-size: 12px; line-height: 1.4; color: var(--muted); }
.theme-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-block-start: 4px; }
.theme-more { position: absolute; inset-block-start: 7px; inset-inline-end: 6px; display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 4px 0 8px; border: 0; border-radius: var(--r-full); background: transparent; font-size: 12px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.theme-more:hover { color: var(--accent-text); background: var(--sunk); }
.theme-more .ico { width: 14px; height: 14px; transform: rotate(-90deg); }
.pop.pop-msg { max-height: calc(100vh - 32px); }
@media (max-width: 1000px) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .theme-grid { grid-template-columns: 1fr; } }

/* ---- the market style: notes inside the pickers, and the list of removed ideas on the Training page ---- */
.pop-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 4px 4px; padding: 10px 12px; border-radius: var(--r-2); background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.pop-note .ico { width: 14px; height: 14px; flex: none; margin-block-start: 2px; }
.retired { margin-block-start: 14px; border: 1px solid var(--line-2); border-radius: var(--r-2); padding: 0 12px; }
.retired > summary { cursor: pointer; padding: 10px 0; font-weight: 600; font-size: 13.5px; }
.retired[open] { padding-block-end: 12px; }
.retired .table td { vertical-align: top; }

/* ---- the concept picker (cards with a picture of the ad) and the hook step ---- */
.pop.pop-concepts { max-height: calc(100vh - 32px); }
.pop-concepts .pop-list { padding: 4px 14px 14px; }
.concept-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.concept-card { display: flex; flex-direction: column; gap: 6px; padding: 8px; text-align: start; border: 1px solid var(--line-2); border-radius: var(--r-3); background: var(--surface); color: var(--ink); cursor: pointer; min-width: 0; }
.concept-card:hover { border-color: var(--border); }
.concept-card.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.concept-card:disabled { opacity: 0.45; cursor: not-allowed; }
.cx { display: block; aspect-ratio: 4 / 5; border-radius: var(--r-2); overflow: hidden; background: var(--sunk); }
.cx img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.cx-sketch, .cx-auto { display: grid; place-items: center; }
.cx-sketch .tz { width: 68px; height: 84px; padding: 6px; gap: 4px; }
.cx-auto .ico { width: 30px; height: 30px; color: var(--accent-text); }
.concept-name { font-weight: 600; font-size: 13px; line-height: 1.25; }
.concept-desc { font-size: 11.5px; color: var(--muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.concept-note { font-size: 12.5px; color: var(--ink-2); margin: -2px 2px 8px; }
.cx-mini { flex: none; width: 34px; aspect-ratio: 4 / 5; border-radius: 4px; overflow: hidden; background: var(--sunk); display: grid; place-items: center; }
.cx-mini img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.cx-mini .tz { width: 30px; height: 38px; border: 0; }
.hook-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.hook-card { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; text-align: start; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); color: var(--ink); cursor: pointer; min-width: 0; }
.hook-card:first-child { grid-column: 1 / -1; }
.hook-card b { font-size: 13px; }
.hook-card span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.hook-card i { font-style: normal; font-size: 11px; color: var(--accent-text); }
.hook-card:hover { border-color: var(--border); }
.hook-card.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.hook-card:disabled { opacity: 0.5; cursor: not-allowed; }
.hook-ex { display: block; margin-block-start: 4px; color: var(--ink); font-size: 13px; }
@media (max-width: 720px) { .concept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- product sheets on the Brands page ---- */
.sheet { border: 1px solid var(--line-2); border-radius: var(--r-2); padding: 0 12px; margin-block-end: 8px; background: var(--surface); }
.sheet > summary { cursor: pointer; padding: 10px 0; font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sheet[open] { padding-block-end: 12px; }
.sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.sheet-grid .field { margin: 0; }
@media (max-width: 820px) { .sheet-grid { grid-template-columns: 1fr; } }

/* Brands: the angles (subjects of ads) and their hooks */
.angle > summary .small { font-weight: 400; }
.angle-promise { margin: 2px 0 10px; font-size: 13.5px; color: var(--ink); max-width: 78ch; }
.angle-aud { margin: 4px 0 12px; font-size: 13px; color: var(--ink-2); }
.hooks-table td { vertical-align: top; padding-block: 8px; }
.hooks-table .hk-ar { text-align: right; min-width: 240px; }
.hooks-table td.hk-ar { font-family: "UI Arabic", var(--font); font-size: 15px; line-height: 1.6; color: var(--ink); }
.hooks-table td.hk-ar b { display: block; font-size: 17px; font-weight: 600; }
.hooks-table td.hk-ar div { color: var(--ink-2); }
.hooks-table .hk-act { white-space: nowrap; text-align: end; }
.hooks-table .hk-act .chip { margin-inline-end: 4px; vertical-align: middle; }
.hooks-table .hk-act .icon-btn { width: 28px; height: 28px; vertical-align: middle; }
.angle-foot { gap: 8px; margin-block-start: 10px; justify-content: space-between; }

/* ---------- brand colours ---------- */
.palette { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 260px); gap: 16px; margin: 12px 0; }
.palette-list { display: grid; gap: 8px; }
.palette-field { padding: 8px 12px 8px 8px; }
.palette-field input { width: 40px; height: 40px; flex: none; }
.palette-field span { flex: 1; display: grid; }
.palette-field small { color: var(--text-2, var(--muted)); font-weight: 400; }
.palette-field code { font-size: 12px; color: var(--muted); }
.palette-show { border-radius: var(--r-2); border: 1px solid var(--line); padding: 16px; display: grid; gap: 12px; align-content: center; justify-items: center; text-align: center; }
.palette-show strong { font-size: 22px; line-height: 1.2; }
.palette-price { color: #fff; font-weight: 800; font-size: 20px; padding: 8px 24px; border-radius: 999px; }
.palette-products { margin: 12px 0; }
.palette-products summary { cursor: pointer; font-weight: 500; padding: 8px 0; }
.palette-grid { display: grid; align-items: end; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.palette-grid .dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); margin-inline-end: 8px; vertical-align: -2px; }
@media (max-width: 760px) { .palette { grid-template-columns: 1fr; } }
