:root {
  color-scheme: light;
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #EEF0F3;
  --text: #111318;
  --muted: #5F6670;
  --line: #DDE1E6;
  --accent: #D2282F; /* Slightly darker to meet AA on surface-2. */
  --lens-a: #3B82F6;
  --lens-b: #F59E0B;
  --lens-c: #8B5CF6;
  --ok: #22C55E;
  --warn: #F59E0B;
  --danger: #EF4444;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.4;
  background: var(--bg);
  color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #0B0D10;
  --surface: #15181D;
  --surface-2: #1D2128;
  --text: #E8EAED;
  --muted: #9AA0A6;
  --line: #2A2F37;
  --accent: #F0565C;
}
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0D10;
  --surface: #15181D;
  --surface-2: #1D2128;
  --text: #E8EAED;
  --muted: #9AA0A6;
  --line: #2A2F37;
  --accent: #F0565C;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0 auto; max-width: 480px; }
.app-header { padding: calc(12px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); font-weight: 700; }
.app-header span { display: block; font-size: .8rem; font-weight: 400; }
#app { padding: 0 16px calc(100px + env(safe-area-inset-bottom)); }
h1 { font-size: 1.6rem; margin: 12px 0 16px; }
h2 { font-size: 1.2rem; margin: 24px 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
p { margin: 8px 0; overflow-wrap: anywhere; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; min-height: 44px; padding: 8px 12px; }
button, select { cursor: pointer; }
a, button, input, select, textarea { touch-action: manipulation; }
button { min-width: 44px; }
a { display: inline-flex; align-items: center; min-height: 44px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; }
.muted { color: var(--muted); }
.chip { display: inline-flex; align-items: center; border-radius: 12px; padding: 4px 8px; color: var(--text); margin: 4px; }
.lens-a { --lens: var(--lens-a); background: rgb(59 130 246 / 18%); }
.lens-b { --lens: var(--lens-b); background: rgb(245 158 11 / 18%); }
.lens-c { --lens: var(--lens-c); background: rgb(139 92 246 / 18%); }
.lens-dots { display: inline-flex; gap: 4px; }
.lens-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lens); }
.confidence { vertical-align: middle; margin-left: 8px; font-size: .85rem; }
.day-pills { display: flex; gap: 4px; overflow-x: auto; }
.day-pills button { white-space: nowrap; flex: 0 0 auto; }
[aria-pressed="true"] { border: 2px solid var(--accent); font-weight: 700; }
.verdict { display: inline-block; color: var(--text); border-left: 4px solid var(--warn); padding: 4px 8px; background: var(--surface-2); }
.verdict-go { border-color: var(--ok); }
.verdict-no { border-color: var(--danger); }
.error-card { border-left: 4px solid var(--danger); }
#tab-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; z-index: 10; background: var(--surface); border-top: 1px solid var(--line); padding: 4px max(4px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); }
#tab-bar a { flex: 1; min-width: 44px; min-height: 64px; display: flex; flex-direction: column; justify-content: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: .75rem; }
#tab-bar a[aria-current="page"] { color: var(--accent); font-weight: 700; }
#tab-bar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
#sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; border: 0; border-radius: 0; background: rgb(0 0 0 / 55%); }
.sheet-panel { position: relative; width: 100%; max-width: 480px; max-height: 85dvh; overflow-y: auto; border-radius: 20px 20px 0 0; background: var(--surface); padding: 8px max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.sheet-handle { display: block; margin: 0 auto; min-width: 80px; }
#toast { position: fixed; z-index: 40; bottom: calc(88px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: calc(100% - 32px); max-width: 448px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
#update-bar { width: calc(100% - 32px); margin: 0 16px 8px; color: var(--accent); background: var(--surface); }
