/* InspectFlow design system.
   Layout idea: a quiet navy rail, a dense working canvas, and one gold thread that marks progress through a job's lifecycle. */
:root {
  --bg: #f4f5f8; --surface: #ffffff; --surface-2: #eef0f4; --surface-3: #e6e9ef;
  --line: #e1e4ea; --line-2: #cdd2db;
  --ink: #121b2d; --ink-2: #47526a; --ink-3: #6f7a90;
  --brand: #17305c; --brand-2: #234683; --brand-soft: #e7ecf6; --on-brand: #ffffff;
  --gold: #9c7c3c; --gold-2: #c2a56b; --gold-soft: #f4eddd;
  --ok: #26735a; --ok-soft: #e2f1ea; --warn: #9a6710; --warn-soft: #f8edd6;
  --bad: #a83f36; --bad-soft: #f8e4e1; --info: #2a5f8a; --info-soft: #e1edf6;
  --side-bg: #0f1e3d; --side-ink: #c5cee0; --side-ink-2: #8492ae; --side-on: #1c3160; --side-line: #1e2f55;
  --c1: #1f3f78; --c2: #b8975a; --c3: #4d8191; --c4: #8a93a8; --c5: #6b5a8c; --c6: #4f8a6c; --c7: #b86f5c; --c8: #3f6fb5;
  --shadow: 0 1px 2px rgba(18, 27, 45, .05), 0 4px 14px rgba(18, 27, 45, .05);
  --shadow-2: 0 12px 40px rgba(12, 20, 40, .22);
  --r: 8px; --r-sm: 6px; --r-lg: 12px;
  --font: 'Manrope', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #121b2e; --surface-2: #18233a; --surface-3: #1f2c47;
    --line: #232f49; --line-2: #33405e;
    --ink: #e7ebf3; --ink-2: #aab4c8; --ink-3: #8390a8;
    --brand: #3d66b0; --brand-2: #5b83cc; --brand-soft: #1a2a4b; --on-brand: #ffffff;
    --gold: #d0b37c; --gold-2: #b8975a; --gold-soft: #2c2616;
    --ok: #5cc09a; --ok-soft: #12302a; --warn: #e0ad55; --warn-soft: #33290f;
    --bad: #ea8a80; --bad-soft: #3a1a18; --info: #7cb5e2; --info-soft: #13293d;
    --side-bg: #080e1b; --side-ink: #c5cee0; --side-ink-2: #7d8aa5; --side-on: #17264a; --side-line: #16213a;
    --c1: #6d95dc; --c2: #d0b37c; --c3: #6fb0c2; --c4: #8e99b0; --c5: #a08fc7; --c6: #6dbd95; --c7: #dc917d; --c8: #8fb4ee;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    --shadow-2: 0 12px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #121b2e; --surface-2: #18233a; --surface-3: #1f2c47;
  --line: #232f49; --line-2: #33405e;
  --ink: #e7ebf3; --ink-2: #aab4c8; --ink-3: #8390a8;
  --brand: #3d66b0; --brand-2: #5b83cc; --brand-soft: #1a2a4b; --on-brand: #ffffff;
  --gold: #d0b37c; --gold-2: #b8975a; --gold-soft: #2c2616;
  --ok: #5cc09a; --ok-soft: #12302a; --warn: #e0ad55; --warn-soft: #33290f;
  --bad: #ea8a80; --bad-soft: #3a1a18; --info: #7cb5e2; --info-soft: #13293d;
  --side-bg: #080e1b; --side-ink: #c5cee0; --side-ink-2: #7d8aa5; --side-on: #17264a; --side-line: #16213a;
  --c1: #6d95dc; --c2: #d0b37c; --c3: #6fb0c2; --c4: #8e99b0; --c5: #a08fc7; --c6: #6dbd95; --c7: #dc917d; --c8: #8fb4ee;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-2: 0 12px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 500 13.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; } h4 { font-size: 13px; }
p { margin: 0 0 8px; }
a { color: var(--brand-2); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--gold-soft); color: var(--ink); }
.num, td.r, .kpi b { font-variant-numeric: tabular-nums; }
.boot { padding: 60px; color: var(--ink-3); }
#app { height: 100%; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100%; }
.shell.collapsed { grid-template-columns: 60px minmax(0, 1fr); }
.side { background: var(--side-bg); color: var(--side-ink); display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--side-line); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; min-height: 56px; }
.logo { width: 30px; height: 30px; border-radius: 7px; background: linear-gradient(145deg, #23407a, #142850); border: 1px solid #34508c; display: grid; place-items: center; flex: none; color: var(--gold-2); }
.logo svg { width: 18px; height: 18px; }
.side-brand b { color: #fff; font-size: 15px; font-weight: 800; letter-spacing: -.02em; display: block; line-height: 1.1; }
.side-brand small { color: var(--side-ink-2); font-size: 10.5px; }
.side-scroll { flex: 1; overflow-y: auto; padding: 4px 8px 12px; scrollbar-width: thin; scrollbar-color: #2a3c66 transparent; }
.nav-head { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; color: var(--side-ink-2); font-size: 11px; font-weight: 700; padding: 12px 8px 5px; cursor: pointer; letter-spacing: .02em; }
.nav-head svg { width: 12px; height: 12px; transition: transform .15s; }
.nav-head.shut svg { transform: rotate(-90deg); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 6px; color: var(--side-ink); font-weight: 600; font-size: 13px; position: relative; white-space: nowrap; }
.nav-item:hover { background: #ffffff0d; text-decoration: none; color: #fff; }
.nav-item.on { background: var(--side-on); color: #fff; }
.nav-item.on::before { content: ''; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-2); }
.nav-item svg { width: 16px; height: 16px; flex: none; opacity: .9; }
.nav-item .cnt { margin-left: auto; background: #ffffff18; color: #fff; font-size: 10.5px; padding: 0 6px; border-radius: 9px; font-weight: 700; }
.shell.collapsed .side-brand div, .shell.collapsed .nav-head, .shell.collapsed .nav-item span, .shell.collapsed .side-foot span, .shell.collapsed .nav-item .cnt { display: none; }
.shell.collapsed .nav-item { justify-content: center; padding: 9px 0; }
.side-foot { border-top: 1px solid var(--side-line); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.side-foot .nav-item { font-size: 12px; color: var(--side-ink-2); cursor: pointer; background: none; border: 0; width: 100%; text-align: left; }
.col { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.top { display: flex; align-items: center; gap: 8px; padding: 0 16px; height: 56px; background: var(--surface); border-bottom: 1px solid var(--line); flex: none; position: relative; z-index: 20; }
.top-l, .top-r { display: flex; align-items: center; gap: 6px; min-width: 0; }
.top-r { margin-left: auto; }
.switch { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 5px 9px; cursor: pointer; font-weight: 600; max-width: 210px; white-space: nowrap; }
.switch:hover { border-color: var(--line-2); background: var(--surface-2); }
.switch span { overflow: hidden; text-overflow: ellipsis; }
.switch svg { width: 13px; height: 13px; flex: none; color: var(--ink-3); }
.orgmark { font-style: normal; width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; flex: none; }
.search { position: relative; flex: 1; max-width: 340px; min-width: 120px; }
.search input { width: 100%; padding: 7px 10px 7px 32px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.search input:focus { background: var(--surface); border-color: var(--brand-2); outline: 0; }
.search > svg { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--ink-3); }
.ibtn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; color: var(--ink-2); position: relative; flex: none; }
.ibtn:hover { background: var(--surface-2); color: var(--ink); }
.ibtn svg { width: 17px; height: 17px; }
.ibtn .dot { position: absolute; top: 5px; right: 4px; min-width: 15px; height: 15px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 9.5px; font-weight: 800; display: grid; place-items: center; padding: 0 3px; }
.main { flex: 1; overflow: auto; min-height: 0; }
.page { padding: 18px 22px 40px; max-width: 1560px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; max-width: 78ch; }
.page-head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 6px 16px; font-size: 12px; font-weight: 600; flex: none; }
.banner.sim { background: var(--gold-soft); color: var(--ink-2); border-bottom: 1px solid var(--line); }
.banner.support { background: var(--bad-soft); color: var(--bad); }
.banner.announce { background: var(--info-soft); color: var(--info); }
.banner svg { width: 14px; height: 14px; flex: none; }
.banner .sp { flex: 1; }

/* ---------- Popovers ---------- */
.pop-wrap { position: relative; }
.pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 6px; max-height: 72vh; overflow: auto; }
.pop.right { left: auto; right: 0; }
.pop.wide { width: 360px; }
.pop h4 { padding: 8px 10px 4px; font-size: 11px; color: var(--ink-3); }
.pop-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; cursor: pointer; width: 100%; border: 0; background: none; text-align: left; color: var(--ink); }
.pop-item:hover { background: var(--surface-2); text-decoration: none; }
.pop-item.on { background: var(--brand-soft); }
.pop-item small { display: block; color: var(--ink-3); font-size: 11.5px; font-weight: 500; }
.pop-item svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* ---------- Primitives ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.3; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn svg { width: 14px; height: 14px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-2); }
.btn.gold { background: var(--gold-soft); border-color: var(--gold-2); color: var(--ink); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.card.pad, .card-b { padding: 14px 16px; }
.card-h { flex-wrap: wrap; display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-bottom: 1px solid var(--line); min-height: 46px; }
.card-h h3 { font-size: 13.5px; }
.card-h .sp, .row .sp { flex: 1; }
.card-h small { color: var(--ink-3); font-weight: 500; }
.grid { display: grid; gap: 14px; }
.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)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.row.nowrap { flex-wrap: nowrap; }
.muted { color: var(--ink-3); } .small { font-size: 12px; } .b { font-weight: 700; } .r { text-align: right; } .c { text-align: center; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; } .mt-s { margin-top: 8px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.info { background: var(--info-soft); color: var(--info); }
.pill.gold { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-2); } .pill.brand { background: var(--brand-soft); color: var(--brand-2); }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 10.5px; font-weight: 700; border: 1px dashed var(--line-2); color: var(--ink-3); vertical-align: middle; white-space: nowrap; }
.tag.sim { border-color: var(--gold-2); color: var(--gold); } .tag.future { border-color: var(--info); color: var(--info); } .tag.mvp { border-color: var(--ok); color: var(--ok); border-style: solid; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-2); display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 800; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.who { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 5px; background: var(--surface-2); font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.chip button { border: 0; background: none; cursor: pointer; padding: 0 0 0 2px; color: var(--ink-3); }
.empty { padding: 34px 16px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }
.note { padding: 9px 12px; border-radius: var(--r-sm); background: var(--info-soft); color: var(--ink-2); font-size: 12.5px; border-left: 3px solid var(--info); }
.note.warn { background: var(--warn-soft); border-color: var(--warn); } .note.gold { background: var(--gold-soft); border-color: var(--gold-2); } .note.bad { background: var(--bad-soft); border-color: var(--bad); }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
dl { margin: 0; }
.meter { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand-2); border-radius: 4px; }
.meter.warn i { background: var(--warn); } .meter.bad i { background: var(--bad); } .meter.gold i { background: var(--gold-2); }
.list > * { padding: 9px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.list > *:last-child { border-bottom: 0; }
.list a.li:hover { background: var(--surface-2); text-decoration: none; }
.li { color: var(--ink); } .li > div { min-width: 0; flex: 1; } .li small { color: var(--ink-3); display: block; }
.dotc { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 13px; display: block; color: var(--ink); position: relative; }
a.kpi:hover { border-color: var(--line-2); text-decoration: none; box-shadow: var(--shadow); }
.kpi span { color: var(--ink-3); font-size: 12px; font-weight: 600; display: block; }
.kpi b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; display: block; }
.kpi em { font-style: normal; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.kpi em.up { color: var(--ok); } .kpi em.down { color: var(--bad); }
.kpi.alert { border-left: 3px solid var(--bad); } .kpi.gold { border-left: 3px solid var(--gold-2); }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; color: var(--ink-3); font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; position: sticky; top: 0; }
.tbl th.sortable { cursor: pointer; } .tbl th.sortable:hover { color: var(--ink); }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.go { cursor: pointer; } .tbl tbody tr.go:hover { background: var(--surface-2); }
.tbl td small { display: block; color: var(--ink-3); }
.tbl-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; }
.toolbar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.toolbar .inp, .toolbar .sel { width: auto; min-width: 130px; }

/* Forms */
.inp, .sel, textarea.inp { width: 100%; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); min-height: 34px; }
.inp:focus, .sel:focus { border-color: var(--brand-2); outline: 0; box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.inp { min-height: 74px; resize: vertical; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .lbl { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--ink-3); }
.field .err { font-size: 11.5px; color: var(--bad); font-weight: 600; }
.req { color: var(--bad); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 600; }
.check input { width: 15px; height: 15px; accent-color: var(--brand-2); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; font-weight: 600; color: var(--ink-2); border-right: 1px solid var(--line); display: inline-flex; gap: 6px; align-items: center; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brand); color: var(--on-brand); }
.seg button svg { width: 14px; height: 14px; }
.toggle { position: relative; width: 34px; height: 19px; flex: none; display: inline-block; }
.toggle input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.toggle i { position: absolute; inset: 0; background: var(--line-2); border-radius: 10px; transition: background .15s; }
.toggle i::after { content: ''; position: absolute; width: 15px; height: 15px; left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + i { background: var(--ok); } .toggle input:checked + i::after { transform: translateX(15px); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 8px 12px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--gold-2); }
.tab .cnt { background: var(--surface-3); border-radius: 9px; padding: 0 6px; font-size: 11px; }

