/* Shared design tokens. Color names describe a UI role within each theme. */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --radius-control: 4px;
  --radius-field: 4px;
  --radius-marker: 2px;
  --size-marker: .625rem;
  --type-display: "Montagu Slab", Rockwell, Georgia, serif;
  --type-body: Barlow, "Segoe UI", Arial, sans-serif;
  --type-number: "IBM Plex Mono", Consolas, "Courier New", monospace;
  --size-label: .8125rem;
  --size-body: 1rem;
  --size-day: 1.25rem;
  --size-title: 1.5rem;
  --size-hero: clamp(2.5rem, 5.4vw, 4.75rem);
  --cut: 12px;
}
.frame {
  --step: polygon(0 var(--cut), calc(var(--cut) / 2) var(--cut), calc(var(--cut) / 2) calc(var(--cut) / 2), var(--cut) calc(var(--cut) / 2), var(--cut) 0, calc(100% - var(--cut)) 0, calc(100% - var(--cut)) calc(var(--cut) / 2), calc(100% - var(--cut) / 2) calc(var(--cut) / 2), calc(100% - var(--cut) / 2) var(--cut), 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut) / 2) calc(100% - var(--cut)), calc(100% - var(--cut) / 2) calc(100% - var(--cut) / 2), calc(100% - var(--cut)) calc(100% - var(--cut) / 2), calc(100% - var(--cut)) 100%, var(--cut) 100%, var(--cut) calc(100% - var(--cut) / 2), calc(var(--cut) / 2) calc(100% - var(--cut) / 2), calc(var(--cut) / 2) calc(100% - var(--cut)), 0 calc(100% - var(--cut)));
}

/* Sunset / night is the signed-out reference. It is also the first-visit default. */
:root, :root[data-mode="night"][data-palette="sunset"] {
  color-scheme: dark;
  --page: #161118; --surface: #241b24; --inset: #30222b; --matte: #291e27;
  --ink: #ffedcf; --muted: #d2bca9; --line: #ae795e; --frame: #e3ad75;
  --faint: #795a53; --past: #a19396; --track: #54474a;
  --selected: #f4bf84; --booked: #abd1bc; --mine: #ff9975;
  --action: #f5a07a; --on-fill: #291b20; --focus: #fff2aa; --error: #ffb5af;
}
:root[data-mode="night"][data-palette="sea"] {
  --page: #121817; --surface: #1e2625; --inset: #263330; --matte: #202d2a;
  --ink: #fff1d7; --muted: #bfcec5; --line: #6c9b90; --frame: #a4d9c7;
  --faint: #526e65; --past: #9ba6a1; --track: #48534d;
  --selected: #a6dbcf; --booked: #a2d7c7; --mine: #f59a70;
  --action: #f59b69; --on-fill: #18251f; --focus: #fff0a5; --error: #ffb2a6;
}
:root[data-mode="night"][data-palette="blue"] {
  --page: #0c101b; --surface: #191b2a; --inset: #252333; --matte: #1a2131;
  --ink: #fff1da; --muted: #d0c4c1; --line: #678eb0; --frame: #92bfdd;
  --faint: #545c72; --past: #a8a1ae; --track: #3d4858;
  --selected: #a0c5e3; --booked: #96c6dd; --mine: #f68e90;
  --action: #ee9497; --on-fill: #211d2b; --focus: #fff1a9; --error: #ffb4ae;
}
:root[data-mode="day"] { color-scheme: light; }
:root[data-mode="day"][data-palette="sunset"] {
  --page: #fff2e4; --surface: #fff7eb; --inset: #f8e9dc; --matte: #f6e4d7;
  --ink: #351f2c; --muted: #654c4b; --line: #a35d50; --frame: #ad5045;
  --faint: #b58b77; --past: #776e6d; --track: #e7d7ca;
  --selected: #f9c595; --booked: #a0cdc0; --mine: #ec947d;
  --action: #f5b87f; --on-fill: #301e25; --focus: #663471; --error: #922e39;
}
:root[data-mode="day"][data-palette="sea"] {
  --page: #ecf6ef; --surface: #fbf9ef; --inset: #e9f1e8; --matte: #e2ece1;
  --ink: #192c29; --muted: #475f55; --line: #568277; --frame: #26776c;
  --faint: #91a79a; --past: #65736b; --track: #dce5d9;
  --selected: #a6d8cb; --booked: #a1d5c6; --mine: #ef967b;
  --action: #f19b71; --on-fill: #192b24; --focus: #73345d; --error: #9c3540;
}
:root[data-mode="day"][data-palette="blue"] {
  --page: #f4f3ed; --surface: #fffbf2; --inset: #e9eff4; --matte: #e2e9ed;
  --ink: #401e34; --muted: #5d5362; --line: #547d9f; --frame: #386e94;
  --faint: #93a3af; --past: #6f6f79; --track: #dbe4ec;
  --selected: #efbcc2; --booked: #a0c9df; --mine: #ef9caa;
  --action: #f0a6b6; --on-fill: #341d2c; --focus: #30478e; --error: #922b41;
}
