/* v2 */
:root {
  --c-david:  #4285F4;
  --c-pamela: #16A765;
  --c-ava:    #F4B5C0;
  --c-chris:  #FF7537;
  --c-family: #7B1FA2;

  --bg:       #0F1115;
  --surface:  #1A1D24;
  --surface-2:#232733;
  --line:     #2A2F3C;
  --text:     #ECEEF2;
  --muted:    #9AA3B2;
  --danger:   #E5484D;
  --ok:       #30A46C;
  --shadow:   0 30px 80px rgba(0,0,0,0.5);
}

body[data-theme="light"] {
  --bg:       #F4F6FA;
  --surface:  #FFFFFF;
  --surface-2:#EEF1F7;
  --line:     #DCE0EA;
  --text:     #1A1D24;
  --muted:    #6B7280;
  --danger:   #DC2626;
  --ok:       #16A34A;
  --shadow:   0 20px 60px rgba(15,17,21,0.12);
}
body[data-theme="light"] {
  background: linear-gradient(180deg, #EAF1FB 0%, var(--bg) 50%) fixed;
}

:root {
  --radius:   16px;
  --r-sm:     8px;
  --r-md:     12px;
  --r-lg:     16px;
  --gap:      16px;
  --tap:      56px;

  /* Spacing scale (4px steps) */
  --s-1:      4px;
  --s-2:      8px;
  --s-3:      12px;
  --s-4:      16px;
  --s-5:      20px;
  --s-6:      24px;
  --s-8:      32px;
  --s-12:     48px;

  /* Neutral accent — used for today / current focus */
  --accent:   var(--text);

  --font: 'Manrope', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Manrope', system-ui, sans-serif;
}

/* Type scale tuned for a 27" wall display viewed from 1–3 m */
:root {
  --fs-xs:   13px;   /* tertiary labels (e.g., "all day", weekday in calendar) */
  --fs-sm:   15px;   /* body small (sidebar labels, event meta, hour gutter) */
  --fs-base: 17px;   /* body */
  --fs-md:   20px;   /* event titles, list items, settings rows */
  --fs-lg:   24px;   /* sub-headings */
  --fs-xl:   30px;   /* day numbers, weather temps */
  --fs-2xl:  44px;   /* large headers */
  --fs-3xl:  72px;   /* clock */
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(1200px 600px at 20% -10%, #1a2030 0%, var(--bg) 60%) fixed;
  color: var(--text);
  font: 400 var(--fs-base)/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

/* ─── Connect screen ─── */
.connect {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: var(--bg);
  z-index: 50;
}
.connect-card {
  background: var(--surface);
  padding: 48px 56px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  text-align: center;
  max-width: 520px;
}
.connect-card h1 { margin: 0 0 8px; font-size: 32px; }
.connect-card p { color: var(--muted); margin: 0 0 28px; }

/* ─── Layout ─── */
body { display: grid; grid-template-columns: 116px 1fr; }
.dashboard {
  display: grid;
  grid-template-rows: 120px 1fr;
  height: 100vh;
  padding: var(--s-3);
  gap: var(--s-4);
  min-width: 0;
}

/* ─── Sidebar ─── */
.sidenav {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 14px 8px;
  gap: 10px;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.nav-item {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 10px;
  font: 600 var(--fs-sm) var(--font);
  cursor: pointer;
  min-height: 76px;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 32px; height: 32px; stroke-width: 2; }
.nav-icon-img { width: 32px; height: 32px; object-fit: contain; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--surface-2);
  color: var(--text);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; width: 4px; height: 60%;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  transform: translateX(-8px);
}
.nav-item { position: relative; }

/* Theme toggle (sits directly under Settings) */
.nav-theme .icon-sun  { display: none; }
.nav-theme .icon-moon { display: block; }
body[data-theme="light"] .nav-theme .icon-sun  { display: block; }
body[data-theme="light"] .nav-theme .icon-moon { display: none; }
.zeus-dark { display: block; }
.zeus-light { display: none; }
body[data-theme="light"] .zeus-dark { display: none; }
body[data-theme="light"] .zeus-light { display: block; }

/* ─── Placeholder views ─── */
.placeholder-view {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 36px;
  overflow-y: auto;
}
.placeholder-view h2 { margin: 0 0 var(--s-3); font-size: var(--fs-2xl); font-weight: 800; font-family: var(--font-display); }
.placeholder-view p { color: var(--muted); font-size: var(--fs-md); max-width: 720px; line-height: 1.5; }
.photo-status {
  margin: 22px 0;
  padding: 14px 18px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 16px;
}
.photo-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ─── Weather View ─── */
#view-weather {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 36px;
  overflow-y: auto;
}
.weather-view h2 { margin: 0 0 28px; font-size: var(--fs-2xl); font-weight: 800; font-family: var(--font-display); }
.weather-view h3 { margin: 20px 0 14px; font-size: var(--fs-lg); font-weight: 700; }
.weather-current {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--surface-2);
  border-radius: 12px;
  margin-bottom: 24px;
}
.wc-icon { font-size: 64px; }
.wc-temp { font-size: 48px; font-weight: 700; }
.wc-wind { color: var(--muted); font-size: var(--fs-md); }
.weather-now {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
  background: var(--surface-2);
  border-radius: 12px;
  margin-bottom: 24px;
}
.wn-icon { font-size: 64px; line-height: 1; }
.wn-temp { font-size: 56px; font-weight: 800; font-family: var(--font-display); }
.wn-meta { display: flex; flex-direction: column; gap: 6px; }
.wn-hilo { font-size: var(--fs-lg); font-weight: 600; }
.wn-wind { color: var(--muted); font-size: var(--fs-md); }
.weather-section { margin-bottom: 24px; }
.weather-hourly {
  display: grid;
  grid-auto-flow: column;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}
.wh-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 8px;
  min-width: 70px;
  text-align: center;
  font-size: var(--fs-sm);
}
.wh-icon { font-size: 28px; }
.wh-temp { font-weight: 600; }
.weather-daily {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}
.wd-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 10px;
  background: var(--surface-2);
  border-radius: 8px;
  text-align: center;
  font-size: var(--fs-sm);
}
.wd-icon { font-size: 32px; }
.wd-max { font-weight: 600; color: rgba(229,72,77,0.85); }
.wd-min { color: var(--muted); }
.wd-temps { display: flex; gap: 4px; }
.weather-uv {
  display: grid;
  grid-auto-flow: column;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}
