/**
 * Daily Command — Morning Mission Control
 * A warm, sophisticated command center for family mornings
 */

/* === Fonts === */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,300..700&display=swap');

/* === Theme: Vintage Rose (Default) === */
:root, [data-theme="vintage-rose"] {
  --theme-name: "Vintage Rose";
  --cream: #f1fffa;
  --cream-rich: #d5c7bc;
  --espresso: #454545;
  --espresso-soft: #785964;
  --accent: #93b7be;
  --accent-glow: #a8c8ce;
  --accent-bold: #785964;
  --secondary: #93b7be;
  --secondary-soft: #d5c7bc;
  --highlight: #785964;
  --muted: #785964;
  --success: #93b7be;
  --warning: #d5c7bc;
  --danger: #785964;
  --info: #93b7be;
  --surface-0: var(--cream);
  --surface-1: #FFFFFF;
  --surface-2: var(--cream-rich);
  --banner-bg: linear-gradient(135deg, #454545 0%, #785964 100%);
  --banner-text: #f1fffa;
  --gradient-wash: rgba(147, 183, 190, 0.15);
}

/* === Theme: Bold Hues === */
[data-theme="bold-hues"] {
  --theme-name: "Bold Hues";
  --cream: #F0F4FF;
  --cream-rich: #E0E8FF;
  --espresso: #3a0ca3;
  --espresso-soft: #7209b7;
  --accent: #f72585;
  --accent-glow: #ff5ca1;
  --accent-bold: #7209b7;
  --secondary: #4361ee;
  --secondary-soft: #4cc9f0;
  --highlight: #f72585;
  --muted: #7209b7;
  --success: #4cc9f0;
  --warning: #f72585;
  --danger: #f72585;
  --info: #4361ee;
  --surface-0: var(--cream);
  --surface-1: #FFFFFF;
  --surface-2: var(--cream-rich);
  --banner-bg: linear-gradient(135deg, #3a0ca3 0%, #7209b7 100%);
  --banner-text: #F0F4FF;
  --gradient-wash: rgba(247, 37, 133, 0.1);
}

/* === Theme: Candy Pop === */
[data-theme="candy-pop"] {
  --theme-name: "Candy Pop";
  --cream: #FFF0F8;
  --cream-rich: #FFE0F0;
  --espresso: #3a0ca3;
  --espresso-soft: #7209b7;
  --accent: #4cc9f0;
  --accent-glow: #7dd8f5;
  --accent-bold: #f72585;
  --secondary: #4361ee;
  --secondary-soft: #4cc9f0;
  --highlight: #f72585;
  --muted: #7209b7;
  --success: #4cc9f0;
  --warning: #f72585;
  --danger: #f72585;
  --info: #4361ee;
  --surface-0: var(--cream);
  --surface-1: #FFFFFF;
  --surface-2: var(--cream-rich);
  --banner-bg: linear-gradient(135deg, #f72585 0%, #7209b7 100%);
  --banner-text: #FFF0F8;
  --gradient-wash: rgba(76, 201, 240, 0.12);
}

/* === Theme: Mystic Evening === */
[data-theme="mystic-evening"] {
  --theme-name: "Mystic Evening";
  --cream: #1a1423;
  --cream-rich: #372549;
  --espresso: #eacdc2;
  --espresso-soft: #b75d69;
  --accent: #b75d69;
  --accent-glow: #c97a84;
  --accent-bold: #774c60;
  --secondary: #774c60;
  --secondary-soft: #372549;
  --highlight: #eacdc2;
  --muted: #774c60;
  --success: #774c60;
  --warning: #b75d69;
  --danger: #b75d69;
  --info: #774c60;
  --surface-0: var(--cream);
  --surface-1: #372549;
  --surface-2: var(--cream-rich);
  --banner-bg: linear-gradient(135deg, #372549 0%, #774c60 100%);
  --banner-text: #eacdc2;
  --gradient-wash: rgba(183, 93, 105, 0.1);
}

/* === Theme: Ocean Sunset === */
[data-theme="ocean-sunset"] {
  --theme-name: "Ocean Sunset";
  --cream: #FFF5F0;
  --cream-rich: #FFE8E0;
  --espresso: #355070;
  --espresso-soft: #6d597a;
  --accent: #e56b6f;
  --accent-glow: #eb8a8d;
  --accent-bold: #b56576;
  --secondary: #6d597a;
  --secondary-soft: #eaac8b;
  --highlight: #e56b6f;
  --muted: #6d597a;
  --success: #6d597a;
  --warning: #eaac8b;
  --danger: #e56b6f;
  --info: #355070;
  --surface-0: var(--cream);
  --surface-1: #FFFFFF;
  --surface-2: var(--cream-rich);
  --banner-bg: linear-gradient(135deg, #355070 0%, #6d597a 100%);
  --banner-text: #FFF5F0;
  --gradient-wash: rgba(229, 107, 111, 0.12);
}

/* === Theme: Pastel Dreamland === */
[data-theme="pastel-dreamland"] {
  --theme-name: "Pastel Dreamland";
  --cream: #FFF8FC;
  --cream-rich: #ffc8dd;
  --espresso: #5c4a6e;
  --espresso-soft: #8b7a9e;
  --accent: #ffafcc;
  --accent-glow: #ffc8dd;
  --accent-bold: #cdb4db;
  --secondary: #a2d2ff;
  --secondary-soft: #bde0fe;
  --highlight: #ffafcc;
  --muted: #8b7a9e;
  --success: #a2d2ff;
  --warning: #ffc8dd;
  --danger: #ffafcc;
  --info: #bde0fe;
  --surface-0: var(--cream);
  --surface-1: #FFFFFF;
  --surface-2: var(--cream-rich);
  --banner-bg: linear-gradient(135deg, #cdb4db 0%, #ffafcc 100%);
  --banner-text: #5c4a6e;
  --gradient-wash: rgba(255, 175, 204, 0.15);
}

/* === Theme: Purple Dream === */
[data-theme="purple-dream"] {
  --theme-name: "Purple Dream";
  --cream: #231942;
  --cream-rich: #5e548e;
  --espresso: #e0b1cb;
  --espresso-soft: #be95c4;
  --accent: #9f86c0;
  --accent-glow: #be95c4;
  --accent-bold: #5e548e;
  --secondary: #be95c4;
  --secondary-soft: #5e548e;
  --highlight: #e0b1cb;
  --muted: #9f86c0;
  --success: #9f86c0;
  --warning: #be95c4;
  --danger: #e0b1cb;
  --info: #9f86c0;
  --surface-0: var(--cream);
  --surface-1: #5e548e;
  --surface-2: var(--cream-rich);
  --banner-bg: linear-gradient(135deg, #231942 0%, #5e548e 100%);
  --banner-text: #e0b1cb;
  --gradient-wash: rgba(159, 134, 192, 0.12);
}

/* === Theme: Purple Haze === */
[data-theme="purple-haze"] {
  --theme-name: "Purple Haze";
  --cream: #F5FAFA;
  --cream-rich: #bee7e8;
  --espresso: #594157;
  --espresso-soft: #726da8;
  --accent: #7d8cc4;
  --accent-glow: #a0d2db;
  --accent-bold: #726da8;
  --secondary: #a0d2db;
  --secondary-soft: #bee7e8;
  --highlight: #7d8cc4;
  --muted: #726da8;
  --success: #a0d2db;
  --warning: #7d8cc4;
  --danger: #594157;
  --info: #7d8cc4;
  --surface-0: var(--cream);
  --surface-1: #FFFFFF;
  --surface-2: var(--cream-rich);
  --banner-bg: linear-gradient(135deg, #594157 0%, #726da8 100%);
  --banner-text: #bee7e8;
  --gradient-wash: rgba(125, 140, 196, 0.12);
}

/* === Theme: Soft Earth === */
[data-theme="soft-earth"] {
  --theme-name: "Soft Earth";
  --cream: #FFFFFF;
  --cream-rich: #d8e2dc;
  --espresso: #9d8189;
  --espresso-soft: #9d8189;
  --accent: #f4acb7;
  --accent-glow: #ffcad4;
  --accent-bold: #9d8189;
  --secondary: #d8e2dc;
  --secondary-soft: #d8e2dc;
  --highlight: #f4acb7;
  --muted: #9d8189;
  --success: #d8e2dc;
  --warning: #ffcad4;
  --danger: #f4acb7;
  --info: #d8e2dc;
  --surface-0: var(--cream);
  --surface-1: #FFFFFF;
  --surface-2: var(--cream-rich);
  --banner-bg: linear-gradient(135deg, #9d8189 0%, #f4acb7 100%);
  --banner-text: #FFFFFF;
  --gradient-wash: rgba(244, 172, 183, 0.15);
}

/* === Theme: Soft Rainbow === */
[data-theme="soft-rainbow"] {
  --theme-name: "Soft Rainbow";
  --cream: #FFFEF8;
  --cream-rich: #fbf8cc;
  --espresso: #6b5a7a;
  --espresso-soft: #8b7a9e;
  --accent: #ffcfd2;
  --accent-glow: #f1c0e8;
  --accent-bold: #cfbaf0;
  --secondary: #90dbf4;
  --secondary-soft: #98f5e1;
  --highlight: #ffcfd2;
  --muted: #8b7a9e;
  --success: #b9fbc0;
  --warning: #fde4cf;
  --danger: #ffcfd2;
  --info: #a3c4f3;
  --surface-0: var(--cream);
  --surface-1: #FFFFFF;
  --surface-2: var(--cream-rich);
  --banner-bg: linear-gradient(135deg, #cfbaf0 0%, #90dbf4 100%);
  --banner-text: #6b5a7a;
  --gradient-wash: rgba(241, 192, 232, 0.15);
}

/* === Theme: Vibrant Fiesta === */
[data-theme="vibrant-fiesta"] {
  --theme-name: "Vibrant Fiesta";
  --cream: #FFF8F0;
  --cream-rich: #FFE8D8;
  --espresso: #3a3a6a;
  --espresso-soft: #8338ec;
  --accent: #ff006e;
  --accent-glow: #ff4d94;
  --accent-bold: #fb5607;
  --secondary: #3a86ff;
  --secondary-soft: #ffbe0b;
  --highlight: #ff006e;
  --muted: #8338ec;
  --success: #3a86ff;
  --warning: #ffbe0b;
  --danger: #ff006e;
  --info: #3a86ff;
  --surface-0: var(--cream);
  --surface-1: #FFFFFF;
  --surface-2: var(--cream-rich);
  --banner-bg: linear-gradient(135deg, #8338ec 0%, #ff006e 100%);
  --banner-text: #FFF8F0;
  --gradient-wash: rgba(255, 0, 110, 0.1);
}

/* Legacy variable aliases for compatibility */
:root {
  --amber: var(--accent);
  --amber-glow: var(--accent-glow);
  --terracotta: var(--accent-bold);
  --sage: var(--secondary);
  --sage-soft: var(--secondary-soft);
  --rose: var(--highlight);
  --surface-elevated: var(--surface-1);

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(44, 36, 24, 0.04);
  --shadow-md: 0 4px 12px rgba(44, 36, 24, 0.06), 0 1px 3px rgba(44, 36, 24, 0.04);
  --shadow-lg: 0 12px 40px rgba(44, 36, 24, 0.1), 0 4px 12px rgba(44, 36, 24, 0.04);
  --shadow-glow: 0 0 20px rgba(212, 165, 116, 0.3);

  /* Layout */
  --rail-width: clamp(380px, 35vw, 500px);
  --max-width: 1800px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--espresso);
  background: var(--surface-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
}

/* Gradient background wash */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50vh;
  background: linear-gradient(
    180deg,
    var(--gradient-wash) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: -1;
}

/* === Typography === */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* === App Layout === */
.app {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-xl);
  padding-bottom: 80px;
}

/* === Status Banner — The Command Center Header === */
.status-banner {
  position: sticky;
  top: var(--space-md);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-md) var(--space-xl);
  background: var(--banner-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.08);
  color: var(--banner-text);
  overflow: hidden;
}

/* Subtle pattern overlay */
.status-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(212, 165, 116, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(139, 154, 125, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.status-banner .left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  position: relative;
  z-index: 1;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--success);
  box-shadow: 0 0 12px var(--success), 0 0 4px var(--success);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.status-banner.late .status-dot {
  background: var(--danger);
  box-shadow: 0 0 12px var(--danger), 0 0 4px var(--danger);
}

.status-banner.tight .status-dot {
  background: var(--warning);
  box-shadow: 0 0 12px var(--warning), 0 0 4px var(--warning);
}

.pace-text {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.9;
}

.status-banner .times {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}

.status-banner .times span {
  color: var(--amber-glow);
}

.btn-plus {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.btn-plus:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.btn-plus:active {
  transform: translateY(0) scale(0.96);
}

/* === Main Layout === */
.layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

@media (min-width: 1024px) {
  .layout {
    display: grid;
    grid-template-columns: 1fr var(--rail-width);
    gap: var(--space-lg);
    align-items: start;
  }

  .layout > .rail {
    position: sticky;
    top: 80px;
  }
}

.main-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* === Today Strip === */
.today-strip {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding: var(--space-md) 0;
}

.today-date {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  color: var(--espresso);
  line-height: 1.1;
}

.today-tags {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
}

/* === Cards === */
.card {
  background: var(--surface-1);
  border: 1px solid rgba(44, 36, 24, 0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--duration-normal) var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.card-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--espresso);
  letter-spacing: -0.01em;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--amber) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(193, 127, 89, 0.3);
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(193, 127, 89, 0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--espresso-soft);
  border: 1px solid rgba(44, 36, 24, 0.1);
}

.btn-ghost:hover {
  background: var(--cream-rich);
  border-color: rgba(44, 36, 24, 0.15);
  color: var(--espresso);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* === Chips === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid rgba(44, 36, 24, 0.08);
  color: var(--espresso-soft);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.chip:hover {
  background: var(--cream-rich);
  border-color: var(--amber);
}

.chip[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.2) 0%, rgba(139, 154, 125, 0.15) 100%);
  border-color: var(--amber);
  color: var(--espresso);
  font-weight: 600;
}

.chip.done {
  opacity: 0.5;
  text-decoration: line-through;
}

/* === Weather Card — Visual Showcase === */
.weather {
  background: linear-gradient(135deg, var(--surface-1) 0%, var(--surface-2) 100%);
  position: relative;
  overflow: hidden;
}

/* Decorative background glow */
.weather::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  opacity: 0.15;
  pointer-events: none;
}

.weather .tools {
  display: flex;
  gap: var(--space-sm);
}

.weather-hero {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  padding: var(--space-xl) 0;
  position: relative;
}

.weather-hero .now {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-shrink: 0;
}

.weather-hero .temp {
  font-family: var(--font-display);
  font-size: 96px;
  line-height: 1;
  color: var(--espresso);
  letter-spacing: -0.03em;
  text-shadow: 0 2px 20px rgba(0,0,0,0.05);
}

.wx-icon {
  font-size: 80px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.weather-hero .desc {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--espresso);
  margin-bottom: var(--space-md);
  font-weight: 400;
}

.weather-hero .stats {
  display: flex;
  gap: var(--space-xl);
  font-size: 18px;
  color: var(--muted);
}

.weather-hero .stats span {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-1);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0,0,0,0.04);
}

.weather-hero.loading {
  opacity: 0.6;
}

.weather-mini {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.weather-mini .cell {
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-2) 100%);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  transition: all var(--duration-fast) var(--ease-out);
}

.weather-mini .cell:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.weather-mini .t {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.weather-mini .v {
  font-size: 20px;
  font-weight: 600;
  color: var(--espresso);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.weather-mini .v .emoji {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.weather-mini .pop {
  font-size: 13px;
  color: var(--muted);
  margin-top: var(--space-xs);
  opacity: 0.8;
}

.weather .foot {
  margin-top: var(--space-lg);
  font-size: 13px;
  color: var(--muted);
  opacity: 0.7;
}

.weather.windy .card-title::after {
  content: ' 💨';
}

/* Clothing recommendation styling */
#wxClothing:not(:empty) {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bold) 100%);
  color: white;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-top: var(--space-lg);
  font-weight: 500;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

#wxClothing:not(:empty)::before {
  content: '👕';
  font-size: 20px;
}

/* === Leave Plan === */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.input,
.field input {
  height: 56px;
  padding: 0 var(--space-md);
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 600;
  color: var(--espresso);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  text-align: center;
  transition: all var(--duration-fast) var(--ease-out);
  font-variant-numeric: tabular-nums;
}

.input:focus,
.field input:focus {
  outline: none;
  background: var(--surface-1);
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}

.switch {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
  font-size: 16px;
  color: var(--espresso-soft);
}

.switch input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--terracotta);
}

/* === Backpacks === */
.backpacks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.backpack-card {
  background: linear-gradient(135deg, var(--surface-2) 0%, rgba(255,255,255,0.5) 100%);
  border: 1px solid rgba(44, 36, 24, 0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.backpack-title {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 var(--space-md) 0;
  color: var(--espresso);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* === Schedules === */
.schedule-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.schedule-kid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.schedule-name {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--espresso);
}

.schedule-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.schedule-btns .btn {
  font-size: 14px;
  padding: 8px 14px;
}

/* === Utilities === */
.utilities {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
}

/* === Theme Picker === */
.theme-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.theme-picker-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.theme-swatch {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: all var(--duration-fast) var(--ease-out);
  overflow: hidden;
}

.theme-swatch::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: var(--radius-full);
}

.theme-swatch:hover {
  transform: scale(1.1);
}

.theme-swatch[aria-pressed="true"] {
  border-color: var(--espresso);
  box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px var(--accent);
}

.theme-swatch[aria-pressed="true"]::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Swatch colors */
.theme-swatch[data-theme="vintage-rose"] {
  background: linear-gradient(135deg, #93b7be 0%, #785964 100%);
}

.theme-swatch[data-theme="bold-hues"] {
  background: linear-gradient(135deg, #f72585 0%, #3a0ca3 100%);
}

.theme-swatch[data-theme="candy-pop"] {
  background: linear-gradient(135deg, #4cc9f0 0%, #f72585 100%);
}

.theme-swatch[data-theme="mystic-evening"] {
  background: linear-gradient(135deg, #b75d69 0%, #1a1423 100%);
}

.theme-swatch[data-theme="ocean-sunset"] {
  background: linear-gradient(135deg, #e56b6f 0%, #355070 100%);
}

.theme-swatch[data-theme="pastel-dreamland"] {
  background: linear-gradient(135deg, #ffafcc 0%, #a2d2ff 100%);
}

.theme-swatch[data-theme="purple-dream"] {
  background: linear-gradient(135deg, #9f86c0 0%, #231942 100%);
}

.theme-swatch[data-theme="purple-haze"] {
  background: linear-gradient(135deg, #7d8cc4 0%, #594157 100%);
}

.theme-swatch[data-theme="soft-earth"] {
  background: linear-gradient(135deg, #f4acb7 0%, #d8e2dc 100%);
}

.theme-swatch[data-theme="soft-rainbow"] {
  background: linear-gradient(135deg, #f1c0e8 0%, #90dbf4 100%);
}

.theme-swatch[data-theme="vibrant-fiesta"] {
  background: linear-gradient(135deg, #ff006e 0%, #ffbe0b 100%);
}

/* Smooth theme transitions */
body,
body::before,
.status-banner,
.card,
.chip,
.btn,
.cardlet,
.time-node,
.backpack-card,
.weather-mini .cell,
.input,
.field input {
  transition:
    background-color var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

/* === Timeline Rail === */
.rail .card {
  background: linear-gradient(180deg, var(--surface-1) 0%, var(--cream) 100%);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  position: relative;
}

/* Timeline connector line */
.timeline::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(180deg, var(--amber) 0%, var(--sage-soft) 100%);
  border-radius: 1px;
  opacity: 0.3;
}

.step {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: var(--space-md);
  align-items: center;
  position: relative;
}

.step.done {
  opacity: 0.4;
}

.step.done .cardlet {
  text-decoration: line-through;
}

.time-node {
  width: 58px;
  height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface-1);
  border: 2px solid var(--sage-soft);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--espresso-soft);
  text-align: center;
  line-height: 1.2;
  white-space: pre-line;
  position: relative;
  z-index: 1;
  transition: all var(--duration-normal) var(--ease-out);
}

.step.now .time-node {
  background: var(--amber);
  border-color: var(--amber);
  color: white;
  box-shadow: var(--shadow-glow);
  transform: scale(1.05);
}

.step.due .time-node {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
  animation: pulse-urgent 1s ease-in-out infinite;
}

@keyframes pulse-urgent {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.cardlet {
  background: var(--surface-1);
  border: 1px solid rgba(44, 36, 24, 0.06);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  transition: all var(--duration-fast) var(--ease-out);
}

.cardlet:hover {
  background: var(--surface-2);
  transform: translateX(4px);
}

.cardlet .label {
  font-size: 15px;
  font-weight: 500;
  color: var(--espresso);
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}

.cardlet .actions {
  display: flex;
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.cardlet:hover .actions {
  opacity: 1;
}

/* Medication card */
.cardlet.med {
  background: linear-gradient(135deg, rgba(201, 168, 154, 0.15) 0%, rgba(255,255,255,0.8) 100%);
  border-color: var(--rose);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.cardlet.med .bottle {
  width: 24px;
  height: 24px;
  color: var(--terracotta);
  flex-shrink: 0;
}

.cardlet.med .bottle svg {
  width: 100%;
  height: 100%;
}

.cardlet.med.armed {
  background: linear-gradient(135deg, rgba(212, 160, 83, 0.2) 0%, rgba(255,255,255,0.9) 100%);
  border-color: var(--warning);
}

.cardlet.med.due {
  background: linear-gradient(135deg, rgba(212, 160, 83, 0.3) 0%, rgba(255,255,255,0.9) 100%);
  border-color: var(--warning);
  animation: pulse-med 1.5s ease-in-out infinite;
}

.cardlet.med.late {
  background: linear-gradient(135deg, rgba(196, 107, 92, 0.2) 0%, rgba(255,255,255,0.9) 100%);
  border-color: var(--danger);
}

@keyframes pulse-med {
  0%, 100% { transform: scale(1); box-shadow: none; }
  50% { transform: scale(1.02); box-shadow: 0 4px 20px rgba(212, 160, 83, 0.3); }
}

/* Bus card - end of timeline */
.cardlet.bus {
  background: linear-gradient(135deg, rgba(255, 200, 0, 0.15) 0%, rgba(255, 150, 0, 0.1) 100%);
  border-color: var(--warning);
  border-width: 2px;
}

.cardlet.bus .label {
  font-size: 16px;
  font-weight: 600;
}

.step.bus .time-node {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  border-color: #FFD700;
  color: #5c4433;
  font-size: 20px;
}

.step.bus .time-node::before {
  content: '🚌';
  font-size: 24px;
}

.step.bus .time-node span {
  display: none;
}

.timeline.dense .step {
  gap: var(--space-sm);
  grid-template-columns: 44px 1fr;
}

.timeline.dense .time-node {
  width: 44px;
  height: 44px;
  font-size: 10px;
}

.timeline.dense .cardlet {
  padding: var(--space-sm) var(--space-md);
}

.timeline.dense .cardlet .label {
  font-size: 13px;
}

.timeline.dense::before {
  left: 21px;
}

/* === Modal === */
dialog.modal {
  border: none;
  padding: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: min(90vw, 800px);
  box-shadow: var(--shadow-lg);
  background: var(--surface-1);
}

dialog.modal::backdrop {
  background: rgba(44, 36, 24, 0.6);
  backdrop-filter: blur(4px);
}

.modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) var(--space-xl);
  background: var(--surface-1);
  border-bottom: 1px solid rgba(44, 36, 24, 0.06);
  font-family: var(--font-display);
  font-size: 22px;
}

.modal .content {
  padding: var(--space-xl);
  background: var(--surface-2);
}

.modal img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  background: var(--espresso);
  color: var(--cream);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: toast-in 0.3s var(--ease-spring);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* === Hints === */
.hint {
  font-size: 14px;
  color: var(--muted);
  margin-top: var(--space-md);
  line-height: 1.5;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* === Focus States === */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* === Utility: Visually Hidden === */
.leave-buffers {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* === Responsive === */
@media (max-width: 768px) {
  .app {
    padding: var(--space-md);
  }

  .card {
    padding: var(--space-lg);
  }

  .status-banner {
    flex-wrap: wrap;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
  }

  .status-banner .times {
    font-size: 16px;
  }

  .card-title {
    font-size: 22px;
  }

  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }

  .backpacks-grid {
    grid-template-columns: 1fr;
  }

  .schedule-actions {
    grid-template-columns: 1fr;
  }

  .weather-mini {
    grid-template-columns: repeat(3, 1fr);
  }

  .weather-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-lg);
  }

  .weather-hero .temp {
    font-size: 72px;
  }

  .wx-icon {
    font-size: 60px;
  }

  .weather-hero .stats {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .today-date {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .status-banner {
    border-radius: var(--radius-lg);
  }

  .status-banner .left {
    width: 100%;
    justify-content: space-between;
  }

  .card-title {
    font-size: 20px;
  }
}

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

  .status-dot {
    animation: none;
  }
}
