/* ==========================================================================
   Carmen — Design Tokens
   Warm, calm, protective. A companion beside you on a night drive, not a
   dashboard of gauges. Palette is deliberately warm-charcoal + amber, tied
   to the subject (headlamps, dashboard glow) rather than a generic dark
   theme. Alert red is reserved exclusively for genuine failures, matching
   the native app's "Alert red reserved for Safety-Engine messages only"
   rule (01_Documentation/08_UI_Specifications.md).
   ========================================================================== */

:root {
  /* Color */
  --carmen-bg: #14120f;
  --carmen-surface: #1e1b17;
  --carmen-surface-2: #262220;
  --carmen-border: #3a342c;
  --carmen-border-soft: #2a2521;
  --carmen-text: #f3ede3;
  --carmen-text-dim: #a79c8c;
  --carmen-text-faint: #726758;
  --carmen-gold: #e3a94f;
  --carmen-gold-strong: #f0bc6c;
  --carmen-gold-dim: rgba(227, 169, 79, 0.16);
  --carmen-teal: #6fa89e;
  --carmen-teal-dim: rgba(111, 168, 158, 0.16);
  --carmen-red: #d66b5b;
  --carmen-red-dim: rgba(214, 107, 91, 0.16);

  /* Type — SF Pro on iOS/iPadOS/macOS via -apple-system, per the native
     app's own design tokens (Document 08: "SF Pro, minimum 17pt for any
     text visible during an active journey"). No webfont network
     dependency, so the shell keeps working offline. */
  --font-display: -apple-system, "SF Pro Display", "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-body: -apple-system, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* 8pt grid */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 48px;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-round: 999px;

  --touch-min: 44px;

  --shadow-soft: 0 1px 0 rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--carmen-bg);
  color: var(--carmen-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

h1, h2, h3, p {
  margin: 0;
}

button {
  font-family: inherit;
  color: inherit;
}

input,
textarea {
  font-family: inherit;
  color: inherit;
}

a {
  color: var(--carmen-gold);
}

/* Belt-and-suspenders: the native [hidden] UA rule has the same
   specificity as an author class like .btn (display: inline-flex), so
   without this, cascade order alone can let a later class win and make a
   "hidden" element visible again. Every element toggled via the `hidden`
   attribute anywhere in this app must actually disappear. */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
