:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --border: #e2e0da;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #74726c;
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --pause: #ebe9e3;
  --grid: #e6e4de;
  --danger: #d03b3b;
  --issue-sp: #d03b3b;
  --issue-sp-bg: rgb(208 59 59 / 0.10);
  --issue-mech: #c98500;
  --issue-mech-bg: rgb(250 178 25 / 0.16);
  --issue-unk: #74726c;
  --ok: #1f8f4e;
  --live: #16a34a;
  --live-halo: rgb(22 163 74 / 0.20);
  --accent-soft: rgb(42 120 214 / 0.10);
  --ring: 0 0 0 4px rgb(42 120 214 / 0.14);
  --dot: rgb(0 0 0 / 0.055);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.04);
  --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.05), 0 12px 28px rgb(0 0 0 / 0.07);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211;
    --surface: #1a1a19;
    --surface-2: #232321;
    --border: #2e2e2b;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --muted: #93928a;
    --accent: #3987e5;
    --accent-ink: #86b6ef;
    --series-1: #3987e5;
    --series-2: #d95926;
    --pause: #262624;
    --grid: #2a2a28;
    --danger: #e66767;
    --issue-sp: #e66767;
    --issue-sp-bg: rgb(230 103 103 / 0.16);
    --issue-mech: #fab219;
    --issue-mech-bg: rgb(250 178 25 / 0.14);
    --issue-unk: #93928a;
    --ok: #3fb970;
    --live: #34d399;
    --live-halo: rgb(52 211 153 / 0.22);
    --accent-soft: rgb(57 135 229 / 0.16);
    --ring: 0 0 0 4px rgb(57 135 229 / 0.22);
    --dot: rgb(255 255 255 / 0.045);
    --shadow: none;
    --shadow-lift: 0 0 0 1px rgb(255 255 255 / 0.04);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --border: #2e2e2b;
  --text: #ffffff; --text-2: #c3c2b7; --muted: #93928a; --accent: #3987e5; --accent-ink: #86b6ef;
  --series-1: #3987e5; --series-2: #d95926; --pause: #262624; --grid: #2a2a28; --danger: #e66767;
  --issue-sp: #e66767; --issue-sp-bg: rgb(230 103 103 / 0.16); --issue-mech: #fab219;
  --issue-mech-bg: rgb(250 178 25 / 0.14); --issue-unk: #93928a;
  --ok: #3fb970; --live: #34d399; --live-halo: rgb(52 211 153 / 0.22); --accent-soft: rgb(57 135 229 / 0.16); --ring: 0 0 0 4px rgb(57 135 229 / 0.22);
  --dot: rgb(255 255 255 / 0.045);
  --shadow: none; --shadow-lift: 0 0 0 1px rgb(255 255 255 / 0.04);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg) radial-gradient(var(--dot) 1px, transparent 1.2px) 0 0 / 22px 22px;
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
body::before {
  content: ""; display: block; height: 4px;
  background: linear-gradient(90deg, var(--series-1) 0 60%, var(--series-2));
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.25rem; }
h3 { font-size: 0.95rem; font-weight: 600; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 1.25em; height: 1.25em; flex: none; }
.ico--xs { width: 1em; height: 1em; }

