/* ═══════════════════════════════════════════════════════════════
   VÅR VECKA — Family Dashboard
   Warm Nordic Editorial · Fraunces + DM Sans
═══════════════════════════════════════════════════════════════ */

/* ─── Custom Properties ─────────────────────────────────────── */
:root {
  --klara:   #7B5EA7;
  --ebbe:    #2E86AB;
  --lo:      #E8724A;
  --adults:  #6B5C4E;
  --accent:  #B85C3A;

  --bg:          #EDE8E0;
  --surface:     #FAF7F3;
  --surface-alt: #E8E2D8;
  --border:      #D2C9BD;
  --text:        #1C1714;
  --text-muted:  #6B5F55;
  --text-light:  #9E9080;

  --shadow:    0 1px 4px rgba(60,40,20,0.06), 0 6px 18px rgba(60,40,20,0.07);
  --shadow-md: 0 2px 8px rgba(60,40,20,0.10), 0 12px 32px rgba(60,40,20,0.12);
  --radius:    18px;
  --radius-sm: 10px;
  --gap:       1.25rem;

  --font-display: 'Fraunces', Georgia, serif;
  --font-sans:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #141210;
    --surface:     #1E1C19;
    --surface-alt: #262320;
    --border:      #302C28;
    --text:        #F0EAE2;
    --text-muted:  #9E9080;
    --text-light:  #6B5F55;
    --shadow:    0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  }
}

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

html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Header ────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-title h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1;
}

.header-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.header-kids {
  display: flex;
  gap: 0.4rem;
}

.kid-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-sans);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

/* ─── Main Layout ───────────────────────────────────────────── */
.dashboard {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: grid;
  gap: var(--gap);
  width: 100%;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card:nth-child(1)  { animation-delay: 0.04s; }
.card:nth-child(2)  { animation-delay: 0.09s; }
.card:nth-child(3)  { animation-delay: 0.14s; }
.card:nth-child(4)  { animation-delay: 0.19s; }
.card:nth-child(5)  { animation-delay: 0.24s; }
.card:nth-child(6)  { animation-delay: 0.29s; }
.card:nth-child(7)  { animation-delay: 0.34s; }
.card:nth-child(8)  { animation-delay: 0.39s; }
.card:nth-child(9)  { animation-delay: 0.44s; }
.card:nth-child(10) { animation-delay: 0.49s; }
.card:nth-child(11) { animation-delay: 0.54s; }
.card:nth-child(12) { animation-delay: 0.59s; }
.card:nth-child(13) { animation-delay: 0.64s; }
.card:nth-child(14) { animation-delay: 0.69s; }
.card:nth-child(15) { animation-delay: 0.74s; }
.card:nth-child(16) { animation-delay: 0.79s; }

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.1rem;
  line-height: 1.2;
}

.card-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

/* ─── Section 2: Narrative ──────────────────────────────────── */
.narrative-card {
  background: linear-gradient(150deg, #F5EFE6 0%, #EBE3D6 100%);
  border: 1px solid #D6CCBF;
  padding: 2rem 2rem 1.75rem;
  position: relative;
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .narrative-card {
    background: linear-gradient(150deg, #201D1A 0%, #1A1714 100%);
    border-color: #302C28;
  }
}

.narrative-card::before {
  content: '\201C';
  position: absolute;
  top: -1.5rem;
  left: 1.25rem;
  font-family: var(--font-display);
  font-size: 9rem;
  line-height: 1;
  color: var(--border);
  pointer-events: none;
  opacity: 0.7;
}

.narrative-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text);
  font-style: italic;
  position: relative;
  z-index: 1;
  overflow-wrap: break-word;
  word-break: break-word;
}

.narrative-text p {
  margin-bottom: 0.8em;
}

.narrative-text p:last-child {
  margin-bottom: 0;
}

