/* The Dictation Index: design system v0.1
   Reference-grade publication feel. Serif for reading, sans for data, mono for method.
   Zero external requests. Light and dark. */

:root {
  --paper: #f6f3ec;
  --paper-2: #eee9dd;
  --paper-3: #e6e0d2;
  --ink: #17160f;
  --ink-2: #3f3b30;
  --muted: #6f6a5d;
  --rule: #d8d2c3;
  --rule-2: #e6e1d4;
  --accent: #3b5f52;
  --accent-ink: #f6f3ec;
  --accent-soft: #e2eae5;
  --warn-soft: #f1e6cf;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 42rem;
  --wide: 76rem;
  --gutter: clamp(16px, 4vw, 40px);
  --section-gap: clamp(3rem, 7vw, 6rem);
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15140f;
    --paper-2: #1c1a14;
    --paper-3: #23211a;
    --ink: #ece7da;
    --ink-2: #cfc8b7;
    --muted: #a09a88;
    --rule: #2e2b23;
    --rule-2: #24221b;
    --accent: #8fb8a6;
    --accent-ink: #15140f;
    --accent-soft: #1f2b26;
    --warn-soft: #2b2619;
  }
}
:root[data-theme="dark"] {
  --paper: #15140f;
  --paper-2: #1c1a14;
  --paper-3: #23211a;
  --ink: #ece7da;
  --ink-2: #cfc8b7;
  --muted: #a09a88;
  --rule: #2e2b23;
  --rule-2: #24221b;
  --accent: #8fb8a6;
  --accent-ink: #15140f;
  --accent-soft: #1f2b26;
  --warn-soft: #2b2619;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 0, "tnum" 1;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em; text-decoration-color: var(--rule); }
a:hover { text-decoration-color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.5rem 0.75rem; font-family: var(--sans); font-size: 0.875rem; z-index: 100;
}
.skip:focus { left: var(--gutter); top: 0.5rem; }

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding-inline: var(--gutter); }
.measure { max-width: var(--measure); }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.005em; }
h2 { font-size: clamp(1.625rem, 1.1rem + 1.8vw, 2.25rem); line-height: 1.15; }
h3 { font-size: 1.25rem; line-height: 1.3; }
p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }

.label {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.label .num { color: var(--accent); margin-right: 0.6em; font-variant-numeric: tabular-nums; }

.lede { font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem); color: var(--ink-2); line-height: 1.5; }
.muted { color: var(--muted); }
.sans { font-family: var(--sans); }
.mono { font-family: var(--mono); font-size: 0.9em; }

/* ---------- Masthead ---------- */

.masthead {
  background: var(--paper-3);
}
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 3.75rem;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .the { color: var(--muted); font-style: italic; }
.masthead nav { display: flex; align-items: center; gap: 1.5rem; font-family: var(--sans); font-size: 0.875rem; }
.masthead nav a { text-decoration: none; color: var(--ink-2); }
.masthead nav a:hover { color: var(--accent); }
.tag {
  font-family: var(--sans);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .masthead nav .navlink { display: none; }
}

/* ---------- Hero ---------- */

.hero { padding-block: clamp(3rem, 7vw, 6rem); background: var(--paper-2); }
.hero .kicker { margin-bottom: 1.5rem; }
.hero h1 {
  font-size: clamp(2.25rem, 1.4rem + 4.2vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  max-width: 18ch;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
.hero .lede { max-width: var(--measure); margin-bottom: 2.5rem; }
.hero .status {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--sans); font-size: 0.875rem; color: var(--ink-2);
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 999px;
  padding: 0.5rem 0.9rem 0.5rem 0.7rem;
}
.hero .status .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.stat { padding: 1.25rem 1.25rem 1.25rem 0; border-right: 1px solid var(--rule-2); }
.stat:last-child { border-right: 0; }
.stat + .stat { padding-left: 1.25rem; }
.stat .n { font-family: var(--serif); font-size: clamp(2.5rem, 2rem + 2.5vw, 3.75rem); line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); transition: opacity 0.6s ease, transform 0.6s ease; }
/* Numbers are visible by default. The script opts the band into the reveal animation. */
.stats-anim .stat:not(.stat-visible) .n { opacity: 0; transform: translateY(0.25em); }
.stat .n small { font-size: 0.55em; color: var(--muted); margin-left: 0.15em; }
.stat .l { margin-top: 0.5rem; font-size: 0.8125rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--rule-2); padding: 1rem 0; }
  .stat + .stat { padding-left: 0; }
  .stat:nth-child(odd) { padding-right: 1rem; border-right: 1px solid var(--rule-2); }
  .stat:nth-child(even) { padding-left: 1rem; }
  .stat:nth-last-child(-n+2) { border-bottom: 0; }
}

