/* ==========================================================================
   AI Playbook for Healthcare — design system
   Zero dependencies. Dark theme default, light theme via [data-theme="light"].
   ========================================================================== */

:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #0b1020;
  --bg-2: #0e1428;
  --surface: #121a33;
  --surface-2: #182241;
  --surface-3: #1f2a4d;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e7ebf7;
  --text-2: #b6bfd6;
  --muted: #8791ab;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --accent-ink: #06202a;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 268px;
  --topbar-h: 58px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-2: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef1f8;
  --border: rgba(16, 21, 39, 0.09);
  --border-strong: rgba(16, 21, 39, 0.18);
  --text: #101527;
  --text-2: #2f3750;
  --muted: #667089;
  --accent: #0e9fb6;
  --accent-2: #7c5cf0;
  --accent-ink: #ffffff;
  --shadow: 0 10px 30px rgba(16, 21, 39, 0.10);
  --shadow-sm: 0 2px 8px rgba(16, 21, 39, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); font-weight: 750; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 .9rem; }
p.lead { font-size: 1.08rem; color: var(--text-2); max-width: 70ch; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
kbd {
  font-family: var(--mono); font-size: .72rem; padding: .1rem .38rem; border-radius: 5px;
  border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface-2);
}
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
ul, ol { padding-left: 1.25rem; }
li { margin: .25rem 0; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 1.1rem 1rem; border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-2) 85%, transparent);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; gap: 1rem;
  transition: transform .3s var(--ease);
  z-index: 40;
}
.brand { display: flex; gap: .7rem; align-items: center; padding: .25rem .4rem .6rem; }
.brand-mark { color: var(--accent); display: grid; place-items: center; }
.brand-title { font-weight: 750; letter-spacing: -.01em; }
.brand-sub { font-size: .78rem; color: var(--muted); margin-top: -2px; }

.nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: .9rem .6rem .35rem; }
.nav a {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: .9rem; position: relative; transition: background .15s;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--surface-3); color: var(--text); font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: 0; top: 25%; height: 50%; width: 3px; border-radius: 3px; background: var(--dot, var(--accent)); }
.nav .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--accent)); flex: 0 0 8px; }
.nav .ico { width: 16px; height: 16px; color: var(--muted); flex: 0 0 16px; }
.nav a.active .ico { color: var(--accent); }
.nav .check { margin-left: auto; color: var(--ok); width: 14px; height: 14px; opacity: 0; transform: scale(.6); transition: all .25s var(--ease); }
.nav .ext-ico { margin-left: auto; width: 13px; height: 13px; color: var(--muted); opacity: .7; }
.nav a.done .check { opacity: 1; transform: scale(1); }

.sidebar-foot { border-top: 1px solid var(--border); padding-top: .9rem; font-size: .8rem; color: var(--muted); }
.progress-label { display: flex; justify-content: space-between; margin-bottom: .35rem; }
.progress { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 6px; transition: width .6s var(--ease); }
.foot-meta { margin-top: .7rem; line-height: 1.4; }

