/* ==========================================================================
   AwardRadar — Component System
   Direction: docs/AWARDRADAR-VISUAL-DIRECTION.md

   Card discipline: surface is a privilege. Only DECISION objects
   (.decision, .evidence-doc) get elevation. Metrics, lists and states use
   rules, alignment, scale and negative space instead of boxes.
   ========================================================================== */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote, dl, dd {
  margin: 0; padding: 0;
}
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }

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

body {
  font-family: var(--type-ui);
  font-size: var(--t-base);
  line-height: var(--lh-normal);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Surface scoping: the two expressions of the brand. */
body.surface-instrument { background: var(--ins-canvas); color: var(--ink-100); }
body.surface-broadsheet { background: var(--bs-paper);   color: var(--bs-ink); }

/* ==========================================================================
   Surface-scoped ink remapping.

   Root cause fix, not a patch: components are authored once against the
   --ink-* scale, and the broadsheet surface REBINDS that scale to its paper
   equivalents. Previously each component needed an explicit
   `.surface-broadsheet .x` override, and the twelve that lacked one rendered
   near-white text on paper — `CGH → SDU` in the landing observation card was
   effectively invisible (1.05:1). Rebinding at the surface makes the failure
   mode impossible for any component, including ones added later.
   ========================================================================== */
body.surface-broadsheet {
  --ink-100: var(--bs-ink);
  --ink-70:  var(--bs-ink-70);
  --ink-45:  var(--bs-ink-45);
  --ink-25:  var(--bs-ink-25);
  --ins-line:        var(--line-bs);
  --ins-line-strong: var(--line-bs-strong);
  --act-azure:       var(--act-azure-bs);
  --act-azure-hover: var(--act-azure-bs-hover);
  --val-brass:       var(--val-brass-bs);
  --val-positive:    var(--val-positive-bs);
  --val-negative:    var(--val-negative-bs);
}

::selection { background: var(--act-azure); color: var(--ink-on-accent); }

/* ==========================================================================
   Focus — visible, never removed. WCAG 2.2 AA.
   ========================================================================== */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--act-azure);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.surface-broadsheet :focus-visible { outline-color: var(--act-azure-bs); }

.skip-link {
  position: absolute; left: var(--s-4); top: -100px;
  z-index: var(--z-toast);
  padding: var(--s-3) var(--s-4);
  background: var(--act-azure); color: var(--ink-on-accent);
  border-radius: var(--r-md); font-weight: var(--w-semibold);
  transition: top var(--m-fast) var(--ease-ui);
}
.skip-link:focus-visible { top: var(--s-4); }

/* ==========================================================================
   Typography primitives — hierarchy lives here, not in colour.
   ========================================================================== */
.eyebrow {
  font-family: var(--type-ui);
  font-size: var(--t-micro);
  font-weight: var(--w-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--ink-45);
}
.surface-broadsheet .eyebrow { color: var(--bs-ink-45); }

.headline {
  font-family: var(--type-editorial);
  font-size: var(--t-3xl);
  font-weight: var(--w-regular);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tighter);
  text-wrap: balance;
}
.headline-2 {
  font-family: var(--type-editorial);
  font-size: var(--t-2xl);
  font-weight: var(--w-regular);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}
.section-title {
  font-family: var(--type-editorial);
  font-size: var(--t-xl);
  font-weight: var(--w-regular);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
}
/* App titles stay in UI type: instrument, not editorial. */
.view-title {
  font-family: var(--type-ui);
  font-size: var(--t-lg);
  font-weight: var(--w-semibold);
  letter-spacing: var(--ls-tight);
  color: var(--ink-100);
}
.view-sub { font-size: var(--t-sm); color: var(--ink-70); max-width: var(--measure-ui); }

.lede {
  font-family: var(--type-ui);
  font-size: var(--t-md);
  line-height: var(--lh-relaxed);
  color: var(--bs-ink-70);
  max-width: var(--measure-editorial);
  text-wrap: pretty;
}
.body-text { line-height: var(--lh-relaxed); max-width: var(--measure-ui); text-wrap: pretty; }
.meta { font-size: var(--t-xs); color: var(--ink-45); }
.surface-broadsheet .meta { color: var(--bs-ink-45); }

