
  /* Colour tokens: the site's own (generate_dashboard.THEME_TOKENS_CSS, App V3.0 audit 2026-11-02). */
  :root{color-scheme:light;--ink:#22282f;--dim:#5f6471;--border:#d5dae1;--divider:#e6e9ee;--row-alt:#f6f8fb;--stripe:#f6f7f9;--frame:#d5dae1;--accent:#09539a;--accent-fill:#09539a;--page-bg:#f1f3f6;--table-bg:var(--surface);--surface:#ffffff;--on-fill:#ffffff;--link:#1f6b3a;--pending:#886308;--pending-bg:#fdf6e8;--pending-border:#e0a83c;--stale:#d9713a;--danger:#bc4539;--danger-border:#f0c9c4;--danger-bg:#fdf2f1;--secondary-fill:#6b7280;--success-fill:#2f855a;--neutral-fill:#6b7280;--danger-fill:#bc4539;--success-bg:#eaf5ee;--fs-2xs:10px;--fs-xs:11px;--fs-sm:12px;--fs-base:13px;--fs-md:14px;--fs-lg:15px;--fs-h2:17px;--fs-h1:22px;--space-2:2px;--space-4:4px;--space-6:6px;--space-8:8px;--space-10:10px;--space-12:12px;--space-16:16px;--space-20:20px;--space-24:24px;--space-32:32px;--radius-xs:2px;--radius-sm:4px;--radius-md:6px;--radius-lg:8px;--radius-xl:10px;--radius-2xl:14px;--radius-pill:999px;--z-pin:1;--z-raised:5;--z-dropdown:10;--z-header:50;--z-banner:60;--strava:#fc4c02;--athletic-net:#760501;--font-mono:'JetBrains Mono', monospace;--accent-on-tint:#09539a;--accent-tint:#d4e6f7;--accent-tint-border:#a8c8e8;--strava-tint:#fbefea;--future-fill:#f6f8fb;--faint:#b7bec6;}
[data-theme="dark"]{color-scheme:dark;--ink:#e7e9ec;--dim:#9aa3ad;--border:#33383f;--row-alt:#20242a;--stripe:#20242a;--frame:var(--border);--divider:var(--border);--page-bg:#15181c;--table-bg:var(--page-bg);--athletic-net:#df0902;--surface:#1e2227;--accent:#1e7bd2;--accent-fill:#1c75c9;--link:#4fb37a;--pending:#d1a13a;--pending-bg:#2e2410;--pending-border:#6b5220;--stale:#e08a4f;--danger:#e2685c;--danger-border:#5c333a;--danger-bg:#33201f;--secondary-fill:#4a5058;--success-bg:#16261c;--accent-on-tint:#7cb4ea;--accent-tint:#1a2a38;--accent-tint-border:#2a4257;--strava-tint:#2e2018;--future-fill:#15181c;}
  :root { --link-on-page: #09539a; }
  [data-theme="dark"] { --link-on-page: #7cb4ea; }
  body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--page-bg);
    font-family: 'Inter', sans-serif;
    color: var(--ink);
    padding: 24px;
    box-sizing: border-box;
  }
  .card {
    width: 100%;
    max-width: 340px;
  }
  .brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 6px;
  }
  .logo { height: 32px; }
  h1 {
    font-size: var(--fs-h1);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0;
    text-align: center;
  }
  .accent-rule {
    height: 3px;
    background: var(--accent);
    margin: 14px 0 20px;
    border-radius: 2px;
  }
  /* Runner/Coach tab toggle (2026-09-18) -- same filled-pill
     current-indicator language used elsewhere in this app
     (.nav-current, the Vdot Calculator's own tabs), reimplemented
     locally since this page doesn't share SHARED_STYLE with the rest
     of the app. */
  .tab-row {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
  }
  .tab-btn {
    flex: 1;
    background: none;
    border: none;
    border-right: 1px solid var(--divider);
    padding: 10px 0;
    font-family: 'Inter', sans-serif;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--dim);
    cursor: pointer;
  }
  .tab-btn:last-child { border-right: none; }
  .tab-btn.tab-current { background: var(--accent-tint); color: var(--accent); }
  [data-theme="dark"] .tab-btn.tab-current { color: var(--on-fill); }
  label {
    display: block;
    font-size: var(--fs-sm);
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
  }
  input[type=text], input[type=password], input[type=email] {
    width: 100%;
    /* 48px tall -- exactly the Log In / Send email button below (v2.0, coach's request) */
    height: 48px;
    font-family: 'Inter', sans-serif;
    font-size: var(--fs-md);
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-sizing: border-box;
    margin-bottom: 16px;
    /* --surface, not --page-bg (2026-09-28): with the page now gray, a
       page-colored input would blend into it -- and in dark mode it
       already did. Same fill as every other input in the app. */
    background: var(--surface);
    color: var(--ink);
  }
  /* Autofill override (2026-09-15) -- this is the actual reason the
     earlier background/color fix above didn't visibly do anything: a
     field the browser has a saved username/password for gets its
     background forced to the browser's OWN default (white, or a pale
     yellow) by internal autofill styling that normal `background`/
     `color` declarations cannot override, no matter how correct they
     are -- confirmed by testing showing the fix working in an
     automated render (which never simulates stored credentials) while
     the real device, which had a saved login for this field, still
     showed a plain white box. The fix isn't a background override at
     all -- it's a huge inset box-shadow the same color as the
     intended background, which visually paints over the forced
     autofill color since box-shadow isn't subject to the same
     browser override. text-fill-color similarly overrides autofill's
     own forced text color, and the long background-color transition
     stops Chrome/WebKit's brief flash to yellow the instant autofill
     kicks in, before this rule has a chance to apply. Covers both the
     WebKit-prefixed pseudo-class (Chrome/Safari/most Android
     browsers, including IronFox) and the newer unprefixed :autofill
     (Firefox desktop) so this holds regardless of which engine is
     rendering it. */
  input[type=text]:-webkit-autofill,
  input[type=email]:-webkit-autofill,
  input[type=password]:-webkit-autofill,
  input[type=text]:-webkit-autofill:hover,
  input[type=password]:-webkit-autofill:hover,
  input[type=text]:-webkit-autofill:focus,
  input[type=password]:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
    -webkit-text-fill-color: var(--ink);
    caret-color: var(--ink);
    transition: background-color 600000s ease-in-out 0s;
  }
  input[type=text]:autofill,
  input[type=email]:autofill,
  input[type=password]:autofill {
    box-shadow: 0 0 0 1000px var(--surface) inset;
  }
  button[type=submit] {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: var(--fs-lg);
    font-weight: 600;
    padding: 0 13px;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: var(--on-fill);
    cursor: pointer;
    box-sizing: border-box;
  }
  @media (hover: hover) { button[type=submit]:hover { opacity: 0.92; } }
  /* Keyboard-focus visibility -- this page has its own standalone
     <style> block (doesn't pull in generate_dashboard.py's
     SHARED_STYLE), so it needs its own copy of the same rule rather
     than inheriting one. :focus-visible only, so it doesn't show on
     mouse/touch clicks. */
  a:focus-visible,
  button:focus-visible,
  input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
  }
  .error {
    background: var(--danger-bg);
    color: var(--danger);
    font-size: var(--fs-base);
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
  }
  form[hidden] { display: none; }
  /* Forgot password (v2.0): the same 24px-under-the-tabs start, 16px field rhythm and
     48px button as Log In; text links sit 16px under the button (4px + their 12px tap padding). */
  [hidden] { display: none !important; }
  .fp-title { font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--ink); margin: 0 0 6px; }
  .fp-text { font-size: var(--fs-base); line-height: 1.5; color: var(--dim); margin: 0 0 24px; }
  .fp-body { font-size: var(--fs-base); line-height: 1.5; color: var(--ink); margin: 0; }
  button.link-btn { display: block; width: auto; height: auto; margin: 4px auto 0; padding: 12px 8px; background: none; border: none; box-shadow: none;
    font-family: 'Inter', sans-serif; font-size: var(--fs-base); font-weight: 600; line-height: 1.2; color: var(--link-on-page); cursor: pointer; }
  .fp-body + button.link-btn { margin-top: 8px; }
  .fp-error { margin-bottom: 16px; }

  /* Phone touch rules: (1) form fields use 16px text -- iPhones zoom the
     page in when a smaller field is tapped; (2) buttons, dropdowns, text
     fields, tabs, segmented toggles, links styled as buttons, expanders and
     "Back to" links are at least 44px (the recommended touch minimum);
     (3) side-by-side links get room. Phones only; desktop untouched.
     !important only on these sizes, on purpose: some pages set deliberately
     small controls (Debug tabs, repeat days, Export) that must still grow on
     a phone. Checkboxes and plain text links (runner names) aren't touched. */
  @media (max-width: 768px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
    select, textarea { font-size: 16px !important; }
    /* ...16px text makes a field's natural width larger, and a field in a row
       won't shrink below it on its own -- on narrow phones (360px and under)
       that pushed the Add button out of the Checklist / List / Announcements
       widgets (2026-10-04). Let fields shrink so the button always fits. */
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
    textarea { min-width: 0; }
    /* Dropdowns may shrink too, but never under the 44px touch width (the
       journal's Hour / Minute / AM-PM row went to 39px at 360px). */
    select { min-width: 44px; }
    /* Sortable column headers are tapped to sort: 44px tall (were 37-41px). */
    thead th { height: 44px; }
    /* Calendar day cells (journal month grid, the portal Calendar, the coach
       Calendar): seven across a phone caps their width (36-41px), but they're
       54-60px tall -- what was missing is the 6px dead gap between days. An
       invisible 3px touch extension on every side closes it, so a tap
       between two days still lands on one. */
    .journal-day::after, .cal-day::after { content: ""; position: absolute; inset: -3px; }
    /* The journal's "+ Log additional run" rows (were 37px tall; 51px since v2.0 to
       match the run card -- runner_journal.py's .journal-add-row). */
    .journal-add-row { min-height: 51px; box-sizing: border-box; display: flex; align-items: center; }
    button, select,
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]),
    a.primary, a.outline, a.secondary, a.resv-edit-btn, [role="tab"], summary {
      min-height: 44px !important;
      box-sizing: border-box;
    }
    button, a.primary, a.outline, a.secondary, a.resv-edit-btn, [role="tab"] { min-width: 44px !important; }
    a.primary, a.outline, a.secondary, a.resv-edit-btn,
    [class$="-back-link"], a.manage-link { display: inline-flex; align-items: center; justify-content: center; }
    summary { display: flex; align-items: center; }
    [class$="-back-link"], a.manage-link { min-height: 44px; }/* Buttons inside an expanded event card (2026-10-05, coach-reported --
       the first audit only measured pages as they load, so it never saw
       these): View Results, Website and Directions in the Dashboard widget,
       both Calendars and the portal home were 30px tall. */.dash-event-link, .cal-event-link, .my-week-event-link { min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
    a.manage-link + a.manage-link { margin-left: 8px; }
    /* Compact icon buttons that are deliberately drawn as 28px boxes (the red
       remove x's, widget collapse chevrons, the Competition details chevron,
       Training History's icon button): keep the 28px look and give them an
       invisible 44px touch area instead (an ::after reaching 8px past every
       edge) -- growing the box itself changed the design and broke the
       Competition table's fixed chevron column. */
    .dash-widget-remove-btn, .dash-checklist-item-remove, .dash-list-item-remove,
    .dash-widget-collapse-btn, .cp-details-btn, .th-card-chev, .km-row-menu-btn, .ac-x {
      min-width: 0 !important; min-height: 0 !important; position: relative;
    }
    .dash-widget-remove-btn::after, .dash-checklist-item-remove::after, .dash-list-item-remove::after,
    .dash-widget-collapse-btn::after, .cp-details-btn::after, .th-card-chev::after, .km-row-menu-btn::after, .ac-x::after {
      content: ""; position: absolute; inset: -8px;
    }
    /* Tappable table rows (2026-10-04; the script is in render_header): a row
       with a link and no controls of its own opens that link when tapped
       anywhere -- it shows the pointer and flashes the highlight blue while
       pressed, so the tap visibly registers. */
    tbody tr:has(a[href]):not(:has(button, input, select, textarea)) { cursor: pointer; }
    tbody tr:has(a[href]):not(:has(button, input, select, textarea)):active > td { background: var(--accent-tint); }
    /* ...and at least 44px tall, since the row is now the tap target (Runner
       Vdot and Meet Results rows were 33-34px). td height acts as a minimum. */
    tbody tr:has(a[href]):not(:has(button, input, select, textarea)) > td { height: 44px; }
    /* Edit mode puts collapse and remove side by side: room so their touch
       areas don't overlap (a tap meant to collapse must never remove). */
    .dash-widget-collapse-btn + .dash-widget-remove-btn { margin-left: 10px; }
  }

  /* A school without a logo shows its initials (v1.9 phase 4). */
  .brand-initials { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px;
                     background: #d4e6f7; color: #09539a; font-weight: 700; font-size: 16px; }
  [data-theme="dark"] .brand-initials { background: #1a2a38; color: #7cb4ea; }
