/* ============================================================================
   USCCB Analytics - one stylesheet, no framework.

   Dark by default, light on request. Every colour is a token, so the two
   themes differ only in the :root blocks. Layout is grid + clamp() throughout,
   so the page reflows continuously instead of jumping between breakpoints.
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ----------------------------------------------------------------------------
   Brand palette: #062137 deep navy, #007A53 green, #7bafd4 light blue.

   Blue is primary — links, the active tab, the users line. Green is secondary —
   page-view bars and positive change. Navy is structural: in dark mode it IS
   the card surface, in light mode it is the body text.

   The two themes cannot share one blue. #7bafd4 on white is about 1.9:1, far
   under the 4.5:1 text minimum, so light mode uses a darkened version of the
   same hue and keeps #7bafd4 for fills only. Dark mode raises the green to
   #00a06c for the same reason in reverse: #007A53 on navy is too close in
   value to read as a line.
   ------------------------------------------------------------------------- */

:root {
  color-scheme: dark;

  --bg:          #03121d;
  --bg-glow:     #0a3150;
  --surface:     #062137;
  --surface-2:   #0a2b45;
  --surface-3:   #0f3653;
  --border:      #17415f;
  --border-soft: #0c2c46;

  --text:        #e9f2f9;
  --text-dim:    #9dbdd4;
  --text-faint:  #6a8ba5;

  --accent:      #7bafd4;
  --accent-2:    #00a06c;
  --accent-soft: rgba(123, 175, 212, 0.15);
  /* Text laid over a solid brand fill. Navy on both, not white: white on the
     dark-mode green measures 3.36:1, under the 4.5:1 minimum, while navy on it
     reaches 4.88:1. */
  --on-accent:   #062137;
  --on-accent-2: #062137;
  --gold:        #e8b86d;

  --up:          #2fb583;
  --up-soft:     rgba(47, 181, 131, 0.15);
  --down:        #fb7185;
  --down-soft:   rgba(251, 113, 133, 0.14);

  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(0,0,0,.35), 0 8px 24px -12px rgba(0,0,0,.65);

  --step--1: clamp(.75rem, .72rem + .12vw, .8rem);
  --step-0:  clamp(.875rem, .85rem + .12vw, .925rem);
  --step-1:  clamp(1rem, .96rem + .2vw, 1.125rem);
  --step-2:  clamp(1.25rem, 1.15rem + .5vw, 1.5rem);
  --step-3:  clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem);

  --gutter: clamp(1rem, .6rem + 2vw, 2rem);
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg:          #f4f8fb;
  --bg-glow:     #dbe9f4;
  --surface:     #ffffff;
  --surface-2:   #f7fafc;
  --surface-3:   #eaf2f8;
  --border:      #d2e1ec;
  --border-soft: #e6eef5;

  --text:        #062137;
  --text-dim:    #4a6b83;
  /* Card meta and section notes are small; #7d99ad on white is only 2.99:1. */
  --text-faint:  #5a7a91;

  --accent:      #1f6f9e;
  --accent-2:    #007A53;
  --accent-soft: rgba(31, 111, 158, 0.10);
  --on-accent:   #ffffff;
  --on-accent-2: #ffffff;
  --gold:        #b4790f;

  --up:          #007A53;
  --up-soft:     rgba(0, 122, 83, 0.11);
  --down:        #be123c;
  --down-soft:   rgba(190, 18, 60, 0.1);

  --shadow: 0 1px 2px rgba(6,33,55,.05), 0 8px 24px -16px rgba(6,33,55,.26);
}

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: var(--step-0)/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif;
  min-height: 100vh;
  /* One soft wash behind the header keeps the page from reading as a flat
     sheet of cards, without costing a background image. */
  background-image: radial-gradient(120% 60% at 50% -10%, var(--bg-glow) 0%, transparent 70%);
  background-repeat: no-repeat;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Tabular figures wherever numbers are compared down a column. */
.num, td.num, th.num, .metric__value, .delta { font-variant-numeric: tabular-nums; }

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

/* A cold report waits on GA4 for ten seconds or more, so the click needs an
   acknowledgement. Fixed to the viewport top, above the sticky tab bar. */
.loadbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 100;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: transform .24s ease-out;
  pointer-events: none;
}
.loadbar[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  /* Still shown — it is information, not decoration — but it steps rather
     than glides. */
  .loadbar { transition: none; }
}

/* ---------------------------------------------------------------- shell --- */

