:root {
  color-scheme: light;
  --bg: #f1f0f9;
  --surface: #ffffff;
  --surface-2: #f7f7fb;
  --border: #e8e7f1;
  --grid: #eeedf4;
  --text: #17161f;
  --text-2: #5f5e70;
  --text-3: #68677a;
  --accent: #5b54e8;
  --accent-soft: #ecebfd;
  --accent-ink: #4038c9;
  --on-accent: #ffffff;
  --lime: #d4ec6a;
  --lime-soft: #f2f9d6;
  --lime-ink: #4d6100;
  --good: #0b6b3d;
  --good-soft: #e3f5ea;
  --bad: #c22f2f;
  --bad-soft: #fbe7e7;
  --series-1: #5b54e8;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --ghost: #d9d7f6;
  --hover: #ebeaf6;  /* row/track highlight, 1.2:1 on surface; text on it stays >= 4.6:1 */
  --shadow: 0 1px 2px rgba(23, 22, 31, .04), 0 4px 16px rgba(23, 22, 31, .04);
  --radius: 16px;
  --radius-sm: 10px;
  --z-sticky: 20;
  --z-popover: 40;
  --z-tooltip: 50;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111117; --surface: #1a1a21; --surface-2: #22222b; --border: #2b2a35; --grid: #26252f;
    --text: #efeef6; --text-2: #b0afc0; --text-3: #9897ac;
    --accent: #8a84f0; --accent-soft: #2a2850; --accent-ink: #b9b5ff; --on-accent: #16152b;
    --lime: #b5d13f; --lime-soft: #2b3310; --lime-ink: #d6ef7a;
    --good: #4cc787; --good-soft: #15301f; --bad: #f07878; --bad-soft: #3a1b1b;
    --series-1: #8a84f0; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --ghost: #3a3870; --hover: #2e2d3a;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111117; --surface: #1a1a21; --surface-2: #22222b; --border: #2b2a35; --grid: #26252f;
  --text: #efeef6; --text-2: #b0afc0; --text-3: #9897ac;
  --accent: #8a84f0; --accent-soft: #2a2850; --accent-ink: #b9b5ff; --on-accent: #16152b;
  --lime: #b5d13f; --lime-soft: #2b3310; --lime-ink: #d6ef7a;
  --good: #4cc787; --good-soft: #15301f; --bad: #f07878; --bad-soft: #3a1b1b;
  --series-1: #8a84f0; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --ghost: #3a3870; --hover: #2e2d3a;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, select, input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px;
  padding: 22px 16px; background: var(--surface-2); border-right: 1px solid var(--border);
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: -.02em; padding: 0 8px; }
.brand span { color: var(--accent); }
.quiz-switch { min-height: 56px; }
.quiz-switch .avatar {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--accent); color: var(--on-accent);
}
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 0 8px; margin-bottom: 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 4px;
  border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font-weight: 500;
  border: 1px solid transparent;
}
.nav a:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.nav a.active { background: var(--accent); color: var(--on-accent); }
.nav svg { width: 16px; height: 16px; flex: none; }
.side-card {
  margin-top: auto; padding: 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); font-size: 12.5px;
}
.side-card h3 { font-size: 13px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.side-card p + p { margin-top: 6px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

.main { min-width: 0; padding: 0 28px 48px; }
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; gap: 12px;
  padding: 16px 0; background: var(--bg);
}
.topbar .crumb { font-weight: 600; margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 500;
}
.pill .status-dot { margin: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
}
.icon-btn:hover, .btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 500;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- header + filters ---------- */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 8px 0 18px; flex-wrap: wrap; }
.hero h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.hero p { color: var(--text-2); margin-top: 4px; max-width: 760px; }
.filters {
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px; margin-bottom: 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filter-row + .filter-row { padding-top: 12px; border-top: 1px solid var(--border); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label, .field .field-label { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.field input {
  height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); max-width: 220px; min-width: 120px;
}
.field input[type="date"] { min-width: 136px; }
.field-group { display: flex; gap: 6px; align-items: flex-end; }
.filters .reset { margin-left: auto; }
.hint { font-size: 12px; color: var(--text-3); margin: -8px 0 16px; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; min-width: 0;
}
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-head p { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 28px 2px 12px; scroll-margin-top: 80px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.legend i.line { height: 2px; width: 14px; border-radius: 2px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi .label { display: flex; justify-content: space-between; color: var(--text-2); font-weight: 500; }
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 4px; }
.kpi .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.chip {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chip.up { background: var(--good-soft); color: var(--good); }
.chip.down { background: var(--bad-soft); color: var(--bad); }
.chip.flat { background: var(--surface-2); color: var(--text-3); }
.chip.lime { background: var(--lime-soft); color: var(--lime-ink); }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }

/* charts */
.chart { position: relative; width: 100%; min-height: 250px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis text { fill: var(--text-3); font-size: 11px; }
.gridline { stroke: var(--grid); stroke-width: 1; }
.crosshair { stroke: var(--text-3); stroke-width: 1; }
.tooltip {
  position: fixed; z-index: var(--z-tooltip); pointer-events: none; min-width: 150px; max-width: 280px;
  padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12); font-size: 12.5px; opacity: 0; transition: opacity .1s;
}
.tooltip.show { opacity: 1; }
.tooltip .t-title { color: var(--text-3); margin-bottom: 6px; font-weight: 500; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .t-row b { font-weight: 700; }
.tooltip .t-sub { display: inline-block; min-width: 46px; margin-left: 8px; text-align: right; color: var(--text-3); font-weight: 500; }
.tooltip .t-key { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.tooltip .t-key i { width: 12px; height: 2px; border-radius: 2px; display: inline-block; }

/* funnel */
.funnel { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(200px, 3fr) 90px 90px 110px; align-items: center; row-gap: 2px; font-size: 13px; }
.funnel .h { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 0 0 8px; }
.funnel .f-head { border-bottom: 1px solid var(--border); border-radius: 0; margin-bottom: 4px; }
.funnel .f-head > .h:first-child { padding-left: 6px; }
.funnel .h.num, .funnel .num { text-align: right; }
.funnel .cell { padding: 7px 0; min-width: 0; }
.funnel .name { font-weight: 500; padding-right: 12px; }
.funnel .name small { display: block; color: var(--text-3); font-weight: 400; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel .bars { position: relative; height: 26px; }
.funnel .bar, .funnel .ghost { position: absolute; left: 0; border-radius: 4px; }
.funnel .bar { top: 4px; height: 18px; background: var(--series-1); }
.funnel .bar.reached { background: var(--ghost); }
.funnel .ghost { top: 0; height: 26px; border: 1.5px solid var(--text-3); border-radius: 6px; opacity: .45; }
.funnel .bar-label { position: absolute; top: 4px; line-height: 18px; font-size: 12px; font-weight: 600; padding-left: 8px; white-space: nowrap; }
.funnel .bar-label.inside { color: var(--on-accent); padding: 0 8px 0 0; }
.funnel .f-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; border-radius: 8px; }
.funnel .f-row:not(.f-head):hover, .funnel .f-row:focus-visible { background: var(--surface-2); }
.funnel .f-row > .cell:first-child { padding-left: 6px; }
.drop { font-weight: 600; }
.drop.big { color: var(--bad); }
.funnel-sep { grid-column: 1 / -1; height: 1px; background: var(--border); margin: 4px 0; }

/* bar lists (answers, results) */
.bars-list { display: flex; flex-direction: column; gap: 8px; }
.bl-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px 58px; gap: 10px; align-items: center; font-size: 13px; }
.bl-row .lbl { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bl-row .lbl span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-track { height: 8px; border-radius: 4px; background: var(--hover); position: relative; }
.bl-fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--series-1); }
.bl-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); border-radius: 1px; }
.bl-row .v { text-align: right; font-weight: 600; }
.bl-row .d { text-align: right; font-size: 12px; }
.answers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.answer-card h3 { font-size: 14px; font-weight: 600; }
.answer-card .q { font-size: 12px; color: var(--text-3); margin: 2px 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.answer-card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* results */
.results-wrap { display: grid; grid-template-columns: 1fr; gap: 16px; justify-items: center; }
.results-wrap .res-list { width: 100%; }
.res-list { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.res-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.res-row i { width: 10px; height: 10px; border-radius: 3px; }
.res-row small { display: block; color: var(--text-3); font-size: 11.5px; }
.res-row .n { text-align: right; font-weight: 600; }
.callout {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 10px 12px;
  border-radius: var(--radius-sm); background: var(--lime-soft); color: var(--lime-ink); font-size: 12.5px;
}
.callout.info { background: var(--accent-soft); color: var(--accent-ink); }

/* stats */
.stat-big { font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.empty {
  display: grid; place-items: center; text-align: center; min-height: 140px; padding: 16px;
  border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text-3); font-size: 13px;
}

/* table */
.tabs { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 999px; border: 1px solid var(--border); }
.tabs button { border: 0; background: transparent; padding: 5px 12px; border-radius: 999px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: right; font-size: 11.5px; font-weight: 600; color: var(--text-3);
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none;
}
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th[aria-sort] { color: var(--text); }
table.data td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.data td:first-child { max-width: 320px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
table.data tr:hover td { background: var(--surface-2); }
table.data tr.top td { background: var(--accent-soft); }
.mini-bar { display: inline-block; height: 6px; border-radius: 3px; background: var(--series-1); vertical-align: middle; margin-right: 8px; }

.notes { font-size: 13px; color: var(--text-2); display: flex; flex-direction: column; gap: 8px; padding-left: 18px; margin: 0; }
footer { margin-top: 28px; font-size: 12px; color: var(--text-3); }

.loading { opacity: .5; transition: opacity .15s; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span-3 { grid-column: span 6; } .span-4, .span-5, .span-7, .span-8 { grid-column: span 12; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .nav, .side-card, .nav-label { display: none; }
  .main { padding: 0 16px 40px; }
  .span-3, .span-6 { grid-column: span 12; }
  .funnel { grid-template-columns: minmax(110px, 1fr) minmax(120px, 2fr) 70px 80px; }
  .funnel .col-delta { display: none; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-wrap { grid-template-columns: 1fr; justify-items: center; }
  .topbar .pill.hide-sm { display: none; }
  .topbar .btn-label { display: none; }
  .topbar .btn.primary { padding: 0 12px; }
  .field input, .dd-trigger { max-width: none; min-width: 0; width: 100%; }
  .field-group { flex: 1 1 100%; }
  .hero h1 { font-size: 24px; }
  .kpi .value { font-size: 24px; }
  .card { padding: 14px; }
  .card-head { flex-wrap: wrap; }
  .funnel { grid-template-columns: minmax(96px, 1fr) minmax(90px, 1.4fr) 56px 64px; font-size: 12px; }
  .funnel .name small { display: none; }
  .field { flex: 1 1 140px; }
  .answers-grid { grid-template-columns: 1fr; }
}

table.data a.ext { color: var(--accent-ink); text-decoration: none; }
table.data a.ext:hover { text-decoration: underline; }
table.data a.ext::after { content: " 97"; font-size: 11px; }


/* LTV summary stats */
.ltv-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.ltv-stat { display: flex; flex-direction: column; gap: 2px; min-width: 140px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 12px; }
.ltv-stat b { font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.ltv-stat.good { background: var(--good-soft); }
.ltv-stat.bad { background: var(--bad-soft); }
.ltv-note { font-size: 12px; color: var(--text-3); margin-top: 8px; }

/* ---------- interaction polish ---------- */
.btn { white-space: nowrap; }
.btn, .icon-btn, .nav a, .tabs button, .dd-trigger, .dd-opt, table.data th, .f-row, .bl-row { cursor: pointer; }
.field input[type="date"] { cursor: text; }
.btn, .icon-btn, .nav a, .tabs button, .dd-trigger, .field input, table.data td, .f-row, .chip {
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.field input:hover { border-color: var(--text-3); }

/* Touch screens: 44px targets, 16px inputs (stops iOS zoom on focus) */
@media (pointer: coarse) {
  .btn, .icon-btn, .dd-trigger, .field input { min-height: 44px; }
  .dd-opt { min-height: 44px; padding: 11px 10px; }
  .icon-btn { min-width: 44px; }
  .tabs button { min-height: 40px; padding: 8px 14px; }
  .nav a { min-height: 44px; }
  .field input, .dd-search { font-size: 16px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- weekly funnel volume ---------- */
.section-sub { font-size: 12.5px; color: var(--text-3); margin: -6px 2px 12px; }
.week-card { display: flex; flex-direction: column; gap: 12px; }
.week-card.latest { border-color: var(--accent); }
.week-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.week-head h3 { font-size: 15px; font-weight: 600; }
.week-head p { font-size: 12px; margin-top: 2px; }
.wk-row { display: flex; flex-direction: column; gap: 5px; }
.wk-top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
.wk-label { color: var(--text-2); font-size: 13px; }
.wk-value { font-size: 16px; font-weight: 700; text-align: right; }
.wk-bar { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.wk-track { height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; }
.wk-fill { height: 100%; border-radius: 3px; background: var(--series-1); }
.wk-share { font-size: 12px; color: var(--text-3); text-align: right; }

/* ---------- speed row ---------- */
.timing .card-head { margin-bottom: 8px; }
.timing-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.timing-row .chip { align-self: center; }
.timing-empty { font-size: 13px; color: var(--text-3); padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.timing-total { font-size: 12.5px; color: var(--text-2); margin-top: 8px; }

/* ---------- dropdown ---------- */
.dd { position: relative; min-width: 0; }
.dd-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; min-width: 150px; max-width: 250px;
  padding: 0 10px 0 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2);
  text-align: left; font-weight: 500;
}
.dd-trigger:hover { border-color: var(--text-3); background: var(--surface); }
.dd.open .dd-trigger { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.dd-value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dd-value-sub { flex: 0 1 auto; min-width: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-3); font-weight: 400; }
.dd-chev { width: 16px; height: 16px; flex: none; margin-left: auto; color: var(--text-3); transition: transform .15s ease; }
.dd.open .dd-chev { transform: rotate(180deg); }
.dd-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: var(--z-popover);
  min-width: 100%; width: max-content; max-width: min(400px, calc(100vw - 32px));
  padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(23, 22, 31, .14), 0 2px 6px rgba(23, 22, 31, .06);
  animation: dd-in .12s ease-out;
}
.dd-pop.align-right { left: auto; right: 0; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }
.dd-search {
  width: 100%; height: 34px; margin-bottom: 6px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
}
.dd-search:focus, .dd-search:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dd-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; outline: none; }
.dd-opt {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 36px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px;
}
.dd-opt.active { background: var(--hover); box-shadow: inset 3px 0 0 var(--accent); }
.dd-opt.selected .dd-label { color: var(--accent-ink); font-weight: 600; }
.dd-check { width: 16px; height: 16px; color: var(--accent); }
.dd-text { display: flex; flex-direction: column; min-width: 0; }
.dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dd-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-3); }
.dd-meta { padding-left: 12px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dd-empty { padding: 10px; font-size: 13px; color: var(--text-3); }

/* quiz switcher: the whole card is the trigger */
.dd-quiz .dd-trigger {
  height: auto; max-width: none; padding: 10px 12px; gap: 10px;
  background: var(--surface); border-radius: var(--radius-sm);
}
.dd-quiz .dd-label { font-weight: 600; }
.dd-quiz .dd-text { flex: 1; }
@media (max-width: 960px) { .grid > .week-card { grid-column: span 6; } }
@media (max-width: 560px) { .grid > .week-card { grid-column: span 12; } }