.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .8rem;
  padding: .7rem 1.4rem; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(10px);
}
.crumbs { display: flex; gap: .45rem; align-items: center; color: var(--muted); font-size: .88rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--muted); }
.crumbs .sep { opacity: .5; }
.crumbs .cur { color: var(--text); font-weight: 600; }
.topbar-actions { display: flex; gap: .5rem; align-items: center; }
.search-btn {
  display: flex; align-items: center; gap: .5rem; padding: .42rem .7rem; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.search-btn:hover { border-color: var(--accent); color: var(--text); }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
}
.icon-btn:hover { border-color: var(--accent); color: var(--text); }
.menu-btn { display: none; position: relative; }
.burger { position: absolute; inset: 0; }
.burger i { position: absolute; left: 10px; right: 10px; height: 2px; border-radius: 1px; background: currentColor; transition: transform .25s var(--ease), opacity .2s, top .25s var(--ease); }
.burger i:nth-child(1) { top: 11px; } .burger i:nth-child(2) { top: 17px; } .burger i:nth-child(3) { top: 23px; }
.menu-btn[aria-expanded="true"] .burger i:nth-child(1) { top: 17px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .burger i:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .burger i:nth-child(3) { top: 17px; transform: rotate(-45deg); }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

.main { padding: 1.6rem 1.6rem 3rem; max-width: 1180px; width: 100%; margin: 0 auto; animation: fadeUp .35s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.site-foot { padding: 1rem 1.6rem 2rem; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--border); max-width: 1180px; width: 100%; margin: 0 auto; }

/* ---------- Page header ---------- */
.page-head { margin-bottom: 1.4rem; display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1; min-width: 280px; }
.eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 700; margin-bottom: .4rem; display: inline-flex; align-items: center; gap: .5rem; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------- Cards & grids ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm);
}
.card.pad-lg { padding: 1.5rem 1.6rem; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.card-head h2, .card-head h3 { margin: 0; }
.card.accent { border-color: color-mix(in srgb, var(--c, var(--accent)) 40%, transparent); }
.card.accent::before { content: none; }
.card.clickable { cursor: pointer; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.card.clickable:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt { margin-top: 1rem; } .mt-lg { margin-top: 1.8rem; } .mb { margin-bottom: 1rem; } .mb-0 { margin-bottom: 0; }

/* ---------- Buttons, chips, badges ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .95rem; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); cursor: pointer;
  font-weight: 600; font-size: .88rem; transition: all .15s var(--ease); white-space: nowrap;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.sm { padding: .35rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 15px; height: 15px; }

.chip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .65rem; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface-2); font-size: .78rem; color: var(--text-2);
  cursor: pointer; transition: all .15s; user-select: none;
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); border-color: var(--accent); color: var(--text); }
.chip .x { opacity: .6; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem; border-radius: 6px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  background: color-mix(in srgb, var(--c, var(--accent)) 18%, transparent); color: var(--c, var(--accent));
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 30%, transparent);
}
.badge.soft { text-transform: none; letter-spacing: 0; font-weight: 600; }
.tag { display: inline-block; padding: .12rem .5rem; border-radius: 6px; background: var(--surface-3); font-size: .74rem; color: var(--text-2); border: 1px solid var(--border); }

.maturity-proven { --c: var(--ok); }
.maturity-emerging { --c: var(--warn); }
.maturity-frontier { --c: var(--accent-2); }

/* ---------- Stats ---------- */
.stat { display: flex; flex-direction: column; gap: .15rem; }
.stat .n { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; color: var(--text); }
.stat .n.accent { color: var(--text); }
.stat .l { font-size: .8rem; color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 2.2rem 2.2rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
}
.hero h1 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); max-width: 22ch; }
.hero .lead { max-width: 62ch; }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center; }
.hero-art { display: grid; place-items: center; }
.domain-wheel { width: 100%; max-width: 320px; }
.domain-wheel .seg { cursor: pointer; transition: opacity .2s, transform .2s; transform-origin: center; }
.domain-wheel .seg:hover { opacity: .85; transform: scale(1.02); }
.domain-wheel text { font-size: 9px; fill: var(--text-2); font-weight: 600; pointer-events: none; }

