/* ─────────────────────────────────────────────────────────────
   Familien-Dashboard
   Idee: Der Startbildschirm ist ein Bilderrahmen. Fotos füllen den
   Bildschirm, der Tag steht als große Schrift direkt darauf.
   Die übrigen Bereiche sind ruhig: Nebelgrau, Schiefer, Enzianblau.
   ───────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Familjen Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url('/fonts/familjen-grotesk-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Familjen Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url('/fonts/familjen-grotesk-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Familjen Grotesk';
  font-style: italic;
  font-display: swap;
  font-weight: 400 700;
  src: url('/fonts/familjen-grotesk-latin-wght-italic.woff2') format('woff2-variations');
}

:root {
  /* Palette: Voralpen im Spätherbst */
  --nebel: #E9EDF0;      /* Hintergrund */
  --firn: #FFFFFF;       /* Flächen */
  --schiefer: #1C2531;   /* Text */
  --stein: #5A6573;      /* Nebentext */
  --grat: #D5DCE2;       /* Linien */
  --kar: #DFE5EA;        /* gedämpfte Flächen */
  --enzian: #3047C9;     /* Aktion */
  --laerche: #F0B43A;    /* Heute */
  --alpenrose: #C23B5E;  /* Warnung / Löschen */

  --bg: var(--nebel);
  --paper: var(--firn);
  --ink: var(--schiefer);
  --ink-2: var(--stein);
  --line: var(--grat);
  --soft: var(--kar);
  --accent: var(--enzian);
  --danger: var(--alpenrose);

  --font: 'Familjen Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Typo-Skala (Quarte, 1.333) */
  --t-0: .75rem; --t-1: .875rem; --t-2: 1rem; --t-3: 1.333rem; --t-4: 1.777rem; --t-5: 2.369rem; --t-6: 3.157rem;

  --r-lg: 22px; --r-md: 14px; --r-sm: 9px;
  --dock-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121820; --paper: #1A222D; --ink: #E8EDF2; --ink-2: #9AA6B4; --line: #2A3442; --soft: #222B37;
    --accent: #7C8FFF; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: var(--t-2); line-height: 1.45; -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 0;
}
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: var(--t-4); }
h2 { font-size: var(--t-3); }
h3 { font-size: var(--t-2); margin: 1.2rem 0 .5rem; }
.muted { color: var(--ink-2); }
.small { font-size: var(--t-1); }
.tiny { font-size: var(--t-0); margin: .7rem 0 0; color: var(--ink-2); }
[hidden] { display: none !important; }
.is-hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

main { padding: 1.5rem 1.5rem calc(var(--dock-h) + 3rem); max-width: 1600px; margin: 0 auto; outline: none; }
body[data-route="start"] main { padding: 0; max-width: none; }
.view-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: .2rem 1rem; margin-bottom: 1.2rem; }
.view-head p { margin: 0; grid-column: 1; }
.view-head .upload-btn { grid-column: 2; grid-row: 1 / span 2; }