.uv-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 8px;
  min-width: 70px;
  text-align: center;
  font-size: var(--fs-sm);
  border-left: 3px solid var(--muted);
}
.uv-item.uv-low { border-left-color: #16A765; }
.uv-item.uv-moderate { border-left-color: #FFC107; }
.uv-item.uv-high { border-left-color: #FF7537; }
.uv-item.uv-very-high { border-left-color: #E91E63; }
.uv-item.uv-extreme { border-left-color: #9C27B0; }
.uv-time { font-size: var(--fs-xs); color: var(--muted); }
.uv-value { font-weight: 600; font-size: var(--fs-lg); }
.uv-label { font-size: var(--fs-xs); color: var(--muted); }

/* ─── Meals View ─── */
#view-meals {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.meals-view { display: flex; flex-direction: column; gap: 20px; height: 100%; }
.meals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.meals-view h2 { margin: 0; font-size: var(--fs-xl); font-weight: 800; font-family: var(--font-display); }
.meals-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.meals-week-label {
  font-size: var(--fs-sm);
  color: var(--muted);
  min-width: 140px;
  text-align: center;
}
.nav-btn { padding: 8px 16px; min-height: 44px; min-width: 44px; }
.meals-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  flex: 1;
  overflow-y: auto;
}
.meal-day {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 10px;
  min-height: 85px;
}
.meal-day-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}
.meal-day-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
}
.meal-day-date {
  font-size: var(--fs-xs);
  color: var(--muted);
}
.meal-day-inputs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.meal-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.meal-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
.meal-input {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px;
  border-radius: 6px;
  font: 500 var(--fs-xs) var(--font);
  cursor: pointer;
  min-height: 36px;
}
.chef-select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px;
  border-radius: 6px;
  font: 500 var(--fs-xs) var(--font);
  cursor: pointer;
  min-height: 36px;
  flex: 1;
}
.meal-input::placeholder { color: var(--muted); }
.meal-input:focus, .chef-select:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.chef-select {
  accent-color: var(--accent);
}
.meal-delete-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.meal-delete-btn:hover {
  color: #ff4444;
  background: rgba(255, 68, 68, 0.1);
}
.chef-option-chris { color: var(--c-chris); }
.chef-option-pamela { color: var(--c-pamela); }
.chef-option-david { color: var(--c-david); }
.chef-option-ava { color: var(--c-ava); }
.chef-option-family { color: var(--c-family); }

/* ─── Zeus View ─── */
#view-zeus {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.zeus-view { display: flex; flex-direction: column; gap: 20px; height: 100%; }
.zeus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.zeus-view h2 { margin: 0; font-size: var(--fs-xl); font-weight: 800; font-family: var(--font-display); }
.zeus-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.zeus-week-label {
  font-size: var(--fs-sm);
  color: var(--muted);
  min-width: 140px;
  text-align: center;
}
.walks-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}
.walk-day {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 10px;
}
.walk-day-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
.walk-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--surface);
  border-radius: 6px;
  border-left: 2px solid var(--line);
}
.walk-time {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
}
.walk-person-select, .walk-location-select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 4px;
  border-radius: 4px;
  font: 500 11px var(--font);
  cursor: pointer;
  min-height: 36px;
}
.walk-person-select:focus, .walk-location-select:focus { outline: none; border-color: var(--accent); }