/* ---------- Domain cards ---------- */
.domain-card { position: relative; display: flex; flex-direction: column; gap: .5rem; min-height: 150px; }
.domain-card .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.domain-card .ico svg { width: 18px; height: 18px; }
.domain-card .num { position: absolute; top: .9rem; right: 1rem; font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.domain-card h3 { margin: .2rem 0 0; }
.domain-card p { color: var(--muted); font-size: .86rem; margin: 0; flex: 1; }
.domain-card .foot { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; color: var(--muted); }
.domain-card .done-pill { color: var(--ok); font-weight: 600; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.1rem; overflow-x: auto; }
.tab { padding: .6rem .9rem; border: 0; background: none; color: var(--muted); cursor: pointer; font-weight: 600; font-size: .88rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Accordion ---------- */
.acc { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.acc + .acc { margin-top: .5rem; }
.acc-head { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .85rem 1rem; background: none; border: 0; text-align: left; cursor: pointer; }
.acc-head:hover { background: var(--surface-2); }
.acc-head .t { flex: 1; font-weight: 600; }
.acc-head .chev { transition: transform .25s var(--ease); color: var(--muted); }
.acc.open .acc-head .chev { transform: rotate(180deg); }
.acc-body { display: none; padding: 0 1rem 1rem; color: var(--text-2); }
.acc.open .acc-body { display: block; animation: fadeUp .25s var(--ease); }

/* ---------- Play cards ---------- */
.play { display: flex; flex-direction: column; gap: .6rem; }
.play .meta { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.play h3 { margin: 0; }
.play .desc { color: var(--text-2); font-size: .9rem; margin: 0; }
.dots { display: inline-flex; gap: 3px; align-items: center; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--surface-3); display: inline-block; border: 1px solid var(--border-strong); }
.dots i.on { background: var(--c, var(--accent)); border-color: transparent; }
.play .steps { margin: .3rem 0 0; padding-left: 1.2rem; font-size: .88rem; color: var(--text-2); }
.play .kpis { display: flex; gap: .35rem; flex-wrap: wrap; }
.play .actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .3rem; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .82rem; color: var(--text-2); font-weight: 600; display: flex; justify-content: space-between; gap: .5rem; }
.field label .val { font-family: var(--mono); color: var(--accent); font-weight: 600; }
.field .help { font-size: .76rem; color: var(--muted); }
input[type="text"], input[type="number"], select, textarea {
  padding: .55rem .7rem; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); width: 100%;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); border-color: var(--accent); }
textarea { min-height: 80px; resize: vertical; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; }
.likert button { padding: .5rem .3rem; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); cursor: pointer; font-size: .74rem; color: var(--muted); line-height: 1.2; transition: all .15s; }
.likert button:hover { border-color: var(--accent); color: var(--text); }
.likert button.on { background: color-mix(in srgb, var(--c, var(--accent)) 22%, var(--surface-2)); border-color: var(--c, var(--accent)); color: var(--text); font-weight: 700; }
.likert button b { display: block; font-size: 1rem; }
.q { padding: .9rem 0; border-top: 1px solid var(--border); }
.q:first-of-type { border-top: 0; }
.q .qt { margin-bottom: .55rem; font-weight: 500; }

