/* Launch Engine — Command Panel. No framework, no CDN. */
:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --raised: #ffffff;
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781;
  --grid: #e1e0d9; --axis: #c3c2b7; --line: rgba(11,11,11,0.10);
  --accent: #2a78d6; --accent-ink: #ffffff; --accent-wash: #e8f1fc;
  --good: #0ca30c; --good-ink: #006300; --good-wash: #e7f5e7;
  --warning: #fab219; --warning-ink: #7a5200; --warning-wash: #fdf3dc;
  --serious: #ec835a; --critical: #d03b3b; --critical-ink: #a32424; --critical-wash: #fbe9e9;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  --plan: #898781;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --raised: #222221;
    --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --line: rgba(255,255,255,0.10);
    --accent: #3987e5; --accent-wash: #16263a;
    --good-ink: #0ca30c; --good-wash: #10240f; --warning-ink: #fab219; --warning-wash: #2b2310;
    --critical-ink: #e66767; --critical-wash: #2c1414;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --raised: #222221;
  --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --line: rgba(255,255,255,0.10);
  --accent: #3987e5; --accent-wash: #16263a;
  --good-ink: #0ca30c; --good-wash: #10240f; --warning-ink: #fab219; --warning-wash: #2b2310;
  --critical-ink: #e66767; --critical-wash: #2c1414;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.25; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 650; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .ink2 { color: var(--ink-2); }
.small { font-size: 13px; } .tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell */
.banner { padding: 8px 16px; font-size: 13px; text-align: center; border-bottom: 1px solid var(--line); }
.banner.paused { background: #0b0b0b; color: #ffffff; border-color: #333; }
.banner.test { background: var(--warning-wash); color: var(--warning-ink); }
.banner.fiction { background: var(--accent-wash); color: var(--ink-2); }
header.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 16px; min-height: 56px; }
.brand { font-weight: 700; color: var(--ink); white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.brand svg { width: 22px; height: 22px; }
.brand small { font-weight: 500; color: var(--muted); }
nav.main { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.top-in { flex-wrap: wrap; row-gap: 0; }
.who { margin-left: auto; }
nav.main { order: 3; flex-basis: 100%; padding-bottom: 8px; margin: 0 -10px; }
.subnav { display: flex; gap: 6px; margin: -6px 0 16px; flex-wrap: wrap; }
.subnav a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; background: var(--surface); }
.subnav a.on { background: var(--accent-wash); color: var(--ink); font-weight: 600; border-color: transparent; }
nav.main::-webkit-scrollbar { display: none; }
nav.main a { color: var(--ink-2); padding: 8px 10px; border-radius: 8px; white-space: nowrap; font-size: 14px; }
nav.main a:hover { background: var(--page); text-decoration: none; }
nav.main a.on { color: var(--ink); background: var(--accent-wash); font-weight: 600; }
.count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--warning); color: #111; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 64px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead p { color: var(--ink-2); margin: 0; }

