/* Lengua Tools: shared tokens and components. The visual world is the Lengua
   Dashboard (lengua-dashboard.vercel.app): light only, white cards on a cool
   plane, Lengua green as the only brand colour, orange as the accent.
   Every text/background pair was checked with a relative-luminance script:
   body text and placeholders >= 4.5:1, marks and borders >= 3:1.
   Component contract and copy glossary: DESIGN.md at the project root. */

:root {
  /* ── Surfaces ─────────────────────────────────────────── */
  --plane: #F8FAFB;        /* page background */
  --surface: #FFFFFF;      /* cards, inputs on the plane, table backgrounds */
  --hair: #E4E8EF;         /* every 1px border and divider */
  --baseline: #D5D9DF;     /* scrollbar thumb, stronger dividers, hover borders */

  /* ── Ink ──────────────────────────────────────────────── */
  --ink: #1C1F23;          /* primary text */
  --ink-2: #4A4F57;        /* secondary text */
  --ink-3: #6B717C;        /* muted text: 4.9:1 on white, 4.7:1 on the plane. Never on --hair fills. */
  --ink-4: #8A8F98;        /* decorative marks and text 18px+ only (the dashboard's muted) */

  /* ── Brand ────────────────────────────────────────────── */
  --brand: #1E7A5A;
  --brand-dark: #165E45;
  --brand-soft: #D4EFE5;
  --brand-tint: #EEF7F3;   /* hover and selected fills */
  --brand-gradient: linear-gradient(135deg, #1E7A5A, #165E45);
  --brand-a10: rgba(30, 122, 90, 0.10);   /* pill and note fills */
  --brand-a20: rgba(30, 122, 90, 0.20);   /* focus ring */
  --brand-a40: rgba(30, 122, 90, 0.40);   /* ghost pill border, hover card border */
  --on-brand: #FFFFFF;
  --on-brand-2: rgba(255, 255, 255, 0.90); /* secondary text on brand fills: 4.6:1 at the lightest corner */

  /* ── Accent ───────────────────────────────────────────── */
  --accent: #E8922A;
  --accent-dark: #C97620;  /* marks and borders only (3.4:1 on white) */
  --accent-soft: #FDE8C8;
  --accent-a12: rgba(232, 146, 42, 0.12);

  /* ── Status ───────────────────────────────────────────── */
  --good: var(--brand);            /* marks */
  --good-ink: var(--brand-dark);   /* text on --good-soft */
  --good-soft: var(--brand-a10);
  --warn: var(--accent);           /* marks */
  --warn-ink: #8A4B12;             /* text on --warn-soft (5.7:1) and on white (6.8:1) */
  --warn-soft: var(--accent-soft);
  --danger: #D31145;               /* borders and marks */
  --danger-ink: #B3123E;           /* text on --danger-soft (5.8:1) */
  --danger-soft: #FCE7EC;
  --danger-a18: rgba(211, 17, 69, 0.18);
  --danger-a40: rgba(211, 17, 69, 0.40);

  /* ── Shape, depth, motion ─────────────────────────────── */
  --radius-card: 16px;
  --radius-block: 12px;
  --radius-control: 8px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 8px rgba(30, 122, 90, 0.07);
  --shadow-lift: 0 6px 20px rgba(30, 122, 90, 0.12);
  --shadow-pop: 0 10px 32px rgba(28, 31, 35, 0.16), 0 2px 6px rgba(28, 31, 35, 0.08);
  --speed: 160ms;
  --ease: ease-out;

  /* ── Type ─────────────────────────────────────────────── */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-micro: 11px;     /* dense table meta */
  --fs-caption: 12px;   /* captions, labels, badges, table headers, top-bar links */
  --fs-dense: 13px;     /* dense body, help text, dense table cells */
  --fs-body: 14px;      /* body, inputs, buttons, table cells */
  --fs-title: 16px;     /* bar titles, card titles */
  --fs-h1: 20px;        /* page h1 inside tool pages */
  --fs-stat: 24px;      /* stat values */
  --fs-display: 30px;   /* the sign-in panel headline */
  --topbar-h: 56px;

  /* ── Aliases for the previous token names (one release) ── */
  --green: var(--brand);
  --green-dark: var(--brand-dark);
  --green-soft: var(--brand-soft);
  --green-tint: var(--brand-tint);
  --green-ink: var(--brand-dark);
  --orange: var(--accent);
  --orange-soft: var(--accent-soft);
  --clay: var(--accent-dark);
  --bg: var(--plane);
  --surface-2: var(--plane);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --muted: var(--ink-3);
  --line: var(--hair);
  --field-border: var(--baseline);
  --ok-bg: var(--good-soft);   --ok-ink: var(--good-ink);
  --warn-bg: var(--warn-soft);
  --err-bg: var(--danger-soft); --err-ink: var(--danger-ink);
  --idle-bg: var(--hair);      --idle-ink: var(--ink-2);
  --radius: var(--radius-card);
  --radius-sm: var(--radius-control);
  --shadow: var(--shadow-card);
}

/* ── Base and browser surfaces ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--baseline) transparent;
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--plane);
  -webkit-font-smoothing: antialiased;
  caret-color: var(--brand);
  accent-color: var(--brand);
}

::selection { background: var(--brand-soft); color: var(--ink); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--baseline); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #C3C9D1; }

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

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.25; font-weight: 600; text-wrap: balance; }
h1 { font-size: var(--fs-h1); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-title); letter-spacing: -0.005em; }
h3 { font-size: var(--fs-body); }

a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-dark); }

small { font-size: var(--fs-caption); }
strong, b { font-weight: 600; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
img, svg { vertical-align: middle; }
button, input, select, textarea { font-family: inherit; }

/* Digits line up wherever they appear. */
td, th, time, .num, .tnum, .pill, .chip, .stat-value, input, .table { font-variant-numeric: tabular-nums; }

.muted { color: var(--ink-3); }
.ink-2 { color: var(--ink-2); }
.ink-3 { color: var(--ink-3); }
.caption { font-size: var(--fs-caption); color: var(--ink-3); }
.dense { font-size: var(--fs-dense); }
.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;
}
[hidden] { display: none !important; }

