@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./golos-text.woff2") format("woff2");
}

@font-face {
  font-family: "Cabin";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("./cabin.woff2") format("woff2");
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./bricolage-grotesque.woff2") format("woff2");
}

/* Mirrors mobile/src/theme.js and docs/brand/STYLE-GUIDE.md. Orange marks the
   brand and the next action; status colors carry state only. */
:root {
  --bg: #fff9f3;
  --paper: #fff;
  --paper-soft: #f7f1ea;
  --ink: #211d19;
  --muted: rgba(33, 29, 25, 0.62);
  --faint: rgba(33, 29, 25, 0.54);
  --line: rgba(33, 29, 25, 0.09);
  --line-strong: rgba(33, 29, 25, 0.16);
  --orange: #e8772e;
  --orange-dark: #b64e16;
  --orange-soft: rgba(232, 119, 46, 0.12);
  --neutral: rgba(33, 29, 25, 0.42);
  --neutral-soft: rgba(33, 29, 25, 0.07);
  --green: #4fa05a;
  --green-soft: rgba(79, 160, 90, 0.1);
  --green-border: rgba(79, 160, 90, 0.25);
  --warning: #d9a13b;
  --warning-soft: rgba(217, 161, 59, 0.14);
  --red: #c4472f;
  --red-soft: rgba(196, 71, 47, 0.1);
  --radius-control: 14px;
  --radius-focus: 16px;
  --radius-collection: 20px;
  --shadow: 0 4px 12px rgba(33, 29, 25, 0.1);
  --shadow-small: 0 2px 8px rgba(33, 29, 25, 0.05);
  --font-body: "Golos Text", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-heading: "Cabin", var(--font-body);
  --font-brand: "Bricolage Grotesque", var(--font-heading);
  color: var(--ink);
  font-family: var(--font-body);
  font-synthesis: none;
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(232, 119, 46, 0.5);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 10px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--orange-dark);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.wordmark {
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.brand-mark {
  display: block;
  flex: none;
  width: 34px;
  height: 34px;
  color: var(--orange);
}

.brand-mark-small {
  width: 30px;
  height: 30px;
}

/* Authentication gate */
.gate {
  display: grid;
  min-height: 100vh;
  padding: 40px 24px;
  place-items: center;
}

.gate-brand {
  position: absolute;
  top: 32px;
  left: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gate-card {
  width: min(100%, 520px);
  padding: 48px;
  text-align: center;
  background: var(--paper);
  border-radius: var(--radius-collection);
}

.gate-card h1 {
  max-width: 470px;
  margin: 12px auto 14px;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.gate-card .lede {
  max-width: 440px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.google-button,
.primary-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
  padding: 0 22px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 17px;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.google-button {
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
}

.google-button:hover {
  background: var(--paper-soft);
}

.primary-button:hover {
  background: var(--orange-dark);
}

.google-button:disabled,
.primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.google-mark {
  display: grid;
  width: 25px;
  height: 25px;
  color: #4285f4;
  font-family: Arial, sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  place-items: center;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 50%;
}

.primary-button {
  color: #fff;
  background: var(--orange);
  border: 1px solid var(--orange);
}

.gate-note {
  margin: 18px 0 0;
  color: var(--faint);
  font-size: 0.76rem;
}

.loader {
  width: 42px;
  height: 42px;
  margin: 0 auto 24px;
  border: 4px solid var(--orange-soft);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.state-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 22px;
  font-size: 1.75rem;
  font-weight: 600;
  place-items: center;
  border-radius: 50%;
}

.denied-icon {
  color: var(--red);
  background: var(--red-soft);
}

.error-icon {
  color: var(--orange-dark);
  background: var(--orange-soft);
}

/* Dashboard shell */
.dashboard {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(20px, 4vw, 54px);
  background: rgba(255, 249, 243, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}

.brand-divider {
  width: 1px;
  height: 22px;
  margin: 0 3px;
  background: var(--line-strong);
}

.product-name {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.account-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  color: var(--orange-dark);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  place-items: center;
  background: var(--orange-soft);
  border-radius: 50%;
}

.account-copy {
  display: grid;
  gap: 1px;
}

.account-copy strong {
  font-size: 0.76rem;
}

.account-copy span {
  color: var(--muted);
  font-size: 0.68rem;
}

.quiet-button,
.refresh-button,
.range-picker button,
.inline-alert button {
  min-height: 36px;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--paper);
  border: 0;
  border-radius: var(--radius-control);
}

.quiet-button {
  margin-left: 4px;
  padding: 0 12px;
}

.quiet-button:hover,
.refresh-button:hover,
.range-picker button:hover,
.inline-alert button:hover {
  color: var(--ink);
  background: var(--paper);
}

.dashboard-shell {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 48px clamp(20px, 4vw, 54px) 36px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 30px;
}

.page-heading h1 {
  margin: 9px 0 7px;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.heading-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.heading-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
}

.range-picker {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--paper);
  border-radius: var(--radius-control);
}

.range-picker button {
  min-width: 43px;
  min-height: 32px;
  color: var(--muted);
  background: transparent;
  border-radius: 10px;
}

.range-picker button[aria-pressed="true"] {
  color: var(--orange-dark);
  background: var(--orange-soft);
}

.refresh-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  background: var(--paper);
}

.refresh-button:disabled,
.range-picker button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.inline-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -10px 0 22px;
  padding: 13px 15px;
  color: #743428;
  font-size: 0.78rem;
  background: var(--red-soft);
  border: 1px solid rgba(189, 80, 62, 0.18);
  border-radius: 12px;
}

.inline-alert button {
  min-height: 30px;
  color: #743428;
  border-color: rgba(189, 80, 62, 0.28);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  max-width: min(380px, calc(100vw - 44px));
  padding: 12px 16px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--ink);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.audio-preview-item { padding: 1rem 0; border-top: 1px solid var(--line); }
.audio-preview-item audio { display: block; max-width: 100%; margin: .5rem 0; }
.audio-preview-item textarea { display: block; width: 100%; min-height: 5rem; margin: .5rem 0; }
#audio-previews { padding: 1.5rem; margin-top: 1.5rem; overflow-wrap: anywhere; }
#audio-previews details { padding: .75rem 0; }

#nightly-reviewers {
  padding: 1.5rem;
  margin-block: 1rem;
  overflow-wrap: anywhere;
  scroll-margin-top: 1rem;
}
#nightly-reviewers h3 { margin-block: 1.25rem .5rem; }
#nightly-reviewers p, #nightly-reviewers ol, #nightly-reviewers ul { margin-block: .65rem; }
#nightly-reviewers a { display: inline-block; margin-block: .35rem; }
#nightly-reviewers button { margin-block: .75rem; }