/* ---------- Overlays ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(8, 14, 28, .5); z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2); width: 520px; max-width: 100%; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; border: 1px solid var(--line); }
.modal.lg { width: 780px; } .modal.xl { width: 1080px; } .modal.full { width: 1320px; height: 92vh; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-h h2 { flex: 1; }
.modal-b { padding: 16px 18px; overflow: auto; flex: 1; min-height: 0; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.drawer-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100vw; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-2); z-index: 150; display: flex; flex-direction: column; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #101a30; color: #fff; padding: 9px 14px; border-radius: 8px; box-shadow: var(--shadow-2); font-weight: 600; display: flex; gap: 8px; align-items: center; max-width: 86vw; border: 1px solid #2a3a60; animation: tin .18s ease-out; }
.toast svg { width: 15px; height: 15px; color: #7fd1ae; flex: none; }
.toast.bad svg { color: #f0a097; } .toast.warn svg { color: #e9c172; }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } }
.busy { position: fixed; inset: 0; z-index: 300; background: rgba(8, 14, 28, .35); display: grid; place-items: center; }
.busy > div { background: var(--surface); padding: 18px 24px; border-radius: var(--r-lg); box-shadow: var(--shadow-2); display: flex; gap: 12px; align-items: center; font-weight: 600; border: 1px solid var(--line); }
.spin { width: 18px; height: 18px; border: 2.5px solid var(--line-2); border-top-color: var(--brand-2); border-radius: 50%; animation: sp .7s linear infinite; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }

/* Charts */
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--ink-3); font: 600 11px var(--font); }
.li > svg, .row > span > svg, .note svg { flex: none; color: var(--ink-3); }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--ink-2); margin-top: 6px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