/* ── Page frame ──────────────────────────────────────────── */
.page { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; }
.page--narrow { max-width: 880px; }
.page--wide { max-width: none; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: var(--fs-h1); }
.page-head p, .page-sub { margin-top: 4px; font-size: var(--fs-dense); color: var(--ink-2); max-width: 70ch; }
.stack { display: grid; gap: 20px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.divider, hr { height: 1px; margin: 16px 0; border: 0; background: var(--hair); }

/* ── Card ────────────────────────────────────────────────── */
.card, .surface {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.card-pad, .surface-pad { padding: 20px; }
/* Sections inside one card are separated by hairlines, never by another card. */
.card-section { padding: 16px 20px; }
.card-section + .card-section { border-top: 1px solid var(--hair); }
.card-section--flush { padding: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; }
.card-title { font-size: var(--fs-title); font-weight: 600; line-height: 1.25; letter-spacing: -0.005em; color: var(--ink); }
.card-sub { margin-top: 2px; font-size: var(--fs-dense); color: var(--ink-2); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-title { font-size: var(--fs-body); font-weight: 600; color: var(--ink); }
.block { padding: 12px 14px; border-radius: var(--radius-block); background: var(--plane); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--radius-control);
  font: inherit; font-size: var(--fs-body); font-weight: 600; line-height: 1;
  color: var(--ink-2); background: transparent;
  white-space: nowrap; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease), color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), transform 80ms var(--ease);
}
.btn svg { flex: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }
.btn.is-loading { cursor: progress; }
.btn .lt-spinner { width: 14px; height: 14px; }

.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--on-brand); }

.btn-secondary { background: var(--surface); border-color: var(--hair); color: var(--ink-2); }
.btn-secondary:hover:not(:disabled) { background: var(--plane); color: var(--ink); }

/* Ghost pill: inline actions such as Update data. */
.btn-ghost, .btn-outline { border-radius: var(--radius-pill); border-color: var(--brand-a40); color: var(--brand); background: transparent; }
.btn-ghost:hover:not(:disabled), .btn-outline:hover:not(:disabled) { background: var(--brand-a10); color: var(--brand-dark); }

.btn-danger { border-radius: var(--radius-pill); border-color: var(--danger-a40); color: var(--danger-ink); background: transparent; }
.btn-danger:hover:not(:disabled) { background: rgba(211, 17, 69, 0.08); color: var(--danger-ink); }

.btn-sm { height: 30px; padding: 0 10px; font-size: var(--fs-caption); gap: 6px; }
.btn-lg { height: 40px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }

.lt-spinner, .spin { animation: lt-spin 0.8s linear infinite; }
@keyframes lt-spin { to { transform: rotate(360deg); } }

