/* ═══════════════════════════════════════════════════════════════════════════
   reading.css — the "Plan reading" card (js/reading-report.js)
   lane cc-impl-1 F1 · 2026-10-10 · NEW FILE. css/styles.css is FROZEN, so this is
   a separate sheet and MUST load AFTER it. Every rule is prefixed .rdg- and
   every colour is a design token, so both themes work: `:root` is the DARK
   palette and `:root.light` (a CLASS on <html>) overrides it.

   Two things this file deliberately does NOT do:
   . borrow the report's badge classes (.qa-count is a SOLID TEAL interactive
     pill — `--blue` is teal). Labels here are outlined tags, never solid pills,
     so a label cannot be mistaken for a button.
   . use a fixed grey. The only literal colours are translucent tints of the
     accent tokens' own values, which read on either background.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Two line weights, both from the theme-aware grey scale. `--border-color` is a
   60%-alpha #2e2e2e in the dark theme: over a #242424 chip it does not read as
   an edge at all, so outlined tags and chips use the next step up. */
.rdg-card {
  --rdg-rule: var(--gray-200);   /* table rules, dividers */
  --rdg-line: var(--gray-300);   /* outlines of chips, tags, buttons, tiles */
  color: var(--text); font-family: var(--font);
}
.rdg-hidden { display: none !important; }
.rdg-offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* ── header + tabs ─────────────────────────────────────────────────────────── */
.rdg-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px 6px;
}
.rdg-head h3 { margin: 0; font-size: .95rem; font-weight: 600; color: var(--text); }
.rdg-head-sub { font-size: 11px; color: var(--text-secondary); }

.rdg-tabs {
  display: flex; flex-wrap: wrap; gap: 2px;
  padding: 0 14px; border-bottom: 1px solid var(--rdg-rule);
}
.rdg-tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; padding: 8px 9px; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 500; color: var(--text-secondary);
  white-space: nowrap;
}
.rdg-tab:hover { color: var(--text); }
.rdg-tab:focus-visible, .rdg-src:focus-visible, .rdg-btn:focus-visible, .rdg-toggle:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 1px;
}
.rdg-tab-on { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.rdg-tab-n {
  margin-left: 5px; font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--text-secondary);
}

.rdg-body { padding: 14px 20px 18px; }
.rdg-pane { font-size: 13px; line-height: 1.5; }

/* ── text atoms ────────────────────────────────────────────────────────────── */
.rdg-h4 {
  margin: 18px 0 6px; font-size: 12px; font-weight: 600; color: var(--text);
  text-transform: uppercase; letter-spacing: .04em;
}
.rdg-pane > .rdg-h4:first-child, .rdg-group > .rdg-h4:first-child { margin-top: 2px; }
.rdg-h4-note {
  margin-left: 8px; font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--text-secondary);
}
.rdg-note { margin: 0 0 8px; font-size: 12px; color: var(--text-secondary); max-width: 92ch; }
.rdg-warn { color: var(--yellow); }
.rdg-muted { color: var(--text-secondary); }
.rdg-sub { font-size: 11px; color: var(--text-secondary); }
.rdg-mono { font-family: var(--font-mono); font-size: 12px; }
.rdg-r { text-align: right; font-variant-numeric: tabular-nums; }
.rdg-label {
  margin-right: 6px; font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-secondary);
}
.rdg-list { margin: 4px 0 8px; padding-left: 18px; font-size: 12.5px; }
.rdg-list li { margin: 2px 0; }
.rdg-card code { font-family: var(--font-mono); font-size: 11.5px; }

/* ── summary ───────────────────────────────────────────────────────────────── */
.rdg-project { font-size: 15px; font-weight: 600; line-height: 1.35; }
.rdg-built { margin: 2px 0 12px; font-size: 11.5px; color: var(--text-secondary); }
.rdg-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 4px; }
.rdg-fact {
  padding: 9px 12px; border: 1px solid var(--rdg-line); border-radius: var(--radius-sm, 8px);
  background: var(--surface);
}
.rdg-fact-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
.rdg-fact-value { font-family: var(--font-mono); font-size: 18px; font-weight: 600; line-height: 1.3; }
.rdg-fact-sub { font-size: 11px; color: var(--text-secondary); }