.checkitem { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .4rem; border-top: 1px solid var(--border); cursor: pointer; }
.checkitem:hover { background: var(--surface-2); }
.checkitem .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-strong); flex: 0 0 20px; display: grid; place-items: center; margin-top: 2px; transition: all .15s; }
.checkitem.on .box { background: var(--ok); border-color: var(--ok); color: #05261a; }
.checkitem .txt { flex: 1; font-size: .9rem; }
.checkitem.on .txt { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.checkitem .fws { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .3rem; }
.fw { font-size: .68rem; padding: .1rem .4rem; border-radius: 5px; font-weight: 700; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }

/* ---------- Bars & charts ---------- */
.bar-row { display: grid; grid-template-columns: 170px 1fr 90px; gap: .8rem; align-items: center; font-size: .85rem; padding: .3rem 0; }
.bar-row .lbl { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .val { text-align: right; font-family: var(--mono); color: var(--text); }
.bar { height: 10px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--c, var(--accent)); border-radius: 6px; transition: width .7s var(--ease); }
.bar.neg > i { background: var(--danger); }

.radar { width: 100%; max-width: 420px; margin: 0 auto; display: block; overflow: visible; }
.radar .grid-line { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.radar .axis { stroke: var(--border-strong); stroke-width: 1; }
.radar .area { fill: color-mix(in srgb, var(--accent) 30%, transparent); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; transition: all .6s var(--ease); }
.radar .pt { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.radar text { font-size: 10px; fill: var(--text-2); font-weight: 600; }

.ring { position: relative; width: 120px; height: 120px; }
.ring svg { transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--surface-3); stroke-width: 10; }
.ring .fill { fill: none; stroke: url(#ringGrad); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .8s var(--ease); }
.ring .c { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; }

.gauge { display: flex; flex-direction: column; gap: .4rem; }
.gauge .track { display: flex; gap: 3px; height: 12px; }
.gauge .track i { flex: 1; border-radius: 3px; background: var(--surface-3); }
.gauge .track i.on { background: var(--c); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
tr:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }

/* ---------- Tool explorer ---------- */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input[type="text"] { flex: 1 1 220px; max-width: 340px; }
.toolbar select { width: auto; max-width: 240px; }
.tool { display: flex; flex-direction: column; gap: .45rem; }
.tool .name { display: flex; gap: .5rem; align-items: center; justify-content: space-between; }
.tool .name a { color: var(--text); font-weight: 700; }
.tool .note { font-size: .84rem; color: var(--text-2); margin: 0; flex: 1; }
.tool .cats { display: flex; gap: .3rem; flex-wrap: wrap; }
.tool.defunct { opacity: .75; border-style: dashed; }
.tool .cmp { position: absolute; top: .8rem; right: .8rem; }
.tool { position: relative; }
.compare-bar { position: sticky; bottom: 1rem; z-index: 5; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow); }

/* ---------- Roadmap ---------- */
.lanes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.lane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem; min-height: 220px; display: flex; flex-direction: column; gap: .5rem; transition: border-color .15s, background .15s; }
.lane.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.lane-head { display: flex; flex-direction: column; gap: .1rem; }
.lane-head h3 { margin: 0; font-size: .95rem; }
select.btn { width: auto; padding-right: 1.6rem; }
.lane-head .cnt { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.lane .empty { color: var(--muted); font-size: .8rem; text-align: center; padding: 1.5rem .5rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.rm-item { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--c); border-radius: 8px; padding: .55rem .65rem; font-size: .84rem; cursor: grab; display: flex; flex-direction: column; gap: .3rem; }
.rm-item:active { cursor: grabbing; }
.rm-item .t { font-weight: 600; }
.rm-item .m { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .74rem; gap: .5rem; }
.rm-item .m .btns { display: flex; gap: .25rem; }
.rm-item .m button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: .1rem .3rem; border-radius: 4px; }
.rm-item .m button:hover { background: var(--surface-3); color: var(--text); }
.rm-item .warn { color: var(--warn); font-size: .72rem; }
.play-picker { max-height: 420px; overflow-y: auto; padding-right: .3rem; }
.pick { display: flex; gap: .6rem; align-items: center; padding: .5rem .4rem; border-top: 1px solid var(--border); font-size: .86rem; }
.pick .sw { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: 0 0 8px; }
.pick .t { flex: 1; }
.pick .btn { padding: .25rem .5rem; font-size: .74rem; }
.gantt { display: flex; flex-direction: column; gap: .35rem; }
.gantt-row { display: grid; grid-template-columns: 220px 1fr; gap: .8rem; align-items: center; font-size: .82rem; }
.gantt-row .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.gantt-track { position: relative; height: 18px; background: var(--surface-3); border-radius: 5px; background-image: linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), var(--border-strong) calc(25% - 1px), var(--border-strong) 25%); background-size: 25% 100%; }
.gantt-track i { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: var(--c); opacity: .9; }

/* ---------- Palette ---------- */
.palette { position: fixed; inset: 0; z-index: 60; background: rgba(4, 8, 20, .6); backdrop-filter: blur(4px); display: grid; place-items: start center; padding-top: 12vh; }
.palette[hidden] { display: none; }
.palette-box { width: min(680px, 92vw); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; animation: fadeUp .2s var(--ease); }
.palette-input-wrap { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-input-wrap input { flex: 1; border: 0; background: none; font-size: 1.05rem; padding: 0; }
.palette-input-wrap input:focus { outline: none; }
.palette-results { max-height: 50vh; overflow-y: auto; padding: .4rem; }
.p-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: .6rem .7rem .25rem; }
.p-item { display: flex; gap: .7rem; align-items: center; padding: .55rem .7rem; border-radius: 9px; cursor: pointer; }
.p-item.active, .p-item:hover { background: var(--surface-3); }
.p-item .sw { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: 0 0 8px; }
.p-item .t { flex: 1; min-width: 0; }
.p-item .t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-item .t span { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.p-item .k { font-size: .7rem; color: var(--muted); }
.palette-foot { display: flex; gap: 1rem; padding: .5rem 1rem; border-top: 1px solid var(--border); font-size: .72rem; color: var(--muted); }
.p-empty { padding: 1.4rem; text-align: center; color: var(--muted); }

/* ---------- Toasts ---------- */
.toast-host { position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 70; display: flex; flex-direction: column; gap: .5rem; }
.toast { background: var(--surface); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--shadow); font-size: .88rem; animation: fadeUp .25s var(--ease); max-width: 340px; }

/* ---------- Callouts ---------- */
.callout { border-left: 3px solid var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 8%, var(--surface)); padding: .8rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .9rem; }
.callout b { color: var(--c, var(--accent)); }
.callout.warn { --c: var(--warn); }
.callout.danger { --c: var(--danger); }
.callout.ok { --c: var(--ok); }
.callout p:last-child { margin-bottom: 0; }