/* ── Form controls ───────────────────────────────────────── */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: var(--fs-caption); font-weight: 500; line-height: 1.25; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: var(--fs-body); line-height: 20px; color: var(--ink);
  background: var(--plane);
  border: 1px solid var(--hair); border-radius: var(--radius-control);
  padding: 8px 12px;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background-color var(--speed) var(--ease);
}
.input, .select { height: 36px; padding-top: 0; padding-bottom: 0; }
.textarea { min-height: 120px; line-height: 1.5; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--baseline); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-a20); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"], .is-invalid,
.input[aria-invalid="true"]:focus, .textarea[aria-invalid="true"]:focus, .select[aria-invalid="true"]:focus, .is-invalid:focus { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-a18); }
/* Disabled: hair fill with ink-2 (6.7:1). ink-3 never sits on a hair fill (3.99:1). */
.input:disabled, .select:disabled, .textarea:disabled { background: var(--hair); color: var(--ink-2); cursor: not-allowed; }
.input:disabled::placeholder, .textarea:disabled::placeholder { color: var(--ink-2); }
.input:read-only:not(:disabled) { background: var(--surface); }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B717C' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.hint { font-size: var(--fs-dense); color: var(--ink-3); }
.field-error { display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-dense); font-weight: 500; color: var(--danger-ink); }
.field-error svg { flex: none; margin-top: 2px; }
.check { display: inline-flex; align-items: flex-start; gap: 8px; font-size: var(--fs-dense); color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--brand); }

/* Segmented choice (platform). Same 36px height as inputs and buttons. */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--plane); border: 1px solid var(--hair); border-radius: var(--radius-control); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: 6px; font-size: var(--fs-dense); font-weight: 500; color: var(--ink-2);
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(28, 31, 35, 0.08), 0 0 0 1px var(--hair); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
.seg label:hover span { color: var(--ink); }

/* ── Pills (badges, status chips) ────────────────────────── */
.pill, .chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px;
  border-radius: var(--radius-pill); font-size: var(--fs-caption); font-weight: 500; line-height: 18px;
  white-space: nowrap; background: var(--hair); color: var(--ink-2);
}
.pill svg, .chip svg { flex: none; }
.pill--dot::before, .chip--dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
/* Brand pills read in brand-dark: --brand on its 10% fill is 4.4:1 over the plane and 4.25:1 over
   --brand-tint (hovered rows, selected items); --brand-dark is 6.2:1 or better on all three. */
.pill--brand, .chip--brand, .chip--existing, .chip--new, .chip--updated, .chip--ok { background: var(--brand-a10); color: var(--brand-dark); }
.pill--neutral, .chip--neutral, .chip--legacy, .chip--pending { background: var(--hair); color: var(--ink-2); }
.pill--warn, .chip--warn, .chip--notfound, .chip--nodata { background: var(--warn-soft); color: var(--warn-ink); }
.pill--error, .chip--error, .chip--failed { background: var(--danger-soft); color: var(--danger-ink); }
.pill--ink, .chip--ink { background: var(--ink); color: var(--on-brand); }

/* ── Underline tabs ──────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: none;
  font: inherit; font-size: var(--fs-body); font-weight: 500; line-height: 20px; color: var(--ink-3);
  white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
/* As the dashboard's tabs: muted text, secondary on hover, primary ink with the brand rule when active. */
.tab:hover { color: var(--ink-2); }
.tab[aria-selected="true"], .tab.is-active, .tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.tab:focus-visible { outline-offset: -2px; border-radius: 6px; }
.tab .count { display: inline-flex; align-items: center; padding: 0 6px; border-radius: var(--radius-pill); font-size: var(--fs-micro); font-weight: 500; line-height: 18px; background: var(--hair); color: var(--ink-2); }
.tab[aria-selected="true"] .count, .tab.is-active .count, .tab[aria-current="page"] .count { background: var(--brand-a10); color: var(--brand-dark); }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { position: relative; overflow: auto; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius-block); }
.card .table-wrap, .surface .table-wrap, .table-wrap--flush { border: 0; border-radius: 0; background: transparent; }
/* Class-only selector (0,1,0) so .table--dense and a page's own table class can set the size. */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-body); }
.table--dense { font-size: var(--fs-dense); }
.table th {
  position: sticky; top: 0; z-index: 2;
  padding: 8px 12px; text-align: left; white-space: nowrap;
  font-size: var(--fs-caption); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3);
  background: var(--surface); border-bottom: 1px solid var(--hair);
}
.table td { padding: 8px 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; white-space: nowrap; color: var(--ink); }
.table td:first-child { font-weight: 500; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--plane); }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--baseline); border-bottom: 0; background: var(--surface); }
.table .right, .table .num { text-align: right; }
.table .wrap { white-space: normal; }
.table .empty { color: var(--ink-3); font-weight: 400; }
.table .meta { font-size: var(--fs-micro); color: var(--ink-3); }
.table td .btn + .btn { margin-left: 6px; }