.shell { max-width: 1440px; margin-inline: auto; padding: 0 var(--gutter) 5rem; }

.masthead {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: clamp(1.25rem, 3vw, 2rem) 0 1.25rem;
}

.masthead__brand { display: flex; align-items: center; gap: .85rem; margin-right: auto; }
.masthead__names { display: flex; flex-direction: column; line-height: 1.25; }

/**
 * The supplied logo.svg is solid #fff throughout, so dropping it in as an
 * <img> would leave it invisible on the light theme. Masking paints the
 * element's own background through the artwork's alpha instead, so one file
 * renders correctly in both themes and inherits the brand colour — no second
 * asset, and no 65KB of inline SVG on every page.
 */
.logo {
  display: block;
  height: 30px;
  aspect-ratio: 119.16 / 36;
  flex: none;
  /* Brand green: #007A53 exactly on light. Dark mode uses the lifted #00a06c
     from the same token, because #007A53 on the navy surface falls to 3.05:1 —
     enough for a solid shape, not for the hairline lettering in this wordmark. */
  background-color: var(--accent-2);
  -webkit-mask: url("logo.svg") no-repeat center / contain;
  mask: url("logo.svg") no-repeat center / contain;
}

/**
 * The login mark is white, on the brand navy.
 *
 * White alone would not survive both themes — the light theme's card is
 * #ffffff, so a white logo on it would be invisible. The plate keeps the navy
 * constant regardless of theme, which is also how this mark is normally used.
 */
.logo-plate {
  display: inline-flex;
  padding: .9rem 1.25rem;
  margin: 0 auto 1.25rem;
  border-radius: 14px;
  background: #062137;
}