/* Mono is a privilege of EVIDENCE: hash, id, raw timestamp, admin enum. */
.mono, .hash, .rec-id {
  font-family: var(--type-data);
  font-size: var(--t-xs);
  letter-spacing: 0;
  color: var(--ink-45);
}
.surface-broadsheet .mono { color: var(--bs-ink-45); }

/* ==========================================================================
   Rule — replaces card borders as the primary separator.
   ========================================================================== */
.rule { height: 1px; background: var(--ins-line); border: 0; }
.rule-strong { height: 1px; background: var(--ins-line-strong); border: 0; }
.surface-broadsheet .rule { background: var(--bs-rule); }
.surface-broadsheet .rule-strong { background: var(--bs-rule-strong); }

/* ==========================================================================
   Buttons — one action accent. No gradient, no glow.
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  min-height: 38px;
  padding: 0 var(--s-4);
  font-size: var(--t-sm);
  font-weight: var(--w-semibold);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: none;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--m-fast) var(--ease-ui),
              border-color var(--m-fast) var(--ease-ui),
              color var(--m-fast) var(--ease-ui);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--act-azure); color: var(--ink-on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--act-azure-hover); }
.btn-primary:active:not(:disabled) { background: var(--act-azure-press); }

.btn-secondary {
  border-color: var(--ins-line-strong);
  color: var(--ink-100);
}
.btn-secondary:hover:not(:disabled) { background: var(--ins-panel); border-color: var(--ink-25); }

.btn-quiet { color: var(--ink-70); padding: 0 var(--s-2); }
.btn-quiet:hover:not(:disabled) { color: var(--ink-100); }

.btn-danger { border-color: var(--val-negative-line); color: var(--val-negative); }
.btn-danger:hover:not(:disabled) { background: var(--val-negative-weak); }

.btn-lg { min-height: 46px; padding: 0 var(--s-6); font-size: var(--t-base); }
.btn-sm { min-height: 30px; padding: 0 var(--s-3); font-size: var(--t-xs); }

/* Broadsheet buttons: darker azure for AA on paper. */
.surface-broadsheet .btn-primary { background: var(--act-azure-bs); }
.surface-broadsheet .btn-primary:hover:not(:disabled) { background: var(--act-azure-bs-hover); }
.surface-broadsheet .btn-secondary { border-color: var(--bs-rule-strong); color: var(--bs-ink); }
.surface-broadsheet .btn-secondary:hover:not(:disabled) { background: var(--bs-paper-alt); }

/* Touch targets.
   Keyed on BOTH coarse pointers and narrow viewports: a small-screen device
   that reports a fine pointer still needs a 44px target, and relying on
   `pointer: coarse` alone left 30px buttons on mobile widths. */
@media (pointer: coarse) {
  .btn { min-height: var(--touch-min); }
  .btn-sm { min-height: 38px; }
}

@media (max-width: 900px) {
  .btn { min-height: var(--touch-min); }
  .btn-sm { min-height: 40px; padding: 0 var(--s-4); }
}

/* ==========================================================================
   Form controls
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.label {
  font-size: var(--t-micro);
  font-weight: var(--w-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--ink-45);
}
.surface-broadsheet .label { color: var(--bs-ink-45); }

.input, .select, .textarea {
  min-height: 40px;
  padding: var(--s-2) var(--s-3);
  background: var(--ins-inset);
  border: 1px solid var(--ins-line-strong);
  border-radius: var(--r-md);
  color: var(--ink-100);
  font-size: var(--t-sm);
  transition: border-color var(--m-fast) var(--ease-ui);
}
.input::placeholder { color: var(--ink-25); }
.input:hover, .select:hover { border-color: var(--ink-25); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  border-color: var(--act-azure);
}
.input[aria-invalid="true"] { border-color: var(--val-negative-line); }

.surface-broadsheet .input,
.surface-broadsheet .select {
  background: #fff;
  border-color: var(--bs-rule-strong);
  color: var(--bs-ink);
}
.surface-broadsheet .input::placeholder { color: var(--bs-ink-45); }

.field-error {
  font-size: var(--t-xs);
  color: var(--val-negative);
  display: flex; align-items: center; gap: var(--s-1);
}
.field-hint { font-size: var(--t-xs); color: var(--ink-45); }

@media (pointer: coarse) {
  .input, .select, .textarea { min-height: var(--touch-min); font-size: var(--t-base); }
}

/* ==========================================================================
   State tags — SEMANTIC ONLY.
   Rectangular low-radius document labels, not accent pills.
   Every state carries a text label: colour is never the sole carrier.
   ========================================================================== */