/* ---------- Sections ---------- */

section { padding-block: var(--section-gap); scroll-margin-top: 1.5rem; }
.section-head { display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.section-head p { max-width: var(--measure); color: var(--ink-2); }

/* Top ten ledger */

.top { padding-block: clamp(3rem, 7vw, 6rem); }
.top-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.25rem; }
.top-head .label { margin-bottom: 0.75rem; }
.top-head h2 { margin-bottom: 0.75rem; }
.top-head p:not(.label):not(.top-legend) { max-width: var(--measure); color: var(--ink-2); margin: 0; }
.top-legend {
  font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  display: none; align-items: center; gap: 0.6rem; margin: 0; white-space: nowrap;
}
.top-legend .sw { display: inline-block; width: 1.75rem; height: 6px; border-radius: 3px; background: var(--rule-2); }

.ledger { list-style: none; margin: 0; padding: 0; }
.entry {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) minmax(13rem, 17rem);
  gap: 0.75rem 1.5rem;
  align-items: center;
  padding: 1.25rem;
  transition: background 120ms;
  cursor: pointer;
}
.entry:hover { background: linear-gradient(90deg, var(--paper-2), transparent 70%); border-radius: 12px; }
.entry-alt { background: color-mix(in srgb, var(--paper-2) 40%, transparent); border-radius: 12px; }
.entry:first-child { background: var(--accent-soft); border-radius: 12px; }
.entry:first-child:hover { background: color-mix(in srgb, var(--accent-soft) 80%, var(--paper-2)); }
.rank-icon {
  width: 2.75rem; height: 2.75rem; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-weight: 600; font-size: 0.875rem;
  color: #fff; overflow: hidden;
}
.rank-icon-has-img { background: transparent !important; }
.rank-icon-img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 12px;
}
.badges { display: inline; margin-left: 0.5rem; }
.badge {
  display: inline-flex; align-items: center;
  font-family: var(--sans); font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase;
  padding: 0.15em 0.55em; border-radius: 999px;
  line-height: 1.4;
  vertical-align: middle;
  position: relative; top: -0.1em;
  margin-right: 0.3rem;
}
.badge-gold { background: #d4a84220; color: #c9982e; border: 1px solid #d4a84240; }
.badge-blue { background: #4a8ec820; color: #5a9ad6; border: 1px solid #4a8ec840; }
.badge-green { background: #4a9e6820; color: #5aac76; border: 1px solid #4a9e6840; }
.badge-teal { background: #3b8f8f20; color: #4da8a4; border: 1px solid #3b8f8f40; }
.badge-silver { background: #8a8a8a18; color: #9a9a9a; border: 1px solid #8a8a8a30; }

.who h3 { font-size: 1.375rem; line-height: 1.2; }
.who h3 a { text-decoration: none; }
.who h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.who .desc { margin: 0.2rem 0 0.55rem; color: var(--ink-2); font-size: 0.9375rem; }
.who .meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }
.scorebox { display: grid; gap: 0.35rem; align-self: center; }
.track { position: relative; height: 2.25rem; border-radius: 6px; background: var(--rule-2); overflow: hidden; }
.fill { position: absolute; top: 0; bottom: 0; left: 0; background: var(--accent); border-radius: 6px; transition: width 800ms cubic-bezier(0.4, 0, 0.2, 1); }
.track-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 0.6rem; font-family: var(--sans); font-size: 0.75rem;
  pointer-events: none; z-index: 1;
}
.track-label span:first-child { color: var(--accent-ink); font-weight: 600; }
.track-label .n { font-family: var(--sans); color: var(--muted); }
.top-note { margin-top: 1rem; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); max-width: var(--measure); }
.stats.band { margin-top: clamp(2rem, 4vw, 3rem); }
@media (max-width: 760px) {
  .entry { grid-template-columns: 2.5rem minmax(0, 1fr); gap: 0.5rem 0.9rem; }
  .scorebox { grid-column: 1 / -1; }
  .rank-icon { width: 2.25rem; height: 2.25rem; font-size: 0.75rem; border-radius: 8px; }
  .rank-icon-img { border-radius: 8px; }
  .who h3 { font-size: 1.25rem; }
  .top-legend { white-space: normal; }
  .badges { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-left: 0; margin-top: 0.3rem; }
  .badge { font-size: 0.625rem; }
  .entry { padding-inline: 0.75rem; }
  .entry:first-child { padding-inline: 0.75rem; }
  .feat-chips { display: none; }
  .compare-label { font-size: 0.625rem; }
  .top-head-right { align-items: flex-start; }
  .legend-compare { display: none; }
  .hero-stat { flex-direction: column; gap: 0.25rem; }
}

/* Method steps */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
}
.step { padding: 1.5rem 1.5rem 1.75rem 0; border-bottom: 1px solid var(--rule); }
.step + .step { padding-left: 1.5rem; border-left: 1px solid var(--rule-2); }
.step .k { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 1rem; margin-bottom: 0.75rem; }
.step h3 { margin-bottom: 0.5rem; }
.step p { font-size: 0.9375rem; color: var(--ink-2); }
@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
  .step + .step { padding-left: 0; border-left: 0; }
}