.result-box { padding: 1.2rem 1.4rem; border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), color-mix(in srgb, var(--accent-2) 14%, var(--surface))); border: 1px solid var(--border-strong); }
.big-num { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.sticky-col { position: sticky; top: 76px; align-self: start; }

pre.export { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; font-size: .78rem; overflow: auto; max-height: 360px; white-space: pre-wrap; }

.empty-state { text-align: center; padding: 2rem; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

.timeline { position: relative; padding-left: 1.4rem; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border-strong); }
.tl-item { position: relative; padding: 0 0 1rem; }
.tl-item::before { content: ""; position: absolute; left: -1.4rem; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--accent)); border: 2px solid var(--surface); }
.tl-item h4 { margin: 0 0 .2rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  #layout { grid-template-columns: 1fr !important; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lanes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { display: none; }
}
@media (max-width: 860px) {
  /* Sidebar becomes a dropdown panel hanging from the top bar. */
  .sidebar {
    position: fixed; left: 0; right: 0; top: var(--topbar-h, 58px); width: auto; flex: none; height: auto;
    max-height: calc(100vh - var(--topbar-h, 58px)); overflow-y: auto;
    border-right: 0; border-bottom: 1px solid var(--border-strong); border-radius: 0 0 18px 18px;
    background: color-mix(in srgb, var(--bg-2) 96%, transparent);
    transform: translateY(-10px); opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform .25s var(--ease), opacity .2s, visibility 0s linear .25s;
    z-index: 28; gap: .6rem; padding: .6rem 1rem 1rem;
  }
  .sidebar.open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; transition: transform .25s var(--ease), opacity .2s; }
  .sidebar .brand { display: none; }
  .sidebar .foot-meta { display: none; }
  .sidebar .nav-section:first-child { padding-top: .4rem; }
  .sidebar .nav a { padding: .65rem .6rem; font-size: .95rem; }
  .scrim { z-index: 27; }
  .scrim.show { display: block; }
  .menu-btn { display: grid; }
  .topbar { height: var(--topbar-h); padding-top: 0; padding-bottom: 0; }
  body.nav-open { overflow: hidden; }
  .search-btn span { display: none; }
  .search-btn kbd { display: none; }
  .grid-2, .grid-3, .grid-4, .two-col { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .lanes { grid-template-columns: 1fr; }
  .main { padding: 1.1rem 1rem 3rem; }
  .hero { padding: 1.5rem 1.2rem; }
  .bar-row { grid-template-columns: 110px 1fr 70px; }
  .gantt-row { grid-template-columns: 130px 1fr; }
  .sticky-col { position: static; }
}

/* ---------- Print ---------- */
@media print {
  body::before { display: none; }
  .sidebar, .topbar, .palette, .toast-host, .page-actions, .btn, .scrim, .site-foot { display: none !important; }
  .content { display: block; }
  .main { max-width: none; padding: 0; animation: none; }
  .card { break-inside: avoid; box-shadow: none; }
  .acc-body { display: block !important; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #fafafa; --surface-3: #f0f0f0; --text: #111; --text-2: #333; --muted: #666; --border: #ddd; --border-strong: #bbb; }
  a { color: #111; }
}

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