/* Design tokens, brief section 4. Dark mode follows the system unless Me sets Light or Dark (data-theme). */
:root {
  --paper: #F6F7F3;
  --ink: #111418;
  --sky: #CFE3F0;
  --signal: #FF5B14;
  --signal-text: #C2410C; /* the orange as text on paper, 4.8:1 */
  --green: #1E8A4C;
  --blue: #2563C9;
  --line: #C9D1D6;
  --line-soft: #E2E6EA;
  --dash: #7D8890; /* dashed outlines and the old plan's line: 3.4:1 on paper, readable on the dark papers too */
  --signal-tint: #FFE3D6;
  --sun: #FDE68A;
  --green-tint: #DCEFE3;
  --warn-tint: #FFF4E5;
  --warn: #C2410C;
  --muted: #4A545C;
  --on-signal: #111418;
  --hover: #FBFBF9;
  --warn-line: #F3D2B4;
  --green-deep: #155E35;
  --surface: #FFFFFF;
  --field: #F6F7F3;

  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-text: "Atkinson Hyperlegible", system-ui, sans-serif;

  --radius: 14px;
  --radius-sm: 12px;
  --pill: 99px;
  --border: 1.5px;
  --tap: 44px;
  --h1: 38px;
  --screen: 480px;
  --nav-width: 1340px; /* the desktop top bar: one width on every page, the widest layout's (Today's three columns) */
  /* Air above every screen's title: enough to clear the status bar in the installed app (iOS reports no safe-area
     inset there, so this is a fixed value), less in a browser tab, which has its own toolbar above. */
  --top-inset: 24px;

  /* Spacing: one 4-based scale for every gap, padding and margin. */
  --space-0-5: 2px;
  --space-1: 4px;
  --space-1-5: 6px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  /* What the scale is used for: the page's side margin, the inside of a card, the air between groups, and the
     public site's bands. Short phones and laptops change these, not the values that use them. */
  --gutter: var(--space-4);
  --card-pad: var(--space-4);
  --section-gap: var(--space-6);
  --header-pad: var(--space-3); /* under every screen's title, above its bottom rule */
  --band: var(--space-7);
}
/* The overrides live here, after the base values: tokens.css loads last, so a :root override in another file loses. */
/* Short phones: less air above and inside cards, so setup fits one screen. */
@media (max-height: 720px) {
  :root { --top-inset: 20px; --card-pad: var(--space-3); --section-gap: var(--space-5); }
}
/* From 900px: a top bar instead of bottom tabs, no status bar to clear, wider margins and bands. */
@media (min-width: 900px) {
  :root { --top-inset: 28px; --gutter: var(--space-5); --band: var(--space-8); }
}
/* The installed app: the title clears the status bar (iOS gives no safe-area inset to go by). */
@media (display-mode: standalone) {
  :root { --top-inset: 52px; }
}

/* Dark (brief section 4): paper and ink swap, surfaces #1A1F24, the orange stays with dark text on it. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --paper: #111418;
  --ink: #F6F7F3;
  --sky: #1E2A33;
  --green: #5DBE85;
  --blue: #6B9BE8;
  --line: #2E363C;
  --line-soft: #242B31;
  --signal-tint: #3A2418;
  --signal-text: #FF5B14;
  --green-tint: #17301F;
  --warn-tint: #33241A;
  --warn: #F08A5B;
  --muted: #AAB4BA;
  --surface: #1A1F24;
  --field: #1A1F24;
  --hover: #20262C;
  --warn-line: #5A3A26;
  --green-deep: #5DBE85;
  --sun: #C9A93E;
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111418;
  --ink: #F6F7F3;
  --sky: #1E2A33;
  --green: #5DBE85;
  --blue: #6B9BE8;
  --line: #2E363C;
  --line-soft: #242B31;
  --signal-tint: #3A2418;
  --signal-text: #FF5B14;
  --green-tint: #17301F;
  --warn-tint: #33241A;
  --warn: #F08A5B;
  --muted: #AAB4BA;
  --surface: #1A1F24;
  --field: #1A1F24;
  --hover: #20262C;
  --warn-line: #5A3A26;
  --green-deep: #5DBE85;
  --sun: #C9A93E;
  color-scheme: dark;
}
