@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/nunito-latin-wght-normal.woff2) format("woff2");
  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: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/nunito-latin-ext-wght-normal.woff2) format("woff2");
  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;
}

@property --bg { syntax: "<color>"; inherits: true; initial-value: #fdcdc3; }
@property --glow { syntax: "<color>"; inherits: true; initial-value: #ffb4a4; }
@property --card { syntax: "<color>"; inherits: true; initial-value: #fff8f6; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #e63a10; }
@property --accent-soft { syntax: "<color>"; inherits: true; initial-value: #ffded6; }

:root {
  --bg: #fdcdc3;
  --glow: #ffb4a4;
  --card: #fff8f6;
  --ink: #1f1a24;
  --muted: #7f6c70;
  --line: rgba(31, 26, 36, 0.09);
  --accent: #e63a10;
  --accent-soft: #ffded6;
  --on-accent: #fff;
  --dark: #1f1a24;
  --on-dark: #fff8f6;
  --danger: #c2372b;
  --shadow: 0 1px 2px rgba(80, 20, 10, 0.06), 0 6px 18px rgba(160, 40, 25, 0.08);
  --display: var(--sans);
  --me: #e63a10;
  --me-soft: #ffded6;
  --them: #5b52cc;
  --them-soft: #e2defa;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 28px;
  color-scheme: light;
}
body[data-view="partner"] {
  --bg: #eeebf7;
  --glow: #cfc8f3;
  --card: #fbfaff;
  --accent: #5b52cc;
  --accent-soft: #e2defa;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1517;
    --glow: #62200f;
    --card: #2d2023;
    --ink: #f7ecea;
    --muted: #b09a9d;
    --line: rgba(255, 255, 255, 0.09);
    --accent: #ff5a33;
    --accent-soft: #55211a;
    --on-accent: #1f1517;
    --dark: #f7ecea;
    --on-dark: #1f1517;
    --me: #ff6a45;
    --me-soft: #55211a;
    --them: #a7a1ff;
    --them-soft: #343062;
    --danger: #ff7a6b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
  body[data-view="partner"] {
    --bg: #18172a;
    --glow: #312a6e;
    --card: #232136;
    --accent: #9b94ff;
    --accent-soft: #343062;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(120% 55% at 50% -5%, var(--glow), transparent 70%);
  background-attachment: fixed;
  transition: --bg 0.45s ease, --glow 0.45s ease, --card 0.45s ease, --accent 0.45s ease, --accent-soft 0.45s ease;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* ---------- Grundlayout ---------- */
.screen {
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 16px);
  display: flex;
  flex-direction: column;
}
#app { height: 100dvh; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.seg {
  position: relative;
  display: inline-flex;
  min-width: 0; /* darf schrumpfen, Namen kürzen sich dann mit … */
  padding: 5px;
  border-radius: 999px;
  background: var(--card);
}
.seg-thumb {
  position: absolute;
  top: 5px; bottom: 5px; left: 5px;
  border-radius: 999px;
  background: var(--accent);
  transition: transform 0.38s cubic-bezier(.22,1.25,.36,1), width 0.38s cubic-bezier(.22,1.25,.36,1);
}
.seg-thumb.no-anim { transition: none; }
.seg button {
  position: relative;
  min-width: 0;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  max-width: 9.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.3s;
}
.seg button[aria-selected="true"] { color: var(--on-accent); }

.icon-btn {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--card);
}
.icon-btn.plain { background: none; box-shadow: none; }
.icon-btn.small { width: 36px; height: 36px; }
.icon-btn.danger { color: var(--danger); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }

/* Mit Serie wird der Profilknopf zur Pille: Flamme + Zahl, dann das Profil-Symbol */
.profile-btn.has-streak {
  display: inline-flex; align-items: center; gap: 8px;
  width: auto; padding: 0 14px;
  border-radius: 999px;
}
.streak-badge {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--accent);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.streak-badge .ic { width: 18px; height: 18px; fill: currentColor; stroke: none; }
/* Schwebt mittig in der unteren Leiste, außerhalb des Layouts: verschiebt nichts, wenn es erscheint */
.update-btn {
  position: absolute; left: 50%; bottom: 6px;
  translate: -50% 0;
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px 0 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  animation: update-pop 0.5s cubic-bezier(.2,1.6,.4,1);
}
.update-btn .ic { width: 18px; height: 18px; stroke-width: 2.4; }
.update-btn:disabled .ic { animation: spin 0.8s linear infinite; }
@media (max-width: 380px) {
  .update-btn { width: 40px; padding: 0; justify-content: center; }
  .update-label { display: none; }
}
@keyframes update-pop { from { transform: scale(0.4); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Datum ---------- */
.date { padding: clamp(16px, 4vh, 32px) 0 clamp(16px, 3vh, 24px); text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Klappanzeige */
.flaps { display: grid; grid-template-columns: 1fr 1fr 1.45fr 1fr; gap: 8px; }
.flap {
  position: relative;
  height: clamp(60px, 9vh, 76px);
  border-radius: 16px;
  box-shadow: var(--shadow);
  perspective: 220px;
  font-weight: 900;
  font-size: clamp(1.9rem, 8.6vw, 2.6rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.half {
  position: absolute;
  left: 0; right: 0;
  height: 50%;
  overflow: hidden;
  background: var(--card);
  backface-visibility: hidden;
}
.half.top {
  top: 0;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(color-mix(in srgb, var(--card) 91%, var(--ink)), color-mix(in srgb, var(--card) 97%, var(--ink)));
  transform-origin: bottom;
}
.half.bot {
  bottom: 0;
  border-radius: 0 0 16px 16px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 12%, transparent);
  transform-origin: top;
}
.half > span { position: absolute; left: 0; right: 0; height: 200%; display: grid; place-items: center; line-height: 1; }
.half.top > span { top: 0; }
.half.bot > span { bottom: 0; }
.half.fold { z-index: 2; }

/* ---------- Karte ---------- */
.card {
  flex: 1;
  min-height: 0;
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.card-kicker { margin: 0 0 14px; color: var(--muted); font-size: 0.95rem; }
.card-pending {
  display: inline-flex; align-items: center; gap: 6px;
  margin: -6px 0 14px; padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem; font-weight: 700;
}
.card-pending .ic { width: 16px; height: 16px; }
.card-question {
  margin: 0 0 28px;
  font-family: var(--display);
  font-size: clamp(1.7rem, 7vw, 2.15rem);
  line-height: 1.15;
  font-weight: 600;
  text-wrap: balance;
}
.card-text {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 5.6vw, 1.7rem);
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.card-text.long { font-size: 1.15rem; text-align: left; }
.card-photo {
  width: 100%;
  max-height: 38vh;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 20px;
}
.card-scroll { width: 100%; max-height: 100%; overflow-y: auto; scrollbar-width: none; }
.card-edit { position: absolute; right: 14px; bottom: 14px; }
.card-empty-title { margin: 0 0 8px; font-family: var(--display); font-size: 1.6rem; font-weight: 600; }
.card-empty-body { margin: 0 0 26px; color: var(--muted); max-width: 26em; text-wrap: balance; }
.card-note { margin: -8px 0 0; color: var(--muted); font-size: 0.9rem; font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 1.05rem;
  background: var(--accent-soft);
  color: var(--ink);
  transition: transform 0.12s ease, filter 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-dark { background: var(--dark); color: var(--on-dark); }
.btn-ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-small { min-height: 42px; padding: 0 18px; font-size: 0.95rem; }

.bottombar { position: relative; display: flex; justify-content: space-between; align-items: center; padding-top: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 24px;
  border-radius: 999px;
  background: var(--card);
  font-weight: 600;
  cursor: pointer;
}
.pill:disabled { opacity: 0.45; cursor: default; }
.pill-group { display: flex; align-items: center; background: var(--card); border-radius: 999px; padding: 2px; }
.pill-group .icon-btn { background: none; box-shadow: none; width: 52px; }
.pill-group .divider { width: 1px; height: 24px; background: var(--line); }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed; inset: 0;
  z-index: 10;
  background: var(--bg);
  overflow-y: auto;
  padding: calc(env(safe-area-inset-top) + 10px) max(16px, calc(50vw - 280px)) calc(env(safe-area-inset-bottom) + 24px);
  animation: rise 0.25s ease;
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .overlay { animation: none; } }

.editor {
  display: flex;
  flex-direction: column;
  inset: 0 0 auto 0;
  height: 100dvh;
  overflow: hidden;
  padding-bottom: 0;
  background: var(--card);
}
.editor-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 0 -10px 8px;
}
.editor-top .chip { justify-self: center; }
.editor-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 0 16px;
  overscroll-behavior: contain;
}
.editor-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 10px 0 calc(env(safe-area-inset-bottom) + 12px);
}
.chip { justify-self: center; }
.editor-top .btn { justify-self: end; }
.chip {
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}
.editor-title {
  font-family: var(--display);
  font-size: clamp(1.7rem, 7vw, 2.2rem);
  line-height: 1.15;
  margin: 0 0 12px;
}
.editor textarea {
  width: 100%;
  min-height: 8em;
  border: 0;
  outline: 0;
  resize: none;
  overflow: hidden;
  padding: 0;
  background: transparent;
  font-family: var(--display);
  font-size: 1.3rem;
  line-height: 1.45;
  caret-color: var(--accent);
}
.editor textarea::placeholder { color: var(--muted); opacity: 0.7; }
.editor-photo { position: relative; margin: 12px 0 0; }
.editor-photo img { width: 100%; max-height: 40vh; object-fit: cover; border-radius: 18px; display: block; }
.editor-photo .icon-btn { position: absolute; top: 10px; right: 10px; }
.round-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.round-btn:active { transform: scale(0.94); }
.round-btn:disabled { opacity: 0.5; }
.round-btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.round-btn .ic { width: 26px; height: 26px; }
.round-btn.soft { background: var(--accent-soft); color: var(--accent); }
.round-btn.primary { background: var(--accent); color: var(--on-accent); }
.round-btn.primary .ic { stroke-width: 2.4; }

.done { display: grid; place-items: center; text-align: center; }
.done-inner { max-width: 360px; }
.done h2 { font-family: var(--display); font-size: 2.4rem; margin: 26px 0 10px; font-weight: 600; }
.done p { margin: 0 0 32px; font-size: 1.1rem; line-height: 1.5; }

/* ---------- Seitenkopf ---------- */
.page-top {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  margin: 0 -10px 6px;
}
.page-top h2 { margin: 0; text-align: center; font-size: 1.15rem; font-weight: 800; }

/* ---------- Verlauf ---------- */
.history-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.history-month {
  margin: 18px 6px 2px;
  font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.history-day {
  display: flex; gap: 14px; align-items: flex-start;
  width: 100%;
  text-align: left;
  background: var(--card);
  border-radius: 22px;
  padding: 14px;
  transition: transform 0.12s ease;
}
.history-day:active { transform: scale(0.98); }
.mini-flap {
  position: relative;
  flex: none;
  width: 52px; height: 58px;
  border-radius: 12px;
  display: grid; place-content: center; justify-items: center; gap: 3px;
  background: linear-gradient(color-mix(in srgb, var(--card) 90%, var(--ink)) 0 50%, color-mix(in srgb, var(--card) 95%, var(--ink)) 50%);
}
.mini-flap::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 50%;
  height: 1px;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
}
.mini-flap b { font-size: 1.35rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.mini-flap span { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; color: var(--muted); }
.history-entries { flex: 1; min-width: 0; display: grid; gap: 10px; padding-top: 2px; }
.history-entry { display: flex; gap: 10px; align-items: flex-start; }
.history-dot {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.78rem; font-weight: 900;
  background: var(--me-soft); color: var(--me);
}
.history-entry.them .history-dot { background: var(--them-soft); color: var(--them); }
.history-text {
  flex: 1; min-width: 0;
  padding-top: 2px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.history-text.dim { color: var(--muted); font-weight: 500; font-style: italic; }
.history-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.history-empty { text-align: center; padding: 48px 20px; color: var(--muted); }

/* ---------- Profil-Sheet ---------- */
.sheet {
  border: 0;
  padding: 6px 16px calc(env(safe-area-inset-bottom) + 22px);
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  margin: auto auto 0;
  border-radius: 28px 28px 0 0;
  background: var(--bg);
  color: var(--ink);
}
.sheet[open] { animation: rise 0.25s ease; }
.sheet::backdrop { background: rgba(20, 12, 20, 0.4); }

/* ---------- Foto im Vollbild ---------- */
.lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: calc(env(safe-area-inset-top) + 64px) 0 calc(env(safe-area-inset-bottom) + 24px);
  border: 0;
  background: #0e080c;
  overscroll-behavior: contain;
}
.lightbox[open] { display: grid; place-items: center; animation: fade-in 0.2s ease; }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; animation: photo-in 0.25s cubic-bezier(.2,1.2,.4,1); }
.lightbox-close {
  position: absolute; top: calc(env(safe-area-inset-top) + 10px); right: 16px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes photo-in { from { transform: scale(0.92); opacity: 0; } }
.card-photo { cursor: zoom-in; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 18%, transparent); margin: 4px auto 8px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; margin-right: -10px; }
.sheet h2 { font-size: 1.9rem; margin: 6px 0 0; line-height: 1.1; }
.sheet-head p { margin: 4px 0 0; }
.sheet h3 {
  font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
  margin: 24px 6px 8px;
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 12px; }
.stat { background: var(--card); border-radius: 18px; padding: 14px 6px 12px; text-align: center; }
.stat b { display: block; font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.76rem; font-weight: 600; color: var(--muted); }
.group { background: var(--card); border-radius: 20px; overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}
.row + .row { border-top: 1px solid var(--line); }
.row-ic {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.row-ic .ic { width: 20px; height: 20px; }
.row-label { flex: 1; }
.row-end { width: 20px; height: 20px; color: var(--muted); }
.row.danger { color: var(--danger); }
.row.danger .row-ic { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.row-input {
  border: 0;
  border-radius: 10px;
  padding: 6px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.group-note { margin: 8px 8px 0; font-size: 0.88rem; line-height: 1.4; color: var(--muted); }
.group-note:empty { display: none; }
.link-btn { margin: 8px 8px 0; color: var(--accent); font-weight: 800; font-size: 0.9rem; }
.switch {
  position: relative;
  flex: none;
  width: 52px; height: 32px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 16%, transparent);
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s cubic-bezier(.3,1.4,.5,1);
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:disabled { opacity: 0.4; cursor: default; }
.group.invite { padding: 14px 16px; }
.group.invite p { margin: 0 0 10px; }
.invite-url {
  font-family: ui-monospace, monospace;
  background: var(--bg);
  padding: 12px;
  border-radius: 12px;
  overflow-wrap: anywhere;
  user-select: all;
  margin: 0 !important;
}

/* ---------- Offline ---------- */
.offline-badge {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
}
.offline-badge .ic { width: 20px; height: 20px; }

/* ---------- Anmeldung ---------- */
.login { justify-content: center; }
.login-inner { text-align: center; }
.login-logo { margin-bottom: 8px; }
.login h1 { font-family: var(--display); font-size: 2.6rem; margin: 0; font-weight: 600; }
.login p { margin: 8px 0 32px; }
.stack { display: grid; gap: 16px; text-align: left; }
.stack label { display: grid; gap: 6px; font-weight: 600; font-size: 0.95rem; }
.stack input {
  height: 54px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 0 16px;
  background: var(--card);
  font-size: 1.05rem;
  font-weight: 400;
}
.form-error { color: var(--danger); margin: 0; font-size: 0.95rem; }
.field-hint { font-weight: 500; font-size: 0.85rem; color: var(--muted); }
.login h1.pin-title { font-size: 2rem; }
#pin-ill .ill { height: 104px; margin-bottom: 10px; }
/* Auf dem Handy beim Tippen: Logo/Illustration ausblenden, damit Felder + Knopf über die Tastatur passen */
@media (pointer: coarse) {
  .login:focus-within { justify-content: flex-start; padding-top: calc(env(safe-area-inset-top) + 24px); }
  .login:focus-within .login-logo,
  .login:focus-within #pin-ill { display: none; }
  .login:focus-within .login-inner > p.muted { margin-bottom: 20px; }
}
.form-error:empty { display: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 92px);
  transform: translateX(-50%);
  z-index: 50;
  background: var(--dark);
  color: var(--on-dark);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  width: max-content;
  max-width: calc(100vw - 32px);
  text-align: center;
  box-shadow: var(--shadow);
}

/* ---------- Schrift: alles in der Systemschrift, Überschriften kräftig ---------- */
.card-question, .card-empty-title, .editor-title, .done h2, .sheet h2, .login h1, .stat b {
  font-weight: 850;
  letter-spacing: -0.015em;
}
.card-text, .editor textarea, .history-text { font-weight: 600; letter-spacing: 0; }

/* ---------- Illustrationen ---------- */
.ill {
  display: block;
  height: clamp(76px, 15vh, 124px);
  width: auto;
  margin: 0 auto 18px;
  overflow: visible;
  fill: none;
  stroke: var(--ink);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ill .paper { fill: var(--card); }
.ill .acc { fill: var(--accent); }
.ill .soft { fill: var(--accent-soft); stroke: none; }
.ill .ink { fill: var(--ink); stroke: none; }
.ill .thin { stroke-width: 3; }
.ill .ghost { stroke-dasharray: 8 8; opacity: 0.45; }
.ill .ghost-solid { opacity: 0.45; }
.done-ill .ill { height: 130px; margin-bottom: 0; }

.ill .a-sway, .ill .a-wiggle, .ill .a-steam, .ill .a-rise { transform-box: fill-box; }
.ill .a-sway { transform-origin: 0% 100%; animation: ill-sway 2.6s ease-in-out infinite; }
@keyframes ill-sway { 0%, 100% { transform: none; } 30% { transform: rotate(-8deg) translateX(-2px); } 60% { transform: rotate(3deg); } }
.ill .a-wiggle { transform-origin: 50% 100%; animation: ill-wiggle 4s ease-in-out infinite; }
@keyframes ill-wiggle {
  0%, 70%, 100% { transform: none; }
  74% { transform: rotate(-5deg); } 78% { transform: rotate(4deg); }
  82% { transform: rotate(-3deg); } 86% { transform: rotate(1.5deg); } 90% { transform: none; }
}
.ill .a-blink { animation: ill-blink 4s ease-in-out infinite; }
@keyframes ill-blink { 0%, 68%, 94%, 100% { opacity: 0.25; } 76%, 86% { opacity: 1; } }
.ill .a-steam { stroke: var(--muted); stroke-width: 3; opacity: 0; animation: ill-steam 2.4s ease-in-out infinite; }
.ill .s2 { animation-delay: 0.8s; }
.ill .s3 { animation-delay: 1.6s; }
@keyframes ill-steam { 0% { opacity: 0; transform: translateY(6px); } 35% { opacity: 0.9; } 100% { opacity: 0; transform: translateY(-10px); } }
.ill .a-rise { animation: ill-rise 1.1s cubic-bezier(.2,.9,.3,1) 0.1s both; }
@keyframes ill-rise { from { transform: translateY(42px); } }
.ill .rays path { transform-box: view-box; transform-origin: 80px 86px; animation: ill-ray 0.45s ease-out both; }
.ill .rays path:nth-child(1) { animation-delay: 0.7s; }
.ill .rays path:nth-child(2) { animation-delay: 0.78s; }
.ill .rays path:nth-child(3) { animation-delay: 0.86s; }
.ill .rays path:nth-child(4) { animation-delay: 0.94s; }
.ill .rays path:nth-child(5) { animation-delay: 1.02s; }
@keyframes ill-ray { from { opacity: 0; transform: scale(0.6); } }
@media (prefers-reduced-motion: reduce) {
  .ill * { animation: none !important; }
  .ill .a-steam { opacity: 0.7; }
}
