:root {
  color-scheme: light;
  --surface-1: #fcfcfb; --surface-2: #f3f2ef; --border: #dcdad4;
  --text-primary: #0b0b0b; --text-secondary: #52514e; --text-muted: #77756f;
  --accent: #2a78d6; --accent-ink: #184f95; --warn-bg: #fff5dc; --warn-border: #e0b74a;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #1a1a19; --surface-2: #242423; --border: #3a3a37;
    --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #9a998f;
    --accent: #3987e5; --accent-ink: #86b6ef; --warn-bg: #2d2610; --warn-border: #7a621c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1a1a19; --surface-2: #242423; --border: #3a3a37;
  --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #9a998f;
  --accent: #3987e5; --accent-ink: #86b6ef; --warn-bg: #2d2610; --warn-border: #7a621c;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface-1); color: var(--text-primary); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Gujarati", sans-serif; }
header, main, footer { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
header { padding-top: 28px; }
h1 { font-size: 1.7rem; margin: 0 0 6px; }
h2 { font-size: 1.25rem; margin: 28px 0 8px; }
h3 { font-size: 1.05rem; margin: 20px 0 6px; }
p, li { color: var(--text-secondary); }
.lede { font-size: 1.05rem; max-width: 70ch; }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 8px; padding: 12px 16px; margin: 16px 0; color: var(--text-primary); }
.notice p, .notice li { color: var(--text-primary); }
.topbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 18px 0 6px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.topbar .spacer { flex: 1; }
button, select { font: inherit; color: var(--text-primary); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button[aria-selected="true"], button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
button:focus-visible, select:focus-visible, audio:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin: 14px 0; background: var(--surface-1); }
.gu { font-size: 1.1rem; line-height: 1.7; color: var(--text-primary); margin: 4px 0 10px; }
.meta { color: var(--text-muted); font-size: .85rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--text-secondary); font-weight: 600; font-size: .8rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.sys { white-space: nowrap; font-weight: 600; color: var(--text-primary); }
audio { height: 34px; width: 260px; max-width: 100%; }
.bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin: 10px 0; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 56px; align-items: center; gap: 8px; margin: 4px 0; font-size: .85rem; }
.bar-row .lbl { color: var(--text-secondary); text-align: right; }
.bar-row .val { font-variant-numeric: tabular-nums; color: var(--text-primary); }
.bar-track { height: 14px; background: var(--surface-2); border-radius: 0 4px 4px 0; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-fill.none { background: transparent; }
.heat td, .heat th { text-align: center; padding: 6px 4px; border: 2px solid var(--surface-1); font-variant-numeric: tabular-nums; }
.heat th { border: none; font-size: .75rem; }
.heat td.cell { min-width: 56px; border-radius: 3px; }
.heat th.rowh { text-align: right; padding-right: 8px; }
#tip { position: fixed; pointer-events: none; z-index: 10; background: var(--text-primary); color: var(--surface-1); padding: 6px 9px; border-radius: 6px; font-size: .8rem; max-width: 280px; display: none; }
.playbtn { padding: 3px 9px; font-size: .85rem; }
.playbtn.playing { background: var(--accent); color: #fff; border-color: var(--accent); }
.small { font-size: .82rem; color: var(--text-muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
details { margin: 8px 0; }
summary { cursor: pointer; color: var(--accent-ink); }
footer { padding: 24px 20px 48px; color: var(--text-muted); font-size: .85rem; }
.heard { font-size: .8rem; color: var(--text-muted); max-width: 46ch; }
.overflow { overflow-x: auto; }
@media (max-width: 640px) { .bar-row { grid-template-columns: 110px 1fr 48px; } audio { width: 200px; } }

.tag { display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 1px 6px; margin-right: 6px; border-radius: 4px; border: 1px solid var(--border); color: var(--text-secondary); white-space: nowrap; vertical-align: 1px; }
.tag.gt { border-style: double; border-width: 3px; color: var(--text-primary); }
.tag.base { border-color: var(--text-muted); }
.tag.prop { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag.ext { border-style: dashed; }
.rk { display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 9px; font-size: .68rem; font-weight: 700; vertical-align: 1px; }
.rk.r1 { background: var(--text-primary); color: var(--surface-1); border: 1px solid var(--text-primary); }
.rk.r2 { background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--text-primary); }
tr.prop-row td { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.verdict { margin: 4px 0 10px; color: var(--text-primary); }
.stack { display: grid; gap: 8px; margin: 12px 0; }
.layer { border: 1px solid var(--border); border-left: 5px solid var(--accent); border-radius: 8px; padding: 10px 14px; background: var(--surface-1); }
.layer.todo { border-left-style: dashed; border-left-color: var(--text-muted); background: var(--surface-2); }
.lhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.chip { font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 9px; border: 1px solid var(--border); }
.chip-ok::before { content: "✔ "; }
.chip-todo::before { content: "○ "; }
.chip-todo { color: var(--text-secondary); }

th.num { white-space: nowrap; }
td.num { white-space: nowrap; }
.card audio { width: 170px; }
.card table { font-size: .84rem; }
.card th, .card td { padding: 6px 4px; }
td.sys { white-space: normal; }
.card td.sys .tag { margin-right: 4px; }