/* Audio review is an exception queue, with processing and release state above it. */
.audio-review-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.audio-review-heading h2 { margin:0; }
.audio-review-intro { max-width:76ch; color:var(--muted); line-height:1.65; }
#audio-previews button { padding:.65rem .9rem; border:0; border-radius:var(--radius-control); background:var(--orange-soft); color:var(--orange-dark); font-family:var(--font-heading); font-weight:700; cursor:pointer; }
#audio-previews button:disabled { opacity:.55; cursor:default; }
.audio-review-preview { border-top:1px solid var(--line); margin-top:1rem; }
.audio-review-preview > summary { font-weight:700; cursor:pointer; padding:.5rem 0; }
.audio-review-body { padding:.5rem 0; }
.audio-review-status { padding:1rem; background:var(--paper-soft); border-radius:.75rem; font-weight:650; line-height:1.6; margin-bottom:.65rem; }
.audio-review-next { max-width:85ch; line-height:1.65; }
.audio-review-notice { padding:1rem; background:var(--orange-soft); border-radius:.65rem; line-height:1.6; }
.audio-review-filters { display:flex; gap:.5rem; flex-wrap:wrap; margin:1.5rem 0 .75rem; }
#audio-previews .audio-review-filters button[aria-pressed="true"] { background:var(--ink); border-color:var(--ink); color:var(--paper); }
#audio-previews input[type="search"] { width:100%; max-width:32rem; padding:.8rem; font:inherit; border:1px solid var(--line-strong); border-radius:.6rem; background:var(--paper); }
#audio-previews .audio-preview-item { padding:1.5rem; margin-top:1rem; border-radius:var(--radius-focus); background:var(--paper); }
.audio-preview-item h3 { margin:0 0 .65rem; font-size:1rem; overflow-wrap:anywhere; }
.audio-preview-item h4 { margin:1.25rem 0 .5rem; }
.audio-preview-item p { line-height:1.65; margin:.5rem 0; }
.audio-review-badge { display:inline-block; padding:.2rem .65rem; border-radius:1rem; background:var(--orange-soft); font-size:.85rem; }
.audio-review-label { font-size:.82rem; font-weight:700; color:var(--muted); }
.audio-review-japanese { font-size:1.12rem; line-height:1.9 !important; }
.audio-review-comparison { display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin:.8rem 0; }
.audio-review-comparison > div { background:var(--bg); padding:.8rem; border-radius:.65rem; min-width:0; }
.audio-review-comparison mark { background:var(--warning-soft); color:var(--ink); border-bottom:2px solid var(--warning); }
.audio-review-hint { font-size:.85rem; color:var(--muted); }
.audio-preview-item label { display:block; font-weight:600; margin-top:1rem; }
#audio-previews textarea { font:inherit; padding:.75rem; border:1px solid var(--line-strong); border-radius:.6rem; resize:vertical; background:var(--paper); }
.audio-review-actions { display:flex; flex-wrap:wrap; gap:.65rem; }
#audio-previews .audio-review-actions button:first-child { background:var(--green-soft); color:#2f6b38; }
.audio-review-decision:not(:empty) { padding:.8rem; background:var(--paper-soft); border-radius:.6rem; }
@media (max-width:650px) { .audio-review-comparison { grid-template-columns:1fr; } #audio-previews .audio-preview-item { padding:1rem; } }

/* Audio review is a focused work surface, separate from usage telemetry. */
.audio-review-page { max-width: 940px; margin: 0 auto; padding: 32px; }
.audio-review-heading h2 { font-size: clamp(25px, 4vw, 36px); letter-spacing: -.025em; }
.audio-review-intro { color: var(--muted); max-width: 680px; line-height: 1.65; }
.audio-review-workspace { background: var(--paper); border-radius: var(--radius-focus); padding: 28px; margin: 24px 0; }
.audio-review-workspace h3 { font-family: var(--font-heading); font-size: 26px; margin: 0 0 12px; }
.audio-review-workspace p { line-height: 1.65; }
.audio-review-workspace button, .audio-review-heading button, .audio-review-library button { border: 0; background: var(--orange-soft); color: var(--orange-dark); font-family: var(--font-heading); font-weight: 700; border-radius: 12px; padding: 12px 16px; min-height: 46px; cursor: pointer; font: inherit; }
.audio-review-workspace button:hover { background: rgba(232, 119, 46, 0.2); }
.audio-review-workspace button:disabled { opacity: .45; cursor: default; }
.audio-review-card { outline: none; }
.audio-review-card .audio-review-japanese { font-size: clamp(23px, 4vw, 30px); line-height: 1.85; margin: 24px 0 12px; color: var(--ink); }
.audio-review-reading { color: var(--muted); font-size: 16px; }
.audio-review-card audio { width: 100%; margin: 16px 0 4px; }
.audio-review-card details { margin-top: 18px; }
.audio-review-card summary, .audio-review-library summary { cursor: pointer; color: var(--muted); padding: 8px 0; }
.audio-review-card label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.audio-review-card textarea { display: block; margin-top: 10px; width: 100%; min-height: 80px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px; font: inherit; }
.audio-review-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.audio-review-actions .audio-review-good { background: var(--green); border-color: var(--green); color: white; }
.audio-review-actions .audio-review-good:hover { background: #3f8a4a; }
.audio-review-library { border-top: 1px solid var(--line); padding-top: 16px; }
.audio-review-library input[type="search"] { width: 100%; margin: 12px 0; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; }
.audio-review-library-row { border-bottom: 1px solid var(--line); padding: 14px 0; }
.audio-review-library-row button { text-align: left; width: 100%; overflow-wrap: anywhere; }
.audio-review-page :focus-visible { outline: 3px solid rgba(232, 119, 46, 0.5); outline-offset: 3px; }
@media (max-width: 600px) { .audio-review-page { padding: 20px 16px; } .audio-review-workspace { padding: 20px 16px; } .audio-review-actions button { flex: 1 1 42%; } }
.audio-review-page[data-reviewing="true"] .audio-review-heading h2 { font-size: 25px; }
.audio-review-page[data-reviewing="true"] .audio-review-workspace { margin-top: 12px; }
.audio-review-card .audio-review-label { margin: 0; }
.audio-review-card .audio-review-badge { margin: 8px 0; }
.audio-review-card .audio-review-japanese { margin: 16px 0 8px; }
.audio-review-decision:empty { display: none; }

/* Account reporting shares the dashboard panels, typography and controls. */
.learners-page { min-width: 0; }
.learners-page > .learner-button { margin-bottom: 18px; }
.learners-page .panel { padding: 26px; margin-bottom: 22px; }
.learners-page h2 { font-family: var(--font-heading); font-size: 1.7rem; letter-spacing: -.025em; margin: 8px 0 12px; }
.learner-note { font-size: .79rem; color: var(--muted); line-height: 1.7; max-width: 105ch; }
.learner-status { padding: 24px 0; line-height: 1.6; color: var(--muted); }
.learner-button { padding: 10px 14px; min-height: 44px; border: 0; background: var(--orange-soft); color: var(--orange-dark); border-radius: var(--radius-control); cursor: pointer; font-family: var(--font-heading); font-weight: 700; font-size: .79rem; }
.learner-button:hover { background: rgba(232, 119, 46, 0.2); }
.learner-button:disabled { cursor: default; opacity: .4; }
.learner-table-wrap { overflow-x: auto; margin: 22px 0 16px; }
.learner-table-wrap:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.learner-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .76rem; line-height: 1.6; }
.learner-table th { font-family: var(--font-heading); font-weight: 700; color: var(--muted); font-size: .7rem; }
.learner-table th, .learner-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); min-width: 94px; vertical-align: middle; }
.learner-table th:first-child, .learner-table td:first-child { padding-left: 0; }
.learner-table .learner-button { white-space: nowrap; }
.learner-identity { min-width: 155px; max-width: 225px; overflow-wrap: anywhere; }
.learner-identity strong, .learner-identity span { display: block; }
.learner-identity span { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.learner-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 15px; font-size: .78rem; color: var(--muted); }
.learner-email { margin: 4px 0; font-size: .93rem; overflow-wrap: anywhere; }
.learner-id { font-size: .7rem; color: var(--muted); overflow-wrap: anywhere; }
.learner-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.learner-metric { border-top: 1px solid var(--line); padding: 14px 0 0; }
.learner-metric dt { font-size: .74rem; font-weight: 700; color: var(--muted); }
.learner-metric dd { margin: 10px 0 0; font-family: var(--font-heading); font-size: 2rem; font-weight: 700; }
.learner-metric p { margin: 7px 0 0; font-size: .72rem; line-height: 1.55; color: var(--muted); }
.learner-timeline { list-style: none; margin: 20px 0 0; padding: 0; }
.learner-timeline > li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; border-top: 1px solid var(--line); padding: 18px 0; font-size: .84rem; }
.learner-timeline time { color: var(--muted); font-size: .74rem; }
.learner-event-properties { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 4px 0 0; }
.learner-event-properties > div { display: flex; gap: 6px; max-width: 100%; font-size: .74rem; line-height: 1.6; }
.learner-event-properties dt { color: var(--muted); white-space: nowrap; }
.learner-event-properties dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 760px) { .learners-page .panel { padding: 20px 16px; } .learner-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .learner-metrics { grid-template-columns: minmax(0, 1fr); } .learner-pagination { justify-content: space-between; } }