/* ─── Fullscreen photo viewer ─── */
#view-photos {
  position: fixed;
  inset: 0 0 0 100px;
  background: #000;
  z-index: 30;
  overflow: hidden;
}
.photo-viewer {
  position: absolute; inset: 0;
  background: #000 center/cover no-repeat;
  transition: opacity .8s ease;
  cursor: pointer;
}
.photo-overlay {
  position: absolute;
  top: 24px; right: 32px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  color: rgba(255,255,255,0.7);
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
  pointer-events: none;
}
.po-time { font-family: var(--font-display); font-size: 56px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; }
.po-date { font-size: var(--fs-md); font-weight: 500; opacity: 0.85; }
.po-weather {
  margin-top: var(--s-2);
  display: flex; flex-direction: column; gap: 4px;
  font-size: var(--fs-md);
  font-weight: 500;
  opacity: 0.9;
}
.po-weather .row { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
body[data-view="photos"] { background: #000; }
body[data-view="photos"] .header,
body[data-view="photos"] .calendar,
body[data-view="photos"] .tasks { display: none; }
.settings-list {
  list-style: none; padding: 0; margin: 18px 0;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 560px;
}
.settings-list li {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-2);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
}
.settings-list code { font: var(--fs-sm) ui-monospace, monospace; color: var(--muted); }

.toggle { position: relative; display: inline-block; width: 52px; height: 30px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background .15s;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .15s, background .15s;
}
.toggle input:checked + .toggle-track { background: var(--c-david); border-color: var(--c-david); }
.toggle input:checked + .toggle-track::after { transform: translateX(22px); background: white; }

/* ─── Header ─── */
.header {
  display: grid;
  grid-template-columns: 140px auto 1fr auto;
  grid-template-rows: 120px;
  gap: 0;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 0;
}
.hourly-weather-strip {
  position: relative;
  padding: 2px 4px;
  margin-top: 4px;
  background: transparent;
  overflow: visible;
}
.hws-chart {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
  pointer-events: none;
}
.hws-line-temp {
  fill: none;
  stroke: #FF6B6B;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hws-line-precip {
  fill: none;
  stroke: #4DABF7;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hws-data {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  font-size: 11px;
  white-space: nowrap;
  overflow-x: auto;
}
.hws-times, .hws-temps, .hws-precips {
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.hws-times span, .hws-temps span, .hws-precips span {
  flex: 1;
  min-width: 40px;
  text-align: center;
  padding: 0 1px;
}
.hws-times span {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
}
.hws-temps span {
  color: #FF6B6B;
  font-weight: 600;
  font-size: 14px;
}
.hws-precips span {
  color: #4DABF7;
  font-weight: 600;
  font-size: 11px;
}
.hws-precips {
  margin-top: -4px;
}
.header .clock      { padding: var(--s-3) var(--s-1) var(--s-3) 0; align-self: start; }
.header .quick-add-col {
  align-self: start;
  margin-top: var(--s-3);
  padding: 0 var(--s-2);
  min-width: 0;
  display: flex; flex-direction: column;
  gap: var(--s-1);
}
.header .quick-add  { min-width: 0; width: 100%; padding: 0; margin: 0; display: flex; gap: 10px; }
.quick-add-input-wrap { position: relative; flex: 1; min-width: 0; }
.quick-add-input-wrap input { width: 100%; padding-right: 52px; }
.dictate-btn {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
  opacity: 0.45;
  display: grid; place-items: center;
  cursor: pointer;
  transition: opacity .15s, background .15s, color .15s;
}
.dictate-btn:hover { opacity: 1; background: var(--surface); }
.dictate-btn svg { width: 18px; height: 18px; }
.dictate-btn.recording {
  opacity: 1;
  color: white;
  background: #E5484D;
  box-shadow: 0 0 0 0 rgba(229,72,77,0.6);
  animation: micPulse 1.2s ease-out infinite;
}
.header .weather-col {
  display: flex; flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 6px 8px;
  align-self: start;
  margin-right: 10px;
}
.header .weather    { padding: 0; }
.ai-chat-col {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.wind-speed {
  font-size: 9px;
  color: var(--muted);
  font-weight: 500;
}
.mic-btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--c-david); color: white;
  border: 0; border-radius: 999px;
  padding: 6px 14px;
  font: 700 12px var(--font);
  box-shadow: 0 4px 12px rgba(66,133,244,0.35);
  transition: transform .1s, background .15s;
}
.mic-btn svg { width: 18px; height: 18px; }
.mic-btn:active { transform: scale(0.96); }
.mic-btn.recording {
  background: #E5484D;
  box-shadow: 0 0 0 0 rgba(229,72,77,0.6);
  animation: micPulse 1.2s ease-out infinite;
}
@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 rgba(229,72,77,0.5); }
  100% { box-shadow: 0 0 0 12px rgba(229,72,77,0); }
}