.logo--login { height: 38px; margin: 0; background-color: #fff; }

/* A hairline between the mark and the tool's own name. */
.masthead__rule {
  width: 1px;
  align-self: stretch;
  margin: .1rem 0;
  background: var(--border);
  flex: none;
}

/* ANALYZE sits light so the bold PRO carries the emphasis; the wordmark is set
   in caps, so it needs positive tracking rather than the tightening used on
   sentence-case headings. */
.masthead__title { font-size: var(--step-1); font-weight: 400; letter-spacing: .075em; line-height: 1.2; }
.masthead__title strong, .login__title strong { font-weight: 800; }

/* On light, the wordmark and its tagline take the brand blue. Dark keeps them
   in --text: #1f6f9e against the navy surface is 2.4:1, and the lighter
   #7bafd4 against white is 1.9:1, so neither blue survives both themes here. */
:root[data-theme="light"] .masthead__title,
:root[data-theme="light"] .masthead__sub,
:root[data-theme="light"] .login__title { color: var(--accent); }
.masthead__sub   { font-size: var(--step--1); color: var(--text-faint); }
.masthead__tools { display: flex; align-items: center; gap: .5rem; }

/* ---------------------------------------------------------------- tabs ---- */

.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: .25rem;
  padding: .4rem;
  margin-bottom: 1.5rem;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 1 0 auto;
  padding: .55rem 1rem;
  border-radius: 10px;
  font-size: var(--step-0);
  font-weight: 550;
  color: var(--text-dim);
  text-align: center;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.tab:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.tab[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------- controls --- */

.controls {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.controls__label { font-size: var(--step--1); color: var(--text-faint); text-transform: uppercase; letter-spacing: .07em; }
.controls__spacer { margin-left: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-dim);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 550;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent-2); }

select.btn {
  padding-right: 2rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
                    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: right 1.05rem center, right .8rem center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* A segmented control, sized like the buttons it sits beside. */
.segs {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.seg {
  padding: .4rem .75rem;
  border-radius: 7px;
  font-size: var(--step--1);
  font-weight: 550;
  color: var(--text-dim);
  white-space: nowrap;
}
.seg:hover { color: var(--text); text-decoration: none; }
.seg[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }

/* The Page tab's address field. Takes the whole first row of the controls so
   a long URL stays readable; the period and buttons wrap beneath it. */
.pagefield {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  flex: 1 1 100%;
}
.pagefield input[type="url"] {
  flex: 1 1 22rem;
  min-width: 0;
  padding: .55rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: var(--step-0);
}
.pagefield input[type="url"]:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pagefield input[aria-invalid="true"] { border-color: var(--down); }
.pagefield__sub {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: var(--step--1);
  color: var(--text-dim);
  white-space: nowrap;
  cursor: pointer;
}
.pagefield__sub input { accent-color: var(--accent); }
.pagefield__help { flex: 1 1 100%; font-size: var(--step--1); display: grid; gap: .25rem; }
.pagefield__help:empty { display: none; }
.pagefield__error { color: var(--down); }
.pagefield__query { color: var(--gold); }
.pagefield__query code { font-size: .95em; }

.pagelink { color: var(--text); overflow-wrap: anywhere; }
.dim { color: var(--text-faint); }
.pagelink:hover { color: var(--accent); }

.empty--page { max-width: 62ch; margin-inline: auto; display: grid; gap: .6rem; }

.grid + .card { margin-top: 1rem; }

/* ------------------------------------------------------------- sections --- */

.section { margin-bottom: 2.5rem; }

.section__head {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .9rem;
}
.section__title { font-size: var(--step-2); font-weight: 620; letter-spacing: -.02em; }
.section__note  { font-size: var(--step--1); color: var(--text-faint); }

.grid { display: grid; gap: 1rem; }
.grid--metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.grid--thirds  { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--halves  { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }

/* ---------------------------------------------------------------- card ---- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card__head {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border-soft);
}
.card__title { font-size: var(--step-0); font-weight: 600; letter-spacing: -.01em; }
.card__meta  { margin-left: auto; font-size: var(--step--1); color: var(--text-faint); }
.card__body  { padding: 1.1rem; }

/* -------------------------------------------------------------- metric ---- */

.metric { padding: 1.15rem 1.25rem; }
.metric__label { font-size: var(--step--1); color: var(--text-dim); font-weight: 550; }
.metric__value { font-size: var(--step-3); font-weight: 680; letter-spacing: -.035em; line-height: 1.1; margin: .3rem 0 .45rem; }
.metric__foot  { display: flex; align-items: center; gap: .5rem; font-size: var(--step--1); color: var(--text-faint); flex-wrap: wrap; }
.metric--accent .metric__value {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 600;
}
.delta__arrow { font-size: .6em; }
.delta--up   { background: var(--up-soft);   color: var(--up); }
.delta--down { background: var(--down-soft); color: var(--down); }
.delta--flat, .delta--none { background: var(--surface-3); color: var(--text-faint); }

/* --------------------------------------------------------------- table ---- */

/* Wide tables scroll inside their card rather than pushing the page sideways -
   the pattern that keeps a 100-row report usable on a phone. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: var(--step-0); }

th, td { padding: .6rem .9rem; text-align: left; white-space: nowrap; }
th {
  position: sticky; top: 0;
  background: var(--surface-2);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
td { border-bottom: 1px solid var(--border-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }

.num { text-align: right; }
td.num { font-weight: 550; }

/* The label column stays put while the numbers scroll under it. */
.table--pinned th:first-child,
.table--pinned td:first-child {
  position: sticky; left: 0;
  background: var(--surface);
  z-index: 2;
}
.table--pinned th:first-child { z-index: 3; background: var(--surface-2); }
.table--pinned tbody tr:hover td:first-child { background: var(--surface-2); }

tr.is-total td { font-weight: 650; border-top: 1px solid var(--border); background: var(--surface-2); }

.rank { color: var(--text-faint); font-variant-numeric: tabular-nums; width: 1%; }

.code-dim {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: .85em;
  color: var(--text-faint);
}

/* A page path is the one cell allowed to wrap and take the slack. */
.path { white-space: normal; max-width: 34rem; word-break: break-word; }
.path a { color: var(--text); }
.path a:hover { color: var(--accent); }

/* A bar drawn behind the cell shows share without needing a chart. */
.bar { position: relative; min-width: 5rem; }
.bar__fill {
  position: absolute; inset: .35rem auto .35rem 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-soft), color-mix(in srgb, var(--accent) 28%, transparent));
}
.bar__text { position: relative; }

/* --------------------------------------------------------------- chart ---- */

.chart { position: relative; height: clamp(240px, 42vw, 400px); }

/* The trend summarises the numbers below it, so it stays shorter than the
   Catholic Current chart, which is the point of its own tab. */
.chart--trend { height: clamp(200px, 26vw, 290px); }

.chart-legend { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.chart-legend__item {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .25rem .6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: var(--step--1);
  color: var(--text-dim);
  cursor: pointer;
}
.chart-legend__item[aria-pressed="false"] { opacity: .4; }
.chart-legend__swatch { width: .6rem; height: .6rem; border-radius: 3px; flex: none; }

/* ------------------------------------------------------------- insight --- */

.insight {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding: .8rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--step-0);
  color: var(--text);
  line-height: 1.55;
}

.insight__mark { color: var(--accent); font-size: .55em; flex: none; }

/* A sparkline and its delta chip share the Change cell, so the trend reads at
   a glance without the table gaining a column. */
.trend-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  white-space: nowrap;
}

/* The sparkline is a button so it opens on tap and on Enter, but it should
   read as part of the row, not as a control. */
.spark {
  display: inline-flex;
  padding: 2px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--accent);
  cursor: pointer;
  flex: none;
  line-height: 0;
}
.spark:hover,
.spark[aria-expanded="true"] { background: var(--accent-soft); }
.spark svg { overflow: visible; }