.narrative-meta {
  font-size: 0.65rem;
  color: var(--text-light);
  margin-top: 1rem;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ─── Section 2.5: Weather ──────────────────────────────────── */
.weather-card {}

.weather-today {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.1rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.weather-icon { font-size: 2.5rem; line-height: 1; }

.weather-temp {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.weather-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 3px; }
.weather-wind { font-size: 0.82rem; color: var(--text-muted); margin-left: 0.5rem; }

.weather-forecast {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.forecast-section {}

.forecast-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 0.35rem;
}

.forecast-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}

.forecast-day.past {
  opacity: 0.35;
}

.forecast-day.today {
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.forecast-day {
  flex: 1;
  min-width: 54px;
  text-align: center;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.25rem;
}

.forecast-name {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.forecast-icon { font-size: 1.35rem; line-height: 1; }

.forecast-temp {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.3rem;
}

/* ─── Section 3: Week Ahead ─────────────────────────────────── */
.week-strip {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.week-section {}

.week-row-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 0.4rem;
  padding-bottom: 0.25rem;
}

.week-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  overflow-x: auto;
}

.week-day {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.35rem;
  min-height: 5.5rem;
  position: relative;
  border: 1px solid transparent;
  transition: border-color 0.15s;
}

.week-day.today {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.week-day-label {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.2rem;
}

.week-day-date {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  line-height: 1;
}

.week-day.today .week-day-date {
  color: var(--accent);
}

.week-event {
  background: var(--surface);
  border-radius: 4px;
  padding: 0.18rem 0.3rem;
  font-size: 0.58rem;
  line-height: 1.3;
  margin-bottom: 0.2rem;
  border-left: 3px solid;
  color: var(--text);
}

.week-event-time {
  font-weight: 700;
  opacity: 0.65;
  display: block;
}


.week-day.past {
  opacity: 0.5;
}

.week-event.all-day {
  font-weight: 600;
  border-left-width: 4px;
  font-size: 0.6rem;
}

/* ─── Section 4: Kids' Corner ───────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.tab-btn {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

.tab-btn:hover {
  border-color: var(--kid-color);
  color: var(--kid-color);
}

.tab-btn.active {
  background: var(--kid-color);
  border-color: var(--kid-color);
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.kid-panel { display: none; }
.kid-panel.active { display: block; }

.kid-subsection { margin-bottom: 1.25rem; }

.kid-subsection-title {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* Homework */
.homework-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.homework-item:last-child { border-bottom: none; }

.hw-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.hw-check.done { background: #48BB78; border-color: #48BB78; color: white; }
.hw-body { flex: 1; }

.hw-subject {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-light);
}

.hw-task { font-size: 0.9rem; color: var(--text); line-height: 1.4; }
.hw-task.done-text { text-decoration: line-through; color: var(--text-light); }
.hw-due { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.hw-due.urgent { color: #C53030; font-weight: 600; }

/* Exams */
.exam-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.exam-countdown {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  min-width: 2.5rem;
  text-align: center;
  line-height: 1;
}

.exam-countdown-unit {
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: block;
  text-align: center;
}

.exam-body { flex: 1; }
.exam-subject { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.exam-topic { font-size: 0.75rem; color: var(--text-muted); }
.exam-date { font-size: 0.72rem; color: var(--text-light); text-align: right; }

.no-items {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.5rem 0;
}

/* ─── Section 5: Family Life ────────────────────────────────── */
.plan-item {
  display: flex;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.plan-item:last-child { border-bottom: none; }

.plan-date-badge {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  text-align: center;
  min-width: 3.2rem;
  flex-shrink: 0;
}

.plan-date-day {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
}

.plan-date-month {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.plan-body { flex: 1; }
.plan-title { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.plan-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.plan-type-badge {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--text-muted);
  margin-right: 0.4rem;
}

.plan-type-badge.social { background: #EBF4FF; color: #2B6CB0; }
.plan-type-badge.date   { background: #FFF5F5; color: #C53030; }
.plan-type-badge.family { background: #F0FFF4; color: #276749; }

@media (prefers-color-scheme: dark) {
  .plan-type-badge.social { background: #1a2a40; color: #90cdf4; }
  .plan-type-badge.date   { background: #40191a; color: #fc8181; }
  .plan-type-badge.family { background: #1a2e25; color: #68d391; }
}

/* ─── Section 6: Admin ──────────────────────────────────────── */
.admin-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}

.admin-item:last-child { border-bottom: none; }

.admin-icon { font-size: 1.4rem; min-width: 2rem; text-align: center; }
.admin-body { flex: 1; }
.admin-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.admin-note { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.admin-countdown { text-align: right; flex-shrink: 0; }

.admin-countdown-num {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.admin-countdown-label {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.admin-countdown-num.urgent  { color: #C53030; }
.admin-countdown-num.warning { color: #C05621; }
.admin-countdown-num.ok      { color: #276749; }

/* ─── Section 7: Goals (kept for compatibility) ─────────────── */
.goal-item { margin-bottom: 1.1rem; }
.goal-item:last-child { margin-bottom: 0; }
.goal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; gap: 0.5rem; }
.goal-title-row { display: flex; align-items: center; gap: 0.5rem; }
.goal-icon { font-size: 1.1rem; }
.goal-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.goal-progress-label { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.goal-bar-bg { height: 7px; background: var(--surface-alt); border-radius: 4px; overflow: hidden; }
.goal-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.goal-note { font-size: 0.72rem; color: var(--text-light); margin-top: 0.3rem; }

/* ─── Section 8: Routines ───────────────────────────────────── */
.routines-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.routine-card {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 1rem;
  border-left: 3px solid;
}

.routine-icon { font-size: 1.4rem; margin-bottom: 0.4rem; }
.routine-title { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.routine-time { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); margin-top: 2px; }
.routine-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.4rem; line-height: 1.4; }

/* ─── Section 9: Saved by Us ────────────────────────────────── */
.saved-card {
  text-align: center;
  padding: 2.5rem 1.75rem;
}

.saved-item {
  min-height: 6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.saved-type-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.saved-content {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  font-style: italic;
  max-width: 560px;
  margin: 0 auto;
  white-space: pre-line;
  text-align: left;
}

.saved-attribution {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  font-style: normal;
  letter-spacing: 0.03em;
}

.saved-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.saved-prev, .saved-next {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: var(--font-sans);
}

.saved-prev:hover, .saved-next:hover {
  background: var(--border);
  color: var(--text);
}

.saved-counter { font-size: 0.72rem; color: var(--text-light); }

/* ─── Section 10: Slideshow ─────────────────────────────────── */
.slideshow-card { padding-bottom: 1rem; }

.slideshow-container {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-alt);
  min-height: 220px;
}

.slideshow-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.placeholder-inner { text-align: center; color: var(--text-muted); }
.placeholder-icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.placeholder-inner p { font-size: 0.85rem; }
.placeholder-sub { font-size: 0.72rem; color: var(--text-light); margin-top: 0.25rem; }

.slideshow-slides { position: relative; }

.slide {
  position: absolute;
  top: 0; left: 0; right: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.slide.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

.slide img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.slideshow-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.6rem 0 0;
}

.slide-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
}

.slide-dots { display: flex; gap: 0.3rem; }

.slide-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.slide-dot.active { background: var(--text-muted); }

.fullscreen-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0,0,0,0.4);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Birthdays ─────────────────────────────────────────────── */
.birthday-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.birthday-item:last-child { border-bottom: none; }

.birthday-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.birthday-body { flex: 1; }
.birthday-name { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.birthday-date { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }

.birthday-countdown {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
  min-width: 4.5rem;
}

.birthday-countdown.soon { color: #C53030; }


/* ─── Header: Nameday ──────────────────────────────────── */
.header-nameday {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ─── Sun Times ────────────────────────────────────────── */
.sun-times {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sun-times .sun-icon { font-size: 1rem; }
.sun-times .sun-label { font-weight: 600; color: var(--text-light); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ─── Holiday Countdown ────────────────────────────────── */
.holiday-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.holiday-item:last-child { border-bottom: none; }

.holiday-icon { font-size: 1.3rem; min-width: 2rem; text-align: center; }

.holiday-body { flex: 1; }
.holiday-name { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.holiday-dates { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }

.holiday-countdown {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  min-width: 5rem;
  line-height: 1.2;
}

.holiday-countdown .unit {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  display: block;
}

.holiday-countdown.active { color: #276749; }

/* ─── School Lunch ─────────────────────────────────────── */
.lunch-header {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}

.lunch-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.3rem;
}

.lunch-item.today {
  background: var(--surface-alt);
  border: 1px solid var(--accent);
}

.lunch-item.past { opacity: 0.4; }

.lunch-day {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  min-width: 2.5rem;
}

.lunch-item.today .lunch-day { color: var(--accent); }

.lunch-meal { font-size: 0.88rem; color: var(--text); }

.lunch-stale {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.5rem 0;
}

/* ─── Waste Collection ─────────────────────────────────── */
.waste-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.waste-item:last-child { border-bottom: none; }

.waste-icon { font-size: 1.4rem; min-width: 2rem; text-align: center; }
.waste-body { flex: 1; }
.waste-type { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.waste-date { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }

.waste-countdown {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
  min-width: 5rem;
}

.waste-countdown.today { color: #C53030; font-size: 0.95rem; }
.waste-countdown.tomorrow { color: #C05621; }

/* ─── Pollen Forecast ──────────────────────────────────── */
.pollen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.pollen-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
}

.pollen-type { font-size: 0.85rem; font-weight: 600; color: var(--text); }

.pollen-level {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pollen-level.low    { background: #C6F6D5; color: #276749; }
.pollen-level.medium { background: #FEFCBF; color: #975A16; }
.pollen-level.high   { background: #FED7D7; color: #C53030; }
.pollen-level.very-high { background: #C53030; color: #fff; }

@media (prefers-color-scheme: dark) {
  .pollen-level.low    { background: #1a2e25; color: #68d391; }
  .pollen-level.medium { background: #2d2a1a; color: #ecc94b; }
  .pollen-level.high   { background: #40191a; color: #fc8181; }
  .pollen-level.very-high { background: #9b2c2c; color: #fff; }
}

/* ─── Packages ─────────────────────────────────────────── */
.package-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.package-item:last-child { border-bottom: none; }

.package-icon { font-size: 1.3rem; min-width: 2rem; text-align: center; }
.package-body { flex: 1; }
.package-desc { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.package-tracking { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }

.package-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--text-muted);
  text-align: right;
}

/* ─── Shopping List ────────────────────────────────────────── */
.shopping-category { margin-bottom: 1rem; }
.shopping-category:last-child { margin-bottom: 0; }

.shopping-category-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 0.4rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.shopping-item:last-child { border-bottom: none; }

.shopping-item.done { opacity: 0.45; }

.shopping-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: white;
}

.shopping-check.checked {
  background: #48BB78;
  border-color: #48BB78;
}

.shopping-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.shopping-item.done .shopping-name {
  text-decoration: line-through;
  color: var(--text-light);
}

.shopping-note {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ─── Footer ────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.72rem;
  color: var(--text-light);
  letter-spacing: 0.03em;
}





/* ─── Password Gate ────────────────────────────────────────── */
.password-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.gate-card {
  text-align: center;
  max-width: 340px;
  width: 100%;
}

.gate-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.gate-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  font-style: italic;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.gate-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-weight: 400;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gate-input {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-sans);
  text-align: center;
  width: 100%;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.gate-input:focus {
  outline: none;
  border-color: var(--klara);
  box-shadow: 0 0 0 3px rgba(123, 94, 167, 0.15);
}

.gate-input::placeholder {
  color: var(--text-light);
}

.gate-btn {
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--klara);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.gate-btn:hover { background: #6A4F94; }
.gate-btn:active { transform: scale(0.98); }

.gate-error {
  color: #C53030;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  margin-top: 1rem;
  display: none;
}

@media (prefers-color-scheme: dark) {
  .password-gate {
    background: var(--bg);
  }
}

/* ─── Mobile: Phones ───────────────────────────────────────── */
@media (max-width: 599px) {

  /* ── Header ── */
  .site-header {
    padding: 0.65rem 1rem;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .header-title h1 {
    font-size: 1.25rem;
  }

  .header-date {
    font-size: 0.68rem;
  }

  .header-nameday {
    order: 3;
    width: 100%;
    font-size: 0.65rem;
    white-space: normal;
    padding-top: 0.2rem;
    border-top: 1px solid var(--border);
    margin-top: 0.15rem;
  }

  .kid-dot {
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
  }

  /* ── Dashboard grid ── */
  .dashboard {
    padding: 0.75rem;
    gap: 0.75rem;
    max-width: 100vw;
  }

  /* ── Cards: breathable mobile padding ── */
  .card {
    padding: 1rem;
    border-radius: 14px;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .card-title {
    font-size: 1.05rem;
    margin-bottom: 0.85rem;
  }

  /* ── Narrative ── */
  .narrative-card {
    padding: 1.25rem 1rem 1rem;
    overflow: visible;
  }

  .narrative-card::before {
    font-size: 5.5rem;
    top: -0.8rem;
    left: 0.6rem;
    display: none;
  }

  .narrative-text {
    font-size: 0.92rem;
    line-height: 1.7;
  }

  .narrative-meta {
    font-size: 0.6rem;
    margin-top: 0.75rem;
  }

  /* ── Weather: today row compact ── */
  .weather-today {
    gap: 0.75rem;
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
  }

  .weather-icon { font-size: 2rem; }
  .weather-temp { font-size: 1.8rem; }
  .weather-desc { font-size: 0.78rem; }

  /* ── Forecast: vertical list on mobile ── */
  .forecast-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
  }

  .forecast-day {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    text-align: left;
    min-width: unset;
  }

  .forecast-name {
    min-width: 2rem;
    margin-bottom: 0;
    font-size: 0.65rem;
  }

  .forecast-icon {
    font-size: 1.2rem;
    min-width: 1.5rem;
    text-align: center;
  }

  .forecast-temp {
    margin-top: 0;
    font-size: 0.9rem;
    min-width: 2.5rem;
  }

  .forecast-day .forecast-desc {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-muted);
  }

  /* ── Week calendar: vertical day-list on mobile ── */
  .week-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    overflow-x: visible;
  }

  .week-day {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    min-height: unset;
    border-radius: 10px;
  }

  .week-day.today {
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
  }

  .week-day-label {
    font-size: 0.6rem;
    min-width: 2rem;
    padding-top: 0.15rem;
    margin-bottom: 0;
  }

  .week-day-date {
    font-size: 1rem;
    min-width: 1.75rem;
    margin-bottom: 0;
  }

  .week-day-events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }

  .week-event {
    font-size: 0.72rem;
    padding: 0.2rem 0.4rem;
    margin-bottom: 0;
  }

  .week-event-time {
    display: inline;
    margin-right: 0.3rem;
  }

  .week-event.all-day {
    font-size: 0.72rem;
  }

  .week-day.past {
    opacity: 0.4;
  }

  /* ── Kids Corner ── */
  .tab-bar {
    gap: 0.3rem;
    margin-bottom: 1rem;
  }

  .tab-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    flex: 1;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
  }

  .kid-subsection {
    margin-bottom: 1rem;
  }

  .homework-item {
    padding: 0.55rem 0;
  }

  .hw-task { font-size: 0.85rem; }

  .exam-item {
    padding: 0.55rem 0.65rem;
  }

  /* ── Family life / plans ── */
  .plan-item {
    gap: 0.65rem;
    padding: 0.65rem 0;
  }

  .plan-date-badge {
    padding: 0.35rem 0.5rem;
    min-width: 2.8rem;
  }

  .plan-date-day { font-size: 1.15rem; }
  .plan-title { font-size: 0.88rem; }
  .plan-meta { font-size: 0.72rem; }

  /* ── Admin ── */
  .admin-item {
    gap: 0.65rem;
    padding: 0.65rem 0;
  }

  .admin-icon { font-size: 1.2rem; min-width: 1.75rem; }
  .admin-title { font-size: 0.85rem; }
  .admin-note { font-size: 0.72rem; }

  .admin-countdown-num { font-size: 1.1rem; }

  /* ── Holidays ── */
  .holiday-item {
    gap: 0.65rem;
    padding: 0.55rem 0;
  }

  .holiday-icon { font-size: 1.15rem; min-width: 1.75rem; }
  .holiday-name { font-size: 0.85rem; }
  .holiday-countdown { font-size: 1rem; min-width: 4rem; }

  /* ── School Lunch ── */
  .lunch-item {
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .lunch-meal { font-size: 0.82rem; }

  /* ── Waste ── */
  .waste-item {
    gap: 0.65rem;
    padding: 0.55rem 0;
  }

  .waste-icon { font-size: 1.2rem; min-width: 1.75rem; }
  .waste-type { font-size: 0.85rem; }
  .waste-countdown { min-width: 4rem; font-size: 0.78rem; }

  /* ── Birthdays ── */
  .birthday-item {
    gap: 0.65rem;
    padding: 0.55rem 0;
  }

  .birthday-name { font-size: 0.85rem; }
  .birthday-countdown { min-width: 3.5rem; font-size: 0.72rem; }

  /* ── Pollen ── */
  .pollen-grid {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .pollen-item {
    padding: 0.5rem 0.65rem;
  }

  .pollen-type { font-size: 0.82rem; }

  /* ── Packages ── */
  .package-item { gap: 0.65rem; }
  .package-desc { font-size: 0.85rem; }

  /* ── Shopping ── */
  .shopping-item { padding: 0.45rem 0; }
  .shopping-name { font-size: 0.85rem; }

  /* ── Routines: keep 2-col but compact ── */
  .routines-grid {
    gap: 0.5rem;
  }

  .routine-card {
    padding: 0.75rem;
  }

  .routine-icon { font-size: 1.15rem; margin-bottom: 0.25rem; }
  .routine-title { font-size: 0.78rem; }
  .routine-time { font-size: 0.62rem; }
  .routine-desc { font-size: 0.7rem; margin-top: 0.25rem; }

  /* ── Saved quotes ── */
  .saved-card {
    padding: 1.5rem 1rem;
  }

  .saved-content {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .saved-prev, .saved-next {
    width: 36px;
    height: 36px;
  }

  /* ── Slideshow ── */
  .slideshow-container {
    min-height: 180px;
  }

  .slide img {
    max-height: 300px;
  }

  .slide-btn {
    width: 34px;
    height: 34px;
  }

  .fullscreen-btn {
    width: 36px;
    height: 36px;
  }

  /* ── Footer ── */
  .site-footer {
    padding: 1.25rem 0.75rem;
  }
}

/* ─── Extra small phones (< 360px) ─────────────────────────── */
@media (max-width: 359px) {
  .dashboard {
    padding: 0.5rem;
    gap: 0.6rem;
  }

  .card {
    padding: 0.85rem;
    border-radius: 12px;
  }

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

  .gate-title { font-size: 1.6rem; }
  .gate-icon { font-size: 2.5rem; }
}


/* ─── Responsive ────────────────────────────────────────────── */
@media (min-width: 600px) {
  .dashboard {
    grid-template-columns: 1fr 1fr;
  }

  .narrative-card,
  #section-weather,
  #section-calendar,
  #section-kids,
  #section-saved,
  #section-slideshow,
  #section-lunch {
    grid-column: 1 / -1;
  }

  .slide img { max-height: 600px; }
}

@media (min-width: 900px) {
  .dashboard { padding: 1.5rem 2.5rem; }
  .week-strip { gap: 0.5rem; }
  .week-event { font-size: 0.62rem; }
}

/* ─── Utilities ─────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

code {
  font-family: monospace;
  background: var(--surface-alt);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
}