/* ── tags (labels — outlined, never solid) ─────────────────────────────────── */
.rdg-tag {
  display: inline-block; padding: 0 6px; margin-right: 6px;
  border: 1px solid var(--rdg-line); border-radius: 4px;
  font-size: 10.5px; font-weight: 600; line-height: 17px; letter-spacing: .02em;
  color: var(--text-secondary); white-space: nowrap; vertical-align: 1px;
}
.rdg-tag-warn, .rdg-tag-cand { color: var(--yellow); border-color: var(--yellow); }
.rdg-tag-dim { border-style: dashed; }
.rdg-tag-run { border-style: dashed; }
.rdg-sev-CRITICAL, .rdg-sev-HIGH { color: var(--red); border-color: var(--red); }
.rdg-sev-MEDIUM { color: var(--yellow); border-color: var(--yellow); }
.rdg-cat { font-size: 11px; color: var(--text-secondary); }
.rdg-pill {
  display: inline-block; padding: 2px 9px; border: 1px solid var(--rdg-line);
  border-radius: 999px; font-size: 12px; background: var(--surface);
}
.rdg-pill b { font-family: var(--font-mono); font-weight: 600; }

/* ── source links: chips, sheet numbers, counts ────────────────────────────── */
.rdg-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; vertical-align: middle; }
.rdg-src, .rdg-nolink {
  appearance: none; margin: 0; font: inherit; color: inherit; text-align: left;
  background: none; border: 0; padding: 0;
}
.rdg-src { cursor: pointer; }
.rdg-chip {
  display: inline-flex; align-items: baseline; gap: 5px; max-width: 52ch;
  padding: 1px 7px; border: 1px solid var(--rdg-line); border-radius: 5px;
  background: var(--surface); font-size: 11.5px; line-height: 18px;
}
.rdg-chip-sheet { font-family: var(--font-mono); font-weight: 600; white-space: nowrap; }
.rdg-chip-text { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdg-chip-code { font-family: var(--font-mono); font-weight: 600; }
.rdg-sheet {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  padding: 0 5px; border: 1px solid var(--rdg-line); border-radius: 4px;
  background: var(--surface); line-height: 18px; white-space: nowrap;
}
.rdg-numlink { font-family: var(--font-mono); font-size: 12px; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.rdg-titlelink { font-weight: 600; font-size: 13px; }
.rdg-src.rdg-chip:hover, .rdg-src.rdg-sheet:hover { border-color: var(--primary); color: var(--primary); }
.rdg-src.rdg-numlink:hover, .rdg-src.rdg-titlelink:hover { color: var(--primary); }
.rdg-nolink.rdg-sheet, .rdg-nolink.rdg-chip { border-style: dashed; color: var(--text-secondary); }

/* ── tables ────────────────────────────────────────────────────────────────── */
.rdg-tablewrap { overflow-x: auto; margin: 4px 0 10px; }
.rdg-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rdg-table th {
  padding: 6px 8px; text-align: left; vertical-align: bottom;
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-secondary); border-bottom: 1px solid var(--rdg-rule); white-space: nowrap;
}
.rdg-table td { padding: 6px 8px; vertical-align: top; border-bottom: 1px solid var(--rdg-rule); }
.rdg-table tbody tr:last-child td { border-bottom: 0; }
.rdg-table td.rdg-r, .rdg-table th.rdg-r { text-align: right; }
.rdg-table td.rdg-nw { white-space: nowrap; }
.rdg-table td.rdg-arrow { color: var(--text-secondary); width: 1%; }
.rdg-table-tight { width: auto; min-width: 50%; }
.rdg-table-tight td, .rdg-table-tight th { padding: 4px 10px 4px 8px; }
.rdg-table-grid { width: auto; font-size: 11.5px; }
.rdg-table-grid td, .rdg-table-grid th { border: 1px solid var(--rdg-rule); padding: 3px 7px; white-space: normal; }
.rdg-table-grid tbody tr:last-child td { border-bottom: 1px solid var(--rdg-rule); }
.rdg-table-facts th { display: none; }
.rdg-detail-row > td { padding: 0 8px; border-bottom: 0; }
.rdg-detail-row .rdg-lazy-body { padding: 6px 0 12px 14px; border-left: 2px solid var(--rdg-rule); margin: 0 0 8px 4px; }
.rdg-table-rooms td { min-width: 60px; }
.rdg-table td.rdg-mono { white-space: nowrap; width: 1%; }
.rdg-scroll { max-height: 460px; overflow: auto; }
.rdg-scroll .rdg-tablewrap { margin: 0; overflow: visible; }

/* a value and the sheets that print it */
.rdg-val { margin: 1px 0; }
.rdg-val-n { font-family: var(--font-mono); font-size: 12px; }
.rdg-val-conflict .rdg-val-n { color: var(--yellow); font-weight: 600; }
.rdg-kv { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; }

/* ── issues ────────────────────────────────────────────────────────────────── */
.rdg-group { margin-bottom: 16px; }
.rdg-issue {
  padding: 9px 12px; margin: 0 0 6px; border: 1px solid var(--rdg-line);
  border-radius: var(--radius-sm, 8px); background: var(--surface);
}
.rdg-issue-top { margin-bottom: 2px; }
.rdg-issue-title { margin: 1px 0; }
.rdg-issue-detail { font-size: 12.5px; max-width: 110ch; }
.rdg-issue-cites { margin-top: 5px; }
.rdg-rfi {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  margin-top: 6px; padding: 4px 0 4px 9px; border-left: 2px solid var(--primary);
  font-size: 12px; color: var(--text-secondary);
}
.rdg-rfi-text { flex: 1 1 auto; min-width: 0; max-width: 110ch; }
.rdg-issue-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.rdg-issue > .rdg-issue-actions { margin-top: 6px; }

/* ── buttons + toggles ─────────────────────────────────────────────────────── */
.rdg-btn {
  appearance: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 500;
  padding: 4px 11px; border: 1px solid var(--rdg-line); border-radius: 6px;
  background: var(--surface); color: var(--text);
}
.rdg-btn:hover { border-color: var(--primary); color: var(--primary); }
.rdg-btn[disabled] { opacity: .55; cursor: default; }
.rdg-btn-quiet { border-color: transparent; background: none; color: var(--text-secondary); }
.rdg-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.rdg-btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.rdg-toggle {
  appearance: none; cursor: pointer; background: none; border: 0; padding: 3px 0;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); text-align: left;
}
.rdg-toggle:hover { color: var(--primary); }
.rdg-toggle-inline { padding: 0; }
.rdg-caret { display: inline-block; width: 11px; color: var(--text-secondary); }
.rdg-group > .rdg-lazy-body { margin-top: 8px; }