.tag {
  display: inline-flex; align-items: center; gap: var(--s-1);
  padding: 2px var(--s-2);
  font-family: var(--type-ui);
  font-size: var(--t-micro);
  font-weight: var(--w-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  white-space: nowrap;
}
.tag-live        { color: var(--val-positive); background: var(--val-positive-weak); border-color: var(--val-positive-line); }
.tag-revalidated { color: var(--act-azure);    background: var(--act-azure-weak);    border-color: var(--act-azure-line); }
.tag-indicative  { color: var(--ink-45);       background: var(--val-neutral-weak);  border-color: var(--val-neutral-line); }
.tag-stale       { color: var(--val-caution);  background: var(--val-caution-weak);  border-color: var(--val-caution-line); }
/* TECHNICAL_ERROR must never look like absence of a fare. */
.tag-technical   { color: var(--val-negative); background: var(--val-negative-weak); border-color: var(--val-negative-line); }
.tag-nofare      { color: var(--ink-45);       background: transparent;              border-color: var(--val-neutral-line); }
.tag-direct      { color: var(--ink-70);       background: var(--val-neutral-weak);  border-color: var(--val-neutral-line); }
.tag-mixed       { color: var(--val-caution);  background: var(--val-caution-weak);  border-color: var(--val-caution-line); }
.tag-miles       { color: var(--val-brass);    background: var(--val-brass-weak);    border-color: var(--val-brass-line); }
.tag-degraded    { color: var(--val-caution);  background: var(--val-caution-weak);  border-color: var(--val-caution-line); }
.tag-unavailable { color: var(--val-negative); background: transparent;              border-color: var(--val-negative-line); }
.tag-sandbox     { color: var(--val-brass);    background: var(--val-brass-weak);    border-color: var(--val-brass-line); }

.surface-broadsheet .tag-live        { color: var(--val-positive-bs); }
.surface-broadsheet .tag-revalidated { color: var(--act-azure-bs); }
.surface-broadsheet .tag-miles       { color: var(--val-brass-bs); }
.surface-broadsheet .tag-indicative,
.surface-broadsheet .tag-direct      { color: var(--bs-ink-70); }

/* State dot — the only place --r-pill is used besides filters */
.dot {
  width: 6px; height: 6px; border-radius: var(--r-pill);
  flex: 0 0 auto; background: var(--ink-25);
}
.dot-positive { background: var(--val-positive); }
.dot-caution  { background: var(--val-caution); }
.dot-negative { background: var(--val-negative); }

/* Selectable filter — the legitimate pill */
.filter-pill {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 32px; padding: 0 var(--s-3);
  font-size: var(--t-xs); font-weight: var(--w-medium);
  color: var(--ink-70);
  background: transparent;
  border: 1px solid var(--ins-line-strong);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color var(--m-fast) var(--ease-ui), border-color var(--m-fast) var(--ease-ui);
}
.filter-pill:hover { color: var(--ink-100); border-color: var(--ink-25); }
.filter-pill[aria-pressed="true"] {
  color: var(--act-azure); border-color: var(--act-azure-line); background: var(--act-azure-weak);
}
@media (pointer: coarse) { .filter-pill { min-height: 38px; } }

/* ==========================================================================
   DECISION SURFACE — the one elevated object.
   This is where the product's value lives, so it earns a surface.
   ========================================================================== */
.decision {
  background: var(--ins-raised);
  border: 1px solid var(--ins-line);
  border-radius: var(--r-lg);
  box-shadow: var(--e-raised);
  padding: var(--s-6);
}
.decision-primary { padding: var(--s-8); }

.decision-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap;
}