.spark-pop {
  position: fixed;
  z-index: 60;
  width: min(340px, calc(100vw - 2rem));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 12px 40px -12px rgba(0,0,0,.55);
  overflow: hidden;
}
.spark-pop[hidden] { display: none; }

.spark-pop__head {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--border-soft);
}
.spark-pop__title { font-size: var(--step--1); font-weight: 600; color: var(--text); }
.spark-pop__close {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--text-faint);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.spark-pop__close:hover { color: var(--text); }
.spark-pop__body { height: 170px; padding: .6rem .8rem .8rem; }

/* --------------------------------------------------------------- notes --- */

.notes { list-style: none; margin-bottom: 1rem; }

.note-item {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: var(--step-0);
}
.note-item:last-child { border-bottom: 0; }
.note-item__date { color: var(--text-faint); font-size: var(--step--1); white-space: nowrap; flex: none; }
.note-item__text { color: var(--text); }
.note-item__remove { margin-left: auto; flex: none; }
.note-item__x {
  border: 0;
  background: none;
  color: var(--text-faint);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 .2rem;
}
.note-item__x:hover { color: var(--down); }

.notes__empty { color: var(--text-faint); font-size: var(--step--1); margin-bottom: 1rem; max-width: 62ch; }

.note-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.note-form input[type="date"] {
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: var(--step--1);
  flex: none;
}
.note-form input[type="date"]:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.note-form input[type="text"] {
  flex: 1 1 18rem;
  padding: .55rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: var(--step-0);
}
.note-form input[type="text"]:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Below this the sparkline would squeeze the number; the delta still tells
   the story on its own. */
@media (max-width: 540px) {
  .spark { display: none; }
}

/* --------------------------------------------------------------- notes ---- */

.note {
  display: flex;
  gap: .7rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--step--1);
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}
.note strong { color: var(--text); font-weight: 600; }
.note--warn { border-left-color: var(--down); }

.empty { padding: 2.5rem 1rem; text-align: center; color: var(--text-faint); }

/* --------------------------------------------------------------- login ---- */

.login { min-height: 100vh; display: grid; place-items: center; padding: var(--gutter); }
.login__card {
  width: min(100%, 380px);
  padding: clamp(1.5rem, 5vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.login__title { font-size: var(--step-2); font-weight: 400; letter-spacing: .075em; }
.login__sub { font-size: var(--step--1); color: var(--text-faint); margin-bottom: 1.5rem; }

.field { display: block; width: 100%; margin-bottom: .9rem; }
.field input {
  width: 100%;
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
.field input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.login .btn { width: 100%; justify-content: center; padding: .7rem; font-size: var(--step-0); }

.error {
  padding: .6rem .8rem;
  margin-bottom: .9rem;
  border-radius: var(--radius-sm);
  background: var(--down-soft);
  color: var(--down);
  font-size: var(--step--1);
  font-weight: 550;
}

/* -------------------------------------------------------------- footer ---- */

.footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-soft);
  font-size: var(--step--1);
  color: var(--text-faint);
  line-height: 1.6;
}

.footer strong { color: var(--text-dim); font-weight: 650; }

/* -------------------------------------------------------------- narrow ---- */

@media (max-width: 640px) {
  .masthead { padding-bottom: 1rem; }
  .masthead__brand { width: 100%; }
  .masthead__tools { width: 100%; }
  .tab { flex: 0 0 auto; }
  th, td { padding: .55rem .7rem; }
  .card__body { padding: .9rem; }
  .metric { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .tabs, .controls, .masthead__tools, .footer { display: none; }
  body { background: #fff; color: #000; }
  .card { break-inside: avoid; border-color: #ccc; box-shadow: none; }
}