.formula {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.formula .eq {
  font-family: var(--mono);
  font-size: clamp(1.125rem, 0.9rem + 1vw, 1.5rem);
  line-height: 1.5;
  padding: 0.25rem 0;
  white-space: nowrap;
  overflow-x: auto;
}
.formula .eq .v { color: var(--accent); }
.formula dl { margin: 0; font-size: 0.9375rem; display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; }
.formula dt { font-family: var(--mono); color: var(--accent); }
.formula dd { margin: 0; color: var(--ink-2); }
@media (max-width: 720px) { .formula { grid-template-columns: 1fr; } }

.publishes { margin-top: 2rem; font-size: 0.9375rem; color: var(--ink-2); }
.publishes ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.publishes li { margin-bottom: 0.25rem; }

/* ---------- Registry ---------- */

.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem;
  font-family: var(--sans); font-size: 0.8125rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.filters[hidden] { display: none; }
.fgroup { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.fgroup .fl { color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.6875rem; margin-right: 0.25rem; }
.chip {
  font: inherit; font-family: var(--sans);
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--rule); border-radius: 999px;
  border-color: color-mix(in srgb, var(--muted) 50%, transparent);
  padding: 0.3rem 0.7rem; cursor: pointer; line-height: 1.2;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.search {
  display: flex; align-items: center; gap: 0.5rem; flex: 1 1 14rem;
}
.search input {
  font: inherit; font-family: var(--sans);
  width: 100%; min-width: 0;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 0.45rem 0.7rem;
}
.search input::placeholder { color: var(--muted); }
.fmeta { margin-left: auto; display: flex; align-items: center; gap: 1rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 0.15em; }

.registry { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.9rem; margin-top: 0.25rem; }
.registry th, .registry td { text-align: left; vertical-align: top; padding: 0.9rem 0.75rem 0.9rem 0; border-bottom: 1px solid var(--rule-2); }
.registry th {
  position: sticky; top: 0; z-index: 2;
  background: var(--paper);
  font-weight: 500; font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--rule);
  padding-top: 0.75rem; padding-bottom: 0.6rem;
}
.registry td.tool { width: 34%; }
.registry .name { font-family: var(--serif); font-size: 1.0625rem; color: var(--ink); }
.registry .name a { text-decoration: none; }
.registry .name a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.registry tbody tr { cursor: pointer; transition: background 80ms; }
.registry tbody tr:hover { background: var(--paper-2); }
.registry .desc { display: block; color: var(--muted); font-size: 0.8125rem; margin-top: 0.15rem; line-height: 1.4; }
.registry .plat { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.registry .plat span {
  font-size: 0.75rem; color: var(--ink-2);
  border: 1px solid var(--rule); border-radius: 3px; padding: 0.1rem 0.4rem; white-space: nowrap;
}
.proc { white-space: nowrap; }
.proc::before {
  content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%;
  margin-right: 0.45rem; vertical-align: 0.05em; background: var(--muted);
}
.proc[data-v="on-device"]::before { background: var(--accent); }
.proc[data-v="hybrid"]::before { background: linear-gradient(90deg, var(--accent) 50%, var(--muted) 50%); }
.proc[data-v="cloud"]::before { background: var(--muted); }
.registry .score { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.registry .score .pend { border-bottom: 1px dotted var(--rule); }
.registry tr[hidden] { display: none; }
.registry .empty td { text-align: center; color: var(--muted); padding-block: 2.5rem; }

@media (max-width: 760px) {
  .registry, .registry tbody, .registry tr, .registry td { display: block; }
  .registry thead { position: absolute; left: -9999px; }
  .registry tr { padding: 1rem 0; border-bottom: 1px solid var(--rule-2); }
  .registry tr[hidden] { display: none; }
  .registry td { border: 0; padding: 0.2rem 0; width: auto; }
  .registry td.tool { width: auto; margin-bottom: 0.5rem; }
  .registry td:not(.tool)::before {
    content: attr(data-label);
    display: inline-block; width: 6.5rem;
    font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  }
  .registry .plat { display: inline-flex; vertical-align: top; }
  .fmeta { margin-left: 0; width: 100%; justify-content: space-between; }
}

.regnote { margin-top: 1.25rem; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }
.regnote a { color: var(--accent); }

/* ---------- Scope ---------- */

.scope-def {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
  line-height: 1.35;
  max-width: 30ch;
  margin-bottom: 2rem;
}
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.cols h3 { font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.75rem; }
.cols ul { list-style: none; margin: 0; padding: 0; }
.cols li { padding: 0.55rem 0; border-top: 1px solid var(--rule-2); display: flex; gap: 0.75rem; align-items: baseline; }
.cols li::before { font-family: var(--sans); font-size: 0.8125rem; color: var(--accent); width: 1rem; flex: 0 0 1rem; }
.cols .in li::before { content: "+"; }
.cols .out li::before { content: "\2013"; color: var(--muted); }

/* ---------- Why ---------- */

#why { background: var(--paper-2); padding-block: var(--section-gap); }
#method { background: var(--paper-3); padding-block: var(--section-gap); }
.why { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.why .claims { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.claim { padding: 1.25rem 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 2.5rem 1fr; gap: 0.5rem; }
.claim .k { font-family: var(--serif); font-style: italic; color: var(--accent); }
.claim h3 { font-size: 1.125rem; margin-bottom: 0.25rem; }
.claim p { font-size: 0.9375rem; color: var(--ink-2); }
@media (max-width: 800px) { .why { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */

.faq { border-top: 1px solid var(--rule); max-width: var(--measure); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none;
  padding: 1.1rem 2.5rem 1.1rem 0;
  font-family: var(--serif); font-size: 1.125rem; line-height: 1.35;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.25rem; top: 1rem;
  font-family: var(--sans); color: var(--accent); font-size: 1.25rem; line-height: 1;
  transition: transform 160ms;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { padding: 0 0 1.25rem; color: var(--ink-2); font-size: 1rem; max-width: 60ch; }

/* ---------- Tool page ---------- */

.tp-crumb { font-size: 0.8125rem; color: var(--muted); margin-bottom: 0; padding-top: clamp(2rem, 5vw, 4rem); }
.tp-crumb a { color: var(--accent); text-decoration: none; }
.tp-crumb a:hover { text-decoration: underline; }
.tp-crumb span { margin-inline: 0.3rem; color: var(--rule); }

.tp-hero {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem;
  padding: 1.25rem 0 2.5rem;
  border-bottom: 1px solid var(--rule);
}
.tp-hero-text { flex: 1; min-width: 0; }
.tp-hero h1 {
  font-size: clamp(2rem, 1.4rem + 2.5vw, 3rem);
  line-height: 1.1; margin-bottom: 0.6rem;
}
.tp-desc { color: var(--ink-2); font-size: 1.125rem; max-width: 36rem; }

/* Tool icon */
.tp-icon {
  width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-weight: 600; font-size: 1.25rem;
  color: #fff; margin-top: 0.2rem; overflow: hidden;
}
.tp-icon-has-img { background: transparent !important; }
.tp-icon-img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 12px;
}

.tp-visit {
  flex-shrink: 0; margin-top: 0.35rem;
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--sans); font-size: 0.875rem;
  padding: 0.5rem 1.1rem; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  text-decoration: none; white-space: nowrap;
  transition: opacity 120ms;
}
.tp-visit:hover { opacity: 0.85; }
.tp-visit span { font-size: 0.75rem; }

/* Overview */
.tp-overview {
  font-family: var(--serif); font-size: 1.0625rem; line-height: 1.65;
  color: var(--ink-2); max-width: 42rem;
  padding: 1.5rem 0 0;
}

.tp-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 6px; overflow: hidden;
  margin-top: 2rem;
}
.tp-card {
  background: var(--paper); padding: 1.25rem 1rem;
  font-family: var(--sans);
}
.tp-card-label {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 0.5rem;
}
.tp-card-val { font-size: 0.9375rem; font-weight: 500; }
.tp-card .plat { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tp-card .plat span {
  background: var(--paper-2); padding: 0.2rem 0.55rem; border-radius: var(--radius);
  font-size: 0.8125rem; font-weight: 400; white-space: nowrap;
}

/* Feature tags + verified date */
.tp-features {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  margin: 1.5rem 0 2rem; font-family: var(--sans);
}
.tp-feat {
  font-size: 0.75rem; padding: 0.3rem 0.7rem; border-radius: 2rem;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 500; white-space: nowrap;
}
.tp-verified {
  font-size: 0.75rem; color: var(--muted); font-family: var(--mono);
  margin-left: auto;
}


/* ---------- Index Score + Sentiment ---------- */
.tp-index {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}
.tp-index-grid {
  display: grid; grid-template-columns: auto 1fr;
  gap: clamp(3rem, 6vw, 6rem); align-items: center;
}

/* --- Score card (gauge container) --- */
.tp-score-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.75rem; text-align: center;
  background: var(--paper);
  border-radius: 16px;
  padding: 2rem 2.5rem 1.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
}
.tp-score-lbl {
  font-family: var(--sans); font-size: 0.6875rem;
  text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted);
}
.tp-score-meta {
  font-family: var(--mono); font-size: 0.6875rem; color: var(--muted);
}

/* --- SVG Gauge --- */
.tp-gauge { width: clamp(180px, 22vw, 260px); height: auto; display: block; }
.tp-gauge-ticks line {
  stroke: var(--rule); stroke-width: 1.5; stroke-linecap: round;
}
.tp-gauge-track {
  fill: none; stroke: var(--rule); stroke-width: 8;
}
.tp-gauge-fill {
  fill: none; stroke: var(--accent); stroke-width: 9;
  stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 100px 100px;
  transition: stroke-dasharray 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.tp-gauge-val {
  font-family: Georgia, 'Times New Roman', serif; font-size: 56px;
  fill: var(--ink); text-anchor: middle; dominant-baseline: auto;
}
.tp-gauge-unit {
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.08em;
  fill: var(--muted); text-anchor: middle;
}

/* --- Sentiment panel --- */
.tp-sentiment {
  display: flex; flex-direction: column;
  padding-top: 0.5rem;
}
.tp-sent-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 1.25rem;
}
.tp-sent-title {
  font-family: var(--sans); font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
  font-weight: 500;
}
.tp-sent-n {
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted); white-space: nowrap;
}

/* Stacked composition bar */
.tp-comp-bar {
  display: flex; height: 24px; border-radius: 12px;
  background: var(--rule); overflow: hidden;
}
.tp-comp-seg {
  height: 100%;
  transition: width 800ms cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}
.tp-comp-seg[data-s="positive"] { background: var(--accent); }
.tp-comp-seg[data-s="neutral"] { background: var(--muted); opacity: 0.45; }
.tp-comp-seg[data-s="negative"] { background: #8b5c3a; }
.tp-comp-seg:first-child { border-radius: 12px 0 0 12px; }
.tp-comp-seg:last-child { border-radius: 0 12px 12px 0; }
.tp-comp-seg:only-child { border-radius: 12px; }

/* Legend */
.tp-comp-legend {
  display: flex; gap: 2rem; margin-top: 1.5rem;
  font-family: var(--sans);
}
.tp-comp-item {
  display: flex; align-items: center; gap: 0.5rem;
}
.tp-comp-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.tp-comp-dot[data-s="positive"] { background: var(--accent); }
.tp-comp-dot[data-s="neutral"] { background: var(--muted); opacity: 0.45; }
.tp-comp-dot[data-s="negative"] { background: #8b5c3a; }
.tp-comp-name { font-size: 0.8125rem; color: var(--muted); }
.tp-comp-pct {
  font-family: var(--mono); font-size: 0.875rem;
  font-weight: 600; color: var(--ink-2);
}
.tp-sent-method {
  margin-top: 1.5rem; padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans); font-size: 0.8125rem;
}
.tp-sent-method a { color: var(--accent); text-decoration: none; }
.tp-sent-method a:hover { text-decoration: underline; }

/* ---------- Quotes / Mentions ---------- */
.tp-quotes { padding: clamp(3rem, 6vw, 5rem) 0; }
.tp-sec-title { font-size: 1.5rem; margin-bottom: 2rem; }

.tp-quote-empty { max-width: 42rem; }

/* Ghost skeleton cards */
.tp-ghost {
  display: flex; gap: 0;
  background: var(--paper-2); border-radius: 10px;
  overflow: hidden; margin-bottom: 0.75rem;
}
.tp-ghost-accent {
  width: 4px; flex-shrink: 0;
  background: var(--rule);
}
.tp-ghost:nth-child(1) .tp-ghost-accent { opacity: 0.7; }
.tp-ghost:nth-child(2) .tp-ghost-accent { opacity: 0.5; }
.tp-ghost:nth-child(3) .tp-ghost-accent { opacity: 0.3; }
.tp-ghost-body { padding: 1.25rem 1.5rem; flex: 1; }
.tp-ghost:nth-child(2) .tp-ghost-body { opacity: 0.65; }
.tp-ghost:nth-child(3) .tp-ghost-body { opacity: 0.35; }
.tp-ghost-line {
  height: 10px; background: var(--rule); border-radius: 5px;
  margin-bottom: 0.6rem; opacity: 0.6;
}
.tp-ghost-line:last-child { margin-bottom: 0; }
.tp-ghost-short { width: 6rem !important; }
.tp-ghost-attr {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 0.9rem;
}
.tp-ghost-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rule); opacity: 0.4;
}
.tp-ghost-note {
  font-family: var(--sans); font-size: 0.8125rem;
  color: var(--muted); margin-top: 1.5rem;
}

/* Populated quotes */
.tp-quote-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  max-width: 52rem;
}
.tp-quote {
  display: flex; gap: 0; text-decoration: none;
  background: var(--paper); border-radius: 10px;
  overflow: hidden; transition: box-shadow 120ms;
}
.tp-quote:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.tp-quote-accent {
  width: 4px; flex-shrink: 0; background: var(--rule);
}
.tp-quote-accent[data-s="positive"] { background: var(--accent); }
.tp-quote-accent[data-s="negative"] { background: #8b5c3a; }
.tp-quote-body { padding: 1rem 1.25rem; flex: 1; min-width: 0; }
.tp-quote-text {
  font-family: var(--serif); font-size: 0.9375rem;
  line-height: 1.6; color: var(--ink); margin: 0 0 0.75rem;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}
.tp-quote-attr {
  font-family: var(--sans); font-size: 0.75rem; color: var(--muted);
  display: flex; align-items: center; gap: 0.5rem;
}
.tp-quote-handle { font-weight: 500; }
.tp-quote-date { opacity: 0.7; }

/* ---------- Related ---------- */
.tp-related { padding-bottom: 2rem; }
.tp-related-head { margin-bottom: 1.5rem; }
.tp-related-head h2 { font-size: 1.375rem; margin-top: 0.25rem; }
.tp-related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1px;
  background: var(--rule); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden;
}
.tp-rel-card {
  display: flex; flex-direction: column; gap: 0.35rem;
  background: var(--paper); padding: 1rem 1.1rem;
  text-decoration: none; color: var(--ink);
  transition: background 120ms;
}
.tp-rel-card:hover { background: var(--paper-2); }
.tp-rel-name { font-family: var(--serif); font-size: 1.0625rem; }
.tp-rel-desc { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); line-height: 1.4; }
.tp-rel-meta { font-family: var(--sans); font-size: 0.75rem; color: var(--muted); margin-top: auto; padding-top: 0.35rem; }