/* Lifecycle rail: the gold thread */
.rail { display: flex; align-items: flex-start; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: thin; }
.rail .st { flex: 1 0 86px; text-align: center; position: relative; font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 0 4px; line-height: 1.25; }
.rail .st::before { content: ''; position: absolute; top: 8px; left: -50%; right: 50%; height: 2px; background: var(--line-2); }
.rail .st:first-child::before { display: none; }
.rail .st i { display: block; width: 18px; height: 18px; border-radius: 50%; margin: 0 auto 6px; background: var(--surface); border: 2px solid var(--line-2); position: relative; z-index: 1; }
.rail .st.done::before, .rail .st.now::before { background: var(--gold-2); }
.rail .st.done i { background: var(--gold-2); border-color: var(--gold-2); }
.rail .st.done { color: var(--ink-2); }
.rail .st.now i { border-color: var(--gold-2); box-shadow: 0 0 0 4px var(--gold-soft); background: var(--surface); }
.rail .st.now i::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }
.rail .st.now { color: var(--ink); font-weight: 800; }

/* Timeline */
.tl { position: relative; padding-left: 18px; }
.tl::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl > div { position: relative; padding: 0 0 12px; }
.tl > div::before { content: ''; position: absolute; left: -18px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--gold-2); }
.tl small { color: var(--ink-3); display: block; }

/* Responsive */
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .hide-md { display: none !important; } }
@media (max-width: 900px) {
  .shell, .shell.collapsed { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 120; top: 0; bottom: 0; left: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: var(--shadow-2); }
  .shell.collapsed .side-brand div, .shell.collapsed .nav-head, .shell.collapsed .nav-item span { display: revert; }
  .g2, .g3, .g-21, .g-12, .form-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 14px 16px 40px; }
  .hide-sm { display: none !important; }
  .top .switch { max-width: 132px; padding: 5px 7px; } .top-r { gap: 2px; } .shell.platform .top > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .top { padding: 0 10px; }
}
@media (min-width: 901px) { .only-sm { display: none !important; } }

/* Print */
#print-root { display: none; }
@media print {
  body { overflow: visible; background: #fff; }
  #app, #drawer, #modal, #coach, #toasts { display: none !important; }
  #print-root { display: block; }
}