/* ---------- layout */
.grid { display: grid; gap: 16px; }
.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; }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g2 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }
@media (max-width: 560px) { .g3, .g4 { grid-template-columns: 1fr; } .who span { display: none; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card.flat { background: transparent; border-style: dashed; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.card-h h2 { margin: 0; }
.stack > * + * { margin-top: 16px; }

/* ---------- hero */
.hero { display: grid; grid-template-columns: auto auto 1fr; gap: 24px; align-items: center; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr 1fr; } .hero .verdict { grid-column: span 2; } }
.ring { position: relative; width: 148px; text-align: center; }
.ring svg { width: 128px; height: 128px; display: block; margin: 0 auto; }
.ring-bg { fill: none; stroke: var(--grid); stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; }
.ring-txt { position: absolute; top: 40px; left: 0; right: 0; display: flex; flex-direction: column; }
.ring-v { font-size: 30px; font-weight: 700; line-height: 1.1; }
.ring-t { font-size: 12px; color: var(--muted); }
.ring-l { font-weight: 600; margin-top: 6px; font-size: 14px; }
.ring-s { font-size: 12px; color: var(--muted); }
.verdict .pill { font-size: 14px; }
.big { font-size: 28px; font-weight: 700; line-height: 1.15; }
.kv { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 12px; }
.kv div { min-width: 90px; } .kv b { display: block; font-size: 18px; } .kv span { font-size: 12px; color: var(--muted); }

/* ---------- status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); background: var(--raised); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.good { background: var(--good-wash); color: var(--good-ink); } .pill.good::before { background: var(--good); }
.pill.warning { background: var(--warning-wash); color: var(--warning-ink); } .pill.warning::before { background: var(--warning); }
.pill.critical { background: var(--critical-wash); color: var(--critical-ink); } .pill.critical::before { background: var(--critical); }
.pill.info::before { background: var(--accent); }
.pill.plain::before { display: none; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--page); border: 1px solid var(--line); color: var(--muted); }

/* ---------- charts */
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: var(--grid); stroke-width: 1; }
svg.chart .axis { stroke: var(--axis); stroke-width: 1; }
svg.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg.chart .lbl { fill: var(--ink-2); font-size: 12px; } svg.chart .lbl.muted { fill: var(--muted); } svg.chart .lbl.strong { fill: var(--ink); font-weight: 650; }
svg.chart .target { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 3; }
svg.chart .plan { fill: none; stroke: var(--plan); stroke-width: 2; stroke-dasharray: 6 5; }
svg.chart .actual { fill: none; stroke: var(--s1); stroke-width: 2.5; stroke-linejoin: round; }
svg.chart .actual-dot { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
svg.chart .today { stroke: var(--axis); stroke-width: 1; }
svg.chart .hit { fill: transparent; } svg.chart .hit:hover { fill: var(--ink); fill-opacity: 0.04; }
svg.chart .s1 { fill: var(--s1); } svg.chart .s2 { fill: var(--s2); } svg.chart .s3 { fill: var(--s3); } svg.chart .s4 { fill: var(--s4); } svg.chart .s5 { fill: var(--s5); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.key { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); } .sw.s3 { background: var(--s3); } .sw.s4 { background: var(--s4); } .sw.s5 { background: var(--s5); }
.sw.plan { background: none; border-top: 2px dashed var(--plan); height: 0; width: 16px; border-radius: 0; }

/* funnel bars */
.fun { display: grid; gap: 10px; }
.fun-row { display: grid; grid-template-columns: 130px 1fr 150px; gap: 12px; align-items: center; }
@media (max-width: 640px) { .fun-row { grid-template-columns: 96px 1fr; } .fun-row .fun-r { grid-column: 2; } }
.fun-bar { height: 22px; background: var(--page); border-radius: 4px; overflow: hidden; }
.fun-bar i { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; min-width: 2px; }
.fun-bar.outbound i { background: var(--s2); } .fun-bar.waitlist i { background: var(--s3); }
.fun-r { font-size: 13px; color: var(--ink-2); }
.meter { height: 6px; background: var(--grid); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }

/* ---------- lists / tables */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.list li:first-child { border-top: 0; padding-top: 2px; }
.list .t { font-weight: 600; } .list .d { font-size: 13px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.p1 { background: var(--critical); } .dot.p2 { background: var(--warning); } .dot.p3 { background: var(--muted); }
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--page); }
.clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* ---------- forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); font: 600 14px var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--axis); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--critical-ink); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); font: 14px var(--font); }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--ink-2); }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toggle { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.toggle:first-of-type { border-top: 0; }
.toggle input { margin-top: 4px; }
.toggle b { display: block; } .toggle span { font-size: 13px; color: var(--muted); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid var(--line); }
.flash.good { background: var(--good-wash); color: var(--good-ink); } .flash.critical { background: var(--critical-wash); color: var(--critical-ink); }
.flash.neutral { background: var(--surface); }

/* ---------- email preview + thread */
.email { background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; white-space: pre-wrap; font-size: 14px; line-height: 1.55; }
.email .subj { font-weight: 650; margin-bottom: 8px; white-space: normal; }
.thread { display: grid; gap: 12px; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--raised); max-width: 92%; }
.msg.out { justify-self: end; background: var(--accent-wash); }
.msg .meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.msg .body { white-space: pre-wrap; }
.draft { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; font-size: 13px; }
details summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
pre.yaml { background: var(--page); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; font-size: 12px; max-height: 420px; }

/* week plan */
.weeks { display: grid; gap: 12px; }
.week { display: grid; grid-template-columns: 90px 1fr; gap: 12px; }
.week .wk { font-weight: 650; padding-top: 10px; } .week .wk small { display: block; font-weight: 400; color: var(--muted); }
.week.now .wk { color: var(--accent); }
.task { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); margin-bottom: 6px; }
.task.done .tt { color: var(--muted); text-decoration: line-through; }
.task form { display: flex; gap: 4px; }

/* public pages */
.public { max-width: 560px; margin: 48px auto; padding: 0 16px; }
.public .card { padding: 28px; }
.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 24px 16px; }