/* Route: airport codes are brand vocabulary. */
.route {
  display: flex; align-items: baseline; gap: var(--s-2);
  font-family: var(--type-ui);
  font-size: var(--t-lg);
  font-weight: var(--w-semibold);
  letter-spacing: 0.01em;
  color: var(--ink-100);
}
.route-arrow { color: var(--ink-45); font-weight: var(--w-regular); }
.route-name { font-size: var(--t-xs); font-weight: var(--w-regular); color: var(--ink-45); }
.route-lg { font-size: var(--t-xl); }

/* ==========================================================================
   VALUE HERO — price and miles. The number is the product.
   Editorial serif + tabular numerals + hero scale. Wins by SCALE, not colour.
   ========================================================================== */
.value-hero {
  display: flex; align-items: baseline; gap: var(--s-2);
  font-family: var(--type-editorial);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  line-height: 1;
  letter-spacing: var(--ls-tighter);
}
.value-hero .unit {
  font-family: var(--type-ui);
  font-size: var(--t-base);
  font-weight: var(--w-medium);
  color: var(--ink-45);
  letter-spacing: 0;
}
.value-hero .amount { font-size: var(--t-hero); font-weight: var(--w-regular); }
.value-hero-md .amount { font-size: var(--t-3xl); }
.value-hero-sm .amount { font-size: var(--t-2xl); }

/* Cash = ink. Miles = brass. Colour as unit of measure. */
.value-cash  .amount { color: var(--ink-100); }
.value-miles .amount { color: var(--val-brass); }
.value-miles .unit   { color: var(--val-brass); opacity: 0.8; }

.surface-broadsheet .value-cash .amount  { color: var(--bs-ink); }
.surface-broadsheet .value-miles .amount { color: var(--val-brass-bs); }
.surface-broadsheet .value-miles .unit   { color: var(--val-brass-bs); }
.surface-broadsheet .value-hero .unit    { color: var(--bs-ink-45); }

/* Delta — direction is stated with a glyph AND a sign, never colour alone. */
.delta {
  display: inline-flex; align-items: baseline; gap: var(--s-1);
  font-family: var(--type-ui);
  font-size: var(--t-sm);
  font-weight: var(--w-semibold);
  font-variant-numeric: tabular-nums;
}
.delta-down { color: var(--val-positive); }
.delta-up   { color: var(--val-negative); }
.delta-flat { color: var(--ink-45); }
.surface-broadsheet .delta-down { color: var(--val-positive-bs); }

/* Taxes always adjacent to miles: miles without taxes is a misleading number. */
.miles-taxes { font-size: var(--t-xs); color: var(--ink-70); }

/* ==========================================================================
   FRESHNESS — real age, never a bare "LIVE".
   ========================================================================== */
.freshness { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-xs); color: var(--ink-70); }
.freshness-age { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   METRIC RULE — replaces the 3 equal-weight KPI cards.
   No surfaces: rules + typographic scale + negative space.
   ========================================================================== */
.metric-rule {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--ins-line);
  border-bottom: 1px solid var(--ins-line);
}
.metric {
  padding: var(--s-4) var(--s-6) var(--s-4) 0;
  border-left: 1px solid var(--ins-line);
  padding-left: var(--s-6);
}
.metric:first-child { border-left: 0; padding-left: 0; }
.metric-label {
  font-size: var(--t-micro); font-weight: var(--w-semibold);
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase;
  color: var(--ink-45); display: block; margin-bottom: var(--s-2);
}
.metric-val {
  font-family: var(--type-editorial);
  font-size: var(--t-2xl); font-weight: var(--w-regular);
  line-height: 1; color: var(--ink-100);
  font-variant-numeric: tabular-nums;
}
.metric-val-sm { font-size: var(--t-lg); }
.metric-note { display: block; margin-top: var(--s-2); font-size: var(--t-xs); color: var(--ink-45); }

/* ==========================================================================
   DATA LIST / TABLE — dense, comparable, no cardification.
   ========================================================================== */
