/* MyBible · Look nach Referenz: Off-White, Pastellkarten (Lime, Lavendel, Himmel, Rosa),
   dünne große Überschriften, schwarze Pillen-Buttons, Kreis-Kalender.
   Schrift: Outfit (variabel, selbst gehostet). */
@font-face { font-family: Outfit; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/outfit-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: Outfit; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/outfit-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+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Kyrillisch: Outfit hat keine kyrillischen Zeichen, darum Onest (gleiche Familie im CSS, nur für diese Zeichen) */
@font-face { font-family: Outfit; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/onest-cyrillic-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Outfit; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/onest-cyrillic-ext-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

:root {
  /* Flächen */
  --bg: #f4f4ef;
  --surface: #fbfbf8;
  --surface-2: #ececE6;
  --ink: #131313;
  --muted: #6a6a64;
  --faint: #8e8e87;
  --ok-dot: #6f8a12;
  --line: #e4e4dc;
  /* Pastelle (Text darauf immer --on-pastel) */
  --lime: #d5e67f;      /* OKLCH .89 .13 117  Anker 1 */
  --lime-deep: #bcd54f;
  --lilac: #bfb0ff;     /* OKLCH .80 .115 292 Anker 2, Komplementär zu Lime */
  --lilac-deep: #9e8afa;
  --sky: #aed3ef;       /* OKLCH .85 .055 240 Begleitfarbe */
  --rose: #fabdd3;      /* OKLCH .86 .075 355 Begleitfarbe */
  --rose-line: #f3c0d7;
  --mist: #f0f0fc;
  --mist-2: #e8e7f9;
  --on-pastel: #141414;
  /* Aktion */
  --cta: #111111;
  --cta-ink: #ffffff;
  --link: #5a41d8;
  --danger: #c23b3b;
  --focus: #9a82fb;
  /* Form */
  --r-xl: 32px;
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --shadow: 0 1px 1px rgba(30, 30, 10, .03), 0 14px 34px -16px rgba(40, 40, 20, .16);
  --shadow-btn: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 20px -10px rgba(40, 40, 20, .25);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121311; --surface: #1b1c19; --surface-2: #262723; --ink: #f1f1ec; --muted: #a3a39b; --faint: #5d5d57; --line: #2c2d29;
    --mist: #23253a; --mist-2: #1d1f31; --cta: #f4f4ef; --cta-ink: #111111; --link: #b9a8ff; --danger: #f07a72;
    --shadow: none; --shadow-btn: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 Outfit, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--link); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(32px, 9vw, 40px); font-weight: 300; line-height: 1.08; letter-spacing: -.02em; }
h2 { font-size: 19px; font-weight: 500; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--bg); }
h1:focus { outline: none; box-shadow: none; }

#app { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 112px); }

/* ---------- Kopf ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.hello { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hello .av { width: 46px; height: 46px; font-size: 15px; }
.hello small { display: block; color: var(--muted); font-size: 14px; line-height: 1.2; }
.hello b { display: block; font-weight: 500; font-size: 18px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn {
  appearance: none; border: 0; width: 46px; height: 46px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-btn);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; color: var(--ink); flex: none;
  transition: transform .12s var(--ease);
}
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn:active { transform: scale(.96); }
.iconbtn:disabled { opacity: .35; cursor: default; }
.iconbtn .dot { position: absolute; top: 11px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--lime-deep); box-shadow: 0 0 0 2px var(--surface); }

.headline { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 22px; }
.headline .glyph { width: 30px; height: 30px; flex: none; margin-bottom: 6px; }

/* ---------- Avatare ---------- */
.av { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; flex: none;
  background: var(--surface-2); color: var(--muted); }