@media (max-width: 720px) {
  .tp-hero { flex-direction: column; gap: 1rem; }
  .tp-cards { grid-template-columns: 1fr 1fr; }
  .tp-index-grid { grid-template-columns: 1fr; justify-items: center; gap: 2.5rem; }
  .tp-sentiment { width: 100%; max-width: none; }
  .tp-comp-legend { gap: 1.25rem; }
  .tp-quote-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .tp-cards { grid-template-columns: 1fr; }
  .tp-comp-legend { flex-direction: column; gap: 0.75rem; }
}

/* Dark-mode card depth (paper is darker than paper-2 in dark mode) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tp-score-card {
    background: var(--rule-2);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 6px 20px rgba(0,0,0,0.2);
  }
  :root:not([data-theme="light"]) .tp-ghost {
    background: var(--rule-2);
  }
  :root:not([data-theme="light"]) .tp-quote {
    background: var(--rule-2);
  }
}
:root[data-theme="dark"] .tp-score-card {
  background: var(--rule-2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 6px 20px rgba(0,0,0,0.2);
}
:root[data-theme="dark"] .tp-ghost {
  background: var(--rule-2);
}
:root[data-theme="dark"] .tp-quote {
  background: var(--rule-2);
}

/* ---------- Rank numbers ---------- */

