/* The accuracy page (/accuracy, /accuracy/rows/{group}; ADR 0061), light
   theme. accuracy-dark.css overrides it for the dark theme (linked with
   data-theme-dark). Agreement is a status: green with a check, amber with a
   dot and a count, never color alone. */

.ac-page {
  --ac-good: #0aac23;
  --ac-good-ink: #006c10;
  --ac-good-soft: #e3f5e6;
  --ac-part: #fbb315;
  --ac-part-ink: #7a5300;
  --ac-part-soft: #fdf1d6;
  --ac-bad: #dc3c3d;
  --ac-bad-ink: #a3201f;
  --ac-bad-soft: #fbe6e6;
  --ac-none: #eceae4;
}

/* ---- Heading ---- */
.ac-hero { margin-bottom: 14px; }
.ac-eyebrow { color: var(--accent-moon); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin: 6px 0 4px; }
.ac-eyebrow a { color: inherit; text-decoration: none; }
.ac-eyebrow a:hover { text-decoration: underline; }
.ac-hero h1 { margin: 0; font-size: clamp(1.9rem, 5.5vw, 3rem); line-height: 1.06; letter-spacing: -0.02em; }
.ac-lede { max-width: 46em; font-size: 1.06rem; line-height: 1.55; margin: 10px 0 0; }
.ac-empty { max-width: 46em; margin-top: 14px; padding: 12px 16px; background: var(--accent-moon-soft); border-radius: 12px; }