.av.c0 { background: var(--lime); color: var(--on-pastel); }
.av.c1 { background: var(--lilac); color: var(--on-pastel); }
.av.c2 { background: var(--sky); color: var(--on-pastel); }
.av.c3 { background: var(--rose); color: var(--on-pastel); }
.av.off { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.av.more { background: var(--ink); color: var(--bg); font-size: 12px; }
.stackav { display: flex; flex-wrap: wrap; row-gap: 8px; padding-left: 8px; }
.stackav .av { margin-left: -6px; box-shadow: 0 0 0 3px var(--surface); }

/* ---------- Karten ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.lime { background: var(--lime); color: var(--on-pastel); }
.card.lilac { background: var(--lilac); color: var(--on-pastel); }
.card.sky { background: var(--sky); color: var(--on-pastel); }
.card.rose { background: var(--rose); color: var(--on-pastel); }
.card.lime .muted, .card.lilac .muted, .card.sky .muted, .card.rose .muted, .hero-card .muted { color: rgba(20, 20, 20, .78); }
/* Auf Pastell immer dunkle Buttons, auch im Dunkelmodus */
.card.lime .btn:not(.soft):not(.danger), .card.lilac .btn:not(.soft):not(.danger), .card.sky .btn:not(.soft):not(.danger), .card.rose .btn:not(.soft):not(.danger) { background: #111; color: #fff; }
.sechead { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 12px; }
.sechead h2 { font-size: 17px; }
.sechead span, .sechead a { font-size: 13px; color: var(--muted); text-decoration: none; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }

/* ---------- Hauptkarte mit gestapelten Karten dahinter ---------- */
.hero { position: relative; margin-top: 34px; margin-bottom: 4px; }
.hero::before, .hero::after { content: ""; position: absolute; height: 80px; border-radius: var(--r-xl); }
.hero::before { background: var(--lime); top: -22px; left: 30px; right: 30px; transform: rotate(-1.2deg); }
.hero::after { background: var(--lilac); top: -11px; left: 14px; right: 14px; transform: rotate(.8deg); }
.hero-card {
  position: relative; z-index: 1; border-radius: var(--r-xl); padding: 22px 22px 20px; overflow: hidden; min-height: 268px;
  background: linear-gradient(155deg, var(--mist) 0%, var(--mist-2) 100%); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.hero-card .label { font-size: 14px; color: var(--muted); }
.hero-card .title { font-size: clamp(34px, 10vw, 44px); font-weight: 500; letter-spacing: -.025em; line-height: 1.05; margin-top: 4px; }
.hero-card .sub { color: var(--muted); font-size: 14px; margin-top: 6px; max-width: 62%; }
.hero-card > :not(.art) { position: relative; z-index: 1; }
.hero-card .art { z-index: 0; position: absolute; right: -26px; bottom: 26px; width: 58%; max-width: 250px; transform: rotate(-9deg); pointer-events: none; }
.hero-card .hfoot { margin-top: auto; padding-top: 18px; }
.hero-card .big { font-size: 30px; font-weight: 400; line-height: 1; }
.hero-card .big small { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 0; border-radius: 999px; padding: 0 22px; min-height: 50px; font-weight: 500; font-size: 15px; cursor: pointer;
  background: var(--cta); color: var(--cta-ink); display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none;
  transition: transform .12s var(--ease), opacity .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.soft { background: var(--surface-2); color: var(--ink); }
.btn.white { background: #fff; color: #111; box-shadow: var(--shadow-btn); }
.btn.lime { background: var(--lime); color: var(--on-pastel); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger); }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap;
  background: rgba(255, 255, 255, .55); color: var(--on-pastel); }
.chip svg { width: 14px; height: 14px; }
.chip.plain { background: var(--surface-2); color: var(--ink); }
.chip.lime { background: var(--lime); color: var(--on-pastel); }
.chip.lilac { background: var(--lilac); color: var(--on-pastel); }
.chip.rose { background: var(--rose); color: var(--on-pastel); }
.chip.dark { background: var(--cta); color: var(--cta-ink); }

/* ---------- Tagesschalter ---------- */
.daypick { display: flex; align-items: center; gap: 8px; margin: -8px 0 4px; }
.daypick .iconbtn { width: 44px; height: 44px; border-radius: 14px; }
.daypick .chip { background: var(--surface); box-shadow: var(--shadow-btn); color: var(--ink); padding: 8px 14px; font-size: 14px; }

/* ---------- Abschnitte (Pastellkacheln) ---------- */
.tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 12px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.tiles::-webkit-scrollbar { display: none; }
.tile { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 16px; min-height: 196px; color: var(--on-pastel); display: flex; flex-direction: column; scroll-snap-align: start; }
.tile.t0 { background: var(--lime); } .tile.t1 { background: var(--lilac); } .tile.t2 { background: var(--sky); } .tile.t3 { background: var(--rose); }
.tile::after { content: ""; position: absolute; width: 150px; height: 150px; right: -50px; bottom: -60px; border-radius: 50%; background: rgba(255, 255, 255, .22); pointer-events: none; }
.tile .book { font-weight: 500; font-size: 16px; position: relative; }
.tile .ring { appearance: none; border: 0; background: none; padding: 0; margin: 14px 0 0; width: 48px; height: 48px; cursor: pointer; position: relative; z-index: 1; }
.tile .ring svg { width: 48px; height: 48px; display: block; }
.tile .ring .track { stroke: rgba(20, 20, 20, .14); }
.tile .ring .fill { stroke: var(--on-pastel); stroke-dasharray: 113.1; stroke-dashoffset: 113.1; transition: stroke-dashoffset .45s var(--ease); }
.tile .ring .check { opacity: 0; transition: opacity .2s .2s; }
.tile.done .ring .fill { stroke-dashoffset: 0; }
.tile.done .ring .check { opacity: 1; }
.tile .ref { margin-top: auto; font-size: 30px; font-weight: 400; letter-spacing: -.02em; line-height: 1.05; position: relative; }
.tile .refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; position: relative; z-index: 1; }
.tile .refs a { font-size: 13px; font-weight: 500; color: var(--on-pastel); text-decoration: none; background: rgba(255, 255, 255, .6); padding: 0 12px; min-height: 36px; border-radius: 999px; display: inline-flex; gap: 4px; align-items: center; }
.tile .refs a svg { width: 12px; height: 12px; }

/* ---------- Frage / Antwort ---------- */
.question { font-size: 21px; font-weight: 400; line-height: 1.3; letter-spacing: -.01em; margin: 12px 0 16px; }
.answer-own { white-space: pre-wrap; background: var(--surface-2); border-radius: var(--r-md); padding: 14px 16px; }
.bubble { background: var(--surface-2); border-radius: 20px 20px 20px 6px; padding: 12px 14px; margin-top: 6px; white-space: pre-wrap; }
.answer { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.answer .who { font-weight: 500; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.answer .body { flex: 1; min-width: 0; }
.locked { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-md); background: var(--mist); color: var(--muted); font-size: 14px; margin-top: 14px; }
.locked svg { width: 20px; height: 20px; flex: none; color: var(--lilac-deep); }

/* ---------- Formulare ---------- */
label.field { display: block; font-size: 13px; color: var(--muted); }
label.field > input, label.field > select, label.field > textarea { margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=time], input[type=date], input[type=number], select, textarea {
  width: 100%; border: 1.5px solid transparent; background: var(--surface-2); border-radius: 16px; padding: 13px 15px; font-size: 16px; outline: none;
  transition: border-color .15s, background .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--ink); background: var(--surface); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; }
textarea { resize: vertical; min-height: 104px; line-height: 1.45; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; cursor: pointer; line-height: 1.45; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; cursor: pointer; }
.switch span { display: inline-flex; align-items: center; gap: 8px; }
.switch span svg { width: 16px; height: 16px; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .2s var(--ease); margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked { background: var(--lilac-deep); }
.switch input:checked::after { transform: translateX(18px); }
.msg { padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.msg.err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.msg.ok { background: var(--lime); color: var(--on-pastel); }
details summary { cursor: pointer; font-weight: 500; list-style: none; min-height: 44px; display: flex; align-items: center; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: " ›"; color: var(--muted); }
details[open] summary::after { content: " ⌄"; }

/* ---------- Gruppe ---------- */
.goal { display: flex; align-items: center; gap: 18px; }
.donut { width: 108px; height: 108px; flex: none; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .track { stroke: rgba(20, 20, 20, .12); }
.donut .fill { stroke: var(--on-pastel); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.donut b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 400; letter-spacing: -.02em; }
.donut b small { font-size: 15px; margin-left: 1px; }
.weekdots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 18px; }
.weekdots div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; }
.weekdots i { width: 100%; max-width: 38px; height: 64px; border-radius: 999px; background: rgba(255, 255, 255, .45); position: relative; overflow: hidden; display: block; }
.weekdots i em { position: absolute; left: 0; right: 0; bottom: 0; background: var(--on-pastel); border-radius: 999px; }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.member + .member { border-top: 1px solid var(--line); }
.member .name { flex: 1; font-weight: 400; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Kalender (Kreise) ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px 6px; }
.cal .h { font-size: 13px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal button {
  aspect-ratio: 1; width: 100%; max-width: 46px; justify-self: center; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  font-size: 14px; font-weight: 400; color: var(--muted); background: var(--surface-2); transition: transform .12s var(--ease);
}
.cal button:active:not(:disabled) { transform: scale(.94); }
.cal button.open { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rose-line); }
.cal button.ok { color: var(--on-pastel); background: radial-gradient(circle at 34% 28%, #f3f8c9 0%, var(--lime) 38%, var(--lime-deep) 100%); box-shadow: 0 6px 12px -6px rgba(120, 140, 20, .55); }
.cal button.late { color: var(--on-pastel); background: radial-gradient(circle at 34% 28%, #ece6ff 0%, var(--lilac) 40%, var(--lilac-deep) 100%); box-shadow: 0 6px 12px -6px rgba(90, 60, 200, .5); }
.cal button.today { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink); }
.cal button.future { background: transparent; color: var(--faint); }
.cal button:disabled { cursor: default; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 16px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 4px; }
.stat { border-radius: var(--r-lg); padding: 16px 18px; }
.stat b { display: block; font-size: 34px; font-weight: 400; line-height: 1.05; letter-spacing: -.02em; }
.stat span { font-size: 13px; }

/* ---------- Leitung ---------- */
.subtabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px 18px; padding: 2px 18px 4px; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { text-decoration: none; background: var(--surface); box-shadow: var(--shadow-btn); border-radius: 999px; padding: 0 16px; min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; white-space: nowrap; color: var(--ink); }
.subtabs a.on { background: var(--cta); color: var(--cta-ink); }
.alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--on-pastel); }
.matrix-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.matrix { border-collapse: separate; border-spacing: 4px; font-size: 12px; }
table.matrix th { font-weight: 400; color: var(--muted); padding: 2px; text-align: center; white-space: nowrap; line-height: 1.2; }
table.matrix th.n { text-align: left; position: sticky; left: 0; background: var(--surface); padding-right: 8px; color: var(--ink); font-size: 13px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
table.matrix td { width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--faint); position: relative; }
table.matrix td.ok { background: var(--ok-dot); box-shadow: none; }
table.matrix td.late { background: var(--lilac-deep); box-shadow: none; }
table.matrix td i { position: absolute; inset: 7px; border-radius: 50%; background: #fff; opacity: .9; }
table.matrix td.na { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.qrow { padding: 14px 0; }
.qrow + .qrow { border-top: 1px solid var(--line); }
.qrow .refs { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.person { padding: 14px 0; }
.person + .person { border-top: 1px solid var(--line); }
.person .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- Tab-Leiste (schwebend) ---------- */
nav.tabs { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 12px); display: flex; justify-content: center; z-index: 10; pointer-events: none; padding: 0 14px; }
nav.tabs .in { pointer-events: auto; display: flex; gap: 2px; padding: 6px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 14px 34px -12px rgba(20, 20, 10, .28), 0 0 0 1px var(--line); }
nav.tabs a { text-decoration: none; color: var(--muted); display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500; transition: background .2s var(--ease), color .2s; }
nav.tabs a svg { width: 22px; height: 22px; flex: none; }
nav.tabs a span { display: none; }
nav.tabs a.on { background: var(--cta); color: var(--cta-ink); padding: 0 18px 0 14px; }
nav.tabs a.on span { display: inline; }

/* ---------- Anmeldung ---------- */
.welcome { margin: calc(-18px - env(safe-area-inset-top)) -18px 0; padding: calc(env(safe-area-inset-top) + 30px) 24px 90px; position: relative; overflow: hidden;
  background: linear-gradient(170deg, #dfee8a 0%, #cbe4b8 42%, #aed3ef 100%); color: #121212; min-height: 380px; border-radius: 0 0 40px 40px; }
.welcome .brandline { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 17px; position: relative; z-index: 2; }
.welcome .brandline img { width: 34px; height: 34px; border-radius: 11px; }
.welcome .art { pointer-events: none; position: absolute; right: -54px; top: 24px; width: 250px; transform: rotate(-12deg); opacity: .95; }
.welcome h1 { position: relative; margin-top: 170px; font-size: clamp(38px, 11vw, 48px); max-width: 11ch; }
.welcome p { position: relative; margin-top: 12px; font-size: 15px; color: rgba(18, 18, 18, .7); max-width: 30ch; }
.welcome.compact { min-height: 0; padding-bottom: 70px; }
.welcome.compact h1 { margin-top: 70px; font-size: 34px; }
.welcome.compact .art { width: 200px; top: 30px; right: -30px; }
.sheet { position: relative; margin-top: -54px; background: var(--surface); border-radius: var(--r-xl); padding: 22px 20px; box-shadow: var(--shadow); }
.sheet .links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 14px; flex-wrap: wrap; }
.sheet .links a { color: var(--ink); text-decoration: none; }
.sheet .links a.muted { color: var(--muted); }
.foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 26px; line-height: 1.7; }
.foot a { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 84px); transform: translateX(-50%); background: var(--cta); color: var(--cta-ink);
  padding: 12px 18px; border-radius: 999px; font-size: 14px; z-index: 20; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .35); max-width: calc(100% - 36px); text-align: center; }
.spinner { padding: 30px 0; }
.skel { border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Bewegung: ruhiges Einblenden, nur bei Ansichtswechsel ---------- */
@media (prefers-reduced-motion: no-preference) {
  .enter > * { animation: rise .42s var(--ease) both; }
  .enter > *:nth-child(2) { animation-delay: .04s; }
  .enter > *:nth-child(3) { animation-delay: .08s; }
  .enter > *:nth-child(4) { animation-delay: .12s; }
  .enter > *:nth-child(5) { animation-delay: .16s; }
  .enter > *:nth-child(n+6) { animation-delay: .2s; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}

/* ---------- Sprache ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.langsw { margin-left: auto; display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .55); }
.langsw button { appearance: none; border: 0; background: transparent; border-radius: 999px; padding: 0 12px; min-height: 40px; font-size: 13px; font-weight: 500; cursor: pointer; color: #121212; min-width: 48px; }
.langsw button.on { background: #121212; color: #fff; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.seg button { appearance: none; border: 0; background: transparent; border-radius: 999px; min-height: 42px; font-size: 15px; cursor: pointer; color: var(--ink); }
.seg button.on { background: var(--cta); color: var(--cta-ink); }
.tile .ref .syn { display: block; font-size: 13px; letter-spacing: 0; margin-top: 2px; opacity: .7; }
.qlang { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.qlang .chip { margin-top: 10px; min-width: 38px; justify-content: center; }
optgroup { font-weight: 600; }

/* ---------- Fehlerseite, Menü ---------- */
.errorbox { text-align: center; padding: 30px 22px; }
.errorbox img { width: 120px; height: auto; margin: 0 auto 10px; display: block; }
.errorbox p { margin: 8px 0 18px; }
details.more { display: inline-block; }
details.more > summary { display: inline-flex; padding: 0 16px; border-radius: 999px; background: var(--surface-2); font-size: 14px; }
details.more[open] > .actions { margin-top: 8px; }
.msg.small { font-size: 13px; }

/* ---------- Dunkelmodus: Pastelle etwas gedämpft, damit nichts grell wirkt ---------- */
@media (prefers-color-scheme: dark) {
  :root { --lime: #bfcf6d; --lilac: #a897ec; --sky: #98bcd8; --rose: #dda4c1; --lime-deep: #a4bb3f; --lilac-deep: #8a74e8; --faint: #6e6e67; }
  .hero::before, .hero::after { opacity: .85; }
  .cal button.ok, .cal button.late { box-shadow: none; }
  :root { --ok-dot: #a4bb3f; }
}
