/* Memorybook, seit 05.12.2026. Babyblau und Salbeigrün pastellig (Wunsch Sebastian),
   Aufbau nach dem Prototyp (prototyp/index.html). Systemschriften, keine fremden Dienste. */
:root {
  --bg: #EEF3F2; --surface: #FFFFFF; --surface-2: #F5F8F8; --ink: #24343B; --muted: #566A70; --line: #DCE6E6;
  --blue: #CFE4F4; --blue-soft: #E6F1FA; --blue-deep: #3D6F96;
  --sage: #D3E1CE; --sage-soft: #E9F0E6; --sage-deep: #4C6B46;
  --warn-bg: #FBE3D6; --warn: #8A3110;
  --glass: rgba(255,255,255,.74);
  --shadow: 0 8px 24px rgba(36,52,59,.10);
  --display: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121819; --surface: #1B2326; --surface-2: #20292C; --ink: #E6EEF0; --muted: #9AAEB3; --line: #2D393C;
    --blue: #2A4252; --blue-soft: #21323C; --blue-deep: #9CC6E8; --sage: #2F4030; --sage-soft: #243126; --sage-deep: #A9C7A2;
    --warn-bg: #3B261C; --warn: #F2B69A; --glass: rgba(27,35,38,.78); --shadow: 0 8px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5;
  -webkit-text-size-adjust: 100%; min-height: 100dvh;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--blue-deep); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

.app { max-width: 620px; margin: 0 auto; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 16px) max(18px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 110px) max(18px, env(safe-area-inset-left));
  background: linear-gradient(175deg, var(--blue-soft) 0, var(--bg) 320px); }

/* Kopf */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; border: 3px solid var(--surface); }
.av.s { background: var(--blue); color: var(--blue-deep); } .av.c { background: var(--sage); color: var(--sage-deep); }
.avs { display: flex; } .avs .av + .av { margin-left: -12px; }
.rund { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; box-shadow: 0 2px 8px rgba(36,52,59,.08); }
.hello { margin: 20px 0 16px; font-size: 2.3rem; line-height: 1.05; letter-spacing: -.01em; }
.hello span { display: block; font-weight: 300; } .hello b { font-weight: 800; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 44px; padding: 0 16px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.chip[aria-pressed="true"] { background: var(--blue); border-color: transparent; }

.sect { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 0 12px; }
.sect h2 { font-size: 1.15rem; } .sect small { color: var(--muted); font-size: .85rem; }

/* Hinweise oben (Freigabe, in Arbeit) */
.hinweise { display: grid; gap: 10px; margin-top: 18px; }
.hinweis { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 20px; background: var(--surface); text-align: left; width: 100%; box-shadow: var(--shadow); }
.hinweis .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--blue); color: var(--blue-deep); }
.hinweis.wartet .ic { background: var(--sage-soft); color: var(--sage-deep); }
.hinweis.fehler .ic { background: var(--warn-bg); color: var(--warn); }
.hinweis div { min-width: 0; flex: 1; } .hinweis b { display: block; } .hinweis small { color: var(--muted); }