/* ── gaps / ask / exports ──────────────────────────────────────────────────── */
.rdg-estimate {
  padding: 9px 12px; margin-bottom: 8px; border: 1px dashed var(--rdg-line);
  border-radius: var(--radius-sm, 8px); font-size: 12.5px;
}
.rdg-ask-row { display: flex; gap: 8px; margin-bottom: 6px; }
.rdg-ask-input {
  flex: 1 1 auto; min-width: 0; padding: 7px 10px; font: inherit; font-size: 13px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--rdg-line); border-radius: 6px;
}
.rdg-ask-input:focus { outline: none; border-color: var(--primary); }
.rdg-answer {
  margin-top: 8px; padding: 10px 12px; border: 1px solid var(--rdg-line);
  border-left-width: 3px; border-radius: var(--radius-sm, 8px); background: var(--surface);
}
.rdg-answer-head { margin-bottom: 4px; }
.rdg-answer-text { font-size: 13.5px; margin-bottom: 6px; }
.rdg-verdict-ok { border-left-color: var(--green); }
.rdg-verdict-ok .rdg-verdict-tag { color: var(--green); border-color: var(--green); }
.rdg-verdict-conflict { border-left-color: var(--yellow); background: rgba(245, 158, 11, .08); }
.rdg-verdict-conflict .rdg-verdict-tag { color: var(--yellow); border-color: var(--yellow); }
.rdg-exports { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 720px) {
  .rdg-body { padding: 12px; }
  .rdg-head { padding: 12px 12px 4px; }
  .rdg-tabs { padding: 0 6px; }
}