/* ── Stat band: equal stats in one row ───────────────────── */
/* The band is a grid of equal columns and every stat subgrids its three rows (label, value, sub),
   so the values of one band sit on one line even when a neighbour's label or sub wraps. The 6px
   spacing is a margin on the value and the sub, not a row gap, so a stat without a sub adds no
   empty gutter. The stats of a flex band (a page's own override) still lay out as before. */
.stat-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat { display: grid; grid-row: span 3; grid-template-rows: subgrid; align-content: start; min-width: 0; padding: 4px 24px 4px 0; }
.stat-label { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-caption); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.stat-dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--brand); flex: none; } /* centred on the first 18px line */
.stat-dot--accent { background: var(--accent); }
.stat-dot--neutral { background: var(--baseline); }
.stat-dot--danger { background: var(--danger); }
.stat-value { margin-top: 6px; font-size: var(--fs-stat); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); }
.stat-sub { margin-top: 6px; font-size: var(--fs-caption); color: var(--ink-2); }
.stat.is-warn .stat-sub { color: var(--warn-ink); font-weight: 500; }

/* ── Progress ────────────────────────────────────────────── */
.progress-track { position: relative; height: 6px; border-radius: var(--radius-pill); background: var(--hair); overflow: hidden; }
/* Set the fill with an inline width ("width: 30%"). Static on purpose: a width animation is layout work. */
.progress-fill { display: block; height: 100%; width: 0; border-radius: var(--radius-pill); background: var(--brand); }
.progress-track.is-warn .progress-fill { background: var(--accent); }

/* ── Notes and alerts ────────────────────────────────────── */
.note {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--radius-block);
  font-size: var(--fs-dense); line-height: 1.5; background: var(--plane); color: var(--ink-2);
}
.note > svg:first-child { flex: none; margin-top: 2px; }
.note--info { background: var(--brand-tint); color: var(--good-ink); }
.note--ok { background: var(--good-soft); color: var(--good-ink); }
.note--warn { background: var(--warn-soft); color: var(--warn-ink); }
.note--error, .note--err { background: var(--danger-soft); color: var(--danger-ink); }
.note a { color: inherit; font-weight: 600; }
.note b, .note strong { font-weight: 600; }

/* ── Empty and placeholder states ────────────────────────── */
.empty-state {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 14px 16px; border-radius: var(--radius-block);
  background: var(--plane); border: 1px solid var(--hair);
  font-size: var(--fs-dense); color: var(--ink-2);
}
.empty-state p { flex: 1 1 240px; }
.empty-state .btn { flex: none; }
.card .empty-state, .surface .empty-state { border-color: transparent; }

/* ── Avatar ──────────────────────────────────────────────── */
.avatar {
  --size: 32px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: var(--brand-gradient); color: var(--on-brand);
  font-size: calc(var(--size) * 0.38); font-weight: 600; line-height: 1; letter-spacing: 0.01em; text-transform: uppercase;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { --size: 24px; }
.avatar--lg { --size: 48px; }

/* ── Dialog ──────────────────────────────────────────────── */
dialog.dlg {
  width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--hair);
  border-radius: var(--radius-card); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-pop);
}
dialog.dlg::backdrop { background: rgba(28, 31, 35, 0.40); }
.dlg-body { padding: 20px 20px 8px; display: grid; gap: 10px; }
.dlg-body h2 { font-size: var(--fs-title); }
/* Only the dialog's own text line; .hint and .field-error keep their component colours. */
.dlg-body > p:not(.hint):not(.field-error) { font-size: var(--fs-dense); color: var(--ink-2); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 20px; }

/* ── Skeleton ────────────────────────────────────────────── */
.skel { border-radius: 6px; background: linear-gradient(90deg, var(--hair) 25%, var(--plane) 50%, var(--hair) 75%); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Small screens ───────────────────────────────────────── */
@media (max-width: 720px) {
  .page { padding: 20px 16px 48px; }
  .card-pad, .surface-pad { padding: 16px; }
  .card-section { padding: 14px 16px; }
  /* Six tracks: a band of three stays three across (never 2 + 1), any other count goes two per
     row and a lone stat fills the row. Every value drops to 20px together, one size per band. */
  .stat-band { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stat { grid-column: span 3; padding-right: 12px; }
  .stat:first-child:nth-last-child(1) { grid-column: 1 / -1; }
  .stat:first-child:nth-last-child(3), .stat:first-child:nth-last-child(3) ~ .stat { grid-column: span 2; }
  .stat-value { font-size: var(--fs-h1); }
  .dlg-body { padding: 18px 18px 6px; }
  .dlg-actions { padding: 10px 18px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  /* A loading ring is information, not decoration: it keeps turning. */
  .lt-spinner, .spin { animation-duration: 0.8s !important; animation-iteration-count: infinite !important; }
}
