/* FORVA design system (D-045). Dark-blue first, soft clay surfaces, the ribbon F logo.
   Wordmark is always FOR in dark blue #0f3f86 and VA in red #d9413f, on every surface.
   Spacing uses one 4/8px scale (--s1 to --s9); radii and shadows come from tokens only. */
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --bg: #f3f6fb; --bg-2: #e9eef7; --card: #ffffff;
  --navy: #0f3f86; --navy-d: #0a2d63; --navy-l: #1d55ad;
  --ink: #0e2752; --ink-2: #183563; --text: #1c2b48; --muted: #5a6888; --muted-2: #8592ad;
  --line: #e1e7f1; --line-2: #d2dbea; --rule: rgba(14,39,82,.06);
  --blue: #1a5aa7; --blue-l: #2f72c4; --yellow: #ffd23f; --yellow-d: #f2b705; --red: #d9413f; --red-d: #b02a2b;
  --accent: var(--navy); --accent-d: var(--navy-d); --accent-2: var(--navy-l); --accent-soft: rgba(15,63,134,.10);
  --ok: #157a52; --ok-bg: #e0f2e9; --warn: #8a5a12; --warn-bg: #fcefd2;
  --bad: #b02a2b; --bad-bg: #fbe5e4; --info: #0f3f86; --info-bg: #e5edf9; --neutral-bg: #edf1f7;
  --radius: 20px; --radius-sm: 12px; --radius-lg: 28px;
  --clay-sm: 0 1px 2px rgba(14,39,82,.06), 0 6px 14px -10px rgba(14,39,82,.35), inset 0 1px 0 #fff;
  --clay: 0 1px 2px rgba(14,39,82,.05), 0 14px 30px -18px rgba(14,39,82,.32), inset 0 1px 0 #fff, inset 0 -3px 8px rgba(14,39,82,.035);
  --clay-lg: 0 2px 4px rgba(14,39,82,.05), 0 28px 50px -26px rgba(14,39,82,.42), inset 0 1px 0 #fff, inset 0 -3px 8px rgba(14,39,82,.035);
  --clay-in: inset 0 2px 4px rgba(14,39,82,.08), inset 0 -1px 0 rgba(255,255,255,.9);
  --clay-color: 0 12px 24px -14px rgba(10,45,99,.7), inset 0 -5px 10px rgba(0,0,0,.14), inset 0 3px 6px rgba(255,255,255,.22);
  --shadow: var(--clay); --shadow-lg: var(--clay-lg);
  --grad: linear-gradient(180deg, #1d55ad, #0f3f86);
  --grad-hover: linear-gradient(180deg, #2461bf, #134a9a);
  --g-red: linear-gradient(180deg, #e2534f, #c93636);
  --g-yellow: linear-gradient(180deg, #ffdd5c, #f6c21c);
  --g-blue: linear-gradient(180deg, #2f72c4, #1a5aa7);
  --sans: "Nunito", "Quicksand", ui-rounded, "SF Pro Rounded", Manrope, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --display: "Nunito", ui-rounded, "SF Pro Rounded", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: var(--display);
  font-family: var(--sans);
  color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
h1 { font-size: 1.9rem; line-height: 1.15; margin: 0 0 var(--s4); }
h2 { font-size: 1.4rem; line-height: 1.2; margin: 0 0 var(--s3); }
h3 { font-size: 1.04rem; line-height: 1.3; margin: 0; color: var(--ink); font-weight: 800; }
h4 { margin: var(--s4) 0 var(--s2); font-size: .95rem; color: var(--ink); }
p { margin: 0 0 var(--s3); }
code { background: var(--neutral-bg); padding: 1px 6px; border-radius: 6px; font-size: .85em; word-break: break-all; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 14px; background: #fff; box-shadow: var(--clay-in); min-width: 0; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #b9c6dd; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-l); box-shadow: var(--clay-in), 0 0 0 3px rgba(29,85,173,.16); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--navy-l); outline-offset: 2px; }
textarea { min-height: 88px; width: 100%; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--navy); box-shadow: none; }
input[type=color] { padding: 2px; width: 48px; height: 36px; }
::selection { background: rgba(29,85,173,.18); }
.muted { color: var(--muted); } .small { font-size: .82rem; } .pad { padding: var(--s6); } .center { text-align: center; }
.text-bad { color: var(--bad); } .text-warn { color: var(--warn); }
.row { display: flex; align-items: center; } .row.space { justify-content: space-between; gap: var(--s4); } .gap { gap: var(--s2); } .wrap { flex-wrap: wrap; } .grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); align-items: stretch; }
.full { width: 100%; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); border: 1px solid var(--line-2); background: #fff; color: var(--ink); border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 700; font-size: .92rem; line-height: 1.3; cursor: pointer; white-space: nowrap; text-decoration: none !important; box-shadow: var(--clay-sm); transition: transform .15s, box-shadow .15s, background .15s, border-color .15s; }
.btn:hover { border-color: #b9c6dd; transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: var(--clay-in); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn-primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--clay-color); }
.btn-primary:hover { background: var(--grad-hover); color: #fff; border-color: transparent; }
.btn-danger { background: var(--g-red); color: #fff; border-color: transparent; box-shadow: 0 12px 24px -14px rgba(140,30,30,.7), inset 0 -5px 10px rgba(0,0,0,.12), inset 0 3px 6px rgba(255,255,255,.22); }
.btn-danger:hover { color: #fff; filter: brightness(1.04); border-color: transparent; }
.btn-danger-ghost { color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--neutral-bg); border-color: transparent; transform: none; }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-lg { padding: 13px 26px; font-size: 1rem; }
.btn-light { background: #fff; color: var(--navy); border-color: transparent; }
.btn-light:hover { color: var(--navy); background: #f3f6fb; border-color: transparent; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); box-shadow: none; }
.btn-outline-light:hover { background: rgba(255,255,255,.1); color: #fff; border-color: #fff; }
.link { background: none; border: 0; color: var(--navy); cursor: pointer; padding: 0; font: inherit; font-weight: 700; }

.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; text-transform: lowercase; white-space: nowrap; vertical-align: middle; margin-left: var(--s1); }
.badge-ok { background: var(--ok-bg); color: var(--ok); } .badge-warn { background: var(--warn-bg); color: var(--warn); } .badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); } .badge-neutral { background: var(--neutral-bg); color: var(--muted); }
.alert { padding: var(--s3) var(--s4); border-radius: var(--radius-sm); margin: var(--s1) 0; font-size: .9rem; border: 1px solid; }
.alert ul { margin: var(--s2) 0 0 var(--s4); padding: 0; }
.alert-error { background: var(--bad-bg); color: #7a1c1c; border-color: #f2c9c6; }
.alert-blocked { background: #fdeedd; color: #8a3d0e; border-color: #f2d3b0; }
.alert-warn { background: var(--warn-bg); color: #6b450c; border-color: #efd8a8; }
.alert-ok { background: var(--ok-bg); color: #0b5e3d; border-color: #c2e5d2; }

.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s5); box-shadow: var(--clay); margin-bottom: var(--s5); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); flex-wrap: wrap; margin: calc(-1 * var(--s5)) calc(-1 * var(--s5)) var(--s4); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.card-head h3 { font-family: var(--display); font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; }
.card-link { display: flex; flex-direction: column; gap: var(--s1); color: inherit; text-decoration: none !important; transition: transform .2s, box-shadow .2s; }
.card-link strong { font-size: 1.02rem; color: var(--ink); }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--clay-lg); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s5); margin-bottom: var(--s5); }
.empty { text-align: center; padding: var(--s7) var(--s4); border: 1px dashed var(--line-2); border-radius: var(--radius); margin: var(--s4) 0; background: #f8fafd; }
.empty-title { font-family: var(--display); font-weight: 800; font-size: 1.15rem; color: var(--ink); margin-bottom: var(--s2); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.field-hint { font-size: .76rem; color: var(--muted); }
.form-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; margin: var(--s2) 0; }
.form-row .field { flex: 1 1 180px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; border-bottom: 1px solid var(--line); padding: var(--s3) var(--s3); }
.table td { border-bottom: 1px solid #edf1f7; padding: var(--s3) var(--s3); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td { padding: 6px var(--s3); }
.clickable { cursor: pointer; } .clickable:hover td { background: #f6f8fc; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: var(--s3) 0; border-bottom: 1px solid #edf1f7; }
.list li:first-child { padding-top: 0; }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px; font-size: .85rem; font-weight: 600; background: #fff; cursor: pointer; }
.chip:hover { border-color: var(--navy-l); }
.tabs { margin: var(--s2) 0 var(--s4); flex-wrap: wrap; display: inline-flex; gap: var(--s1); padding: var(--s1); background: var(--neutral-bg); border-radius: 999px; box-shadow: var(--clay-in); }
.tab { border: 0; background: transparent; border-radius: 999px; padding: 6px 16px; cursor: pointer; font: inherit; font-size: .85rem; font-weight: 700; color: var(--muted); text-transform: capitalize; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--grad); color: #fff; box-shadow: var(--clay-color); }
.checklist { list-style: none; padding: 0; margin: 0; } .checklist li { padding: 6px 0; color: var(--muted); } .checklist li.done { color: var(--ok); }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: var(--s2) var(--s4); margin: 0; } .dl dt { color: var(--muted); font-size: .85rem; } .dl dd { margin: 0; }
details > summary { cursor: pointer; font-weight: 700; color: var(--navy); }

/* brand: the wordmark keeps the same colours everywhere */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none !important; }
.logo-mark { flex: none; display: block; object-fit: contain; }
.logo-word { font-family: Arial, "Helvetica Neue", Helvetica, ui-sans-serif, system-ui, sans-serif; font-weight: 800; font-size: 1.3rem; line-height: 1; letter-spacing: .005em; color: #0f3f86; }
.logo-word span { color: #d9413f; }
.logo-light .logo-word { color: #0f3f86; } .logo-light .logo-word span { color: #d9413f; }
.icon { display: block; }

/* shell */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
.sidebar { margin: var(--s4) 0 var(--s4) var(--s4); height: calc(100vh - 2 * var(--s4)); position: sticky; top: var(--s4); border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--rule); box-shadow: var(--clay); color: var(--text); padding: var(--s5) var(--s4); display: flex; flex-direction: column; gap: var(--s5); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.sidebar-top { display: flex; justify-content: space-between; align-items: center; padding: 0 var(--s2); }
.close-menu { color: var(--ink); }
.ws-name { font-size: .85rem; font-weight: 700; color: var(--ink); padding: 10px var(--s3); background: var(--neutral-bg); border-radius: var(--radius-sm); }
.ws-switch { background: var(--neutral-bg); color: var(--ink); border-color: transparent; border-radius: var(--radius-sm); box-shadow: none; }
.side-nav { display: flex; flex-direction: column; gap: var(--s5); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); padding: 0 var(--s3) 6px; }
.nav-item { display: block; padding: 9px var(--s3); border-radius: var(--radius-sm); color: #3a4a6b; font-size: .9rem; font-weight: 600; text-decoration: none !important; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--neutral-bg); color: var(--ink); }
.nav-item.active { background: var(--grad); color: #fff; font-weight: 700; box-shadow: var(--clay-color); }
.sidebar-foot { margin-top: auto; color: var(--muted); text-transform: capitalize; padding: var(--s3) var(--s3) 0; border-top: 1px solid var(--line); }
.main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding: var(--s4) var(--s6); background: rgba(243,246,251,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 5; }
.brand-pick { display: flex; align-items: center; gap: var(--s2); font-weight: 700; color: var(--muted); font-size: .85rem; } .brand-pick select { min-width: 240px; border-radius: 999px; padding: 8px 16px; color: var(--ink); font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: var(--s4); }
.bell { position: relative; font-weight: 700; font-size: .88rem; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 14px; text-decoration: none !important; box-shadow: var(--clay-sm); }
.bell:hover { border-color: #b9c6dd; }
.dot { background: var(--red); color: #fff; font-size: .7rem; border-radius: 999px; padding: 0 7px; margin-left: 6px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 999px; background: var(--grad); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: .95rem; flex: none; box-shadow: var(--clay-color); }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; font-size: .85rem; } .user-meta strong { color: var(--ink); } .user-meta .link { font-size: .78rem; font-weight: 600; color: var(--muted); text-align: left; }
.content { padding: var(--s2) var(--s6) var(--s8); max-width: 1360px; }
.hide-desktop { display: none; }

/* page header + KPI tiles */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-head h1 { margin: var(--s1) 0 var(--s1); font-size: 1.9rem; }
.page-sub { margin: 0; color: var(--muted); font-size: .92rem; }
.hub-eyebrow { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.kpi { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: var(--s1); color: #fff !important; border-radius: var(--radius); padding: var(--s4) var(--s5) var(--s5); min-height: 124px; text-decoration: none !important; box-shadow: var(--clay-color); transition: transform .2s, box-shadow .2s; }
.kpi::after { content: ""; position: absolute; width: 120px; height: 120px; right: -40px; top: -48px; border-radius: 999px; background: rgba(255,255,255,.1); }
a.kpi:hover { transform: translateY(-2px); }
.kpi.k1 { background: var(--grad); }
.kpi.k2 { background: var(--g-red); box-shadow: 0 12px 24px -14px rgba(140,30,30,.7), inset 0 -5px 10px rgba(0,0,0,.12), inset 0 3px 6px rgba(255,255,255,.22); }
.kpi.k3 { background: var(--g-blue); }
.kpi.k4 { background: var(--g-yellow); color: var(--navy-d) !important; box-shadow: 0 12px 24px -14px rgba(150,100,0,.6), inset 0 -5px 10px rgba(190,120,0,.18), inset 0 3px 6px rgba(255,255,255,.5); }
.kpi.k4::after { background: rgba(255,255,255,.25); }
.kpi-l { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .92; }
.kpi-v { font-family: var(--display); font-size: 2.1rem; font-weight: 800; line-height: 1.1; margin-top: var(--s1); }
.kpi-s { font-size: .8rem; font-weight: 600; opacity: .88; margin-top: auto; }

/* studio */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s5); align-items: start; }
.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s4); margin-top: var(--s3); }
.variant { margin: 0; padding: var(--s4); }
.variant-head { font-weight: 600; font-size: .85rem; margin-bottom: .4rem; display: flex; justify-content: space-between; }
.variant img, .variant video { width: 100%; border-radius: 14px; margin-bottom: .4rem; background: #000; }
.caption { white-space: pre-wrap; font-family: inherit; font-size: .88rem; margin: 0; word-break: break-word; }
.media-strip { display: flex; gap: .5rem; flex-wrap: wrap; margin: .25rem 0 .5rem; }
.media-strip img, .media-strip video { height: 120px; border-radius: 14px; border: 1px solid var(--line); }
.media-strip figure { margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.render-out img { max-width: 360px; width: 100%; border-radius: 14px; border: 1px solid var(--line); }
.picker { border: 1px solid var(--line); border-radius: 16px; padding: .75rem; margin-top: .5rem; max-height: 420px; overflow: auto; }
.comment { border-bottom: 1px solid var(--line); padding: .4rem 0; } .comment p { margin: .2rem 0; }
.copy { display: block; margin-top: .35rem; user-select: all; }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s4); }
.asset { background: #fff; border: 0; box-shadow: var(--clay); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s3); display: flex; flex-direction: column; gap: .4rem; }
.asset-thumb { aspect-ratio: 1; background: var(--neutral-bg); border-radius: 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-meta { display: flex; flex-direction: column; gap: .15rem; min-width: 0; } .asset-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 0; box-shadow: var(--clay); border-radius: var(--radius); overflow: hidden; background: #fff; }
.cal-head { font-size: .75rem; font-weight: 600; color: var(--muted); padding: .4rem; border-bottom: 1px solid var(--line); background: var(--neutral-bg); }
.cal-day { min-height: 110px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .3rem; display: flex; flex-direction: column; gap: .25rem; }
.cal-day.out { background: #fafafa; color: #94a3b8; } .cal-day.today .cal-n { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 .4rem; }
.cal-n { font-size: .78rem; align-self: flex-start; }
.cal-item { font-size: .75rem; background: var(--info-bg); border-radius: 14px; padding: .2rem .35rem; overflow: hidden; }
.cal-item a { color: var(--ink); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item.tone-PUBLISHED { background: var(--ok-bg); } .cal-item.tone-FAILED, .cal-item.tone-BLOCKED { background: var(--bad-bg); } .cal-item.tone-PAUSED { background: var(--warn-bg); } .cal-item.tone-DRY_RUN_COMPLETE, .cal-item.tone-CANCELED { background: var(--neutral-bg); }

.split { display: grid; grid-template-columns: 340px 1fr; gap: var(--s5); align-items: start; }
.split-list { display: flex; flex-direction: column; gap: .4rem; max-height: 75vh; overflow: auto; }
.split-detail { background: #fff; border: 0; box-shadow: var(--clay); border-radius: var(--radius); padding: var(--s5); min-height: 300px; }
.convo { display: block; background: #fff; border: 2px solid transparent; box-shadow: var(--clay-sm); border-radius: 16px; padding: .55rem .7rem; color: inherit; text-decoration: none !important; }
.convo.active { border-color: var(--navy); }
.clamp { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.thread { display: flex; flex-direction: column; gap: .6rem; }
.msg { max-width: 85%; padding: .55rem .75rem; border-radius: 16px; background: var(--neutral-bg); }
.msg.out { align-self: flex-end; background: #e6eefb; border: 0; }
.msg p { margin: .2rem 0; white-space: pre-wrap; }
.transcript { max-height: 280px; overflow: auto; font-size: .88rem; display: flex; flex-direction: column; gap: .3rem; margin-top: .5rem; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s4); }
.clip { margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.clip-video { width: 100%; max-height: 360px; background: #000; border-radius: 14px; }
.meter { height: 10px; box-shadow: var(--clay-in); background: var(--neutral-bg); border-radius: 999px; overflow: hidden; margin: .2rem 0 .6rem; }
.meter > div { height: 100%; background: var(--navy); border-radius: 999px; } .meter > .hot { background: var(--bad); }
.usage-row { display: flex; justify-content: space-between; font-size: .9rem; }
.narrative { white-space: pre-wrap; font-family: inherit; margin: 0; }
.evidence { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem; margin: .5rem 0; }
.evidence-card { margin: 0; padding: .6rem .75rem; } .evidence-card blockquote { margin: .3rem 0; padding-left: .6rem; border-left: 3px solid var(--accent-2); color: var(--muted); font-size: .85rem; }
.creator { border-top: 1px solid var(--line); padding: .6rem 0; }
.danger-zone { border-color: #fecaca; }

/* public */
.pub { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; color: var(--text); overflow-x: clip; }
.pub-section.tight { padding-top: 0; }
.pub-nav { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.pub-nav-in { max-width: 1200px; margin: 0 auto; padding: var(--s3) var(--s5); display: flex; justify-content: space-between; align-items: center; gap: var(--s5); min-height: 68px; }
.pub-links { gap: var(--s6); }
.pub-links a:not(.btn) { color: #3a4a6b; font-size: .93rem; font-weight: 600; }
.pub-links a:not(.btn):hover { color: var(--navy); text-decoration: none; }
.pub-links .btn { margin-left: var(--s2); }
.hero { text-align: center; padding: var(--s9) var(--s5) var(--s8); max-width: 1200px; margin: 0 auto; width: 100%; }
.eyebrow { display: inline-flex; align-items: center; gap: var(--s2); background: #fff; color: var(--navy); border: 1px solid var(--line-2); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 7px 16px; border-radius: 999px; margin-bottom: var(--s5); box-shadow: var(--clay-sm); }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--red); }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.1; max-width: 880px; margin: 0 auto var(--s5); font-weight: 800; color: var(--ink); }
.hero h1 em { font-style: normal; color: var(--navy-l); }
.lead { font-size: 1.14rem; color: var(--muted); max-width: 680px; margin: 0 auto var(--s6); line-height: 1.7; }
.hero-cta { display: flex; justify-content: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.hero > .small { margin: 0; }
.hero-preview { margin: var(--s8) auto 0; max-width: 980px; }
.hp-window { display: grid; grid-template-columns: 200px 1fr; text-align: left; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--clay-lg); padding: var(--s4); gap: var(--s5); }
.hp-side { background: var(--bg); border-radius: var(--radius); padding: var(--s4) var(--s3); display: flex; flex-direction: column; gap: 2px; }
.hp-side .logo { margin: 0 var(--s2) var(--s4); } .hp-side .logo-word { font-size: 1.1rem; } .hp-side .logo-mark { width: 26px; height: 26px; }
.hp-nav { color: #3a4a6b; font-size: .82rem; font-weight: 600; padding: 7px var(--s3); border-radius: 10px; }
.hp-nav.on { background: var(--grad); color: #fff; font-weight: 700; }
.hp-main { padding: var(--s2) var(--s2) 0 0; display: flex; flex-direction: column; gap: var(--s1); }
.hp-title { font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: var(--ink); margin-bottom: var(--s4); }
.hp-main .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.hero-preview figcaption { margin-top: var(--s4); }
.pub-band { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pub-section { padding: var(--s9) var(--s5); max-width: 1200px; margin: 0 auto; width: 100%; }
.pub-section h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); font-weight: 800; margin-bottom: var(--s3); }
.section-lead { max-width: 640px; margin: 0 auto var(--s7); font-size: 1.04rem; }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); }
.feature { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s5); box-shadow: var(--clay); transition: transform .2s, box-shadow .2s; }
.pub-band .feature { background: var(--bg); box-shadow: none; border-color: var(--line); }
.feature:hover { transform: translateY(-2px); box-shadow: var(--clay-lg); }
.pub-band .feature:hover { background: #fff; }
.feature .ico { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--grad); margin-bottom: var(--s4); box-shadow: var(--clay-color); }
.feature h3 { font-size: 1.04rem; margin-bottom: var(--s2); }
.feature p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s5); }
.steps li { flex: 0 1 calc((100% - 3 * var(--s5)) / 4); background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s2); box-shadow: var(--clay); }
.steps strong { font-size: 1.04rem; color: var(--ink); margin-top: var(--s2); font-weight: 800; }
.steps p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.step-n { flex: none; width: 34px; height: 34px; border-radius: 999px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem; box-shadow: var(--clay-color); }
.split-cta { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--s8); align-items: center; }
.split-cta h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
.ticks { list-style: none; padding: 0; margin: var(--s5) 0 0; display: flex; flex-direction: column; gap: var(--s3); }
.ticks li { position: relative; padding-left: 36px; color: var(--text); font-weight: 600; line-height: 1.5; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 999px; background: var(--info-bg); color: var(--navy); font-weight: 900; font-size: .75rem; display: flex; align-items: center; justify-content: center; }
.cta-panel { background: var(--grad); color: #dfe8f7; border-radius: var(--radius-lg); padding: var(--s6); border: 0; box-shadow: 0 30px 50px -28px rgba(10,45,99,.8), inset 0 -6px 12px rgba(0,0,0,.14), inset 0 3px 8px rgba(255,255,255,.18); }
.cta-panel h3 { color: #fff; font-size: 1.45rem; line-height: 1.25; margin-bottom: var(--s3); font-weight: 800; }
.cta-panel p { font-size: 1.02rem; line-height: 1.65; margin: 0 0 var(--s5); }
.cta-panel .row { gap: var(--s3); }
.table-card { padding: var(--s2) var(--s5); overflow-x: auto; margin-bottom: 0; }
.note-card { margin-bottom: 0; }
.note-card h3 { font-family: var(--display); font-weight: 800; font-size: 1.2rem; margin-bottom: var(--s2); }
.note-card p { margin: 0; }
.prose { max-width: 760px; } .prose p { color: #3a4a6b; } .prose h3 { margin-top: var(--s5); margin-bottom: var(--s2); }
article.pub-section.prose { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--rule); box-shadow: var(--clay); margin: var(--s7) auto; padding: var(--s7); }
.pub-footer { margin-top: auto; background: #fff; border-top: 1px solid var(--line); }
.pub-footer-in { max-width: 1200px; margin: 0 auto; padding: var(--s5); display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap; font-size: .88rem; }
.pub-footer-in .row { gap: var(--s5); }
.pub-footer-in .logo-word { font-size: 1.05rem; } .pub-footer-in .logo-mark { width: 28px; height: 28px; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--s5) var(--s4); background: var(--bg); }
.auth-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: var(--s4); background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--rule); box-shadow: var(--clay-lg); padding: var(--s7) var(--s6) var(--s6); }
.auth-card > .logo { margin-bottom: var(--s2); }
.auth-card h1 { font-size: 1.9rem; margin: 0; }
.auth-card h2 { margin: var(--s2) 0 0; }
.auth-sub { margin: calc(-1 * var(--s2)) 0 var(--s2); font-size: 1rem; color: var(--muted); }
.auth-card .btn-lg { margin-top: var(--s2); }
.auth-foot { text-align: center; color: var(--muted); font-size: .86rem; margin: 0; padding-top: var(--s4); border-top: 1px solid var(--line); }
.review-wrap { min-height: 100vh; background: var(--bg); }
.review-main { max-width: 900px; margin: 0 auto; padding: var(--s5) var(--s4); }
.review-main .media-strip img, .review-main .media-strip video { height: auto; max-height: 420px; max-width: 100%; }

@media (max-width: 1100px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li { flex-basis: calc((100% - var(--s5)) / 2); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; margin: 0; top: 0; inset: 0 auto 0 0; height: 100vh; border-radius: 0 var(--radius-lg) var(--radius-lg) 0; width: 280px; z-index: 20; transform: translateX(-105%); transition: transform .2s; }
  .menu-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(14,39,82,.4); }
  .hide-desktop { display: inline-flex; }
  .editor, .split, .grid-2 { grid-template-columns: 1fr; }
  .content { padding: var(--s2) var(--s4) var(--s7); }
  .topbar { padding: var(--s3) var(--s4); gap: var(--s2); }
  .user-meta { display: none; }
  .bell { padding: 6px 12px; }
  .brand-pick > span { display: none; }
  .brand-pick select { min-width: 0; max-width: 40vw; padding: 7px 12px; }
  .topbar-right { gap: var(--s2); }
  .avatar { width: 34px; height: 34px; }
  .page-head h1 { font-size: 1.55rem; }
  .kpis { gap: var(--s3); }
  .kpi { padding: var(--s4); min-height: 112px; } .kpi-v { font-size: 1.75rem; }
  .calendar { grid-template-columns: repeat(7, minmax(44px, 1fr)); font-size: .7rem; overflow-x: auto; }
  .cal-day { min-height: 70px; }
  .cal-item .badge { display: none; }
  .table { display: block; overflow-x: auto; }
  .pub-nav-in { padding: var(--s3) var(--s4); min-height: 60px; }
  .pub-links a:not(.btn) { display: none; }
  .hero { padding: var(--s8) var(--s4) var(--s7); }
  .eyebrow { font-size: .68rem; letter-spacing: .05em; }
  .pub-section { padding: var(--s8) var(--s4); }
  .section-lead { margin-bottom: var(--s6); }
  .hero-preview { margin-top: var(--s7); }
  .hp-window { grid-template-columns: 1fr; padding: var(--s3); } .hp-side { display: none; }
  .split-cta { grid-template-columns: 1fr; gap: var(--s6); }
  .auth-card { padding: var(--s6) var(--s5) var(--s5); }
  article.pub-section.prose { margin: var(--s4); padding: var(--s5); width: auto; }
  .dl { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .feature-grid { grid-template-columns: 1fr; }
  .steps li { flex-basis: 100%; }
  .pub-footer-in { flex-direction: column; text-align: center; }
}

/* Native FORVA video editor */
.studio-layout{display:grid;grid-template-columns:minmax(220px,360px) minmax(260px,1fr);gap:24px;margin:18px 0}.studio-preview{position:relative;background:#080b12;overflow:hidden;container-type:inline-size;max-height:580px;margin:auto}.studio-preview video{width:100%;height:100%;position:absolute;inset:0}.studio-caption{position:absolute;left:9%;right:16%;text-align:center;line-height:1.15;font-weight:800;text-shadow:0 2px 3px #000,2px 0 3px #000,-2px 0 3px #000;padding:.15em;pointer-events:none;transform:translateY(-50%)}.studio-caption.lower{top:75.5%}.studio-caption.center{top:49%}.studio-caption.top{top:13%}.studio-hook{position:absolute;top:16%;left:9%;right:16%;transform:translateY(-50%);text-align:center;background:#0009;color:white;font-size:6.5cqw;font-weight:800;padding:.2em}.studio-fields{border:0;padding:0;display:grid;gap:14px;min-width:0}.studio-fields input:not([type=checkbox]),.studio-fields select{width:100%}.studio-export{border-top:1px solid var(--border,#ddd);padding-top:20px;margin-top:20px}.studio-export video{max-height:480px;max-width:100%}.caption-editor{max-height:420px;overflow:auto}.caption-cue{padding:10px 0;border-bottom:1px solid #ddd}.caption-cue input{max-width:120px}.caption-cue textarea{width:100%;min-height:60px}.video-studio .clip-video{background:#111}.video-studio fieldset:disabled{opacity:.7}@media(max-width:760px){.studio-layout{grid-template-columns:1fr}.studio-preview{max-width:320px}.studio-fields .grid-2{grid-template-columns:1fr 1fr}}

/* grids own the gap; cards inside them do not add their own bottom margin */
.grid-2, .cards { margin-bottom: var(--s5); }
.grid-2 > .card, .cards > .card, .grid-2 > div > .card:last-child { margin-bottom: 0; }
.form-row > .btn, .form-row > button { min-height: 46px; }

/* AI Command Center */
.cc-layout { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.cc-side { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.cc-main { min-width: 0; }
.cc-main .thread { max-height: 70vh; overflow-y: auto; }
.cc-main code { overflow-wrap: anywhere; }
@media (max-width: 900px) { .cc-layout { grid-template-columns: minmax(0, 1fr); } .cc-main { order: -1; } }

/* Anti-abuse: sign-up bot check and Super Admin stats (D-051) */
.turnstile { min-height: 70px; margin: var(--s2) 0 var(--s3); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: var(--s3) var(--s4); }
.stat-n { font-size: 1.6rem; font-weight: 800; }
.stat-l { font-size: .78rem; color: var(--muted); font-weight: 700; }
.check { display: flex; gap: var(--s2); align-items: center; font-size: .9rem; }

/* Floating AI worker (assistant.tsx) */
.ai-dock { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.ai-fab { width: 72px; height: 72px; border-radius: 50%; border: 3px solid #fff; padding: 4px; background: var(--g-blue); box-shadow: 0 16px 32px -12px rgba(15,63,134,.6); cursor: pointer; display: grid; place-items: center; transition: transform .15s; animation: ai-bob 3.2s ease-in-out infinite; }
.ai-fab:hover { transform: scale(1.06); }
.ai-fab:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.ai-fab.talking { box-shadow: 0 0 0 0 rgba(47,114,196,.6); animation: ai-pulse 1s ease-out infinite; }
.ai-fab .ai-avatar { box-shadow: none; }
.ai-panel { width: min(380px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 120px)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--clay-lg); overflow: hidden; }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--rule); background: #f6f9fe; }
.ai-head .grow { flex: 1; min-width: 0; }
.ai-settings { padding: 10px 14px; border-bottom: 1px solid var(--rule); display: grid; gap: 8px; background: #fbfcfe; }
.ai-pick { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font: inherit; }
.ai-pick.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(26,90,167,.2); font-weight: 600; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.ai-msg { align-self: flex-start; max-width: 88%; background: #eef3fb; border-radius: 14px 14px 14px 4px; padding: 8px 12px; font-size: .9rem; }
.ai-msg.out { align-self: flex-end; background: var(--blue); color: #fff; border-radius: 14px 14px 4px 14px; }
.ai-chips { padding: 0 14px; }
.ai-input { padding: 10px 14px; border-top: 1px solid var(--rule); align-items: center; }
.ai-input input { min-width: 0; }
.ai-foot { padding: 0 14px 10px; margin: 0; }
.ai-avatar { display: inline-block; border-radius: 50%; overflow: hidden; flex: none; background: #e9eef6; box-shadow: 0 0 0 2px #fff; transition: box-shadow .2s; }
.ai-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.ai-avatar.ai-talking { animation: ai-speak 1s ease-in-out infinite; }
.ai-check { margin-left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--blue-l); color: #fff; display: inline-grid; place-items: center; font-size: .75rem; }
@keyframes ai-speak { 0%,100% { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(47,114,196,.55); } 50% { box-shadow: 0 0 0 2px #fff, 0 0 0 9px rgba(47,114,196,.15); } }
@keyframes ai-bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -4px; } }
@keyframes ai-pulse { 0% { box-shadow: 0 0 0 0 rgba(47,114,196,.55); } 100% { box-shadow: 0 0 0 18px rgba(47,114,196,0); } }
@media (prefers-reduced-motion: reduce) { .ai-fab, .ai-fab.talking, .ai-avatar.ai-talking { animation: none; } }
@media (max-width: 640px) { .ai-dock { right: 12px; bottom: 12px; } .ai-fab { width: 60px; height: 60px; } }

/* Voice input row: keep the text box usable; messages wrap below */
.voice-row { flex-wrap: wrap; align-items: center; }
.voice-row > input { flex: 1 1 220px; min-width: 180px; }
.mic-note { flex-basis: 100%; order: 10; }
.ai-input { flex-wrap: wrap; }
.ai-input > input { flex: 1 1 140px; min-width: 120px; }
