/* ==========================================================================
   Ledger — Base Styles
   Root design tokens (CSS custom properties) + global element resets.
   ========================================================================== */

  :root{
    --paper: #FAF8F4;
    --paper-raised: #FFFFFF;
    --ink: #1A2238;
    --ink-soft: #3D4663;
    --rule: #E8E2D6;
    --rule-strong: #D8CFC0;
    --urgent: #C75D3C;
    --urgent-bg: #F8E9E2;
    --done: #7A8B69;
    --done-bg: #EAEEE3;
    --warn: #C99A3E;
    --warn-bg: #F6EEDD;
    --shadow: 0 1px 2px rgba(26,34,56,0.04), 0 4px 12px rgba(26,34,56,0.05);
    --radius: 10px;
    --font-body: 'Source Serif 4', serif;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --sidebar-bg: var(--ink);
    --sidebar-fg: #EDEAE2;
    --sidebar-strong: #FFFFFF;
    --sidebar-muted: rgba(237,234,226,0.5);
    --sidebar-hover: rgba(237,234,226,0.07);
    --sidebar-active: rgba(237,234,226,0.13);
    /* Shell/Search/Dashboard cleanup §10: semantic "today" tint, replacing
       the hardcoded #FFFCF7 previously used directly in components.css for
       the Timetable's current-day column and the Week grid's current-day
       header. Derived from --warn (a confirmed-real token in every theme,
       already used for exactly this kind of "highlight" purpose elsewhere
       — e.g. schedule.js's .today-col background) mixed lightly into
       --paper-raised, rather than inventing an unconfirmed new per-theme
       value — this automatically follows each theme's own accent color
       instead of shipping one warm-cream value that only reads correctly
       against the Classic/Creative themes. */
    --today-tint: color-mix(in srgb, var(--warn) 5%, var(--paper-raised));
  }

/* ---------- Global resets & base typography ---------- */
  *{ box-sizing: border-box; }
  html,body{ margin:0; padding:0; }
  /* Phase 1 (Navigation & visual polish) §1: prevents a brief page-level
     horizontal scrollbar flash while the sidebar collapses/expands
     (.shell's grid-template-columns animates smoothly over 0.18s while a
     couple of its children switch layout mode — e.g. .sidebar-top's
     flex-direction — instantly at the same moment, which can very
     briefly overflow by a sub-pixel amount during the transition).
     Deliberately set on html (the actual root scrolling element for the
     whole page), NOT on an inner wrapper like .shell: an earlier attempt
     put this on .shell itself, but CSS's overflow computed-value rule
     silently promotes an element's other axis from 'visible' to 'auto'
     whenever one axis is set to something other than 'visible' — that
     turned .shell into an unintended NESTED scroll container, which
     became the nearest scrolling ancestor for .sidebar's
     `position:sticky`, breaking it (the sidebar stopped matching the
     page's real height once main content grew taller than one viewport).
     html is already the page's own root scrolling context, so making its
     already-implicit vertical scroll explicit here doesn't introduce any
     new intermediate scroll box — position:sticky keeps behaving exactly
     as "stick to the page", not "stick to some wrapper div". Components
     that intentionally scroll horizontally (.timetable-wrap,
     .schedule-table-wrap at narrow widths) still work normally — their
     own overflow-x:auto creates its own local scroll container regardless
     of this rule on html. */
  html{ overflow-x: hidden; }
  body{
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
  }
  h1,h2,h3,h4, .display{
    font-family: var(--font-heading);
    letter-spacing: 0;
    margin: 0;
  }
  .mono{ font-family: var(--font-mono); }
  button{ font-family: inherit; color: inherit; cursor: pointer; }
  input, select, textarea{ font-family: var(--font-body); }

  a{ color: var(--ink); }

  ::selection{ background: var(--warn-bg); }

  button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible{
    outline: 2px solid var(--ink-soft);
    outline-offset: 2px;
  }

/* ---------- Reduced motion preference ---------- */
  @media (prefers-reduced-motion: reduce){
    *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  }


.connection-reminder{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px 24px;margin-bottom:24px;border:1px solid var(--rule-strong);border-radius:16px;background:var(--paper-raised);}.connection-reminder p{margin:6px 0 0;line-height:1.5}.connection-reminder-actions{display:flex;flex-wrap:wrap;gap:10px;flex-shrink:0}@media(max-width:640px){.connection-reminder{align-items:flex-start;flex-direction:column;padding:18px;gap:16px}.connection-reminder-actions{width:100%}}