/* ---------- Dock (Navigation) ---------- */
.dock {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; gap: 2px; padding: 5px; border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 8px 30px rgba(20, 30, 45, .18), inset 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent);
}
.dock a {
  display: flex; align-items: center; gap: .4rem; padding: .6rem 1rem; border-radius: 999px;
  text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: var(--t-1); min-height: 44px;
}
.dock a span { font-size: 1.05rem; line-height: 1; }
.dock a.active { background: var(--ink); color: var(--bg); }
/* Auf dem Foto: dunkles, gläsernes Dock */
body[data-route="start"] .dock { background: rgba(14, 20, 28, .38); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
body[data-route="start"] .dock a { color: rgba(255,255,255,.78); }
body[data-route="start"] .dock a.active { background: rgba(255,255,255,.92); color: #141B24; }

.demo-banner { margin: 1rem 1.5rem 0; padding: .6rem .9rem; border-radius: var(--r-sm); background: #FFF1C9; color: #634A00; font-size: var(--t-1); }
@media (prefers-color-scheme: dark) { .demo-banner { background: #3E3418; color: #FFE6A0; } }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  padding: .6rem 1.1rem; border-radius: 999px; cursor: pointer; min-height: 44px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .4rem; text-decoration: none;
}
.btn:hover { border-color: var(--ink-2); }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: .35rem .85rem; min-height: 36px; font-size: var(--t-1); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.08); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.icon-btn { font: inherit; font-size: 1.5rem; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; line-height: 1; }
.icon-btn.sm { width: 34px; height: 34px; font-size: .95rem; border-color: transparent; background: transparent; color: var(--ink-2); }
.icon-btn.sm:hover { background: var(--soft); }
.icon-btn.sm[data-armed] { width: auto; padding: 0 .6rem; border-radius: 999px; color: var(--danger); border-color: var(--danger); font-size: .8rem; font-weight: 700; }
.fab {
  position: fixed; right: calc(1.5rem + env(safe-area-inset-right)); bottom: calc(14px + env(safe-area-inset-bottom));
  width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--accent); color: #fff;
  font-size: 2rem; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent); cursor: pointer; z-index: 31;
}
body:not([data-route="kalender"]) .fab { display: none; }
.upload-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Allgemeine Bausteine ---------- */
.card { background: var(--paper); border-radius: var(--r-lg); padding: 1.1rem 1.2rem; }
.skeleton { background: linear-gradient(90deg, var(--soft), var(--line), var(--soft)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-md); }
.h-40 { height: 40px; } .h-80 { height: 80px; } .h-160 { height: 160px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.error-box { padding: 1rem; border-radius: var(--r-md); background: color-mix(in srgb, var(--danger) 10%, var(--paper)); color: var(--danger); grid-column: 1 / -1; }
.note { margin: 0 0 1rem; padding: .7rem 1rem; border-radius: var(--r-md); background: var(--paper); color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.tag { font-size: var(--t-0); padding: .15rem .55rem; border-radius: 999px; background: var(--soft); color: var(--ink-2); }
.tag-ok { background: color-mix(in srgb, #3FA275 16%, var(--paper)); color: #2A7B55; font-weight: 600; }

/* ═════════════ Startbildschirm ═════════════ */
.home {
  position: relative; min-height: 100dvh; color: #fff; overflow: hidden; isolation: isolate;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: calc(2rem + env(safe-area-inset-top)) clamp(1.5rem, 4vw, 4rem) calc(var(--dock-h) + 2.5rem);
  background: #1C2531;
}
.stage { position: absolute; inset: 0; z-index: -2; }
.slide {
  position: absolute; inset: -2%; background: center / cover no-repeat;
  opacity: 0; transition: opacity 1.8s ease;
}
.slide.is-on { opacity: 1; animation: drift 70s ease-out forwards; }
@keyframes drift { from { transform: scale(1.0) translate3d(0,0,0); } to { transform: scale(1.08) translate3d(-1.5%, -1%, 0); } }
.scrim {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 15, 22, .62) 0%, rgba(10, 15, 22, .38) 42%, rgba(10, 15, 22, 0) 72%),
    linear-gradient(0deg, rgba(10, 15, 22, .55) 0%, rgba(10, 15, 22, 0) 38%),
    linear-gradient(180deg, rgba(10, 15, 22, .35) 0%, rgba(10, 15, 22, 0) 22%);
  transition: background .8s;
}
.home-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; }
.home-time {
  display: block; font-size: clamp(5rem, 13vw, 11rem); font-weight: 500; line-height: .82;
  letter-spacing: -.055em; font-variant-numeric: tabular-nums; margin-left: -.04em;
  text-shadow: 0 2px 30px rgba(0,0,0,.25);
}
.home-date { font-size: var(--t-4); font-weight: 450; margin-top: .9rem; letter-spacing: -.01em; opacity: .92; }
.home-weather { text-align: right; text-shadow: 0 1px 12px rgba(0,0,0,.3); }
.hw-now { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; }
.hw-icon { font-size: 2.6rem; }
.hw-temp { font-size: var(--t-6); font-weight: 500; letter-spacing: -.03em; line-height: 1; }
.hw-text { opacity: .85; margin-top: .2rem; }
.hw-days { list-style: none; margin: .9rem 0 0; padding: 0; display: flex; gap: 1.2rem; justify-content: flex-end; }
.hw-days li { display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: var(--t-1); }
.hw-days li span:first-child { opacity: .75; }
.hw-days li span:nth-child(2) { font-size: 1.35rem; }

.home-story { align-self: end; max-width: 36ch; padding-bottom: 1.4rem; text-shadow: 0 1px 18px rgba(0,0,0,.35); }
.story-line {
  margin: 0 0 .4em; font-size: clamp(1.5rem, 2.7vw, 2.4rem); line-height: 1.18; font-weight: 450; letter-spacing: -.018em;
  text-wrap: pretty;
}
.story-line b { font-weight: 700; }
.story-line.is-loading { width: 12ch; border-radius: 8px; background: rgba(255,255,255,.12); }
.story-soft { font-size: clamp(1.1rem, 1.7vw, 1.45rem); opacity: .93; margin-top: .8em; line-height: 1.3; }
.mark { text-decoration: underline; text-decoration-color: var(--c); text-decoration-thickness: .14em; text-underline-offset: .16em; text-decoration-skip-ink: none; }
.idea-name { font-weight: 650; }
.glass-btn {
  font: inherit; font-size: var(--t-1); font-weight: 650; color: #fff; text-decoration: none; vertical-align: .25em;
  display: inline-flex; align-items: center; min-height: 40px; padding: .35rem 1rem; margin-left: .4rem; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.14);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); cursor: pointer; text-shadow: none;
}
.glass-btn:hover { background: rgba(255,255,255,.26); }
.home-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; min-height: 1.5rem; }
.home-countdown { margin: 0; font-size: var(--t-2); font-weight: 600; opacity: .9; }
.home-countdown:not(:empty)::before { content: ''; display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: var(--laerche); margin-right: .55em; vertical-align: .1em; }
.photo-caption { font: inherit; font-size: var(--t-1); color: #fff; opacity: .75; background: none; border: 0; padding: .3rem 0; cursor: pointer; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.photo-caption:hover { opacity: 1; }

/* Nacht: Bild abgedunkelt, nur noch Uhr */
.home.is-night .slide { filter: brightness(.3) saturate(.6); }
.home.is-night .home-story, .home.is-night .home-foot, .home.is-night .home-countdown { opacity: 0; pointer-events: none; }
.home.is-night .home-side { display: none; }
.home.is-night .home-clock { text-align: center; }
.home.is-night .home-top { justify-content: center; align-self: center; text-align: center; grid-row: 2; }
.home.is-night .home-time { opacity: .6; }
.home-story, .home-weather, .home-foot { transition: opacity .8s; }

@media (prefers-reduced-motion: reduce) {
  .slide.is-on { animation: none; }
  .slide { transition: none; }
}

/* ═════════════ Kalender ═════════════ */
.start { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.5rem; align-items: start; }
.week-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.week-head h1 { font-size: var(--t-4); }
.week-head h1 small { color: var(--ink-2); font-weight: 450; font-size: var(--t-2); margin-left: .4rem; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day {
  position: relative; background: var(--paper); border-radius: var(--r-md);
  padding: .7rem .55rem 2.8rem; min-height: 360px; display: flex; flex-direction: column; gap: .45rem;
}
.day.is-weekend { background: color-mix(in srgb, var(--paper) 70%, var(--soft)); }
.day.is-today { box-shadow: inset 0 4px 0 var(--laerche); }
.day.is-past > *:not(.day-head) { opacity: .55; }
.day-head { display: flex; align-items: baseline; gap: .35rem; padding: 0 .2rem .35rem; }
.day-head span:first-child { color: var(--ink-2); font-weight: 600; font-size: var(--t-1); }
.day-head b { font-size: var(--t-4); font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.is-today .day-head b { color: #A76F00; }
.day-weather { margin-left: auto; font-size: var(--t-0); color: var(--ink-2); white-space: nowrap; }
.events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.event {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "time person" "title title";
  padding: .4rem .5rem .45rem .6rem; border-radius: var(--r-sm); cursor: pointer;
  background: color-mix(in srgb, var(--c) 13%, var(--paper)); box-shadow: inset 3px 0 0 var(--c);
}
.event.is-allday { background: var(--c); color: #fff; box-shadow: none; }
.event.is-allday .event-time { color: rgba(255,255,255,.85); }
.event-time { grid-area: time; font-size: var(--t-0); color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.event-person { grid-area: person; font-size: .85rem; }
.event-title { grid-area: title; font-weight: 600; font-size: var(--t-1); overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.day-add {
  position: absolute; left: .5rem; right: .5rem; bottom: .5rem; height: 32px; border-radius: var(--r-sm);
  border: 1px dashed var(--line); background: transparent; color: var(--ink-2); font-size: 1.1rem; cursor: pointer; opacity: .55;
}
.day-add:hover { opacity: 1; background: var(--soft); }

.side { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1.5rem; }
.side > .card { background: var(--paper); }
.weather-now { display: flex; align-items: center; gap: .8rem; }
.weather-icon { font-size: 3rem; line-height: 1; }
.weather-temp { font-size: var(--t-5); font-weight: 600; line-height: 1; letter-spacing: -.03em; }
.weather-next { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.weather-next div { display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: var(--t-1); }
.weather-next div span:nth-child(2) { font-size: 1.4rem; }
.weekend-weather { display: flex; gap: .3rem 1.2rem; flex-wrap: wrap; margin-top: .5rem; }
.sugg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.sugg { display: flex; flex-direction: column; gap: .45rem; padding: .75rem; border-radius: var(--r-md); background: var(--bg); }
.sugg .tag { background: var(--paper); }
.sugg-main { display: flex; gap: .6rem; align-items: flex-start; }
.sugg-icon { font-size: 1.4rem; line-height: 1.2; }
.sugg-actions { display: flex; gap: .3rem; align-items: center; }
.sugg > .btn { align-self: flex-start; }
.claude-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

/* ═════════════ Ideen ═════════════ */
.quick-add { display: flex; gap: .5rem; margin-bottom: 1rem; }
.quick-add input { flex: 1; font: inherit; padding: .75rem 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 3px; flex-wrap: wrap; }
.seg button, .toggle { font: inherit; font-size: var(--t-1); font-weight: 600; border: 0; background: transparent; color: var(--ink-2); padding: .4rem .85rem; border-radius: 999px; cursor: pointer; min-height: 36px; }
.seg button.on { background: var(--paper); color: var(--ink); }
.toggle { background: var(--soft); }
.toggle.on { background: var(--accent); color: #fff; }
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .8rem; }
.idea-card { background: var(--paper); border-radius: var(--r-lg); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.idea-top { display: flex; gap: .7rem; align-items: flex-start; }
.idea-icon { font-size: 1.6rem; line-height: 1; padding-top: .1rem; }
.idea-text { flex: 1; min-width: 0; }
.idea-text h3 { font-size: 1.15rem; margin: 0 0 .25rem; overflow-wrap: break-word; hyphens: manual; }
.idea-text h3 a { text-decoration: none; }
.idea-text p { margin: .15rem 0; }
.idea-tools { display: flex; gap: .15rem; align-items: center; margin: -.3rem -.4rem 0 0; }
.idea-actions { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: .7rem; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--ink-2); padding: 2.5rem 1rem; border: 1px dashed var(--line); border-radius: var(--r-lg); }

/* ═════════════ Fotos ═════════════ */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.photo { margin: 0; background: var(--paper); border-radius: var(--r-lg); overflow: hidden; }
.photo img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--soft); }
.photo.is-off img { filter: grayscale(1) opacity(.5); }
.photo figcaption { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .5rem .6rem .9rem; }
.photo-cap { font-weight: 600; font-size: var(--t-1); display: flex; flex-direction: column; min-width: 0; }
.photo-cap small { font-weight: 400; color: var(--ink-2); }
.photo-tools { display: flex; gap: .1rem; flex-shrink: 0; }
.sheet-photo { width: 100%; border-radius: var(--r-md); aspect-ratio: 16/10; object-fit: cover; }

/* ═════════════ Kinder ═════════════ */
.kid { display: flex; flex-direction: column; gap: 2rem; max-width: 1200px; margin: 0 auto; }
.kid-day-head { display: flex; align-items: baseline; gap: .8rem; margin-bottom: .9rem; }
.kid-day-head h2 { font-size: var(--t-6); letter-spacing: -.03em; }
.kid-weather { margin-left: auto; font-size: 3rem; display: flex; align-items: center; gap: .3rem; }
.kid-weather small { font-size: var(--t-4); font-weight: 650; }
.kid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.kid-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; text-align: center;
  padding: 1.4rem 1rem; border-radius: 28px; background: color-mix(in srgb, var(--c, #999) 18%, var(--paper));
  min-height: 210px; box-shadow: inset 0 -6px 0 color-mix(in srgb, var(--c, #999) 55%, transparent);
}
.kid-free { --c: #3FA275; }
.kid-icon { font-size: 5rem; line-height: 1; }
.kid-icon.sm { font-size: 2.6rem; }
.kid-title { font-size: var(--t-3); font-weight: 700; hyphens: auto; -webkit-hyphens: auto; }
.kid-when { font-size: var(--t-2); color: var(--ink-2); font-weight: 600; }
.kid-later { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.3rem; border-radius: var(--r-lg); background: var(--paper); font-size: var(--t-3); }

/* ═════════════ Dialoge & Toast ═════════════ */
dialog { border: 0; padding: 0; border-radius: 26px; width: min(560px, calc(100vw - 1.5rem)); max-height: calc(100dvh - 2rem); background: var(--paper); color: var(--ink); box-shadow: 0 24px 70px rgba(10, 20, 35, .3); }
dialog::backdrop { background: rgba(16, 24, 34, .45); backdrop-filter: blur(3px); }
.sheet { padding: 1.4rem 1.4rem 1rem; display: flex; flex-direction: column; gap: .9rem; }
.sheet h2 { font-size: var(--t-4); }
.field { display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 0; }
.field > span { font-size: var(--t-1); font-weight: 600; color: var(--ink-2); }
.field em { font-style: normal; font-weight: 400; opacity: .75; }
.field input:not([type=checkbox]):not([type=radio]), .field textarea {
  font: inherit; padding: .7rem .85rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%;
}
.field-check { flex-direction: row; align-items: center; gap: .5rem; flex: 0 0 auto; align-self: end; min-height: 48px; }
.field-check input { width: 22px; height: 22px; accent-color: var(--accent); }
.field-narrow { flex: 0 0 140px; }
.row { display: flex; gap: .8rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: .45rem .85rem; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font-size: var(--t-1); font-weight: 600; color: var(--ink-2); background: var(--paper); }
.chip input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-person input:checked + span { background: var(--c); border-color: var(--c); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: .5rem; padding-top: .5rem; position: sticky; bottom: 0; background: var(--paper); }
.detail-meta { margin: 0; color: var(--ink-2); }
.detail-note { white-space: pre-wrap; margin: 0; }
.toast { position: fixed; left: 50%; bottom: calc(var(--dock-h) + 2rem + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .75rem 1.2rem; border-radius: 999px; font-weight: 600; z-index: 50; max-width: calc(100vw - 2rem); }
.toast[data-kind="error"] { background: var(--danger); color: #fff; }

/* ═════════════ Responsiv ═════════════ */
@media (max-width: 1180px) {
  .start { grid-template-columns: 1fr; }
  .side { position: static; display: grid; grid-template-columns: 1fr 1.6fr; align-items: start; }
}
@media (max-width: 820px) {
  main { padding: 1rem .8rem calc(var(--dock-h) + 2.5rem); }
  .dock { left: .6rem; right: .6rem; transform: none; justify-content: space-between; }
  .dock a { flex-direction: column; gap: .1rem; padding: .4rem .2rem; flex: 1; font-size: .7rem; justify-content: center; }
  .dock a span { font-size: 1.15rem; }
  .fab { bottom: calc(var(--dock-h) + 30px + env(safe-area-inset-bottom)); right: 1rem; width: 56px; height: 56px; }

  .home { padding: calc(1.4rem + env(safe-area-inset-top)) 1.3rem calc(var(--dock-h) + 2.2rem); }
  .home-top { flex-direction: column; gap: 1.2rem; }
  .home-weather { text-align: left; }
  .home-side, .home-countdown { align-items: flex-start; text-align: left; }
  .hw-now, .hw-days { justify-content: flex-start; }
  .home-date { font-size: var(--t-3); margin-top: .6rem; }
  .home-story { max-width: none; padding-top: 2rem; }
  .scrim { background: linear-gradient(0deg, rgba(10,15,22,.75) 0%, rgba(10,15,22,.35) 55%, rgba(10,15,22,.45) 100%); }
  .home-foot { flex-direction: column; align-items: flex-start; }

  .side { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; gap: 5px; }
  .day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: flex-start; padding: .6rem; }
  .day.is-past { display: none; }
  .day.is-today { box-shadow: inset 4px 0 0 var(--laerche); }
  .day-head { flex-direction: column; align-items: center; gap: 0; width: 56px; padding: 0 .4rem 0 0; }
  .day-weather { margin: .15rem 0 0; }
  .events { flex: 1; min-width: 0; }
  .events:empty::after { content: "frei"; color: var(--ink-2); font-size: var(--t-1); padding: .45rem 0; display: block; }
  .day-add { position: static; width: 36px; height: 36px; flex: 0 0 auto; }
  .event { grid-template-columns: auto 1fr auto; grid-template-areas: "time title person"; gap: .5rem; align-items: baseline; }
  .quick-add { flex-wrap: wrap; }
  .quick-add input { flex-basis: 100%; }
  .view-head { grid-template-columns: 1fr; }
  .view-head .upload-btn { grid-column: 1; grid-row: auto; justify-self: start; margin-top: .6rem; }
  .kid-day-head h2 { font-size: var(--t-5); }
  .kid-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .kid-icon { font-size: 3.6rem; }
  .kid-card { min-height: 150px; }
  dialog { margin-bottom: 0; border-radius: 26px 26px 0 0; width: 100vw; max-width: 100vw; }
  .row { flex-wrap: wrap; }
}

/* ═════════════ Essen ═════════════ */
.meals .week-head h2 { font-size: var(--t-3); }
.meal-week { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.meal-day { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; align-items: center; background: var(--paper); border-radius: var(--r-md); padding: .7rem .9rem; }
.meal-day.is-today { box-shadow: inset 4px 0 0 var(--laerche); }
.meal-day.is-past { opacity: .55; }
.meal-date { display: flex; flex-direction: column; line-height: 1.2; }
.meal-date span { color: var(--ink-2); font-size: var(--t-1); }
.meal-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .5rem; }
.meal-slot {
  font: inherit; text-align: left; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; gap: .15rem;
  padding: .55rem .8rem; border-radius: var(--r-sm); border: 1px solid transparent; background: var(--bg); min-height: 56px;
}
.meal-slot:hover { border-color: var(--line); }
.meal-slot.is-kita { background: color-mix(in srgb, var(--laerche) 16%, var(--paper)); }
.meal-slot.is-empty { background: transparent; border: 1px dashed var(--line); }
div.meal-slot { cursor: default; }
.meal-label { font-size: var(--t-0); font-weight: 650; color: var(--ink-2); }
.meal-title { font-weight: 600; }
.meal-add { color: var(--ink-2); font-size: var(--t-1); }
.chip-btn { font: inherit; font-size: var(--t-1); font-weight: 600; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.chip-btn:hover { border-color: var(--ink-2); }
.sheet-wide { min-width: min(640px, 100%); }
dialog:has(.sheet-wide) { width: min(680px, calc(100vw - 1.5rem)); }
.import-table { display: flex; flex-direction: column; gap: .3rem; max-height: 40vh; overflow: auto; }
.import-row { display: grid; grid-template-columns: 150px 1fr auto; gap: .4rem; align-items: center; }
.import-row input { font: inherit; font-size: var(--t-1); padding: .45rem .6rem; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); color: var(--ink); min-width: 0; }
.upload-btn { position: relative; align-self: flex-start; }

/* ═════════════ Tagebuch ═════════════ */
.pending { background: var(--paper); border-radius: var(--r-lg); padding: 1rem 1.1rem; margin-bottom: 1.2rem; box-shadow: inset 4px 0 0 var(--laerche); }
.pending h2 { margin-bottom: .6rem; }
.pending-item { font: inherit; width: 100%; display: grid; grid-template-columns: 1fr auto auto; gap: .8rem; align-items: center; text-align: left; padding: .7rem .2rem; background: none; border: 0; border-top: 1px solid var(--line); color: var(--ink); cursor: pointer; font-weight: 600; }
.pending-item:first-of-type { border-top: 0; }
.pending-cta { color: var(--accent); font-size: var(--t-1); }
.diary-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.diary-month { font-weight: 650; color: var(--ink-2); margin-top: .8rem; }
.diary-entry { display: grid; grid-template-columns: 132px 1fr auto; gap: 1rem; background: var(--paper); border-radius: var(--r-lg); padding: .7rem; align-items: start; }
.diary-entry img, .diary-noimg { width: 132px; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--r-md); background: var(--soft); }
.diary-noimg { display: grid; place-items: center; font-size: 2.6rem; }
.diary-body h3 { font-size: var(--t-3); margin: .2rem 0 .2rem; }
.diary-body p { margin: .1rem 0; }
.diary-note { white-space: pre-wrap; }
.diary-tools { display: flex; }
.diary-foot { margin-top: 1.5rem; }
.rating { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.rate input { position: absolute; opacity: 0; }
.rate span { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .7rem .3rem; border-radius: var(--r-md); border: 1px solid var(--line); cursor: pointer; font-weight: 600; font-size: var(--t-1); color: var(--ink-2); }
.rate b { font-size: 2.1rem; font-weight: 400; line-height: 1; }
.rate input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--paper)); color: var(--ink); }
.rate input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.field-check span { font-size: var(--t-1); }

/* ═════════════ Ideen-Eingang ═════════════ */
.inbox { background: var(--paper); border-radius: var(--r-lg); padding: 1rem 1.1rem; margin-bottom: 1.2rem; }
.inbox p { margin: .2rem 0 .6rem; }
.inbox ul { list-style: none; margin: 0; padding: 0; }
.inbox li { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; padding: .5rem 0; border-top: 1px solid var(--line); }
.inbox-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═════════════ Kinder: Sterne & Schlafen ═════════════ */
.kid-food { --c: #8A7CF0; }
.kid-tasks .kid-day-head { align-items: center; }
.star-count { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: 1.4rem; flex-wrap: wrap; justify-content: flex-end; }
.star-count small { font-size: var(--t-1); color: var(--ink-2); font-weight: 600; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; }
.task {
  position: relative; font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .25rem;
  padding: 1.1rem .8rem; border-radius: 24px; border: 3px dashed var(--line); background: var(--paper); min-height: 150px; justify-content: center;
}
.task-icon { font-size: 3.2rem; line-height: 1; }
.task-label { font-weight: 700; font-size: var(--t-2); text-align: center; }
.task-when { font-size: var(--t-0); color: var(--ink-2); font-weight: 600; }
.task-star { position: absolute; top: .4rem; right: .6rem; font-size: 1.6rem; opacity: 0; transform: scale(.4); transition: opacity .25s, transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.task.is-done { border-style: solid; border-color: var(--laerche); background: color-mix(in srgb, var(--laerche) 14%, var(--paper)); }
.task.is-done .task-star { opacity: 1; transform: scale(1); }
.kid-sleep { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem; border-radius: var(--r-lg); background: #26304A; color: #fff; font-size: var(--t-3); }
.kid-sleep b { font-weight: 700; }
.moons { font-size: 1.6rem; letter-spacing: .1em; margin-top: .3rem; line-height: 1.3; }
@media (prefers-reduced-motion: reduce) { .task-star { transition: none; } }

/* ═════════════ Start: Ergänzungen ═════════════ */
.home-side { display: flex; flex-direction: column; align-items: flex-end; gap: 1.6rem; }
.home-countdown { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; text-align: right; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.home-countdown:empty { display: none; }
.home-ask .cd-item { opacity: 1; }
.cd-item { margin: 0; font-size: var(--t-2); font-weight: 500; opacity: .92; }
.cd-item b { font-weight: 700; }
.cd-item:not(.cd-ask)::before { content: ''; display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: var(--laerche); margin-right: .55em; vertical-align: .1em; }
.cd-ask .glass-btn { vertical-align: 0; min-height: 34px; padding: .2rem .8rem; }
.story-food { margin-top: .5em; }
.home-countdown:not(:empty)::before { content: none; }

@media (max-width: 820px) {
  .meal-day { grid-template-columns: 1fr; gap: .5rem; }
  .meal-date { flex-direction: row; gap: .5rem; align-items: baseline; }
  .diary-entry { grid-template-columns: 96px 1fr; }
  .diary-entry img, .diary-noimg { width: 96px; }
  .diary-tools { grid-column: 2; justify-content: flex-end; margin-top: -.4rem; }
  .import-row { grid-template-columns: 1fr auto; }
  .import-row input[type=date] { grid-column: 1 / -1; }
  .task-grid { grid-template-columns: repeat(2, 1fr); }
  .task { min-height: 130px; }
  .dock a { font-size: .62rem; }
}