/* Voice modal */
.voice-modal { width: min(640px, 100%); }
.voice-status { color: var(--muted); font-size: var(--fs-md); }
.voice-log {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-base);
  min-height: 140px;
  max-height: 320px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s-2);
}
.voice-log .turn { line-height: 1.4; }
.voice-log .turn.user { color: var(--text); font-weight: 600; }
.voice-log .turn.user::before { content: "You: "; color: var(--muted); font-weight: 500; }
.voice-log .turn.bot { color: var(--text); }
.voice-log .turn.bot::before { content: "Dashboard: "; color: var(--c-david); font-weight: 600; }
.voice-log .turn.partial { color: var(--muted); font-style: italic; }
.voice-log .turn.partial::before { content: "… "; }
.mic-action svg { width: 22px; height: 22px; margin-right: 8px; }
.photo-banner {
  width: 116px;
  height: 94px;
  margin: 0 12px;
  align-self: center;
  border-radius: var(--r-md);
  background: var(--surface-2) center/cover no-repeat;
  transition: opacity .8s ease;
}
.header-center {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}
.clock {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 4px;
  white-space: nowrap;
}
.clock .time {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.clock .date {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

/* 6-day forecast */
.forecast-6day {
  display: grid;
  grid-auto-flow: column;
  gap: 4px;
  margin-top: 2px;
}
.day-forecast {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.df-day {
  font-size: 8px;
  font-weight: 700;
  color: var(--text);
}
.df-icon {
  font-size: 14px;
  line-height: 1;
}
.df-temps {
  display: flex;
  gap: 4px;
  font-size: 10px;
  color: var(--text);
  font-weight: 700;
}
.df-max {
  color: rgba(229,72,77,0.85);
}
.df-min {
  color: rgba(66,133,244,0.85);
}

.quick-add {
  display: flex; gap: 10px; align-self: end;
}
.quick-add input {
  flex: 1;
  height: 42px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  padding: 0 var(--s-4);
}
.quick-add input:focus { outline: 2px solid var(--c-david); outline-offset: 1px; }

.weather {
  display: flex; flex-direction: column; justify-content: center; gap: 0;
}
.wx-display {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: flex-end;
  gap: 2px;
  white-space: nowrap;
}
.wx-place {
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  margin-right: 10px;
}
.wx-details {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: flex-end;
  gap: 1px;
  font-size: 10px;
  font-weight: 600;
}
.wx-details {
  min-width: 90px;
}
.wx-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  line-height: 1.3;
  width: 100%;
}
.wx-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  min-width: 28px;
}
.wx-temp {
  color: var(--text);
}
.wx-rainfall {
  color: #4DABF7;
}
.wx-wind {
  color: var(--muted);
}

/* Hourly forecast strip */

/* ─── Buttons ─── */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  height: 42px;
  min-width: 42px;
  padding: 0 var(--s-5);
  border-radius: var(--r-md);
  font: 600 16px var(--font);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: transform .05s, background .15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--c-david); border-color: var(--c-david); color: white; }