.ac-tiles { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; max-width: 60em; }
.ac-tile { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.ac-tile strong { font-size: clamp(1.4rem, 4vw, 1.85rem); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ac-tile span { color: var(--muted); font-size: 0.9rem; line-height: 1.35; }
.ac-tile small { color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.ac-meta { color: var(--muted); font-size: 0.9rem; max-width: 52em; margin: 12px 0 0; }
.ac-meta a { color: var(--accent-moon); }

/* ---- Bands ---- */
.ac-band { margin-top: 30px; scroll-margin-top: 64px; }
.ac-band > h2 { font-size: 1.3rem; margin: 0 0 10px; }
.ac-note { color: var(--muted); font-size: 0.92rem; max-width: 48em; margin: 0 0 12px; }
.ac-note a, .ac-prose a { color: var(--accent-moon); }
.ac-prose { max-width: 46em; line-height: 1.58; }
.ac-prose p, .ac-p { margin: 0 0 12px; }

/* ---- A reference ---- */
.ac-source { margin-top: 16px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ac-source-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.ac-source-head h3 { margin: 0; font-size: 1.12rem; }
.ac-source-head h3 a { color: inherit; text-decoration: none; }
.ac-source-head h3 a:hover { text-decoration: underline; }
.ac-about { color: var(--muted); font-size: 0.92rem; margin: 6px 0 0; max-width: 52em; }
.ac-error { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--ac-bad-soft); color: var(--ac-bad-ink); font-size: 0.92rem; max-width: 52em; }
.ac-source .ac-note { margin: 10px 0 0; }

.ac-badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 650; line-height: 1.6; white-space: nowrap; }
.ac-badge-ok { background: var(--ac-good-soft); color: var(--ac-good-ink); }
.ac-badge-failed { background: var(--ac-bad-soft); color: var(--ac-bad-ink); }
.ac-badge-off { background: var(--ac-none); color: var(--muted); }

.ac-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 14px; }
.ac-group { border: 1px solid var(--line); border-left: 5px solid var(--ac-none); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.ac-group.ac-state-ok { border-left-color: var(--ac-good); }
.ac-group.ac-state-part { border-left-color: var(--ac-part); }
.ac-group-head h4 { margin: 0; font-size: 0.98rem; }
.ac-tally { margin: 3px 0 0; font-weight: 650; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.ac-state-ok .ac-mark { color: var(--ac-good-ink); }
.ac-state-part .ac-mark { color: var(--ac-part-ink); }
.ac-spread { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0; }
.ac-spread div { min-width: 0; }
.ac-spread dt { color: var(--muted); font-size: 0.72rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
.ac-spread dd { margin: 1px 0 0; font-size: 1.05rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.ac-test { color: var(--muted); font-size: 0.84rem; line-height: 1.45; margin: 8px 0 0; }

.ac-rows { margin-top: 8px; }
.ac-rows > summary { cursor: pointer; color: var(--accent-moon); font-size: 0.9rem; font-weight: 600; }
.ac-rows > summary:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 3px; border-radius: 4px; }
.ac-group:has(.ac-rows[open]) { grid-column: 1 / -1; }

/* ---- Rows ---- */
.ac-table-wrap, .ac-history-wrap { overflow-x: auto; margin-top: 8px; }
.ac-table, .ac-dev { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.ac-table th, .ac-table td, .ac-dev th, .ac-dev td { padding: 5px 10px 5px 0; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.ac-table thead th, .ac-dev thead th { color: var(--muted); font-size: 0.7rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }
.ac-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ac-table td:nth-child(3) { white-space: nowrap; }
.ac-table tr.ac-miss td { background: var(--ac-part-soft); }
.ac-verdict { white-space: nowrap; }
.ac-verdict > span:first-child { font-weight: 700; color: var(--ac-good-ink); }
.ac-miss .ac-verdict > span:first-child { color: var(--ac-part-ink); }
.ac-row-note { display: block; white-space: normal; color: var(--muted); font-size: 0.8rem; min-width: 14em; }
.ac-table-note { color: var(--muted); font-size: 0.82rem; margin: 6px 0 0; }
.ac-dev tbody th { font-weight: 650; }
.ac-dev td:last-child { font-variant-numeric: tabular-nums; }

/* ---- The last nights ---- */
.ac-history { border-collapse: separate; border-spacing: 2px; font-size: 0.78rem; }
.ac-history thead th { color: var(--muted); font-weight: 600; padding: 0 0 4px; vertical-align: bottom; }
.ac-history thead th:first-child { text-align: left; }
.ac-night { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; line-height: 1; }
.ac-history tbody th { text-align: left; font-weight: 600; padding-right: 10px; white-space: nowrap; max-width: 18em; overflow: hidden; text-overflow: ellipsis; }
.ac-cell { width: 22px; min-width: 22px; height: 22px; text-align: center; border-radius: 4px; font-weight: 700; font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.ac-cell.ac-state-ok { background: var(--ac-good-soft); color: var(--ac-good-ink); box-shadow: inset 0 -3px 0 var(--ac-good); }
.ac-cell.ac-state-part { background: var(--ac-part-soft); color: var(--ac-part-ink); box-shadow: inset 0 -3px 0 var(--ac-part); }
.ac-cell.ac-state-none { background: var(--ac-none); }
.ac-key { white-space: nowrap; font-weight: 600; }
.ac-key.ac-state-ok { color: var(--ac-good-ink); }
.ac-key.ac-state-part { color: var(--ac-part-ink); }

@media (max-width: 640px) {
  .ac-source { padding: 14px 14px; }
  .ac-groups { grid-template-columns: minmax(0, 1fr); }
  .ac-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-tile { padding: 12px; }
  /* A row per comparison on phones: place and date, then ours, theirs and the difference. */
  .ac-table thead { display: none; }
  .ac-table tbody tr { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); }
  .ac-table tbody td { border: 0; padding: 0; }
  .ac-table tbody td:nth-child(1) { font-weight: 650; }
  .ac-table tbody td:nth-child(2) { text-align: right; color: var(--muted); }
  .ac-table tbody td:nth-child(3) { grid-column: 1 / -1; color: var(--muted); }
  .ac-table tbody td:nth-child(4)::before { content: "Ours "; color: var(--muted); }
  .ac-table tbody td:nth-child(5)::before { content: "Theirs "; color: var(--muted); }
  .ac-table tbody td:nth-child(4), .ac-table tbody td:nth-child(5) { grid-column: 1 / -1; white-space: normal; }
  .ac-table tbody td:nth-child(6) { font-weight: 650; }
  .ac-table tbody td:nth-child(7) { text-align: right; }
  .ac-row-note { min-width: 0; }
  .ac-history tbody th { max-width: 9em; }
}