header.site { padding: 36px 0 20px; }
header.site h1 { font-size: 1.75rem; letter-spacing: -0.02em; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-size: 0.8rem; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-top: 3px; }
.wordmark span { color: var(--accent); }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-mark rect { fill: var(--accent); }
.brand-mark path { fill: #fff; }
.tagline { margin: 14px 0 0; color: var(--text-2); }

main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
/* Same structure and styling as the footer on the other dustincremascoli.com sites. */
.site-footer { margin-top: 40px; border-top: 1px solid var(--border); background: var(--bg); padding: 32px 0 72px; }
.footer-notes { margin: 0 0 24px; max-width: 80ch; color: var(--muted); font-size: 0.85rem; }
.footer-nav {
  display: flex; flex-wrap: wrap; gap: 22px 52px;
  padding-bottom: 24px; margin-bottom: 22px; border-bottom: 1px solid var(--border);
}
.footer-nav-group { min-width: 0; }
.footer-nav-label { margin: 0 0 8px; color: var(--muted); font-size: 0.68rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-nav-list, .footer-links { display: flex; flex-wrap: wrap; align-items: center; list-style: none; padding: 0; margin: 0; }
.footer-nav-list { gap: 6px 22px; }
.footer-links { gap: 9px 22px; }
.footer-nav-list li, .footer-links li { display: flex; align-items: center; }
.footer-nav-link, .footer-links a {
  display: inline-flex; align-items: center; gap: 6px; padding-block: 2px;
  color: var(--text-2); text-decoration: none; font-size: 0.9rem; font-weight: 550; line-height: 1.5;
}
.footer-links a { font-size: 0.875rem; gap: 7px; }
.footer-nav-link:hover, .footer-links a:hover { color: var(--accent); }
.footer-nav-link .ico--xs { opacity: 0.55; }
.footer-nav-link:hover .ico--xs { opacity: 1; }
.footer-links .ico { width: 1.05em; height: 1.05em; }
.nav-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 2px var(--live-halo); }
.footer-nav-link.is-current { color: var(--muted); font-weight: 650; }
.footer-nav-link.is-current .nav-dot { background: var(--muted); box-shadow: none; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px 26px; align-items: center; justify-content: space-between; }
.footer-meta { margin: 0; color: var(--muted); font-size: 0.85rem; }
.footer-meta .sep { margin-inline: 7px; }
.site-footer a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card h3 { margin-bottom: 12px; }

.btn {
  font: inherit; font-size: 0.925rem; font-weight: 550;
  border-radius: 10px; padding: 9px 14px; cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .15s, opacity .15s, transform .08s, box-shadow .15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-ink); box-shadow: 0 4px 14px rgb(42 120 214 / 0.3); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.btn.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.kbd { font: 0.75rem/1 var(--mono); opacity: 0.8; padding: 3px 5px; border-radius: 5px; background: rgb(255 255 255 / 0.18); }

.task-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.eyebrow { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.chip { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 0.8rem; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; }
.chip:empty { display: none; }
.task-text { font-size: 1.3rem; font-weight: 550; margin: 12px 0 0; line-height: 1.4; text-wrap: balance; }

.editor { padding: 0; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.editor:focus-within { border-color: var(--accent); box-shadow: var(--ring), var(--shadow); }
textarea {
  display: block; width: 100%; border: 0; resize: vertical; min-height: 220px;
  padding: 20px; background: transparent; color: var(--text);
  font: 1.0625rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
textarea:focus-visible { outline: none; }
textarea[readonly] { color: var(--text-2); }
.editor-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.live { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; color: var(--text-2); font-size: 0.875rem; }
.live b { color: var(--text); font: 600 0.95rem var(--mono); font-variant-numeric: tabular-nums; }
.live-state { color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.live-state::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--muted); opacity: 0.5;
}
.live-state[data-state="recording"] { color: var(--text-2); }
.live-state[data-state="recording"]::before { background: var(--series-2); opacity: 1; animation: pulse 1.4s ease-in-out infinite; }
.live-state[data-state="busy"]::before { background: var(--accent); opacity: 1; animation: pulse .7s ease-in-out infinite; }
.live-state[data-state="done"]::before { background: var(--ok); opacity: 1; }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.75); } }
.actions { display: flex; gap: 8px; margin-left: auto; }
.error { margin: 0; padding: 10px 16px; color: var(--danger); font-size: 0.9rem; }