.data-list { display: flex; flex-direction: column; }
.data-row {
  display: grid; align-items: center; gap: var(--s-4);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--ins-line);
  transition: background-color var(--m-fast) var(--ease-ui);
}
.data-row:hover { background: rgba(226, 232, 240, 0.025); }
.data-row-head {
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--ins-line-strong);
  font-size: var(--t-micro); font-weight: var(--w-semibold);
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase;
  color: var(--ink-45);
}
.data-cell { min-width: 0; }
.data-cell-right { text-align: right; }
.data-primary { font-size: var(--t-sm); font-weight: var(--w-medium); color: var(--ink-100); }
.data-secondary { font-size: var(--t-xs); color: var(--ink-45); }

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: var(--s-2) var(--s-3);
  font-size: var(--t-micro); font-weight: var(--w-semibold);
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase;
  color: var(--ink-45); border-bottom: 1px solid var(--ins-line-strong);
}
.table td {
  padding: var(--s-3);
  font-size: var(--t-sm);
  border-bottom: 1px solid var(--ins-line);
  vertical-align: middle;
}
.table tbody tr:hover { background: rgba(226, 232, 240, 0.025); }

/* ==========================================================================
   EVIDENCE DOCUMENT — the second legitimate surface.
   Treated as an audit record, not a dashboard widget.
   ========================================================================== */
.evidence-doc {
  background: var(--ins-inset);
  border: 1px solid var(--ins-line);
  border-left: 2px solid var(--act-azure-line);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-6);
}
.evidence-row {
  display: flex; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--ins-line);
  font-size: var(--t-sm);
}
.evidence-row:last-child { border-bottom: 0; }
.evidence-key { color: var(--ink-45); }
.evidence-val { color: var(--ink-100); font-variant-numeric: tabular-nums; text-align: right; }
.evidence-val-mono { font-family: var(--type-data); font-size: var(--t-xs); word-break: break-all; }

/* ==========================================================================
   REVALIDATION PROGRESS — real backend states only.
   QUEUED -> CHECKING_SOURCE -> VALIDATING -> terminal.
   ========================================================================== */
.reval { display: flex; flex-direction: column; gap: var(--s-2); }
.reval-steps { display: flex; align-items: center; gap: var(--s-2); }
.reval-step {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--t-xs); color: var(--ink-25);
  transition: color var(--m-data) var(--ease-out);
}
.reval-step[data-state="active"] { color: var(--act-azure); }
.reval-step[data-state="done"] { color: var(--ink-70); }
.reval-step-mark {
  width: 7px; height: 7px; border-radius: var(--r-pill);
  border: 1px solid currentColor; flex: 0 0 auto;
}
.reval-step[data-state="done"] .reval-step-mark,
.reval-step[data-state="active"] .reval-step-mark { background: currentColor; }
.reval-track { height: 2px; background: var(--ins-line); border-radius: var(--r-sm); overflow: hidden; }
.reval-fill {
  height: 100%; width: 0; background: var(--act-azure);
  transition: width var(--m-data) var(--ease-out);
}
.reval-outcome { font-size: var(--t-sm); font-weight: var(--w-semibold); }
.reval-outcome[data-outcome="VALIDATED"]   { color: var(--val-positive); }
.reval-outcome[data-outcome="CHANGED"]     { color: var(--val-caution); }
.reval-outcome[data-outcome="UNAVAILABLE"] { color: var(--ink-45); }
.reval-outcome[data-outcome="TECHNICAL"]   { color: var(--val-negative); }

/* Only permitted infinite animation: real in-flight progress. */
@keyframes reval-indeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
.reval-track[data-indeterminate="true"] .reval-fill {
  width: 25%; animation: reval-indeterminate 1.1s var(--ease-ui) infinite;
}

/* ==========================================================================
   SOURCE HEALTH
   ========================================================================== */
.health-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center;
  gap: var(--s-4); padding: var(--s-3) 0;
  border-bottom: 1px solid var(--ins-line);
}
.health-name { font-size: var(--t-sm); font-weight: var(--w-medium); color: var(--ink-100); }
.health-coverage { font-size: var(--t-xs); color: var(--ink-45); }
.health-state { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-xs); }

/* ==========================================================================
   EMPTY / ERROR / LOADING — three DISTINCT states.
   Ambiguity here contradicts the product's core promise.
   ========================================================================== */
