/* ── Design Tokens ──────────────────────────────────────────────
   Daily Focus v2 — Minimal Neutral Design System
   Geist font · Zinc palette · Light/Dark themes
   ──────────────────────────────────────────────────────────── */

/* ── Light Theme (default) ─────────────────────────────────── */
:root {
  /* Surfaces */
  --bg: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f4f4f5;

  /* Borders */
  --border: #e4e4e7;
  --border-hover: #d4d4d8;

  /* Text */
  --text: #09090b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --text-inverse: #fafafa;

  /* Accent */
  --accent: #18181b;
  --accent-hover: #27272a;

  /* Semantic */
  --urgent: #dc2626;
  --urgent-bg: #fef2f2;
  --urgent-border: #fecaca;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --meds: #d97706;
  --meds-bg: #fffbeb;
  --meds-border: #fde68a;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  /* Focus */
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  /* Progress */
  --progress-track: #e4e4e7;
  --progress-fill: #18181b;

  /* Scrollbar */
  --scrollbar-track: transparent;
  --scrollbar-thumb: #d4d4d8;
  --scrollbar-thumb-hover: #a1a1aa;

  /* Transitions */
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
}

/* ── Dark Theme ────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #09090b;
  --bg-secondary: #18181b;
  --bg-tertiary: #27272a;

  --border: #27272a;
  --border-hover: #3f3f46;

  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-inverse: #09090b;

  --accent: #fafafa;
  --accent-hover: #e4e4e7;

  --urgent: #ef4444;
  --urgent-bg: #1c0a0a;
  --urgent-border: #7f1d1d;
  --success: #22c55e;
  --success-bg: #052e16;
  --success-border: #166534;
  --meds: #f59e0b;
  --meds-bg: #1c1507;
  --meds-border: #92400e;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);

  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  --progress-track: #27272a;
  --progress-fill: #fafafa;

  --scrollbar-thumb: #3f3f46;
  --scrollbar-thumb-hover: #52525b;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  transition: background var(--duration-slow) ease, color var(--duration-slow) ease;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* ── Selection ─────────────────────────────────────────────── */
::selection {
  background: var(--accent);
  color: var(--text-inverse);
}

/* ── Focus Visible ─────────────────────────────────────────── */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* ── Titlebar (macOS drag region) ──────────────────────────── */
.titlebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  -webkit-app-region: drag;
  z-index: 100;
}

/* ── Main Container ────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 32px 48px;
}

/* ── Utility ───────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Theme Toggle Icon Visibility ──────────────────────────── */
.icon-sun  { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