.btn-danger  { background: var(--danger);  border-color: var(--danger);  color: white; }
.btn-ghost   { background: transparent; }

/* ─── Calendar ─── */
.calendar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4);
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}
.cal-toolbar {
  display: flex; align-items: center; gap: var(--s-3);
  padding-bottom: var(--s-3);
}
.cal-toolbar { padding-bottom: 6px; gap: var(--s-2); }
.cal-toolbar .btn,
.cal-toolbar .nav-btn {
  height: 26px;
  min-width: 26px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 6px;
}
.cal-range { font-size: 14px; font-weight: 700; margin-left: var(--s-1); }
.legend { font-size: 12px; gap: var(--s-4); }
.legend .legend-item { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.legend .legend-item .dot { margin: 0; }
.legend .legend-item input[type="checkbox"] { cursor: pointer; margin-right: 2px; }
.legend .legend-item:has(input:not(:checked)) { opacity: 0.5; }
.legend {
  margin-left: auto;
  display: flex; align-items: center; gap: var(--s-4);
  color: var(--muted); font-size: var(--fs-sm); font-weight: 500;
}
.dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}

.cal-grid {
  display: grid;
  grid-template-columns: 72px repeat(7, 1fr);
  grid-template-rows: 50px auto 1fr;
  gap: 1px;
  background: var(--line);
  border-radius: 12px;
  overflow: hidden;
  min-height: 0;
}
.cal-grid > * { background: var(--surface); }