/* Empty/error states.
   The block keeps a readable measure, but its top rule must span the full
   column: a 52ch border under a full-width section head reads as a broken
   divider terminating mid-screen. The rule therefore lives on a full-width
   wrapper (::before) while the TEXT keeps its measure. */
.state-block {
  position: relative;
  padding: var(--s-12) 0;
  border-top: 0;
}
.state-block::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  border-top: 1px solid var(--ins-line);
}
.state-block > * { max-width: 52ch; }
.state-title {
  font-family: var(--type-editorial);
  font-size: var(--t-lg); font-weight: var(--w-regular);
  color: var(--ink-100); margin-bottom: var(--s-2);
}
.state-text { font-size: var(--t-sm); color: var(--ink-70); line-height: var(--lh-relaxed); }
.state-actions { margin-top: var(--s-6); display: flex; gap: var(--s-3); flex-wrap: wrap; }
.state-block[data-kind="error"] { border-top-color: var(--val-negative-line); }
.state-block[data-kind="error"] .state-title { color: var(--val-negative); }

.skeleton {
  background: linear-gradient(90deg, var(--ins-panel) 0%, var(--ins-raised) 50%, var(--ins-panel) 100%);
  background-size: 200% 100%;
  border-radius: var(--r-sm);
  animation: skeleton-sweep 1.2s var(--ease-ui) infinite;
}
@keyframes skeleton-sweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line { height: 12px; margin-bottom: var(--s-2); }

/* ==========================================================================
   MODAL / DRAWER
   ========================================================================== */
.overlay {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: rgba(6, 8, 11, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-4);
  animation: fade-in var(--m-base) var(--ease-ui);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative; z-index: var(--z-modal);
  width: 100%; max-width: 560px;
  max-height: calc(100vh - var(--s-12));
  overflow-y: auto;
  background: var(--ins-panel);
  border: 1px solid var(--ins-line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--e-overlay);
  animation: modal-rise var(--m-base) var(--ease-out);
}
@keyframes modal-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); padding: var(--s-6) var(--s-6) var(--s-4);
  border-bottom: 1px solid var(--ins-line);
}
.modal-title { font-size: var(--t-base); font-weight: var(--w-semibold); }
.modal-body { padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-4); }
.modal-foot {
  display: flex; justify-content: flex-end; gap: var(--s-3);
  padding: var(--s-4) var(--s-6) var(--s-6);
  border-top: 1px solid var(--ins-line);
}
.modal-close {
  width: var(--touch-min); height: var(--touch-min);
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--ink-45);
  cursor: pointer; border-radius: var(--r-md);
}
.modal-close:hover { color: var(--ink-100); background: var(--ins-raised); }

/* ==========================================================================
   TOAST — no accent rail, no coloured left strip (AI tell #4).
   State is carried by a dot plus text.
   ========================================================================== */
#toast-container {
  position: fixed; z-index: var(--z-toast);
  right: var(--s-4); bottom: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-2);
  max-width: 360px; pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--ins-raised);
  border: 1px solid var(--ins-line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--e-raised);
  font-size: var(--t-sm); color: var(--ink-100);
  animation: toast-in var(--m-base) var(--ease-out);
  pointer-events: auto;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.toast .dot { margin-top: 6px; }

/* On mobile the toast must clear the bottom nav and never cover a CTA. */
@media (max-width: 900px) {
  #toast-container {
    left: var(--s-4); right: var(--s-4); max-width: none;
    bottom: calc(var(--bottomnav-h) + var(--s-4) + env(safe-area-inset-bottom, 0px));
  }
}

/* ==========================================================================
   Utilities — deliberately minimal
   ========================================================================== */
.stack   { display: flex; flex-direction: column; }
.stack-2 { gap: var(--s-2); } .stack-3 { gap: var(--s-3); }
.stack-4 { gap: var(--s-4); } .stack-6 { gap: var(--s-6); }
.stack-8 { gap: var(--s-8); } .stack-12 { gap: var(--s-12); }
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.row-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); } .gap-4 { gap: var(--s-4); } .gap-6 { gap: var(--s-6); }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { color: var(--act-azure); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }
.surface-broadsheet .link { color: var(--act-azure-bs); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.text-right { text-align: right; }
.hide { display: none !important; }
