/* Personal Dashboard — antjanus.com as an operator console.
   Tokens: primitives are inlined per theme; components only read semantic roles. */

:root {
  color-scheme: light;
  --ground: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --border: #d3dae3;
  --ink: #111820;
  --text: #2a3542;
  --dim: #505c6b;
  --accent: #364f6a;
  --accent-hover: #2a3f54;
  --accent-ink: #ffffff;
  --accent-soft: #e2e9f1;
  --focus: #1f63d6;
  --s-ai: #6a3bcf;
  --s-garden: #13704f;
  --s-tools: #875c00;
  --s-story: #b03a29;
  --s-pattern: #2d5c93;
  --live: #b04d06;
  --ok: #1c6e52;
  --h0: #e2e7ee;
  --h1: #bfd0e4;
  --h2: #86a6cc;
  --h3: #4f79ab;
  --h4: #274a74;
  --code-bg: #0f151d;
  --code-ink: #dbe4ee;
  --code-dim: #8d9bab;
  --code-key: #c4a5ff;
  --code-str: #8fd6b1;
  --shadow: 0 1px 0 rgba(17, 24, 32, 0.04), 0 4px 16px -8px rgba(17, 24, 32, 0.12);
  --radius: 10px;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --cond: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0a0f15;
    --surface: #111821;
    --surface-2: #17202b;
    --border: #25303d;
    --ink: #eef3f8;
    --text: #c8d2dd;
    --dim: #97a5b5;
    --accent: #86a9d1;
    --accent-hover: #a5c2e3;
    --accent-ink: #0a0f15;
    --accent-soft: #1a2838;
    --focus: #8cc2ff;
    --s-ai: #b5a0ff;
    --s-garden: #54c99d;
    --s-tools: #e2b84f;
    --s-story: #f29081;
    --s-pattern: #7fb2e8;
    --live: #f3a651;
    --ok: #54c99d;
    --h0: #19222d;
    --h1: #1e3a5a;
    --h2: #2d5a89;
    --h3: #4c87c3;
    --h4: #93c3f3;
    --code-bg: #080c11;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 6px 18px -10px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0a0f15;
  --surface: #111821;
  --surface-2: #17202b;
  --border: #25303d;
  --ink: #eef3f8;
  --text: #c8d2dd;
  --dim: #97a5b5;
  --accent: #86a9d1;
  --accent-hover: #a5c2e3;
  --accent-ink: #0a0f15;
  --accent-soft: #1a2838;
  --focus: #8cc2ff;
  --s-ai: #b5a0ff;
  --s-garden: #54c99d;
  --s-tools: #e2b84f;
  --s-story: #f29081;
  --s-pattern: #7fb2e8;
  --live: #f3a651;
  --ok: #54c99d;
  --h0: #19222d;
  --h1: #1e3a5a;
  --h2: #2d5a89;
  --h3: #4c87c3;
  --h4: #93c3f3;
  --code-bg: #080c11;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 6px 18px -10px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { color: var(--ink); margin: 0; line-height: 1.2; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--surface) 255px, var(--border) 255px, var(--border) 256px, transparent 256px); }
.dash > div > .panel { height: 100%; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; text-decoration: none; color: var(--ink); }
.brand svg { flex: none; }
.brand b { display: block; font-family: var(--cond); font-size: 1.125rem; letter-spacing: 0.01em; }
.brand span { display: block; font-family: var(--mono); font-size: 0.8125rem; color: var(--dim); }
.nav-label { font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); padding: 14px 10px 6px; }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 10px;
  border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500;
  border-left: 3px solid transparent; transition: background 150ms, color 150ms;
}
.nav a svg { flex: none; opacity: 0.8; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
.nav .count { margin-left: auto; font-family: var(--mono); font-size: 0.8125rem; color: var(--dim); }
.nav .ext { margin-left: auto; font-size: 0.8125rem; color: var(--dim); }
.side-foot { margin-top: auto; padding: 16px 10px 4px; border-top: 1px solid var(--border); font-size: 0.875rem; color: var(--dim); }
.side-foot .status { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; margin-bottom: 4px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2.4s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 10px 28px; min-height: 64px;
  background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.crumbs { font-family: var(--mono); font-size: 0.875rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.crumbs b { color: var(--ink); font-weight: 600; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; height: 42px; width: 260px; }
.search input { border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 0.9375rem; width: 100%; min-width: 0; }
.search input::placeholder { color: var(--dim); }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
kbd { font-family: var(--mono); font-size: 0.8125rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--dim); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; }
}

.content { padding: 28px; width: 100%; max-width: 1440px; margin: 0 auto; flex: 1; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 28px; margin-bottom: 22px; }
.eyebrow { font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.page-title { font-family: var(--cond); font-weight: 700; font-size: clamp(2rem, 3.4vw, 3rem); letter-spacing: -0.01em; }
.page-sub { font-size: 1.1875rem; color: var(--text); max-width: 62ch; margin-top: 10px; margin-bottom: 0; }
.range { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.range span, .range a { font-family: var(--mono); font-size: 0.8125rem; padding: 9px 12px; color: var(--dim); text-decoration: none; border-right: 1px solid var(--border); }
.range :last-child { border-right: 0; }
.range .on { background: var(--accent-soft); color: var(--ink); font-weight: 600; }

/* ---------- Dashboard grid & panels ---------- */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.s-3 { grid-column: span 3; } .s-4 { grid-column: span 4; } .s-5 { grid-column: span 5; } .s-6 { grid-column: span 6; }
.s-7 { grid-column: span 7; } .s-8 { grid-column: span 8; } .s-9 { grid-column: span 9; } .s-12 { grid-column: span 12; }
@media (max-width: 1180px) {
  .s-3 { grid-column: span 6; } .s-4, .s-5 { grid-column: span 6; } .s-6 { grid-column: span 6; }
  .s-7, .s-8, .s-9 { grid-column: span 12; }
  .s-4.wide-md, .s-5.wide-md { grid-column: span 12; }
}
@media (max-width: 760px) { .dash > * { grid-column: span 12; } }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.panel-title { font-family: var(--mono); font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); margin: 0; }
.panel-head .meta { font-family: var(--mono); font-size: 0.8125rem; color: var(--dim); }
.panel-head .more { margin-left: auto; font-size: 0.9375rem; font-weight: 500; text-decoration: none; }
.panel-head .more:hover { text-decoration: underline; }
.panel-body { padding: 18px; flex: 1; }
.panel-body.flush { padding: 0; }
.panel-foot { padding: 11px 18px; border-top: 1px solid var(--border); font-size: 0.875rem; color: var(--dim); }
.panel.dark { background: #111a25; border-color: #26344a; color: #cbd6e3; }
.panel.dark .panel-title, .panel.dark h2, .panel.dark h3 { color: #f1f5f9; }
.panel.dark .panel-head { border-color: #26344a; }
.panel.dark a { color: #9fc4ee; }
.panel.dark .dim { color: #9cabbd; }

/* ---------- KPI strip (hairline, grid-gap separators) ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow); }
.kpi { background: var(--surface); padding: 15px 18px 14px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kpi .label { font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--dim); }
.kpi .value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 2rem; font-weight: 600; color: var(--ink); line-height: 1.15; letter-spacing: -0.02em; }
.kpi .value small { font-size: 1rem; font-weight: 500; color: var(--dim); margin-left: 4px; }
.kpi .sub { font-size: 0.875rem; color: var(--dim); }
.kpi svg.spark { width: 100%; height: 28px; margin-top: 6px; overflow: visible; }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.spark .area { fill: color-mix(in srgb, var(--accent) 16%, transparent); stroke: none; }
.spark .end { fill: var(--live); }
.delta { font-family: var(--mono); font-size: 0.8125rem; color: var(--ok); }

/* ---------- Hero / profile ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.hero-main { padding: 28px 30px; justify-content: center; }
.hero-main h1 { font-family: var(--cond); font-weight: 700; font-size: clamp(2.1rem, 3.8vw, 3.4rem); letter-spacing: -0.015em; line-height: 1.05; max-width: 16ch; }
.hero-main .lede { font-size: 1.1875rem; margin: 16px 0 22px; max-width: 54ch; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 8px; font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background 150ms, border-color 150ms; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.link-2 { font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--accent); min-height: 44px; display: inline-flex; align-items: center; }
.link-3 { color: var(--dim); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.link-3:hover { color: var(--ink); text-decoration: underline; }
.operator { position: relative; overflow: hidden; min-height: 340px; padding: 0; }
.operator img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 25%; }
.operator::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 10, 15, 0) 35%, rgba(6, 10, 15, 0.88) 100%); }
.operator .readout { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 18px 20px; color: #eef3f8; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.operator .readout div { min-width: 0; }
.operator .readout dt { font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.07em; color: #b9c7d6; }
.operator .readout dd { margin: 0; font-weight: 600; font-size: 1rem; }
.operator .tag-live { position: absolute; z-index: 1; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 8px; background: rgba(6, 10, 15, 0.78); color: #eef3f8; font-family: var(--mono); font-size: 0.8125rem; padding: 6px 10px; border-radius: 999px; }
@media (max-width: 980px) { .hero { grid-template-columns: 1fr; } .operator { min-height: 380px; } }

/* ---------- Charts ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.875rem; color: var(--text); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; flex: none; display: inline-block; }
.c-ai { background: var(--s-ai); } .c-garden { background: var(--s-garden); } .c-tools { background: var(--s-tools); }
.c-story { background: var(--s-story); } .c-pattern { background: var(--s-pattern); } .c-accent { background: var(--accent); }

.vbars { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; height: 200px; align-items: end; padding-top: 18px; margin-top: 8px;
  background-image: linear-gradient(to top, var(--border) 1px, transparent 1px); background-size: 100% 25%; background-position: 0 100%; }
.vbar { height: 100%; display: flex; flex-direction: column-reverse; position: relative; min-width: 0; }
.vbar .seg { width: 100%; min-height: 0; }
.vbar .v { position: absolute; left: 0; right: 0; text-align: center; font-family: var(--mono); font-size: 0.8125rem; color: var(--ink); font-weight: 600; padding-bottom: 3px; }
.vaxis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; border-top: 1px solid var(--dim); padding-top: 6px; }
.vaxis span { text-align: center; font-family: var(--mono); font-size: 0.8125rem; color: var(--dim); }

.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 3.5rem; gap: 12px; align-items: center; font-size: 0.9375rem; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.hbar .lbl a { color: inherit; text-decoration: none; } .hbar .lbl a:hover { text-decoration: underline; }
.hbar .track { height: 12px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--accent); border-radius: 3px; }
.hbar .val { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); font-weight: 600; }
@media (max-width: 520px) { .hbar { grid-template-columns: minmax(0, 8rem) minmax(0, 1fr) 3rem; } }

/* heatmap */
.heat-wrap { overflow-x: auto; padding-bottom: 4px; }
.heat { display: block; width: 100%; min-width: 560px; height: auto; }
.heat text { font-family: var(--mono); font-size: 9px; fill: var(--dim); }
.heat rect { fill: var(--h0); rx: 1.5; }
.heat[data-mode="all"] rect[data-la="1"], .heat[data-mode="articles"] rect[data-lx="1"], .heat[data-mode="patterns"] rect[data-lp="1"] { fill: var(--h1); }
.heat[data-mode="all"] rect[data-la="2"], .heat[data-mode="articles"] rect[data-lx="2"], .heat[data-mode="patterns"] rect[data-lp="2"] { fill: var(--h2); }
.heat[data-mode="all"] rect[data-la="3"], .heat[data-mode="articles"] rect[data-lx="3"], .heat[data-mode="patterns"] rect[data-lp="3"] { fill: var(--h3); }
.heat[data-mode="all"] rect[data-la="4"], .heat[data-mode="articles"] rect[data-lx="4"], .heat[data-mode="patterns"] rect[data-lp="4"] { fill: var(--h4); }
.heat rect.today { stroke: var(--live); stroke-width: 1.4; }
.heat-scale { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8125rem; color: var(--dim); font-family: var(--mono); }
.heat-scale i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.seg-ctl { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-ctl button { font: inherit; font-family: var(--mono); font-size: 0.8125rem; background: var(--surface); color: var(--dim); border: 0; border-right: 1px solid var(--border); padding: 0 12px; min-height: 36px; cursor: pointer; }
.seg-ctl button:last-child { border-right: 0; }
.seg-ctl button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.seg-ctl button:hover { color: var(--ink); }

/* meter / bullet graph */
.bullet { position: relative; height: 18px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bullet .q { position: absolute; top: 0; bottom: 0; left: 0; background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); }
.bullet .bar { position: absolute; top: 5px; bottom: 5px; left: 0; background: var(--accent); border-radius: 2px; }
.bullet .target { position: absolute; top: 2px; bottom: 2px; width: 3px; background: var(--ink); }

/* series progress marks */
.marks { display: flex; gap: 6px; }
.marks i { width: 22px; height: 10px; border-radius: 2px; background: var(--s-story); display: inline-block; }
.marks i.todo { background: transparent; border: 1.5px dashed var(--dim); }

/* gantt */
.gantt { display: grid; gap: 8px; }
.g-row { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: 12px; align-items: center; }
.g-row .who { font-size: 0.9375rem; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-row .who small { display: block; font-family: var(--mono); font-size: 0.8125rem; color: var(--dim); font-weight: 400; }
.g-track { position: relative; height: 22px; background: repeating-linear-gradient(to right, var(--surface-2) 0, var(--surface-2) calc(100% / 16 - 1px), var(--border) calc(100% / 16 - 1px), var(--border) calc(100% / 16)); border-radius: 3px; }
.g-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; background: var(--accent); }
.g-bar.now { background: var(--live); }
.g-axis { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: 12px; }
.g-axis div { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.8125rem; color: var(--dim); }
@media (max-width: 600px) { .g-row, .g-axis { grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr); } .g-axis .hide-xs { display: none; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.data th { text-align: left; font-family: var(--mono); font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.data td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data tr:last-child td { border-bottom: 0; }
.data tbody tr:hover td { background: var(--surface-2); }
.data .t-title a { color: var(--ink); font-weight: 600; text-decoration: none; }
.data .t-title a:hover { text-decoration: underline; color: var(--accent); }
.data .t-title p { margin: 3px 0 0; color: var(--dim); font-size: 0.9375rem; }
.data .t-date { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--dim); font-size: 0.875rem; }
.data .t-num { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.data th.t-num { text-align: right; }
.data th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.data th button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 760px) { .hide-sm { display: none; } }

/* ---------- Chips, pills, badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.8125rem; padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); background: var(--surface); text-decoration: none; white-space: nowrap; }
a.chip:hover { border-color: var(--accent); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.coll { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.8125rem; color: var(--text); white-space: nowrap; }
.badge { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 0.8125rem; font-weight: 600; padding: 1px 8px; border-radius: 4px; border: 1px solid currentColor; }
.badge.new { color: var(--live); }
.badge.upd { color: var(--s-pattern); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter { font: inherit; font-size: 0.9375rem; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.filter:hover { border-color: var(--accent); color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.filter .n { font-family: var(--mono); font-size: 0.8125rem; opacity: 0.85; }

/* ---------- Feed / event log ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 6.2rem 14px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 0.9375rem; }
.feed li:last-child { border-bottom: 0; }
.feed time { font-family: var(--mono); font-size: 0.8125rem; color: var(--dim); padding-top: 2px; }
.feed .dotc { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; }
.feed b { color: var(--ink); font-weight: 600; }
.feed a { color: var(--ink); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color 150ms, transform 150ms; }
.card:hover { border-color: var(--accent); }
.card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.card .thumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--surface-2), var(--accent-soft)); overflow: hidden; border-bottom: 1px solid var(--border); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card h3 a:focus-visible { outline: none; }
.card p { margin: 0; font-size: 0.9375rem; color: var(--text); }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card .cfoot { margin-top: auto; padding-top: 8px; }

/* compact tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--border); }
.tile { background: var(--surface); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.tile h3 { font-size: 1.0625rem; font-weight: 600; }
.tile h3 a { color: var(--ink); text-decoration: none; }
.tile h3 a::after { content: ""; position: absolute; inset: 0; }
.tile h3 a:hover { text-decoration: underline; }
.tile p { margin: 0; font-size: 0.9375rem; }
.tile .type { font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--dim); }

/* list rows */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.rows li:last-child { border-bottom: 0; }
.rows li:hover { background: var(--surface-2); }
.rows a.t { color: var(--ink); font-weight: 600; text-decoration: none; }
.rows a.t::after { content: ""; position: absolute; inset: 0; }
.rows a.t:hover { text-decoration: underline; }
.rows .d { font-family: var(--mono); font-size: 0.8125rem; color: var(--dim); white-space: nowrap; }
.rows p { grid-column: 1 / -1; margin: 0; font-size: 0.9375rem; color: var(--dim); }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* callout strip */
.strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 18px 22px; border-radius: var(--radius); border: 1px solid var(--border); background: linear-gradient(90deg, var(--accent-soft), var(--surface)); margin-bottom: 16px; }
.strip p { margin: 0; font-size: 1.0625rem; color: var(--ink); font-weight: 500; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--border); background: var(--surface); padding: 28px; }
.foot-grid { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.6fr; gap: 28px; }
.foot h2 { font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); margin-bottom: 10px; font-weight: 600; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.foot ul a { color: var(--text); text-decoration: none; display: inline-block; padding: 3px 0; }
.foot ul a:hover { color: var(--ink); text-decoration: underline; }
.foot .copy { max-width: 1440px; margin: 22px auto 0; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 0.875rem; color: var(--dim); font-family: var(--mono); }
.sub-form { display: flex; gap: 8px; flex-wrap: wrap; }
.sub-form input { flex: 1 1 180px; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); font: inherit; }
.sub-form input::placeholder { color: var(--dim); }
.form-msg { font-size: 0.9375rem; margin: 8px 0 0; min-height: 1.4em; }
@media (max-width: 980px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- Responsive shell ---------- */
@media (max-width: 1020px) {
  .app { grid-template-columns: 1fr; background: none; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--border); gap: 6px; }
  .brand { padding: 4px 0; }
  .nav-label, .side-foot { display: none; }
  .nav { order: 3; width: 100%; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; gap: 4px; padding-bottom: 4px; scrollbar-width: thin; }
  .nav a { border-left: 0; border-bottom: 3px solid transparent; border-radius: 6px 6px 0 0; min-height: 44px; padding: 8px 12px; }
  .nav a[aria-current="page"] { border-bottom-color: var(--accent); }
  .nav .count, .nav .ext { margin-left: 4px; }
  .nav.secondary { display: none; }
  .topbar { padding: 8px 16px; }
  .content { padding: 18px 16px; }
  .search { width: 200px; }
}
@media (max-width: 600px) {
  .search { display: none; }
  .crumbs { font-size: 0.8125rem; }
  .kpi .value { font-size: 1.6rem; }
  .hero-main { padding: 22px 20px; }
  .foot { padding: 24px 16px; }
}
@media (max-width: 420px) { .kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; } }

/* ---------- Article ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; background: transparent; }
.progress span { display: block; height: 100%; width: 0; background: var(--live); }
.art-hero { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-bottom: 16px; min-height: 320px; display: flex; align-items: flex-end; background: #0f151d; }
.art-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 12, 17, 0.25) 0%, rgba(8, 12, 17, 0.92) 85%); }
.art-hero .inner { position: relative; z-index: 1; padding: 28px 30px; color: #e8eef5; max-width: 860px; }
.art-hero .eyebrow { color: #c3d0de; }
.art-hero .eyebrow a { color: #c3d0de; }
.art-hero h1 { color: #fff; font-family: var(--cond); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.08; letter-spacing: -0.01em; }
.art-hero p { font-size: 1.1875rem; margin: 12px 0 0; color: #dbe4ee; }
.art-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.toc { position: sticky; top: 84px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li a { display: grid; grid-template-columns: 1.8rem 1fr; padding: 7px 10px; border-left: 2px solid var(--border); color: var(--text); text-decoration: none; font-size: 0.9375rem; line-height: 1.35; }
.toc li a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); font-family: var(--mono); font-size: 0.8125rem; color: var(--dim); padding-top: 1px; }
.toc li a:hover { color: var(--ink); border-left-color: var(--dim); }
.toc li a[aria-current="true"] { color: var(--ink); font-weight: 600; border-left-color: var(--live); background: var(--surface-2); }
.toc-mobile { display: none; margin-bottom: 16px; }
.toc-mobile summary { cursor: pointer; padding: 12px 16px; font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; color: var(--ink); min-height: 44px; }
.toc-mobile .toc { position: static; padding: 0 12px 12px; }
.telemetry { position: sticky; top: 84px; display: grid; gap: 16px; }
.tele { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.tele div { background: var(--surface); padding: 12px 14px; }
.tele dt { font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); }
.tele dd { margin: 2px 0 0; font-family: var(--mono); font-size: 1.25rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.readbar { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.8125rem; color: var(--dim); }
.readbar .track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.readbar .track span { display: block; height: 100%; width: 0; background: var(--live); }
.prose-panel { padding: 30px 40px 36px; }
.prose { font-size: 1.125rem; line-height: 1.72; color: var(--text); max-width: 720px; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose h2 { font-family: var(--cond); font-size: 1.85rem; font-weight: 700; margin-top: 2.2em; scroll-margin-top: 90px; display: flex; gap: 12px; align-items: baseline; }
.prose h2 .sec { font-family: var(--mono); font-size: 0.875rem; color: var(--dim); font-weight: 500; }
.prose a { color: var(--accent); }
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; color: var(--ink); }
.prose ol, .prose ul { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose blockquote { margin: 1.4em 0 0; padding: 14px 18px; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--surface-2); }
.prose blockquote p { margin: 0; }
.prose blockquote .k { display: block; font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.prose blockquote.why { border-left-color: var(--s-garden); }
.prose blockquote.why .k { color: var(--s-garden); }
.prose blockquote.ask { border-left-color: var(--live); border-style: dashed; border-left-style: solid; }
.prose blockquote.ask .k { color: var(--live); }
.prose blockquote.skill { border-left-color: var(--s-ai); }
.prose blockquote.skill .k { color: var(--s-ai); }
.code { margin: 1.4em 0 0; border-radius: 8px; overflow: hidden; background: var(--code-bg); border: 1px solid #1f2a37; }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; border-bottom: 1px solid #1f2a37; font-family: var(--mono); font-size: 0.8125rem; color: var(--code-dim); }
.code-bar button { font: inherit; background: transparent; color: #dbe4ee; border: 1px solid #334255; border-radius: 6px; padding: 0 12px; min-height: 34px; cursor: pointer; }
.code-bar button:hover { background: #1b2633; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 0.875rem; line-height: 1.6; color: var(--code-ink); tab-size: 2; }
.prose pre code, .code pre code { background: none; border: 0; padding: 0; border-radius: 0; font-size: inherit; color: inherit; }
.code .tk-c { color: var(--code-dim); font-style: italic; }
.code .tk-s { color: var(--code-str); }
.code .tk-k { color: var(--code-key); }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 1240px) {
  .art-layout { grid-template-columns: 200px minmax(0, 1fr); }
  .telemetry { position: static; grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 900px) {
  .art-layout { grid-template-columns: minmax(0, 1fr); }
  .art-layout > .toc-col { display: none; }
  .toc-mobile { display: block; }
  .prose-panel { padding: 22px 18px 28px; }
  .art-hero .inner { padding: 22px 20px; }
}

/* ---------- Patterns ---------- */
.pat-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0 14px; min-height: 48px; flex: 1 1 320px; }
.pat-search input { border: 0; background: transparent; font: inherit; color: var(--ink); width: 100%; min-width: 0; }
.pat-search input::placeholder { color: var(--dim); }
.pat-search input:focus { outline: none; }
.pat-search:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.pat-card .thumb { aspect-ratio: 16 / 8; display: grid; place-items: center; background: var(--surface-2); }
.pat-card .glyph { width: 70%; height: 62%; }
.pat-card .cat { font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--dim); }
.pat-card .good { font-size: 0.875rem; color: var(--dim); }
.empty { text-align: center; padding: 40px 20px; }
.empty h3 { font-size: 1.25rem; margin-bottom: 6px; }
.empty[hidden] { display: none; }
.three-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--border); }
.three-ways div { background: var(--surface); padding: 16px 18px; }
.three-ways h3 { font-size: 1.0625rem; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.three-ways p { margin: 0; font-size: 0.9375rem; }
@media (max-width: 760px) { .three-ways { grid-template-columns: 1fr; } }

.panes-tabs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.panes-tabs [role="tab"] { font: inherit; font-size: 0.9375rem; background: transparent; border: 0; border-bottom: 3px solid transparent; color: var(--text); padding: 8px 12px; min-height: 44px; cursor: pointer; }
.panes-tabs [role="tab"][aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--live); }
.panes-tabs .tools { margin-left: auto; display: flex; gap: 8px; }
.pane { padding: 20px; }
.pane[hidden] { display: none; }
.pane .code { margin: 0; }
.pane-note { font-size: 0.9375rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; }
.prompt-text { font-size: 1.0625rem; line-height: 1.7; max-width: 72ch; }
.stage { background: var(--ground); border: 1px dashed var(--border); border-radius: 8px; padding: 22px; container-type: inline-size; }
.stage-cap { font-size: 0.9375rem; color: var(--dim); margin: 0 0 10px; }

/* the pattern itself: hairline stat strip */
.hss-strip { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; grid-template-columns: 1fr; }
@container (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 42rem) { .hss-strip.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hss-strip.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 56rem) { .hss-strip.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.hss-tile { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; font: inherit; color: inherit; border: 0; }
button.hss-tile { cursor: pointer; }
button.hss-tile:hover { background: var(--surface-2); }
.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); box-shadow: inset 0 -3px 0 var(--accent); }
.hss-label { font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); overflow-wrap: anywhere; }
.hss-fig { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.hss-fig.missing { color: var(--dim); font-weight: 500; }
.hss-unit { font-size: 0.875rem; color: var(--dim); }
.hss-list { list-style: none; margin: 12px 0 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.hss-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 0.9375rem; }
.hss-list li:last-child { border-bottom: 0; }
.hss-list li[hidden] { display: none; }
.hss-status { font-size: 0.9375rem; margin: 10px 0 0; color: var(--text); }

/* bits */
.stack-bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; gap: 2px; }
.stack-bar span { display: block; height: 100%; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 0.9375rem; }
.kv dt { font-family: var(--mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); padding-top: 2px; }
.kv dd { margin: 0; color: var(--ink); }
.quote-list { list-style: none; margin: 0; padding: 0; counter-reset: q; }
.quote-list li { counter-increment: q; display: grid; grid-template-columns: 2.4rem 1fr; padding: 10px 0; border-bottom: 1px solid #26344a; font-size: 1.0625rem; font-style: italic; color: #e3eaf2; }
.quote-list li:last-child { border-bottom: 0; }
.quote-list li::before { content: counter(q, decimal-leading-zero); font-family: var(--mono); font-style: normal; font-size: 0.8125rem; color: #f3a651; padding-top: 4px; }
.skill-group + .skill-group { margin-top: 16px; padding-top: 16px; border-top: 1px solid #26344a; }
.skill-group h3 { font-size: 1.0625rem; margin-bottom: 2px; }
.skill-group p { font-size: 0.9375rem; margin: 0 0 8px; color: #b5c3d3; }
.panel.dark .chip { background: #172232; border-color: #2d3e55; color: #d9e3ee; }
.photo-panel { position: relative; overflow: hidden; min-height: 260px; padding: 0; }
.photo-panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.note-sm { font-size: 0.875rem; color: var(--dim); margin: 12px 0 0; }
.footnote { font-size: 0.875rem; color: var(--dim); margin: 0 0 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* pattern glyphs */
.glyph .ga { fill: var(--accent); } .glyph .gb { fill: var(--border); } .glyph .gs { fill: var(--surface); stroke: var(--border); }
.glyph .gl { fill: var(--live); } .glyph .gg { fill: var(--s-garden); } .glyph .gt { fill: var(--s-tools); } .glyph .gi { fill: var(--s-ai); }
.glyph .gk { fill: none; stroke: var(--ink); stroke-width: 1.5; }

.months { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-top: 16px; }
.months div { background: var(--surface); padding: 8px 10px; min-width: 0; }
.months b { display: block; font-family: var(--mono); font-size: 1.125rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.months span { font-family: var(--mono); font-size: 0.8125rem; color: var(--dim); }
.months small { display: block; font-size: 0.8125rem; line-height: 1.35; color: var(--dim); overflow-wrap: anywhere; }
@media (max-width: 760px) { .months { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

[hidden] { display: none !important; }