.cal-corner, .cal-day-head { display: flex; align-items: center; justify-content: center; }
.cal-day-head {
  flex-direction: column;
  gap: 4px;
  padding: 6px 0;
  font-weight: 600;
  color: var(--muted);
}
.cal-day-head .day-line {
  display: flex; align-items: baseline; gap: 8px;
}
.cal-day-head .dow {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  line-height: 1;
}
.cal-day-head.today { color: var(--text); }
.cal-day-head.today .dow { color: var(--text); }
.cal-day-head .num {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.day-dots {
  display: flex; gap: 4px;
  align-items: center; justify-content: center;
  height: 10px;
  margin-top: 4px;
}
.day-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.day-more { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.cal-day-head.today .num { color: var(--text); }

.cal-allday {
  grid-column: 2 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  min-height: 36px;
}
.cal-allday-cell {
  background: var(--surface);
  padding: 4px;
  display: flex; flex-direction: column; gap: 2px;
}
.cal-allday-label {
  grid-column: 1; grid-row: 2;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.cal-body {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: 72px repeat(7, 1fr);
  overflow: hidden;
  position: relative;
  background: var(--line);
  gap: 1px;
  min-height: 0;
}
.cal-hours, .cal-day { border-bottom: 1px solid var(--line); }
.cal-hours {
  display: grid;
  grid-template-rows: repeat(var(--hours, 14), 1fr);
  background: var(--surface);
}
.cal-hour {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
  padding: 4px 10px;
  border-top: 1px solid var(--line);
}
.cal-day {
  position: relative;
  background: var(--surface);
  display: grid;
  grid-template-rows: repeat(var(--hours, 14), 1fr);
}
.cal-day .slot { border-top: 1px solid var(--line); }
.cal-day.today {
  background: linear-gradient(rgba(66,133,244,0.12), rgba(66,133,244,0.12)), var(--surface);
}
body[data-theme="light"] .cal-day.today {
  background: linear-gradient(rgba(66,133,244,0.10), rgba(66,133,244,0.10)), var(--surface);
}

.event {
  position: absolute;
  left: 4px; right: 4px;
  background: var(--c, var(--c-david));
  color: white;
  border-radius: var(--r-sm);
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.1;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  border-left: 4px solid rgba(255,255,255,0.4);
}
.event .ev-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px;
  line-height: 1.1;
  opacity: 0.9;
  white-space: nowrap;
}
.event .ev-meta .ev-person { font-weight: 700; }
.event .ev-meta .ev-time { font-weight: 500; }
.event .ev-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0;
}
.event.allday {
  font-size: var(--fs-sm);
  padding: 6px 10px;
}
.event.allday .ev-person {
  font-size: var(--fs-sm); font-weight: 700; opacity: 0.9; margin-right: 8px;
}
.event.allday .ev-title { font-size: var(--fs-sm); display: inline; margin: 0; }
.event.allday {
  position: relative;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border-left: none;
}

/* ─── Tasks ─── */
.tasks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
  min-height: 0;
}
.task-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
  overflow: hidden;
}
.task-col header {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-lg); font-weight: 700;
}
.task-col header .dot { width: 14px; height: 14px; }
.task-list {
  list-style: none; margin: 0; padding: var(--s-2);
  overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s-2);
}
.task-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: var(--s-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  font-weight: 500;
  min-height: 60px;
  cursor: pointer;
}
.task-item.done { opacity: 0.45; text-decoration: line-through; }
.task-check {
  width: 26px; height: 26px;
  border-radius: 8px;
  border: 2px solid var(--muted);
  display: grid; place-items: center;
  background: transparent;
  cursor: pointer;
}
.task-item.done .task-check {
  background: var(--ok); border-color: var(--ok); color: white;
}
.task-check::after { content: ""; }
.task-item.done .task-check::after {
  content: "✓"; color: white; font-weight: 700;
}
.task-del {
  background: transparent; border: 0; color: var(--muted);
  font-size: 22px; min-width: 44px; min-height: 44px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  cursor: pointer;
}
.task-del:hover { background: var(--surface); color: var(--text); }
.task-add {
  display: flex; gap: var(--s-2);
  padding: var(--s-3);
  border-top: 1px solid var(--line);
}
.task-add input {
  flex: 1;
  height: 52px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 var(--s-4);
  font-size: var(--fs-base);
}