/* Zeitleiste */
.feed { display: grid; gap: 14px; }
.monat { font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--muted); margin: 14px 4px 0; }
.entry { background: var(--surface); border-radius: 24px; padding: 14px; display: grid; gap: 10px; text-align: left; width: 100%; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: .82rem; color: var(--muted); }
.kind { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.kind svg { width: 14px; height: 14px; }
.k-text, .k-meilenstein { background: var(--sage-soft); color: var(--sage-deep); }
.k-stimme, .k-moment { background: var(--blue-soft); color: var(--blue-deep); }
.entry h3 { font-size: 1.12rem; }
.entry p { margin: 0; white-space: pre-line; }
.entry .kurz { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.byline { font-size: .8rem; color: var(--muted); }
.bild { position: relative; border-radius: 18px; overflow: hidden; background: var(--blue-soft); aspect-ratio: 4 / 3; }
.bild img, .bild video { width: 100%; height: 100%; object-fit: cover; display: block; }
.bild .mehr { position: absolute; right: 10px; bottom: 10px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 99px; padding: 3px 12px; font-weight: 700; font-size: .85rem; }
.bild .play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.bild .play span { width: 56px; height: 56px; border-radius: 50%; background: var(--glass); display: grid; place-items: center; }
audio { width: 100%; height: 44px; }
.leer { text-align: center; color: var(--muted); padding: 30px 10px; background: var(--surface); border-radius: 24px; }
.leer b { display: block; color: var(--ink); font-family: var(--display); font-size: 1.15rem; margin-bottom: 4px; }

/* Leiste unten */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px max(12px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 6px) max(12px, env(safe-area-inset-left)); }
.nav-in { max-width: 620px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.nav button.tab { display: grid; justify-items: center; gap: 2px; font-size: .75rem; color: var(--muted); min-height: 52px; align-content: center; }
.nav button.tab[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav button.tab[aria-current="page"] svg { stroke: var(--blue-deep); }
.fab { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(140deg, var(--blue-deep), var(--sage-deep)); color: #fff;
  display: grid; place-items: center; margin-top: -30px; box-shadow: 0 6px 14px rgba(36,52,59,.2); border: 5px solid var(--surface); }
.fab svg { width: 28px; height: 28px; stroke-width: 2.4; }

/* Blätter */
.scrim { position: fixed; inset: 0; background: rgba(20,32,38,.4); z-index: 10; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; background: var(--surface); border-radius: 28px 28px 0 0;
  max-height: 92dvh; overflow-y: auto; padding: 12px max(20px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 24px) max(20px, env(safe-area-inset-left));
  animation: hoch .25s ease-out; }
.sheet > * { max-width: 580px; margin-left: auto; margin-right: auto; }
@keyframes hoch { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { font-size: 1.45rem; margin-bottom: 4px; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: .95rem; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 20px; text-align: left; background: var(--surface-2); border: 1px solid var(--line); width: 100%; }
.choice .ic { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.choice b { display: block; font-size: 1.02rem; } .choice small { color: var(--muted); }
label.f { display: grid; gap: 6px; font-weight: 700; font-size: .9rem; margin-bottom: 12px; }
input[type=text], input[type=password], input[type=date], textarea {
  width: 100%; font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.btn { min-height: 50px; border-radius: 99px; padding: 0 22px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--blue-deep); color: var(--surface); }
.btn.soft { background: var(--surface-2); border: 1px solid var(--line); }
.btn.warn { background: var(--warn-bg); color: var(--warn); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.abstand { margin-top: 18px; } .abstand-k { margin-top: 10px; }
.hint { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }
.fehlertext { color: var(--warn); font-weight: 600; margin: 8px 0 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 99px; padding: 5px; gap: 4px; margin-bottom: 14px; }
.seg button { min-height: 42px; border-radius: 99px; font-weight: 700; }
.seg button[aria-pressed="true"] { background: var(--blue); }

/* Aufnahme */
.rec { display: grid; justify-items: center; gap: 14px; padding: 8px 0 4px; }
.recbtn { width: 104px; height: 104px; border-radius: 50%; background: var(--blue); color: var(--blue-deep); display: grid; place-items: center; position: relative; }
.recbtn svg { width: 40px; height: 40px; }
.recbtn.live { background: var(--blue-deep); color: var(--surface); }
.recbtn.live::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 3px solid var(--blue); animation: puls 1.4s ease-out infinite; }
@keyframes puls { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.timer { font-family: var(--display); font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pegel { display: flex; gap: 4px; height: 40px; align-items: center; width: 80%; }
.pegel i { flex: 1; background: var(--blue-deep); border-radius: 3px; height: 100%; transform: scaleY(.15); transition: transform .1s; }

/* Medienwahl */
.drop { position: relative; display: grid; place-items: center; gap: 6px; border: 2px dashed var(--line); border-radius: 20px; padding: 26px 14px; text-align: center; color: var(--muted); margin-bottom: 12px; cursor: pointer; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.vorschau { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-bottom: 12px; }
.vorschau div { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--blue-soft); display: grid; place-items: center; font-size: .8rem; color: var(--muted); }
.vorschau img { width: 100%; height: 100%; object-fit: cover; }
.fortschritt { height: 8px; border-radius: 9px; background: var(--surface-2); overflow: hidden; margin: 10px 0; }
.fortschritt i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left; background: var(--blue-deep); transition: transform .2s; }

/* Detail */
.galerie { display: grid; gap: 10px; margin-bottom: 14px; }
.galerie img, .galerie video { width: 100%; border-radius: 18px; display: block; background: var(--blue-soft); }
.detailtext { white-space: pre-line; font-size: 1.05rem; line-height: 1.65; margin: 10px 0 16px; }
details.roh { background: var(--surface-2); border-radius: 16px; padding: 10px 14px; margin-bottom: 12px; font-size: .9rem; color: var(--muted); }
details.roh summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.frage { background: var(--warn-bg); color: var(--warn); border-radius: 16px; padding: 12px 14px; margin-top: 12px; }

/* Anmeldung */
.login { max-width: 420px; margin: 8vh auto 0; display: grid; gap: 18px; }
.login .seg { margin: 0; }
.marke { display: flex; align-items: center; gap: 12px; }
.marke .logo { width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(140deg, var(--blue), var(--sage)); display: grid; place-items: center; color: var(--blue-deep); }
.marke .logo svg { width: 30px; height: 30px; }
.marke h1 { font-size: 1.8rem; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 100px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 700; z-index: 20; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.sprite { position: absolute; }
