@font-face { font-family: Cairo; font-weight: 400; font-display: swap; src: url(/static/fonts/cairo-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Cairo; font-weight: 600; font-display: swap; src: url(/static/fonts/cairo-arabic-600-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Cairo; font-weight: 700; font-display: swap; src: url(/static/fonts/cairo-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Cairo; font-weight: 900; font-display: swap; src: url(/static/fonts/cairo-arabic-900-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Cairo; font-weight: 400; font-display: swap; src: url(/static/fonts/cairo-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Cairo; font-weight: 600; font-display: swap; src: url(/static/fonts/cairo-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Cairo; font-weight: 700; font-display: swap; src: url(/static/fonts/cairo-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: Cairo; font-weight: 900; font-display: swap; src: url(/static/fonts/cairo-latin-900-normal.woff2) format('woff2'); }

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: #0e1726;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e4e7ec;
  --line-2: #d0d5dd;
  --brand: #12284a;
  --brand-2: #1d3d6e;
  --accent: #a17a2c;
  --up: #067647;
  --up-bg: #ecfdf3;
  --down: #b42318;
  --down-bg: #fef3f2;
  --warn: #b54708;
  --warn-bg: #fffaeb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --font: Cairo, "Segoe UI", Tahoma, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; color: var(--ink); }
h1 { font-size: 1.9rem; font-weight: 900; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.08rem; font-weight: 700; }
a { color: var(--brand-2); }
.num, .tabular, table td, .kpi-value { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
span.num, b.num, code.num { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.unit { font-size: .82em; font-weight: 600; }
.kpi-value .unit, .scen .v .unit { font-size: .5em; font-weight: 700; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.up { color: var(--up); }
.down { color: var(--down); }
.warn { color: var(--warn); }
.hidden { display: none !important; }

button, .btn { font-family: inherit; font-size: .95rem; font-weight: 700; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: .55rem 1rem; cursor: pointer; min-height: 42px; transition: background .15s, border-color .15s; }
button:hover, .btn:hover { border-color: var(--brand-2); }
button:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 34px; padding: .3rem .7rem; font-size: .85rem; }
.btn-danger { color: var(--down); }
input, select, textarea { font-family: inherit; font-size: 1rem; color: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; padding: .55rem .75rem; background: var(--surface); width: 100%; min-height: 42px; }
textarea { min-height: 140px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid rgba(29, 61, 110, .22); outline-offset: 1px; border-color: var(--brand-2); }
label { display: block; font-size: .86rem; font-weight: 700; color: var(--ink-2); margin-bottom: .3rem; }
.field { margin-bottom: .9rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- landing ---------- */
.landing { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.landing-hero { background: linear-gradient(160deg, #0b1d38 0%, #12284a 55%, #1d3d6e 100%); color: #e9eef6; padding: 3.2rem 3rem; display: flex; flex-direction: column; gap: 1.6rem; }
.landing-hero h1 { color: #fff; font-size: 2.6rem; }
.landing-hero .lead { font-size: 1.15rem; color: #c9d5e6; max-width: 34rem; }
.brand-mark { display: flex; align-items: center; gap: .65rem; font-weight: 900; font-size: 1.35rem; color: #fff; }
.brand-mark .logo { width: 40px; height: 40px; border-radius: 11px; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 900; flex: none; }
.brand-sub { display: block; font-size: .72rem; font-weight: 600; color: #b8c7de; line-height: 1.2; margin-top: .1rem; }
.hero-kicker { display: inline-flex; align-self: flex-start; background: rgba(161, 122, 44, .22); border: 1px solid rgba(235, 198, 117, .42); color: #f6dca0; border-radius: 999px; padding: .28rem .85rem; font-size: .82rem; font-weight: 800; }
.hero-pillars { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .3rem; }
.hero-pill { font-size: .78rem; font-weight: 700; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .16); color: #e9eef6; border-radius: 999px; padding: .24rem .7rem; }
.q3 { display: grid; gap: .8rem; margin-top: .4rem; }
.q3 div { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; padding: .8rem 1rem; }
.q3 b { color: #fff; display: block; }
.landing-auth { display: grid; place-items: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.8rem; box-shadow: var(--shadow); }
.tabs { display: flex; gap: .4rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .25rem; margin-bottom: 1.2rem; }
.tabs button { flex: 1; border: 0; background: transparent; min-height: 38px; }
.tabs button.active { background: var(--surface); box-shadow: var(--shadow); }
.ws-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ws-pick label { border: 1px solid var(--line-2); border-radius: 10px; padding: .55rem .65rem; cursor: pointer; font-weight: 600; margin: 0; display: flex; gap: .45rem; align-items: flex-start; }
.ws-pick input { width: auto; min-height: auto; margin-top: .3rem; }
.ws-pick label:has(input:checked) { border-color: var(--brand); background: #eef2f8; }
.form-error { color: var(--down); font-weight: 700; min-height: 1.4em; font-size: .9rem; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 274px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, #0d1f3c 0%, #12284a 100%); color: #d6e0ee; padding: 1.15rem .85rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: .8rem; }
.sidebar .brand-mark { padding: 0 .4rem; }
.ws-badge { font-size: .78rem; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; padding: .35rem .6rem; margin: 0 .4rem; }
.nav-group-label { font-size: .72rem; font-weight: 800; color: #94a8c7; padding: .45rem .55rem .15rem; letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: .18rem; }
.nav button { background: transparent; border: 0; color: #d6e0ee; text-align: start; display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .9rem; border-radius: 10px; padding: .48rem .65rem; min-height: 39px; }
.nav button:hover { background: rgba(255, 255, 255, .08); }
.nav button.active { background: #fff; color: var(--brand); box-shadow: 0 2px 6px rgba(0, 0, 0, .14); }
.nav .eng-num { width: 21px; height: 21px; border-radius: 6px; background: rgba(255, 255, 255, .13); color: #f6dca0; font-size: .74rem; font-weight: 900; display: grid; place-items: center; flex: none; font-variant-numeric: tabular-nums; }
.nav button.active .eng-num { background: var(--brand); color: #fff; }
.nav svg { width: 18px; height: 18px; flex: none; }
.sidebar .spacer { flex: 1; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.6rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h2 { font-size: 1.2rem; }
.btn-export { background: #fdf8ee; border-color: #dec488; color: #6e4f12; font-weight: 800; }
.btn-export:hover { background: #f9efd8; border-color: var(--accent); }
.btn-coach { background: #ecfdf3; border-color: #abefc6; color: #067647; font-weight: 800; }
.btn-coach.off { background: var(--surface-2); border-color: var(--line-2); color: var(--muted); }
.persona-switch { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .2rem; gap: .2rem; }
.persona-switch button { border: 0; background: transparent; min-height: 30px; padding: .22rem .6rem; font-size: .78rem; border-radius: 7px; color: var(--ink-2); }
.persona-switch button.active { background: var(--brand); color: #fff; }
.coach-wrap { padding: 1rem 1.6rem 0; max-width: 1480px; width: 100%; }
.coach-wrap:empty { display: none; }
.coach-card { background: linear-gradient(135deg, #f8fafc 0%, #eef4ff 100%); border: 1px solid #c7d7fe; border-inline-start: 4px solid var(--brand); border-radius: 13px; padding: .95rem 1.15rem; display: flex; flex-direction: column; gap: .55rem; }
.coach-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.coach-badge { font-size: .76rem; font-weight: 900; color: var(--brand); background: #fff; border: 1px solid #c7d7fe; border-radius: 999px; padding: .15rem .65rem; }
.coach-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.coach-item { background: rgba(255, 255, 255, .82); border: 1px solid #dce6f9; border-radius: 10px; padding: .65rem .8rem; font-size: .88rem; }
.coach-item b { display: block; font-size: .78rem; color: var(--brand-2); margin-bottom: .2rem; }
.coach-item.mistake b { color: var(--down); }
.coach-item.persona b { color: var(--up); }
.flywheel-svg { display: block; max-width: 340px; width: 100%; margin: 0 auto; height: auto; }
@media (max-width: 900px) {
  .coach-wrap { padding: .8rem .9rem 0; }
  .coach-grid { grid-template-columns: 1fr; }
  .persona-switch { width: 100%; justify-content: space-between; }
}
@media print {
  .coach-wrap, .persona-switch { display: none !important; }
}
.content { padding: 1.4rem 1.6rem 5rem; display: flex; flex-direction: column; gap: 1.2rem; max-width: 1480px; width: 100%; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.2rem; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; margin-bottom: .85rem; flex-wrap: wrap; }
.card-head .sub { color: var(--muted); font-size: .86rem; }
.grid { display: grid; gap: 1.2rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.g-auto { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
#briefArea:empty { display: none !important; }

/* KPI tiles / P&L bar */
.pnl-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 0; overflow: hidden; }
.pnl-bar .kpi { padding: 1.1rem 1.2rem; border-inline-end: 1px solid var(--line); }
.pnl-bar .kpi:last-child { border-inline-end: 0; }
.kpi-label { font-size: .84rem; color: var(--muted); font-weight: 700; }
.kpi-value { font-size: 1.9rem; font-weight: 900; line-height: 1.2; margin-top: .2rem; }
.kpi-foot { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.q-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.q-box { border: 1px solid var(--line); border-radius: 12px; padding: .85rem 1rem; background: var(--surface-2); }
.q-box .q { font-size: .78rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .02em; }
.q-box p { margin: .3rem 0 0; font-weight: 600; }
.q-box.move { background: #eef2f8; border-color: #c7d3e6; }

table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: start; font-size: .8rem; color: var(--muted); font-weight: 700; padding: .55rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.table-wrap td:first-child { min-width: 150px; }
th.sortable { cursor: pointer; }

.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: .15rem .6rem; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.up { background: var(--up-bg); border-color: #abefc6; }
.chip.down { background: var(--down-bg); border-color: #fecdca; }
.chip.warn { background: var(--warn-bg); border-color: #fedf89; }
.chip.brand { background: #eef2f8; border-color: #c7d3e6; color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }

.bar { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; min-width: 70px; }
.bar > span { display: block; height: 100%; background: var(--brand-2); border-radius: 99px; }
.dbar { position: relative; height: 10px; background: var(--surface-2); border-radius: 99px; min-width: 90px; }
.dbar::after { content: ""; position: absolute; inset-inline-start: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-2); }
.dbar > span { position: absolute; top: 0; bottom: 0; border-radius: 99px; }
.dbar > span.pos { background: var(--up); inset-inline-start: 50%; }
.dbar > span.neg { background: var(--down); inset-inline-end: 50%; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: .8rem; align-items: center; justify-content: space-between; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .t { font-weight: 700; }
.clickable { cursor: pointer; }
.clickable:hover .t { color: var(--brand-2); text-decoration: underline; }

.scen { border: 1px solid var(--line); border-radius: 12px; padding: .9rem; }
.scen.best { border-top: 3px solid var(--up); }
.scen.base { border-top: 3px solid var(--brand-2); }
.scen.worst { border-top: 3px solid var(--down); }
.scen .v { font-size: 1.35rem; font-weight: 900; }
.play { display: grid; grid-template-columns: 38px 1fr auto; gap: .8rem; align-items: start; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.play:last-child { border-bottom: 0; }
.play .rank { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 900; }
.play .meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.slider-row { display: grid; grid-template-columns: 1fr 140px 70px; gap: .7rem; align-items: center; margin-bottom: .5rem; }
.slider-row input[type=range] { padding: 0; min-height: 28px; border: 0; }
.slider-row .num { text-align: end; font-weight: 800; }
.compare-cell { display: grid; grid-template-columns: 1fr auto; gap: .4rem; align-items: center; }
.qa-thread { display: flex; flex-direction: column; gap: .6rem; max-height: 360px; overflow-y: auto; margin-bottom: .7rem; }
.qa-q { align-self: flex-start; background: #eef2f8; border-radius: 12px; padding: .5rem .8rem; font-weight: 700; max-width: 85%; }
.qa-a { align-self: flex-end; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .85rem; max-width: 92%; white-space: pre-wrap; }
.connector { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.connector .ic { width: 40px; height: 40px; border-radius: 10px; background: #eef2f8; color: var(--brand); display: grid; place-items: center; }
.connector .ic svg { width: 22px; height: 22px; }
.empty { text-align: center; color: var(--muted); padding: 1.4rem .5rem; }
.gauge { display: block; margin: 0 auto; }
.toast { position: fixed; inset-inline-end: 1.2rem; bottom: 1.2rem; background: var(--ink); color: #fff; padding: .75rem 1.1rem; border-radius: 12px; font-weight: 700; z-index: 50; box-shadow: var(--shadow); max-width: 90vw; }
.toast.err { background: var(--down); }
.spark { display: block; width: 100%; height: 70px; }
.badge-ai { font-size: .75rem; font-weight: 800; border-radius: 6px; padding: .1rem .45rem; background: #f4ebff; color: #6941c6; }
.badge-model { font-size: .75rem; font-weight: 800; border-radius: 6px; padding: .1rem .45rem; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.mobile-nav { display: none; }
.lang-btn { min-width: 52px; }
.notice { background: var(--warn-bg); border: 1px solid #fedf89; color: #7a2e0e; border-radius: 10px; padding: .6rem .85rem; font-size: .88rem; }
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 1.3rem; max-width: 520px; width: 92vw; }
dialog::backdrop { background: rgba(14, 23, 38, .4); }

/* ---------- 7 Commercial Engines & Launchpad ---------- */
.phase-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.phase-card { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; background: var(--surface-2); border-top: 3px solid var(--brand-2); }
.phase-card .ph-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .45rem; }
.engine-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: .95rem; }
.engine-tile { border: 1px solid var(--line); border-radius: 13px; padding: 1rem 1.05rem; background: var(--surface); display: flex; flex-direction: column; gap: .5rem; transition: border-color .15s, transform .15s; cursor: pointer; }
.engine-tile:hover { border-color: var(--brand-2); transform: translateY(-1px); }
.engine-tile .et-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.engine-tile .et-badge { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: .85rem; }
.engine-tile .et-book { font-size: .76rem; color: var(--accent); font-weight: 800; }

.subtabs { display: inline-flex; flex-wrap: wrap; gap: .35rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .28rem; }
.subtabs button { border: 0; background: transparent; min-height: 36px; padding: .35rem .85rem; border-radius: 9px; font-size: .88rem; }
.subtabs button.active { background: var(--brand); color: #fff; }

.errc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.errc-box { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; background: var(--surface-2); }
.errc-box.eliminate { border-top: 3px solid var(--down); }
.errc-box.reduce { border-top: 3px solid var(--warn); }
.errc-box.raise { border-top: 3px solid var(--brand-2); }
.errc-box.create { border-top: 3px solid var(--up); }
.errc-box textarea { min-height: 92px; font-size: .92rem; }
.canvas-svg { display: block; width: 100%; height: auto; max-height: 300px; }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .83rem; font-weight: 700; color: var(--ink-2); margin-bottom: .5rem; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: .4rem; vertical-align: -2px; }
.legend .lg-startup::before { background: var(--up); }
.legend .lg-leader::before { background: var(--accent); }
.legend .lg-market::before { background: #98a2b3; }

.oneliner-banner { background: linear-gradient(135deg, #0f2342 0%, #1b3a6b 100%); color: #fff; border-radius: 14px; padding: 1.2rem 1.4rem; }
.oneliner-banner .kicker { font-size: .78rem; font-weight: 800; color: #f6dca0; margin-bottom: .3rem; }
.oneliner-banner p { margin: 0; font-size: 1.12rem; font-weight: 700; line-height: 1.7; }
.nine-phase { margin-bottom: 1rem; }
.nine-phase-title { font-size: .88rem; font-weight: 800; color: var(--brand); margin-bottom: .5rem; display: flex; align-items: center; gap: .5rem; }
.nine-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.nine-cell { border: 1px solid var(--line); border-radius: 12px; padding: .85rem; background: var(--surface-2); }
.nine-cell label { color: var(--brand); font-size: .84rem; }
.nine-cell textarea { min-height: 94px; font-size: .9rem; }

.hook-loop { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
.hook-step { border: 1px solid var(--line); border-radius: 12px; padding: .95rem; background: var(--surface-2); border-top: 3px solid var(--brand); }
.hook-step .step-tag { font-size: .76rem; font-weight: 900; color: var(--accent); margin-bottom: .25rem; }
.hook-step textarea { min-height: 82px; font-size: .9rem; }

.script-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: .8rem; }
.script-card { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; background: var(--surface-2); }
.script-card .sk { font-size: .78rem; font-weight: 800; color: var(--brand-2); margin-bottom: .25rem; }
.script-card p { margin: 0; font-weight: 600; font-size: .94rem; }
.grade-badge { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-weight: 900; font-size: .84rem; }
.grade-A { background: var(--up-bg); color: var(--up); border: 1px solid #abefc6; }
.grade-B { background: #eef2f8; color: var(--brand); border: 1px solid #c7d3e6; }
.grade-C { background: var(--warn-bg); color: var(--warn); border: 1px solid #fedf89; }

.alert-stack { display: flex; flex-direction: column; gap: .6rem; }
.fin-alert { border-radius: 12px; padding: .8rem 1rem; border: 1px solid var(--line); }
.fin-alert.danger { background: var(--down-bg); border-color: #fecdca; color: #7a271a; }
.fin-alert.warn { background: var(--warn-bg); border-color: #fedf89; color: #7a2e0e; }
.fin-alert.ok { background: var(--up-bg); border-color: #abefc6; color: #054f31; }
.fin-alert b { display: block; margin-bottom: .15rem; }

.bridge-row { display: flex; justify-content: space-between; align-items: center; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.bridge-row:last-child { border-bottom: 0; font-weight: 900; font-size: 1.04rem; padding-top: .8rem; }

@media (max-width: 1180px) {
  .hook-loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .phase-track, .nine-grid, .errc-grid, .script-grid, .hook-loop { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .mobile-nav, .topbar button { display: none !important; }
  .shell { grid-template-columns: 1fr !important; }
  .content { padding: 0 !important; max-width: none !important; }
  .card { box-shadow: none !important; break-inside: avoid; }
}

@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pnl-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pnl-bar .kpi:nth-child(2) { border-inline-end: 0; }
  .pnl-bar .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .landing { grid-template-columns: 1fr; }
  .landing-hero { padding: 2rem 1.4rem; }
  .landing-hero h1 { font-size: 2rem; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .q-strip { grid-template-columns: 1fr; }
  .content { padding: 1rem .9rem 6rem; }
  .topbar { padding: .75rem .9rem; }
  .mobile-nav { display: flex; position: fixed; bottom: 0; inset-inline: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 20; overflow-x: auto; }
  .mobile-nav button { flex: 1; border: 0; border-radius: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: .72rem; min-width: 70px; padding: .45rem .2rem; color: var(--muted); }
  .mobile-nav button.active { color: var(--brand); }
  .mobile-nav svg { width: 21px; height: 21px; }
  .slider-row { grid-template-columns: 1fr 90px 60px; }
}
@media (max-width: 560px) {
  .play { grid-template-columns: 34px 1fr; }
  .play > div:last-child { grid-column: 1 / -1; min-width: 0 !important; }
  .g4, .pnl-bar { grid-template-columns: 1fr; }
  .pnl-bar .kpi { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .kpi-value { font-size: 1.6rem; }
  .ws-pick { grid-template-columns: 1fr; }
}