/* ─── Modal ─── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  z-index: 100;
  padding: 24px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow);
}
.modal h2 { margin: 0 0 var(--s-1); font-size: var(--fs-2xl); font-weight: 800; font-family: var(--font-display); }
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field > span { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.field input, .field textarea, .field select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-4);
  font: var(--fs-md) var(--font);
  min-height: 60px;
}
.field textarea { min-height: 64px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row > .field { min-width: 0; }
.row > .field input { min-width: 0; width: 100%; font-size: var(--fs-base); }
.row-inline { flex-direction: row; align-items: center; gap: 10px; }
.row-inline input { min-height: 0; }

.people { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.people button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.people button .swatch {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--c);
  border: 4px solid transparent;
  transition: transform .1s, border-color .1s;
}
.people button .name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
}
.people button.active .swatch {
  border-color: var(--text);
  transform: scale(1.08);
}
.people button.active .name { color: var(--text); }

.modal-actions {
  display: flex; gap: 10px; margin-top: 8px;
  align-items: center;
}
.modal-actions .btn { flex: 1; height: 64px; font-size: 18px; }
.modal-actions .btn-ghost { flex: 0 0 auto; }
.preview {
  background: var(--surface-2);
  padding: 14px; border-radius: 10px;
  font: 14px/1.4 ui-monospace, monospace;
  white-space: pre-wrap;
  margin: 0;
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 16px;
  z-index: 200;
  box-shadow: var(--shadow);
}
.toast.error { border-color: var(--danger); }
.toast.ok    { border-color: var(--ok); }

/* Groceries */
.groceries-view { display: grid; grid-template-columns: 1fr 380px; gap: 24px; height: 100%; min-height: 0; }
.gro-search-col { display: flex; flex-direction: column; min-height: 0; }
.gro-search-col h2 { margin: 0 0 16px; font-size: var(--fs-2xl); font-weight: 800; font-family: var(--font-display); }
.gro-search { display: flex; gap: 10px; margin-bottom: 16px; }
.gro-search input {
  flex: 1; padding: 14px 16px; font-size: var(--fs-lg);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; color: inherit;
}
.gro-search button {
  padding: 14px 22px; font-size: var(--fs-lg); font-weight: 700;
  background: var(--accent); color: #fff; border: 0; border-radius: 12px; cursor: pointer;
}
.gro-results { flex: 1; overflow-y: auto; min-height: 0; }
.gro-hint, .gro-result-count { color: var(--muted); padding: 8px 2px; }
.gro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.gro-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; text-align: left;
  padding: 12px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 14px; cursor: pointer; color: inherit; position: relative;
}
.gro-card:active { transform: scale(0.98); }
.gro-img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 10px; }
.gro-name { font-size: var(--fs-md); font-weight: 600; line-height: 1.2; }
.gro-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: var(--fs-sm); }
.gro-size { color: var(--muted); }
.gro-price { font-weight: 700; }
.gro-sale { color: #e53935; font-weight: 700; }
.gro-was { color: var(--muted); text-decoration: line-through; font-size: var(--fs-xs); }
.gro-add { margin-top: 4px; text-align: center; font-weight: 700; color: var(--accent); font-size: var(--fs-sm); }

.gro-list-col { display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); border-radius: 16px; padding: 16px; }
.gro-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.gro-list-head h3 { margin: 0; font-size: var(--fs-xl); font-weight: 700; }
.gro-count { color: var(--muted); font-weight: 500; }
.gro-clear { padding: 8px 12px; font-size: var(--fs-sm); background: transparent; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); cursor: pointer; }
.gro-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.gro-empty { color: var(--muted); padding: 12px 4px; }
.gro-list-item { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.gro-list-item.done .gro-list-name { text-decoration: line-through; color: var(--muted); }
.gro-check { width: 26px; height: 26px; flex: none; border: 2px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.gro-list-item.done .gro-check { background: var(--accent); border-color: var(--accent); }
.gro-list-img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 8px; flex: none; }
.gro-list-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gro-list-name { font-size: var(--fs-md); font-weight: 600; }
.gro-list-sub { font-size: var(--fs-xs); color: var(--muted); }
.gro-qty { font-weight: 700; color: var(--accent); }
.gro-del { width: 32px; height: 32px; flex: none; border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--line); }