.writing-review-card { background: var(--paper); border-radius: var(--radius-focus); padding: 24px; margin: 20px 0; }
.writing-review-card h3 { margin-top: 0; }
.writing-review-card h4 { margin: 18px 0 6px; font-size: 14px; }
.writing-review-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; margin: 0 0 12px; }
.writing-review-text[lang="ja"] { font-size: 20px; }
.writing-review-card summary { cursor: pointer; margin-top: 16px; font-weight: 600; }
.writing-review-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.writing-review-controls select, .writing-review-controls button { padding: 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); }
.writing-review-controls button:disabled { opacity: 0.45; cursor: default; }

.release-detail { padding: 1.25rem; border: 1px solid var(--border, #ddd5c9); border-radius: 12px; }
.release-detail dl { display: grid; grid-template-columns: minmax(8rem, 10rem) minmax(0, 1fr); gap: .4rem 1rem; }
.release-detail dt { font-weight: 600; }
.release-detail dd { margin: 0; overflow-wrap: anywhere; }
.release-detail a + a { margin-left: 1rem; }
.release-actions { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.release-actions a, .release-detail a, .release-history a { color: var(--orange-dark); text-underline-offset: 3px; }
.release-history { width: 100%; border-collapse: collapse; font-size: .9rem; }
.release-history th, .release-history td { text-align: left; padding: .6rem; border-bottom: 1px solid var(--border, #ddd5c9); }
#nightly-reviewers details { margin-top: 1.5rem; }
@media (max-width: 600px) { .release-detail dl { grid-template-columns: 1fr; } .release-detail dd { margin-bottom: .5rem; } .release-history { font-size: .8rem; } .release-history th:last-child, .release-history td:last-child { display: none; } }


/* Panels used by the audio review, builds and waitlist pages. */
.panel { min-width: 0; padding: 23px; background: var(--paper); border-radius: var(--radius-focus); }
.panel h2 { margin: 5px 0 0; font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }

/* ---------------------------------------------------------------------------
   Reporting pages. Every page shares one skeleton: heading and filters, a row
   of headline numbers, one chart, then sortable tables. Definitions live in
   tooltips and the Guide, not in paragraphs beside the numbers.
   ------------------------------------------------------------------------- */
:root {
  /* Five categorical slots, validated for color-vision deficiency (dataviz
     reference order: blue, orange, aqua, yellow, magenta). */
  --series-words: #2a78d6;
  --series-grammar: #eb6834;
  --series-input: #1baf7a;
  --series-output: #eda100;
  --series-review: #e87ba4;
  --bar-current: var(--orange);
  --bar-earlier: rgba(232, 119, 46, 0.3);
  --ok: #cfc3b4;
}

.dashboard-shell { padding-top: 22px; }
.dashboard-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0 0 22px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.dashboard-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-family: var(--font-heading); font-size: 0.86rem; font-weight: 600; text-decoration: none; }
.dashboard-nav a:hover { color: var(--ink); background: var(--paper-soft); }
.dashboard-nav a[aria-current="page"] { color: var(--orange-dark); background: var(--orange-soft); }
.dashboard-nav .nav-guide { margin-left: auto; }
.nav-divider { width: 1px; height: 20px; margin: 0 6px; background: var(--line-strong); }
.nav-count { min-width: 20px; padding: 1px 6px; color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 1.5; text-align: center; background: var(--orange); border-radius: 999px; }

.page-heading { align-items: center; gap: 18px; margin-bottom: 20px; }
.page-heading h1 { margin: 0 0 4px; font-size: 1.75rem; }
.heading-note { font-size: 0.82rem; }
.heading-actions { flex-wrap: wrap; justify-content: flex-end; }
.heading-control:empty { display: none; }

.view { display: grid; gap: 16px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; }

/* Controls */
.control { display: inline-flex; align-items: center; gap: 6px; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.segmented button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; color: var(--muted); font-family: var(--font-heading); font-size: 0.8rem; font-weight: 700; cursor: pointer; background: transparent; border: 0; border-radius: 9px; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { color: var(--orange-dark); background: var(--orange-soft); }
.segmented .count { min-width: 18px; padding: 0 5px; color: var(--muted); font-size: 0.7rem; background: var(--neutral-soft); border-radius: 999px; }
.button { min-height: 34px; padding: 0 13px; color: var(--orange-dark); font-family: var(--font-heading); font-size: 0.8rem; font-weight: 700; cursor: pointer; background: var(--orange-soft); border: 0; border-radius: 10px; }
.button:hover { background: rgba(232, 119, 46, 0.2); }
.button.primary { color: #fff; background: var(--orange); }
.button.primary:hover { background: var(--orange-dark); }
.button.quiet { color: var(--ink); background: var(--paper-soft); }
.button:disabled { cursor: default; opacity: 0.5; }
.link-button { display: grid; gap: 1px; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; background: none; border: 0; }
.link-button strong { font-weight: 700; }
.link-button span { color: var(--muted); font-size: 0.72rem; }
.link-button:hover strong { color: var(--orange-dark); }
.link-button.inline { display: inline; color: var(--orange-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.back-button { justify-self: start; padding: 0; color: var(--orange-dark); font-family: var(--font-heading); font-size: 0.82rem; font-weight: 700; text-decoration: none; cursor: pointer; background: none; border: 0; }
.search { min-height: 34px; width: min(260px, 100%); padding: 0 12px; color: var(--ink); font: inherit; font-size: 0.82rem; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; }
.search:focus-visible, select:focus-visible { outline: 3px solid rgba(232, 119, 46, 0.5); outline-offset: 2px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toolbar select { min-height: 34px; max-width: 100%; padding: 0 10px; font: inherit; font-size: 0.8rem; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 10px; }

/* Definitions */
.term { display: inline-flex; align-items: center; gap: 5px; }
.info { display: inline-grid; width: 16px; height: 16px; flex: none; padding: 0; color: var(--muted); font-family: Georgia, serif; font-size: 0.66rem; font-style: italic; font-weight: 700; line-height: 1; cursor: help; place-items: center; background: transparent; border: 1px solid var(--line-strong); border-radius: 50%; }
.info:hover, .info:focus-visible { color: var(--orange-dark); border-color: var(--orange); }
.info.static { cursor: default; vertical-align: middle; }
.tooltip { position: absolute; z-index: 50; display: grid; gap: 6px; padding: 12px 14px; color: #fff; font-size: 0.78rem; line-height: 1.5; background: var(--ink); border-radius: 12px; box-shadow: var(--shadow); pointer-events: auto; }
.tooltip[data-placement="above"] { transform: translateY(-100%); }
.tooltip strong { font-family: var(--font-heading); font-size: 0.82rem; }
.tooltip p { margin: 0; }
.tooltip .tooltip-source { color: rgba(255, 255, 255, 0.7); font-size: 0.72rem; }
.tooltip a { color: #ffc49b; }

/* Headline numbers */
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; min-width: 0; flex-direction: column; gap: 6px; padding: 16px 18px 14px; background: var(--paper); border-radius: var(--radius-focus); }
.kpi-label { margin: 0; color: var(--muted); font-family: var(--font-heading); font-size: 0.8rem; font-weight: 600; }
.kpi-value { margin: 2px 0 0; font-family: var(--font-heading); font-size: 2.3rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-of { color: var(--faint); font-size: 1rem; font-weight: 600; letter-spacing: 0; }
.kpi-note { margin: 0; color: var(--muted); font-size: 0.74rem; }
.delta { color: var(--muted); font-size: 0.74rem; font-weight: 600; }
.delta.good { color: #2f7a3b; }
.delta.bad { color: var(--red); }
.spark { display: block; width: 100%; height: 28px; margin-top: auto; padding-top: 6px; }
.spark .current { fill: var(--bar-current); }
.spark .earlier { fill: var(--bar-earlier); }

/* Cards and charts */
.card { min-width: 0; padding: 18px 20px; background: var(--paper); border-radius: var(--radius-focus); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-family: var(--font-heading); font-size: 1.02rem; font-weight: 700; }
.aside-note { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.74rem; }
.card-foot, .page-foot { margin: 10px 0 0; color: var(--muted); font-size: 0.74rem; line-height: 1.5; }
.page-foot a, .card-foot a { color: var(--orange-dark); text-underline-offset: 3px; }
.subhead { display: flex; align-items: center; gap: 6px; margin: 16px 0 6px; color: var(--muted); font-family: var(--font-heading); font-size: 0.8rem; font-weight: 600; }
.muted-text { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.6; }
.muted-text a { color: var(--orange-dark); }
.chart { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; }
.chart .y-axis { display: flex; height: 200px; flex-direction: column; justify-content: space-between; color: var(--faint); font-size: 0.66rem; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; }
.chart .x-axis { display: flex; margin-top: 6px; color: var(--faint); font-size: 0.66rem; }
.chart .x-axis span { flex: 1 1 0; min-width: 0; overflow: hidden; text-align: center; white-space: nowrap; }
.chart .plot { min-width: 0; }
.chart .bars { display: block; width: 100%; height: 200px; overflow: visible; }
.chart.small .y-axis, .chart.small .bars { height: 130px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .hit { fill: transparent; }
.chart .bar:hover .hit { fill: var(--neutral-soft); }
.chart .segment { stroke: var(--paper); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.chart .current .segment.value { fill: var(--bar-current); }
.chart .earlier .segment.value { fill: var(--bar-earlier); }
.chart .segment.words { fill: var(--series-words); }
.chart .segment.grammar { fill: var(--series-grammar); }
.chart .segment.input { fill: var(--series-input); }
.chart .segment.output { fill: var(--series-output); }
.chart .segment.review { fill: var(--series-review); }
.chart .segment.ok { fill: var(--ok); }
.chart .segment.rejected { fill: var(--warning); }
.chart .segment.error { fill: var(--red); }
.chart .earlier .segment:not(.value) { opacity: 0.45; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--muted); font-size: 0.74rem; }
.key { display: inline-flex; align-items: center; gap: 6px; }
.key::before { width: 10px; height: 10px; content: ""; border-radius: 3px; background: var(--swatch, var(--bar-current)); }
.key-current { --swatch: var(--bar-current); }
.key-earlier { --swatch: var(--bar-earlier); }
.key-words { --swatch: var(--series-words); }
.key-grammar { --swatch: var(--series-grammar); }
.key-input { --swatch: var(--series-input); }
.key-output { --swatch: var(--series-output); }
.key-review { --swatch: var(--series-review); }
.key-ok { --swatch: var(--ok); }
.key-rejected { --swatch: var(--warning); }
.key-error { --swatch: var(--red); }
.dot { display: inline-block; width: 9px; height: 9px; flex: none; border-radius: 3px; background: var(--swatch, var(--bar-current)); }
.dot.key-words, .dot.key-grammar, .dot.key-input, .dot.key-output, .dot.key-review { background: var(--swatch); }
.dot::before { display: none; }
.meter { width: 64px; height: 8px; flex: none; }
.meter .track { fill: var(--neutral-soft); }
.meter .fill { fill: var(--bar-current); }
.with-meter { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; font-variant-numeric: tabular-nums; }

/* Tables */
.table-wrap { max-width: 100%; overflow-x: auto; }
.table-wrap:focus-visible { outline: 3px solid rgba(232, 119, 46, 0.5); outline-offset: 2px; }
.data-table { width: 100%; font-size: 0.82rem; line-height: 1.45; text-align: left; border-collapse: collapse; }
.data-table th { padding: 8px 10px; color: var(--muted); font-family: var(--font-heading); font-size: 0.74rem; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line-strong); }
.data-table td { padding: 10px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.data-table th:first-child, .data-table td:first-child { padding-left: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table th.num .sort { flex-direction: row-reverse; }
.data-table .sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; color: inherit; font: inherit; cursor: pointer; background: none; border: 0; }
.data-table .sort:hover { color: var(--ink); }
.sort-mark { color: var(--faint); font-size: 0.7rem; }
th[aria-sort] .sort-mark { color: var(--orange-dark); }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: var(--bg); }
.empty-row { color: var(--muted); text-align: center; }
.finance-page { display: grid; gap: 16px; }
.finance-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.finance-warning { padding: 12px 16px; color: #774512; background: #fff1d6; border: 1px solid #f0d19b; border-radius: var(--radius-focus); font-size: .84rem; line-height: 1.5; }
.finance-source-actions { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .76rem; }
.finance-edit-link { white-space: nowrap; }
.finance-breakdown { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.finance-breakdown li, .finance-total { display: flex; justify-content: space-between; gap: 16px; margin: 0; }
.finance-breakdown li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .83rem; }
.finance-breakdown strong, .finance-total strong { font-variant-numeric: tabular-nums; }
.finance-breakdown .finance-empty { color: var(--muted); }
.finance-total { padding-top: 12px; color: var(--muted); font-size: .8rem; }
.finance-total strong { color: var(--ink); }
.finance-issue-list { margin: 0; padding-left: 20px; color: var(--red); font-size: .83rem; line-height: 1.65; }
.finance-issue-list li, .finance-held-list li { padding: 5px 0; }
.finance-issue-next-step { display: block; color: var(--muted); }
.finance-issue-list a, .finance-held-list a, .finance-recurring-list a { display: inline-block; margin-left: 8px; color: var(--orange-dark); font-size: .76rem; }
.finance-on-hold { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.finance-on-hold summary { width: fit-content; cursor: pointer; }
.finance-held-list { margin: 8px 0 0; padding-left: 20px; line-height: 1.55; }
.finance-clear { margin: 0; color: var(--muted); font-size: .83rem; }
.finance-recurring { border-top: 3px solid var(--orange); }
.finance-recurring-total { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.finance-recurring-label { margin: 0; color: var(--muted); font-size: .84rem; }
.finance-recurring-amount { margin: 4px 0 0; font-family: var(--font-heading); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.finance-recurring-counts { margin: 0 0 4px; color: var(--muted); font-size: .76rem; text-align: right; }
.finance-recurring-note { margin: 12px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.finance-recurring-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-top: 18px; }
.finance-recurring-group { min-width: 0; }
.finance-recurring-group h3 { margin: 0 0 8px; font-family: var(--font-heading); font-size: .9rem; }
.finance-plan-confirmation > summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.finance-plan-confirmation > section { margin-top: 12px; }
.finance-recurring-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.finance-recurring-item { min-width: 0; padding: 10px 0; border-top: 1px solid var(--line); font-size: .78rem; }
.finance-recurring-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.finance-recurring-main > div { display: grid; min-width: 0; gap: 2px; }
.finance-recurring-main strong { overflow-wrap: anywhere; }
.finance-recurring-vendor, .finance-recurring-meta { color: var(--muted); }
.finance-recurring-prices { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.finance-recurring-meta { margin: 4px 0 0; font-size: .72rem; line-height: 1.45; }
.finance-plan-details { margin-top: 6px; color: var(--muted); font-size: .72rem; }
.finance-plan-details summary { width: fit-content; cursor: pointer; }
.finance-plan-details-content { display: grid; gap: 3px; margin-top: 5px; }
.finance-plan-details-content p { margin: 0; line-height: 1.45; }
.finance-plan-details-content a { margin-left: 0; }
.finance-plan-status.review { color: var(--orange-dark); background: var(--orange-soft); }
.finance-plan-status.inactive { color: var(--muted); background: var(--neutral-soft); }
.finance-inactive-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .76rem; }
.finance-table-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.finance-search, .finance-status-filter { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--paper); font: inherit; font-size: .76rem; }
.finance-search { width: min(220px, 42vw); }
.finance-verification.matched { color: #1f6f58; background: rgba(27, 175, 122, .12); }
.finance-verification.receipt { color: #5b4a86; background: rgba(91, 74, 134, .1); }
.finance-verification.manual { color: var(--muted); background: var(--neutral-soft); }
.finance-verification.review { color: var(--orange-dark); background: var(--orange-soft); }
.finance-amount { display: grid; justify-items: end; white-space: nowrap; }
.finance-amount strong { font-weight: 650; }
.finance-allocation { color: var(--muted); font-size: .68rem; }
.finance-transactions .table-wrap { overflow-x: auto; }
.finance-transactions .data-table { min-width: 1320px; }
.type-name { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; overflow-wrap: anywhere; }
.mono.small { font-size: 0.7rem; color: var(--muted); }
.low-sample { color: var(--faint); }
.bad-text { color: var(--red); font-weight: 700; }

/* Small facts */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; color: var(--muted); font-size: 0.7rem; font-weight: 700; white-space: nowrap; background: var(--neutral-soft); border-radius: 999px; }
.badge.internal { color: #5b4a86; background: rgba(91, 74, 134, 0.1); }
.badge.events { color: #1f6f58; background: rgba(27, 175, 122, 0.12); }
.badge.new { color: var(--orange-dark); background: var(--orange-soft); }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.stat-row.compact { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.stat { min-width: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.stat dt { color: var(--muted); font-size: 0.76rem; }
.stat dd { margin: 4px 0 2px; font-family: var(--font-heading); font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.inline-stat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 12px 0 0; color: var(--muted); font-size: 0.78rem; }
.inline-stat strong { color: var(--ink); font-family: var(--font-heading); font-size: 1.15rem; }

/* States */
.state { display: grid; gap: 6px; justify-items: center; padding: 34px 20px; text-align: center; background: var(--paper); border-radius: var(--radius-focus); }
.state .loader { width: 30px; height: 30px; margin: 0 0 6px; border-width: 3px; }
.state-title { margin: 0; font-family: var(--font-heading); font-weight: 700; }
.state-text { max-width: 520px; margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.6; }
.state.error .state-title { color: var(--red); }
.view[aria-busy="true"] > :not(.state) { opacity: 0.55; transition: opacity 120ms ease; }
.inline-alert { margin: 0; }

/* Learners */
.learner-cell { display: inline-flex; align-items: center; gap: 10px; }
.status-dot { display: inline-block; width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--line-strong); }
.status-dot.day { background: #2f9e57; }
.status-dot.week { background: var(--orange); }
.status-dot.older { background: rgba(33, 29, 25, 0.25); }
.status-dot.none { background: transparent; border: 1.5px solid rgba(33, 29, 25, 0.35); }
.profile { display: grid; gap: 8px; }
.profile-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.profile-title h2 { margin: 0; font-family: var(--font-heading); font-size: 1.4rem; }
.profile-meta { margin: 0; color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.chips li { padding: 4px 10px; font-size: 0.76rem; background: var(--bg); border-radius: 999px; }
.feedback-mini { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.feedback-mini li { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.82rem; }
.feedback-mini a { color: var(--ink); overflow-wrap: anywhere; }
.feedback-mini .meta { color: var(--muted); font-size: 0.72rem; }
.feedback-mini .badge { justify-self: start; }
.timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 0.8rem; }
.timeline-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.timeline time { color: var(--muted); font-size: 0.74rem; }
.properties { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 6px 0 0; }
.properties > div { display: flex; gap: 6px; max-width: 100%; font-size: 0.74rem; }
.properties dt { color: var(--muted); white-space: nowrap; }
.properties dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }

/* Feedback */
.feedback-list { display: grid; gap: 12px; }
.feedback-card { display: grid; gap: 8px; padding: 16px 18px; background: var(--paper); border-left: 4px solid var(--orange); border-radius: var(--radius-focus); }
.feedback-card.done { border-left-color: var(--line-strong); }
.feedback-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.feedback-head .who { display: inline-flex; align-items: center; gap: 8px; }
.feedback-head time { color: var(--muted); font-size: 0.76rem; }
.feedback-message { margin: 0; font-size: 0.95rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-meta { margin: 0; color: var(--muted); font-size: 0.76rem; overflow-wrap: anywhere; }
.feedback-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ack-note { color: #2f7a3b; font-size: 0.78rem; font-weight: 600; }
.feedback-details summary { color: var(--muted); font-size: 0.76rem; cursor: pointer; }
.feedback-details dl { display: grid; gap: 4px; margin: 8px 0 0; font-size: 0.74rem; }
.feedback-details dl > div { display: flex; gap: 8px; }
.feedback-details dt { min-width: 60px; color: var(--muted); }
.feedback-details dd { margin: 0; overflow-wrap: anywhere; }
.feedback-screenshot { display: block; max-width: min(100%, 360px); max-height: 640px; border: 1px solid var(--line); border-radius: 10px; }
.focus-note { margin: 0; font-size: 0.82rem; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; color: var(--muted); font-size: 0.8rem; }
.collapsible > summary { font-family: var(--font-heading); font-weight: 700; cursor: pointer; }
.collapsible[open] > summary { margin-bottom: 10px; }

/* Guide */
.guide .card h2 { margin: 0 0 10px; font-family: var(--font-heading); font-size: 1.05rem; }
.guide-list { display: grid; gap: 8px; margin: 0; padding-left: 18px; font-size: 0.86rem; line-height: 1.55; }
.guide-sources { display: grid; gap: 12px; margin: 0; }
.guide-sources dt { font-weight: 700; }
.guide-sources dd { margin: 2px 0 0; color: var(--muted); font-size: 0.84rem; line-height: 1.55; }
.guide-intro { margin: 0 0 10px; font-size: 0.86rem; line-height: 1.55; }
.collection td.yes { color: #2f7a3b; font-weight: 700; }
.collection td.no { color: var(--faint); }
.glossary-group h3 { margin: 18px 0 6px; color: var(--orange-dark); font-family: var(--font-heading); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; }
.glossary-group dl { display: grid; gap: 0; margin: 0; }
.glossary-term { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.glossary-term:target { background: var(--orange-soft); }
.glossary-term dt { font-weight: 700; font-size: 0.86rem; }
.glossary-term dd { display: grid; gap: 4px; margin: 0; font-size: 0.84rem; line-height: 1.55; }
.glossary-term .how { color: var(--muted); }
.glossary-term .term-source { color: var(--faint); font-size: 0.72rem; }

@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .finance-recurring-total { align-items: start; flex-direction: column; gap: 8px; }
  .finance-recurring-counts { text-align: left; }
}

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .gate-brand { top: 23px; left: 24px; }
  .gate-card { padding: 42px 25px; }
  .topbar { min-height: 60px; padding: 10px 16px; }
  .brand .wordmark, .brand-divider, .product-name, .account-copy { display: none; }
  .dashboard-shell { padding: 16px 16px 28px; }
  .dashboard-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .dashboard-nav a { flex: none; }
  .dashboard-nav .nav-guide { margin-left: 0; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .heading-actions { justify-content: flex-start; }
  .card { padding: 16px 14px; }
  .glossary-term { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .data-table { min-width: 560px; }
  .collection.data-table { min-width: 0; }
  .chart .x-axis span:nth-child(even) { visibility: hidden; }
}

@media (max-width: 420px) {
  .kpi { padding: 14px; }
  .kpi-value { font-size: 1.9rem; }
  .segmented button { padding: 0 9px; }
}