.rank { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding-top: 0.15rem; }
.rank-num {
  font-family: var(--sans); font-size: 0.6875rem; font-weight: 600;
  color: var(--muted); letter-spacing: 0.02em;
}
.entry:first-child .rank-num { color: var(--accent); }

/* ---------- Delta chip ---------- */

.delta-chip {
  display: inline-flex; align-items: center;
  font-family: var(--sans); font-size: 0.5625rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent);
  padding: 0.1em 0.45em; border-radius: 999px;
  margin-left: 0.4rem; vertical-align: middle;
  position: relative; top: -0.1em;
}

/* ---------- Feature chips ---------- */

.feat-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.45rem; }
.feat-chip {
  font-family: var(--sans); font-size: 0.6875rem;
  color: var(--muted); background: var(--paper-2);
  border: 1px solid var(--rule-2); border-radius: 999px;
  padding: 0.15em 0.55em; line-height: 1.4; white-space: nowrap;
}
.feat-chip-proc { background: #e0e8f0; color: #4a6078; border-color: #c8d4e0; }
.feat-chip-plat { background: #e8e4dc; color: #6a6050; border-color: #d8d2c6; }
.feat-chip-price { background: #e8dff0; color: #6a5080; border-color: #d6cce4; }
.feat-chip-feat { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 20%, transparent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .feat-chip-proc { background: #1e2830; color: #8aacc4; border-color: #2a3a48; }
  :root:not([data-theme="light"]) .feat-chip-plat { background: #252218; color: #b0a888; border-color: #353020; }
  :root:not([data-theme="light"]) .feat-chip-price { background: #261e30; color: #b08acc; border-color: #362a44; }
  :root:not([data-theme="light"]) .feat-chip-feat { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 20%, transparent); }
}
:root[data-theme="dark"] .feat-chip-proc { background: #1e2830; color: #8aacc4; border-color: #2a3a48; }
:root[data-theme="dark"] .feat-chip-plat { background: #252218; color: #b0a888; border-color: #353020; }
:root[data-theme="dark"] .feat-chip-price { background: #261e30; color: #b08acc; border-color: #362a44; }
:root[data-theme="dark"] .feat-chip-feat { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 20%, transparent); }

/* ---------- Sentiment mini-bar ---------- */

.mini-sent-bar {
  display: flex; height: 2.25rem; border-radius: 6px;
  background: var(--rule-2); overflow: hidden;
}
.mini-sent-seg {
  height: 100%; min-width: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 0.75rem; font-weight: 600; overflow: hidden;
}
.mini-sent-seg span { padding: 0 0.3rem; white-space: nowrap; }
.mini-sent-seg[data-s="positive"] { background: var(--accent); color: var(--accent-ink); }
.mini-sent-seg[data-s="neutral"] { background: var(--muted); opacity: 0.4; }
.mini-sent-seg[data-s="negative"] { background: #8b5c3a; color: #f6f3ec; }
.mini-sent-seg:first-child { border-radius: 5px 0 0 5px; }
.mini-sent-seg:last-child { border-radius: 0 5px 5px 0; }

/* ---------- Compare ---------- */

.compare-label {
  display: flex; align-items: center; gap: 0.35rem;
  font-family: var(--sans); font-size: 0.6875rem; color: var(--muted);
  cursor: pointer; margin-top: 0.35rem; user-select: none;
}
.compare-cb { accent-color: var(--accent); cursor: pointer; }
.compare-panel {
  position: fixed; bottom: -20rem; left: 50%; transform: translateX(-50%);
  width: min(36rem, calc(100% - 2rem));
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 12px; box-shadow: 0 -4px 24px rgba(0,0,0,0.1);
  z-index: 50; transition: bottom 300ms ease;
  font-family: var(--sans);
}
.compare-visible { bottom: 1rem; }
.compare-inner { padding: 1.25rem 1.5rem; }
.compare-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: none; border: 0; font-size: 1.25rem; color: var(--muted);
  cursor: pointer; line-height: 1; padding: 0.25rem;
}
.compare-close:hover { color: var(--ink); }
.compare-title {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); margin-bottom: 1rem;
}
.compare-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: start; }
.compare-vs { font-style: italic; color: var(--muted); padding-top: 0.5rem; font-family: var(--serif); }
.compare-name { font-family: var(--serif); font-size: 1.125rem; margin-bottom: 0.35rem; }
.compare-score { font-family: var(--mono); font-size: 1.375rem; font-weight: 600; color: var(--accent); }
.compare-detail { font-size: 0.8125rem; color: var(--ink-2); margin-top: 0.25rem; }

/* ---------- Hero stat ---------- */

.hero-stat {
  display: flex; align-items: baseline; gap: 0.75rem;
  margin-bottom: 1.75rem; margin-top: -0.5rem;
}
.hero-stat-n {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 2rem + 2.5vw, 4rem);
  line-height: 1; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.hero-stat-l {
  font-family: var(--sans); font-size: 0.9375rem;
  color: var(--muted); max-width: 14ch; line-height: 1.35;
}

/* ---------- Updated date ---------- */

.top-updated {
  font-family: var(--mono); font-size: 0.6875rem; color: var(--muted);
  margin: 0.35rem 0 0;
}
.top-head-right { display: flex; flex-direction: column; align-items: flex-end; }

/* ---------- Sticky legend ---------- */

.legend-sticky {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  font-family: var(--sans); font-size: 0.6875rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); padding: 0.6rem 0;
}
.legend-sticky .wrap {
  display: flex; align-items: center; gap: 0.6rem; justify-content: flex-end;
}
.legend-sticky .sw {
  display: inline-block; width: 1.25rem; height: 5px;
  border-radius: 3px; background: var(--rule-2);
}
.legend-compare { margin-left: auto; font-style: normal; opacity: 0.6; }

/* ---------- Formula calculator ---------- */

.calc-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.calc-field {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-family: var(--sans); font-size: 0.6875rem; color: var(--muted);
}
.calc-field input {
  font-family: var(--mono); font-size: 1rem;
  width: 5.5rem; padding: 0.4rem 0.5rem;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius);
}
.calc-field input:focus { border-color: var(--accent); outline: none; }
.calc-result {
  font-family: var(--mono); font-size: 1.5rem;
  font-weight: 600; color: var(--accent);
  padding-top: 1rem;
}

/* ---------- Cite button ---------- */

.cite-btn {
  font: inherit; font-family: var(--sans); font-size: 0.8125rem;
  background: none; border: 1px solid var(--rule);
  color: var(--ink-2); border-radius: 999px;
  padding: 0.35rem 0.8rem; cursor: pointer;
  transition: border-color 120ms, color 120ms;
}
.cite-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Footer ---------- */

footer { border-top: 1px solid var(--rule); padding-block: 2.5rem 3.5rem; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }
footer .wrap { display: flex; flex-direction: column; gap: 1.75rem; }
.footer-main { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-provenance { max-width: var(--measure); font-size: 0.875rem; color: var(--ink-2); line-height: 1.55; margin: 0; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; padding-top: 1rem; border-top: 1px solid var(--rule-2); }
.footer-actions { display: flex; align-items: center; gap: 1.25rem; }
footer .links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
footer a { text-decoration: none; color: var(--ink-2); }
footer a:hover { color: var(--accent); }
footer .wm { font-family: var(--serif); font-size: 1.125rem; color: var(--ink); }

/* ---------- Print ---------- */

@media print {
  .masthead nav, .filters, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  .registry th { position: static; }
}