.results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.results.reveal .tile, .results.reveal > .card, .results.reveal > .split { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.results.reveal .tile:nth-child(2) { animation-delay: 50ms; }
.results.reveal .tile:nth-child(3) { animation-delay: 100ms; }
.results.reveal .tile:nth-child(4) { animation-delay: 150ms; }
.results.reveal .tile:nth-child(5) { animation-delay: 200ms; }
.results.reveal > .card, .results.reveal > .split { animation-delay: 250ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; padding-top: 8px; }
.results-head p { margin: 4px 0 0; max-width: 60ch; }
.threshold { font-size: 0.875rem; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; }

.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; transition: box-shadow .2s, transform .2s; }
.tile:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.tile:first-child::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--accent); }
.tile:first-child .value { color: var(--accent-ink); }
.tile h3 { font-size: 0.85rem; color: var(--text-2); font-weight: 550; margin: 0; }
.tile .value { margin: 6px 0 2px; font-size: 2.25rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .value small { font-size: 0.8rem; font-weight: 500; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.tile .sub { margin: 0; font-size: 0.825rem; color: var(--muted); }

.review-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin-bottom: 12px; }
.review-head h3 { margin: 0; }
.review-summary { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.85rem; color: var(--text-2); }
.count { display: inline-flex; align-items: center; gap: 6px; }
/* A tiny underlined sample word, drawn exactly like the marks in the text. */
.swatch { font-size: 0.75rem; color: var(--muted); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.swatch.sp { text-decoration: underline wavy var(--issue-sp); text-decoration-thickness: 1.5px; }
.swatch.mech { text-decoration: underline solid var(--issue-mech); }
.swatch.unk { text-decoration: underline dotted var(--issue-unk); }
.written {
  margin: 0; padding: 14px 16px; border-radius: 10px; background: var(--surface-2);
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; color: var(--text);
}
mark.issue { background: none; color: inherit; cursor: pointer; border-radius: 3px; text-decoration-thickness: 2px; text-underline-offset: 3px; }
mark.issue.sp { text-decoration: underline wavy var(--issue-sp); text-decoration-thickness: 1.5px; }
mark.issue.mech { text-decoration: underline solid var(--issue-mech); }
mark.issue.unk { text-decoration: underline dotted var(--issue-unk); }
mark.issue.sp.hot, mark.issue.sp:hover { background: var(--issue-sp-bg); }
mark.issue.mech.hot, mark.issue.mech:hover { background: var(--issue-mech-bg); }
mark.issue.unk.hot, mark.issue.unk:hover { background: var(--surface); outline: 1px solid var(--border); }
.issue-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.issue-list:empty { display: none; }
.issue-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 8px; border-radius: 8px; font-size: 0.9rem; }
.issue-item:hover, .issue-item:focus { background: var(--surface-2); outline: none; }
.issue-item.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--issue-mech-bg); } to { background: transparent; } }
.issue-text { flex: 1; min-width: 12ch; }
.issue-text .found { color: var(--text-2); }
.issue-text .fix { font-weight: 600; }
.badge { font-size: 0.72rem; font-weight: 600; border-radius: 999px; padding: 1px 8px; white-space: nowrap; border: 1px solid var(--border); color: var(--text-2); background: var(--surface); }
.badge::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.badge.sp::before { background: var(--issue-sp); }
.badge.mech::before { background: var(--issue-mech); }
.badge.unk::before { background: var(--issue-unk); }
.btn.tiny { padding: 3px 9px; font-size: 0.78rem; border-radius: 7px; }
.dict { margin-top: 14px; font-size: 0.875rem; }
.dict summary { cursor: pointer; color: var(--text-2); }
.dict p { margin: 8px 0; }
.dict-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dict-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--surface-2); }
.chip-x { font: inherit; font-size: 0.75rem; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 999px; }
.chip-x:hover { color: var(--danger); background: var(--surface); }
.insights ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }

.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 8px; }
.chart-head h3 { margin-bottom: 2px; }
.chart-head p { margin: 0; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; font-size: 0.8rem; color: var(--text-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.key { display: inline-block; }
.key-bar { width: 10px; height: 12px; border-radius: 3px 3px 0 0; background: var(--series-1); }
.key-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--series-2); }
.key-pause { width: 14px; height: 12px; border-radius: 2px; background: var(--pause); outline: 1px solid var(--border); }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.chart .bar { fill: var(--series-1); }
.chart .del { fill: var(--series-2); stroke: var(--surface); stroke-width: 2; }
.chart .pause { fill: var(--pause); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover, .chart .hit.active { fill: var(--text); fill-opacity: 0.05; }
.chart .lane-label { font-size: 10px; }
.tooltip {
  position: fixed; z-index: 10; pointer-events: none; max-width: 240px;
  background: var(--text); color: var(--surface); border-radius: 8px; padding: 8px 10px;
  font-size: 0.8rem; line-height: 1.4; box-shadow: 0 4px 16px rgb(0 0 0 / 0.2);
}
.tooltip b { font-weight: 650; }
.table-view { margin-top: 12px; font-size: 0.85rem; }
.table-view summary { cursor: pointer; color: var(--text-2); }
.table-scroll { overflow-x: auto; max-height: 320px; overflow-y: auto; }

table { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 550; font-size: 0.8rem; position: sticky; top: 0; background: var(--surface); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.task-cell { white-space: normal; min-width: 220px; color: var(--text-2); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bands { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.band-row { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 10px; font-size: 0.875rem; }
.band-track { height: 10px; border-radius: 0 4px 4px 0; background: var(--surface-2); overflow: hidden; }
.band-fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 0; }
.band-val { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.details { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 0.875rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.history h2 { margin-bottom: 8px; font-size: 1.1rem; }
.history tbody tr { cursor: pointer; }
.history tbody tr:hover { background: var(--surface-2); }
.history tbody tr.current { background: var(--surface-2); }
.icon-btn { font: inherit; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.icon-btn:hover { color: var(--danger); background: var(--surface); }

/* Five tiles never leave an orphan: one row of five, or 2 + 2 + a full-width last tile. */
@media (max-width: 880px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile:last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .tile .value { font-size: 1.8rem; }
}
@media (max-width: 420px) {
  .actions { width: 100%; }
  .actions .btn.primary { flex: 1; justify-content: center; }
  .kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
/* Touch screens: Return is a line break there (see app.js), so don't advertise the key. */
@media (hover: none) and (pointer: coarse) {
  .kbd { display: none; }
}
