/* Haluna – Aussehen.
   Leitidee: Eine Sache auf einmal. Der Startbildschirm zeigt das, was jetzt dran ist, groß in Indigo;
   alles andere ist ruhig und zurückhaltend. Jedes Modul hat eine eigene Farbe, damit man es ohne
   Lesen wiedererkennt. Schrift: Atkinson Hyperlegible Next (für gute Lesbarkeit entwickelt). */

@font-face {
  font-family: 'Atkinson';
  src: url('/fonts/atkinson-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson';
  src: url('/fonts/atkinson-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson';
  src: url('/fonts/atkinson-800.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg: #eef0f7;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --ink: #1e2147;
  --ink-soft: #5a5e83;
  --line: #d9dcea;
  --focus-bg: #262a5c;
  --focus-ink: #ffffff;
  --focus-soft: #c3c6ec;
  --danger: #b8372f;

  --med: #138a78;
  --med-tint: #d5f0eb;
  --vertrag: #b8720a;
  --vertrag-tint: #fbebcb;
  --notiz: #6b4fd8;
  --notiz-tint: #e7e0fb;
  --tagebuch: #2667c9;
  --tagebuch-tint: #dce8fb;
  --termin: #c23a6b;
  --ablage: #3f7d20;
  --ablage-tint: #e1efd8;
  --beleg: #8a5a2b;
  --beleg-tint: #f1e5d8;
  --zyklus: #c2543a;
  --zyklus-tint: #fbe4dc;
  --packen: #0b78a6;
  --packen-tint: #d7edf7;

  --radius-big: 28px;
  --radius: 16px;
  --radius-small: 10px;
  --gutter: 20px;
  --tap: 52px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #15172e;
    --surface: #1f2240;
    --surface-2: #262a4c;
    --ink: #ecedf7;
    --ink-soft: #a3a7c8;
    --line: #353a63;
    --focus-bg: #e6e4ff;
    --focus-ink: #1e2147;
    --focus-soft: #4e5284;
    --danger: #ff8a80;
    --med: #4fd1bb;
    --med-tint: #1b3d3d;
    --vertrag: #f2b44a;
    --vertrag-tint: #3e3322;
    --notiz: #a996ff;
    --notiz-tint: #2f2a55;
    --tagebuch: #7fb0ff;
    --tagebuch-tint: #1f2f55;
    --termin: #ff86b0;
    --ablage: #9bd27a;
    --ablage-tint: #263a22;
    --beleg: #e0b48a;
    --beleg-tint: #3a2e24;
    --zyklus: #ff9f86;
    --zyklus-tint: #422922;
    --packen: #74c8ef;
    --packen-tint: #1b3546;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #15172e;
  --surface: #1f2240;
  --surface-2: #262a4c;
  --ink: #ecedf7;
  --ink-soft: #a3a7c8;
  --line: #353a63;
  --focus-bg: #e6e4ff;
  --focus-ink: #1e2147;
  --focus-soft: #4e5284;
  --danger: #ff8a80;
  --med: #4fd1bb;
  --med-tint: #1b3d3d;
  --vertrag: #f2b44a;
  --vertrag-tint: #3e3322;
  --notiz: #a996ff;
  --notiz-tint: #2f2a55;
  --tagebuch: #7fb0ff;
  --tagebuch-tint: #1f2f55;
  --termin: #ff86b0;
  --ablage: #9bd27a;
  --ablage-tint: #263a22;
  --beleg: #e0b48a;
  --beleg-tint: #3a2e24;
  --zyklus: #ff9f86;
  --zyklus-tint: #422922;
  --packen: #74c8ef;
  --packen-tint: #1b3546;
  color-scheme: dark;
}

/* ---------- Grundgerüst ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Atkinson', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

.app {
  max-width: 34rem;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) var(--gutter) calc(env(safe-area-inset-bottom) + 120px);
  outline: none;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}
h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.15rem;
  font-weight: 700;
}
p {
  margin: 0;
}

a {
  color: inherit;
}

.i {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 3px solid var(--notiz);
  outline-offset: 2px;
  border-radius: var(--radius-small);
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--ink-soft);
}
.small {
  font-size: 0.875rem;
}
.stack > * + * {
  margin-top: 12px;
}
.space {
  margin-top: 32px;
}

/* ---------- Kopfzeilen ---------- */

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  margin-bottom: 20px;
}
.top h1 {
  flex: 1;
}
.top .date {
  flex: 1;
  color: var(--ink-soft);
  font-weight: 700;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover {
  background: var(--surface);
}
.top .icon-btn:first-child {
  margin-left: -14px;
}
.top .icon-btn:last-child {
  margin-right: -14px;
}

/* ---------- Knöpfe ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.btn.wide {
  width: 100%;
}
.btn.quiet {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line);
}
.btn.text {
  background: transparent;
  color: var(--ink-soft);
  padding: 0 12px;
}
.btn.danger {
  background: transparent;
  color: var(--danger);
  box-shadow: inset 0 0 0 2px currentColor;
}
.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-row .btn {
  flex: 1;
}

/* ---------- Heute: die eine Sache, die jetzt dran ist ---------- */

.greeting {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.now {
  position: relative;
  padding: 24px 24px 20px;
  border-radius: var(--radius-big);
  background: var(--focus-bg);
  color: var(--focus-ink);
  overflow: hidden;
}
.now .kind {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--focus-soft);
  font-weight: 700;
}
.now .kind .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--kind, var(--focus-soft));
}
.now .title {
  margin: 14px 0 4px;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
/* Notiz-Titel auf „Heute“: sieht aus wie der Titel, lässt sich aber antippen (öffnet die Notiz) */
.now .title-open {
  display: inline;
  /* größere Tippfläche, ohne dass sich der Abstand ändert (Innenabstand bei inline zählt nicht zur Zeilenhöhe) */
  margin: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--focus-soft);
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.now .title-open:disabled {
  opacity: 0.7;
}
.now .detail {
  color: var(--focus-soft);
  font-size: 1.05rem;
}
.now .actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  align-items: center;
}
.now .go {
  flex: 1;
  min-height: 64px;
  border: 0;
  border-radius: 999px;
  background: var(--focus-ink);
  color: var(--focus-bg);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}
.now .later {
  min-height: 64px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--focus-soft);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.now.calm {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line);
}
.now.calm .title {
  font-size: 1.6rem;
}
.now.calm .detail {
  color: var(--ink-soft);
}

/* Erledigt: Haken wächst, Karte gleitet weg. Die einzige Bewegung, die von selbst passiert. */
.now.done .title,
.now.done .detail,
.now.done .actions,
.now.done .kind {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.now .tick {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}
.now .tick .i {
  width: 96px;
  height: 96px;
  stroke-width: 2.5;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
}
.now.done .tick {
  opacity: 1;
}
.now.done .tick .i {
  transition: stroke-dashoffset 0.45s 0.1s ease-out;
  stroke-dashoffset: 0;
}

.kind-med {
  --kind: var(--med);
}
.kind-contract {
  --kind: var(--vertrag);
}
.kind-note {
  --kind: var(--notiz);
}

/* ---------- Danach: höchstens zwei weitere Dinge ---------- */

.after {
  margin-top: 28px;
}
.after h2 {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 1rem;
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 0;
  border-bottom: 2px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.rows > li:last-child .row,
.rows > .row:last-child {
  border-bottom: 0;
}
.row .mark {
  width: 6px;
  align-self: stretch;
  border-radius: 3px;
  background: var(--kind, var(--line));
  flex: none;
}
.row .body {
  flex: 1;
  min-width: 0;
}
.row .body .t,
.row .body .s {
  display: block;
}
.row .body .t {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.row .body .s {
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.row .meta {
  color: var(--ink-soft);
  font-weight: 700;
  white-space: nowrap;
}
.row .meta.warn {
  color: var(--vertrag);
}
button.row {
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.more-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--ink-soft);
  font-weight: 700;
}

/* ---------- Modul-Kacheln ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 36px;
}
.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 120px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--tint);
  color: var(--ink);
  text-decoration: none;
}
.tile .i {
  width: 30px;
  height: 30px;
  color: var(--kind);
}
.tile .name,
.tile .info {
  display: block;
}
.tile .name {
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.2;
}
.tile .info {
  color: var(--ink-soft);
  font-size: 0.875rem;
  margin-top: 2px;
}
.m-medikamente {
  --kind: var(--med);
  --tint: var(--med-tint);
}
.m-vertraege {
  --kind: var(--vertrag);
  --tint: var(--vertrag-tint);
}
.m-notizen {
  --kind: var(--notiz);
  --tint: var(--notiz-tint);
}
.m-tagebuch {
  --kind: var(--tagebuch);
  --tint: var(--tagebuch-tint);
}
.kind-diary {
  --kind: var(--tagebuch);
}

/* Weitere Bereiche unter den großen Kacheln: kleine runde Knöpfe, ruhig, immer sichtbar */
/* Rechts bleibt immer so viel frei, wie der Knopf „+ Neu“ breit ist – so liegt nie ein Symbol dahinter,
   egal wie viele es sind (die Reihe bricht stattdessen um). Breite siehe .fab weiter unten. */
:root {
  --fab-space: 124px;
}
@media (max-height: 700px), (max-width: 360px) {
  :root {
    --fab-space: 68px;
  }
}
.mini-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 8px;
  margin-top: 20px;
  padding-right: var(--fab-space);
}
.mini-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 4px 2px;
  color: var(--ink);
  text-decoration: none;
  text-align: center;
}
.mini-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--tint);
}
.mini-icon .i {
  width: 24px;
  height: 24px;
  color: var(--kind);
}
.mini-name {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
}
.link-quiet {
  display: block;
  min-height: 44px;
  /* links, damit der Knopf „+ Neu“ rechts ihn nicht verdeckt */
  margin: 12px 0 0;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Startseite anpassen (Fenster) ---------- */

.area-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.area-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid var(--line);
}
.area-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 10px 0;
  color: inherit;
  text-decoration: none;
}
.area-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: var(--radius-small);
  background: var(--tint);
}
.area-icon .i {
  width: 26px;
  height: 26px;
  color: var(--kind);
}
.area-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.area-text span {
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.star-btn {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--line);
  cursor: pointer;
}
.star-btn .i {
  width: 28px;
  height: 28px;
}
.star-btn.on {
  color: var(--vertrag);
}
.star-btn.on .i {
  fill: currentColor;
}

/* ---------- Ein „+“ für alles ---------- */

.quick-targets {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.quick-targets .btn .i {
  width: 22px;
  height: 22px;
}
.quick-hint {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.quick-more {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* ---------- Startpakete (Einführung) ---------- */

.packages {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.package {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.package .i {
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--ink-soft);
}
.package .text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.package .text strong {
  font-size: 1.05rem;
}
.package .text span {
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.package[aria-pressed='true'] {
  border-color: var(--focus-bg);
  background: var(--focus-soft);
}
.package[aria-pressed='true'] .i {
  color: var(--focus-bg);
}
/* Häkchen rechts nur, wenn gewählt */
.package > .i:last-child {
  visibility: hidden;
}
.package[aria-pressed='true'] > .i:last-child {
  visibility: visible;
}

/* ---------- Schnell-Notiz-Knopf (immer unten) ---------- */

.fab {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 28px 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--notiz);
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 30px -10px rgba(40, 20, 120, 0.55);
  z-index: 5;
}
:root[data-theme='dark'] .fab {
  color: #15172e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .fab {
    color: #15172e;
  }
}
/* Rechts unten statt mittig: verdeckt so kaum Inhalt. Auf breiten Bildschirmen bleibt er am Rand der App-Spalte. */
.fab {
  left: auto;
  right: max(calc(env(safe-area-inset-right) + 16px), calc((100vw - 34rem) / 2 + 8px));
  transform: none;
}
/* Kleine Handys: nur ein rundes „+“ (der Name steht für Screenreader im aria-label) */
@media (max-height: 700px), (max-width: 360px) {
  .fab {
    width: 60px;
    padding: 0;
    justify-content: center;
  }
  .fab .fab-label {
    display: none;
  }
  .fab .i {
    width: 28px;
    height: 28px;
  }
}

/* ---------- Formulare ---------- */

.field {
  display: block;
  margin-top: 20px;
}
.field > span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}
.field .hint {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.875rem;
}
input[type='text'],
input[type='email'],
input[type='password'],
input[type='date'],
input[type='time'],
input[type='number'],
input[type='datetime-local'],
select,
textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.45;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--notiz);
}
.inline {
  display: flex;
  gap: 10px;
}
.inline > * {
  flex: 1;
}
.form-actions {
  margin-top: 32px;
}
.error {
  margin-top: 16px;
  color: var(--danger);
  font-weight: 700;
}

/* Auswahl als große Knöpfe (statt Dropdowns) */
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.choice {
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.choice[aria-pressed='true'] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

/* Uhrzeiten eines Medikaments */
.times {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.time-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-left: 4px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.time-chip input {
  width: auto;
  min-height: 44px;
  border: 0;
  padding: 0 4px 0 10px;
  background: transparent;
}
.time-chip .icon-btn {
  width: 40px;
  height: 40px;
}

/* ---------- Medikamente: heutige Einnahmen ---------- */

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.check {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 68px;
  padding: 10px 0;
  border: 0;
  border-bottom: 2px solid var(--line);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.checklist li:last-child .check {
  border-bottom: 0;
}
.check .box {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--med);
  color: transparent;
  flex: none;
}
.check .box .i {
  stroke-width: 3;
}
.check.is-taken .box {
  background: var(--med);
  color: var(--surface);
}
.check.is-skipped .box {
  border-style: dashed;
  border-color: var(--ink-soft);
}
.check.is-taken .t,
.check.is-skipped .t {
  color: var(--ink-soft);
}
.check .time {
  font-weight: 800;
  min-width: 3.2em;
}
.check .t {
  font-weight: 700;
}

.progress {
  display: flex;
  gap: 6px;
  margin: 4px 0 20px;
}
.progress span {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--line);
}
.progress span.on {
  background: var(--med);
}

/* ---------- Verträge ---------- */

.deadline-hero {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--vertrag-tint);
}
.deadline-hero .big {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
}
.deadline-hero.cancelled {
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line);
}
.facts {
  margin: 20px 0 0;
}
.facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 2px solid var(--line);
}
.facts dt {
  color: var(--ink-soft);
}
.facts dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}
.preview-line {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: var(--radius-small);
  background: var(--vertrag-tint);
  font-weight: 700;
}

/* ---------- Notizen ---------- */

.note-row.plain {
  display: block;
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.note-row .t {
  display: block;
}
.note-row .when {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--notiz);
  font-size: 0.875rem;
  font-weight: 700;
}
.note-row .when .i {
  width: 16px;
  height: 16px;
}
.note-done {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--notiz);
  background: transparent;
  color: transparent;
  cursor: pointer;
  flex: none;
}
.note-done.on {
  background: var(--notiz);
  color: var(--surface);
}
.note-done .i {
  stroke-width: 3;
}
textarea.note-text {
  min-height: 160px;
  overflow-y: auto;
  font-size: 1.05rem;
}
.day-choice {
  min-width: 48px;
  padding: 0 10px;
}
details.done-list {
  margin-top: 28px;
}
details.done-list summary {
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
  min-height: var(--tap);
  display: flex;
  align-items: center;
}

/* ---------- Tagebuch ---------- */

a.now {
  display: block;
  text-decoration: none;
}
textarea.tall {
  min-height: 220px;
}

.moods {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.mood {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 72px;
  padding: 8px 2px;
  border: 2px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}
.mood .face {
  font-size: 1.6rem;
  line-height: 1.2;
}
.mood[aria-pressed='true'] {
  border-color: var(--tagebuch);
  background: var(--tagebuch-tint);
  color: var(--ink);
  font-weight: 700;
}

.diary-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.diary-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.diary-head .face {
  font-size: 2rem;
}

/* KI-Bereiche: blauer Rand links, damit klar ist, was von der KI kommt */
.ai-box {
  margin-top: 28px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--tagebuch-tint);
}
.ai-box h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.ai-box h2 .i {
  color: var(--tagebuch);
}
.ai-box .question {
  margin-top: 16px;
  font-weight: 700;
}
.ai-box textarea {
  min-height: 84px;
  margin-top: 6px;
}
.ai-box .qa-done dt {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.ai-box .qa-done dd {
  margin: 2px 0 0;
}
.summary-box {
  margin-top: 0;
}
.summary-box h2 .grow {
  flex: 1;
}
.summary-box textarea {
  min-height: 220px;
  font-size: 1.05rem;
  line-height: 1.6;
}
.summary-box .btn-row {
  margin-top: 12px;
}

/* Zeichen-Zähler unter Textfeldern */
.char-count {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.char-count.near {
  color: var(--danger);
  font-weight: 700;
}
.summary-box .diary-text {
  font-size: 1.05rem;
  line-height: 1.6;
}
details.told {
  margin-top: 20px;
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
}
details.told summary {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
}
details.told summary {
  list-style: none;
}
details.told summary::-webkit-details-marker {
  display: none;
}
details.told summary::after {
  content: '+';
  margin-left: auto;
  font-size: 1.5rem;
  font-weight: 400;
}
details.told[open] summary::after {
  content: '−';
}
details.told .diary-text {
  margin-bottom: 14px;
}
.told-q {
  display: block;
  margin-bottom: 2px;
}
.task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 2px solid color-mix(in srgb, var(--tagebuch) 25%, transparent);
}
.task-row .t {
  flex: 1;
  font-weight: 700;
}
.task-row .btn {
  min-height: 44px;
  padding: 0 16px;
}
.ai-meta {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.btn.ai {
  background: var(--tagebuch);
  color: #fff;
}
:root[data-theme='dark'] .btn.ai {
  color: #15172e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .btn.ai {
    color: #15172e;
  }
}

.help-box {
  margin-bottom: 20px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 3px var(--tagebuch);
}
.help-box h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.help-box p {
  margin-top: 8px;
}
.help-box a {
  font-weight: 800;
}

/* ---------- Kalender ---------- */

.m-kalender {
  --kind: var(--ink);
  --tint: var(--surface);
}
.tile.m-kalender {
  box-shadow: inset 0 0 0 2px var(--line);
}
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -8px -14px 8px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-head {
  padding: 4px 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}
.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  min-height: 58px;
  padding: 6px 0 4px;
  border: 0;
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.cal-day .num {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}
.cal-day .marks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3px;
  min-height: 20px;
}
.cal-day .face {
  font-size: 1rem;
  line-height: 1;
  color: var(--tagebuch);
}
.cal-day.is-today .num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
}
.cal-day[aria-selected='true'] {
  box-shadow: inset 0 0 0 3px var(--tagebuch);
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--kind);
}
.cal-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.cal-legend .dot {
  margin-right: 6px;
}
.day-list {
  margin-top: 24px;
}
.day-list h2 {
  margin-bottom: 4px;
}
.day-list .btn {
  margin-top: 16px;
}

/* ---------- Fotos ---------- */

.photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.photo-item {
  position: relative;
}
.photo-open {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
img.thumb {
  display: block;
  width: 76px;
  height: 76px;
  border-radius: var(--radius-small);
  object-fit: cover;
}
.photo-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
}
.photo-remove .i {
  width: 16px;
  height: 16px;
}
.photo-add {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 76px;
  height: 76px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
}
img.photo-full {
  display: block;
  width: 100%;
  max-height: 75dvh;
  object-fit: contain;
  border-radius: var(--radius-small);
}
.wide-photo {
  width: 100%;
  margin-top: 12px;
}
img.photo-large {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: var(--radius);
}
img.mini {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}
.mini-photos {
  display: flex;
  gap: 4px;
  margin: 4px 0;
}
img.row-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-small);
  object-fit: cover;
  flex: none;
}

/* ---------- Meine Sachen (früher „Wo ist was?“ / Belege – gleiche Farbe Grün wie „Wo ist was?“) ---------- */

.m-sachen,
.kind-sachen {
  --kind: var(--ablage);
  --tint: var(--ablage-tint);
}
.m-ablage {
  --kind: var(--ablage);
  --tint: var(--ablage-tint);
}
.m-belege {
  --kind: var(--beleg);
  --tint: var(--beleg-tint);
}
.kind-ablage {
  --kind: var(--ablage);
}
.kind-beleg,
.kind-receipt {
  --kind: var(--beleg);
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.search-field .i {
  color: var(--ink-soft);
}
.search-field input {
  border: 0;
  padding-left: 0;
  background: transparent;
}
.place-hero {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--ablage-tint);
}
.big-place {
  margin-top: 4px;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.beleg-hero {
  background: var(--beleg-tint);
  font-weight: 700;
}

/* ---------- Sperrbildschirm ---------- */

.lockscreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 6vh;
  text-align: center;
}
.lock-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--focus-bg);
  color: var(--focus-ink);
}
.lock-icon .i {
  width: 34px;
  height: 34px;
}
.pin-dots {
  display: flex;
  gap: 14px;
  min-height: 20px;
  margin-top: 8px;
}
.pin-dots i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--ink-soft);
}
.pin-dots i.on {
  background: var(--ink);
  border-color: var(--ink);
}
.lock-status {
  min-height: 1.5em;
  color: var(--danger);
  font-weight: 700;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  gap: 14px;
  margin: 4px 0 12px;
}
.keypad button {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
}
.keypad button .i {
  width: 32px;
  height: 32px;
  color: var(--notiz);
}
.lockscreen .btn {
  max-width: 280px;
}

/* ---------- Termine ---------- */

.kind-event {
  --kind: var(--termin);
}
.quick-ai {
  margin: 0 0 8px;
}
.quick-ai p {
  margin-bottom: 10px;
}
textarea.short {
  min-height: 72px;
}
.check-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 8px;
  font-weight: 700;
}
.check-line input {
  width: 22px;
  height: 22px;
  accent-color: var(--ink);
}
input:disabled {
  opacity: 0.45;
}
.event-time {
  font-weight: 800;
  min-width: 3.2em;
}

/* ---------- Einstellungen als Menü ---------- */

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.menu > li + li {
  border-top: 2px solid var(--bg);
}
.menu-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 10px 14px 10px 12px;
  color: inherit;
  text-decoration: none;
}
.menu-row > .i {
  color: var(--ink-soft);
}
.menu-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  flex: none;
}
.menu-text {
  flex: 1;
  min-width: 0;
}
.menu-title {
  display: block;
  font-weight: 700;
}
.menu-status {
  display: block;
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.menu-heading {
  margin: 32px 0 10px;
  color: var(--ink-soft);
  font-size: 1rem;
}
.version-line {
  margin-top: 28px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  text-align: center;
}
.news-entry .current {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
}

/* ---------- Was ist neu ---------- */

.news-entry {
  margin-top: 24px;
}
.news-entry h2 {
  margin-bottom: 6px;
}
.news-entry ul {
  margin: 0;
  padding-left: 1.2em;
}
.news-entry li {
  margin-top: 6px;
}
dialog.sheet .news-entry:first-child {
  margin-top: 0;
}
details.news-entry.old {
  margin-top: 0;
  padding: 14px 0;
  border-bottom: 2px solid var(--line);
}
details.news-entry.old summary {
  font-weight: 700;
  cursor: pointer;
  min-height: 28px;
}
details.news-entry.old ul {
  margin-top: 8px;
}
ul.news-short {
  margin: 0;
  padding-left: 1.2em;
  font-size: 1.05rem;
}
ul.news-short li + li {
  margin-top: 10px;
}
ul.module-offers {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.module-offer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 2px solid var(--line);
}
.module-offer .text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.module-offer .text span {
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.module-offer .btn {
  flex: none;
}

/* ---------- Admin: Nutzung ---------- */

.online-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--line);
  vertical-align: middle;
}
.online-dot.on {
  background: var(--med);
  box-shadow: 0 0 0 3px var(--med-tint);
}
.hour-chart {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  align-items: end;
  gap: 2px;
  height: 120px;
  margin-top: 12px;
}
.hour-chart .bar {
  position: relative;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: var(--focus-soft);
}
.hour-chart .bar.quiet {
  background: var(--med);
}
.hour-chart .bar.night {
  opacity: 0.45;
}
.hour-axis {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.6875rem;
  text-align: center;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.chip {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.8125rem;
}
.feedback-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.feedback-list li {
  padding: 14px 0;
  border-bottom: 2px solid var(--line);
}
.feedback-list li.unread .feedback-text {
  font-weight: 700;
}
.feedback-text {
  margin: 6px 0;
  white-space: pre-wrap;
}
.feedback-list .btn-row {
  margin-top: 8px;
}
.badge {
  display: inline-block;
  min-width: 22px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--danger);
  color: var(--surface);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
}

/* ---------- Datenschutzerklärung ---------- */

.legal h2 {
  margin-top: 28px;
}
.legal p,
.legal li {
  line-height: 1.55;
}
.legal ul {
  padding-left: 1.2em;
}
.legal address {
  font-style: normal;
  white-space: pre-line;
}
dialog.sheet {
  max-height: 85dvh;
  overflow-y: auto;
}

/* ---------- Admin ---------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stat {
  padding: 14px 12px;
  border-radius: var(--radius);
  background: var(--surface);
}
.stat strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
}
.stat span {
  color: var(--ink-soft);
  font-size: 0.8rem;
}
.server-status {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
}
.server-status ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.server-status li {
  margin-top: 6px;
  font-weight: 700;
}
.server-status li.ok {
  color: var(--med);
}
.server-status li.bad {
  color: var(--danger);
}
.admin-users {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.admin-users > li {
  padding: 16px 0;
  border-bottom: 2px solid var(--line);
}
.admin-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
/* Personen aufklappbar: zu = Name + zuletzt online, auf = alle Zahlen */
.admin-users > li:has(> details.admin-user) {
  padding: 0;
}
details.admin-user summary {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: var(--tap);
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
}
details.admin-user summary::-webkit-details-marker {
  display: none;
}
details.admin-user summary::after {
  content: '+';
  margin-left: auto;
  padding-left: 12px;
  font-size: 1.5rem;
  color: var(--ink-soft);
}
details.admin-user[open] summary::after {
  content: '−';
}
.admin-sum {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.admin-head {
  flex-wrap: wrap;
}
.admin-user-body {
  padding: 0 0 16px;
}
.admin-nums {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 10px 0 0;
}
.admin-nums dt {
  color: var(--ink-soft);
  font-size: 0.8rem;
}
.admin-nums dd {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
}

/* ---------- Infos (KI, Datenschutz) ---------- */

h2.with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}
h2.with-icon .i {
  color: var(--tagebuch);
}
.info-list {
  margin: 12px 0 0;
}
.info-list div {
  padding: 12px 0;
  border-bottom: 2px solid var(--line);
}
.info-list div:last-child {
  border-bottom: 0;
}
.info-list dt {
  font-weight: 700;
}
.info-list dd {
  margin: 2px 0 0;
  color: var(--ink-soft);
}
.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  border-bottom: 2px solid var(--line);
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

/* ---------- Unten aufgehendes Fenster (Schnell-Notiz, Rückfragen) ---------- */

dialog.sheet {
  width: 100%;
  max-width: 34rem;
  margin: auto auto 0;
  padding: 24px var(--gutter) calc(env(safe-area-inset-bottom) + 24px);
  border: 0;
  border-radius: var(--radius-big) var(--radius-big) 0 0;
  background: var(--surface);
  color: var(--ink);
}
dialog.sheet::backdrop {
  background: rgba(15, 17, 40, 0.45);
}
dialog.sheet[open] {
  animation: sheet-in 0.22s ease-out;
}
@keyframes sheet-in {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.sheet-head .icon-btn {
  margin-right: -12px;
}

/* ---------- Modul-Auswahl (beim ersten Start und in den Einstellungen) ---------- */

.picker {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}
.pick {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px;
  border: 3px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pick .icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--tint);
  color: var(--kind);
  flex: none;
}
.pick .icon .i {
  width: 28px;
  height: 28px;
}
.pick .text {
  flex: 1;
}
.pick .text strong {
  display: block;
  font-size: 1.1rem;
}
.pick .text span {
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.pick .state {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  color: transparent;
  flex: none;
}
.pick[aria-pressed='true'] {
  border-color: var(--kind);
}
.pick[aria-pressed='true'] .state {
  background: var(--kind);
  border-color: var(--kind);
  color: var(--surface);
}
.pick .state .i {
  width: 18px;
  height: 18px;
  stroke-width: 3;
}

.intro {
  padding-top: 24px;
}
.intro .logo {
  width: 56px;
  height: 56px;
  color: var(--notiz);
}
.intro h1 {
  margin-top: 20px;
  font-size: 2rem;
}
.intro p {
  margin-top: 10px;
  color: var(--ink-soft);
}

/* ---------- Einstellungen ---------- */

.section {
  margin-top: 36px;
}
.section > h2 {
  margin-bottom: 4px;
}
.switch-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 8px 0;
  border-bottom: 2px solid var(--line);
}
.switch-row:last-child {
  border-bottom: 0;
}
.switch-row .text {
  flex: 1;
}
.switch-row .text span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.switch {
  position: relative;
  width: 56px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  flex: none;
}
.switch::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform 0.15s ease;
}
.switch[aria-checked='true'] {
  background: var(--ink);
}
.switch[aria-checked='true']::after {
  transform: translateX(24px);
  background: var(--bg);
}

.notice {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-small);
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line);
}
.notice ol {
  margin: 8px 0 0;
  padding-left: 1.3em;
}

input.time-inline {
  width: auto;
  min-width: 7.5em;
}

/* ---------- Leere Bereiche ---------- */

.empty {
  padding: 32px 0 8px;
}
.empty p {
  color: var(--ink-soft);
  margin: 8px 0 20px;
}

/* ---------- Anmeldung ---------- */

.login {
  padding-top: 8vh;
}

/* ---------- Meldungen ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 96px);
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 14px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  z-index: 20;
}
.toast.with-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 20px;
  white-space: nowrap;
}
.toast-action {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

/* ---------- Wischen (Notizen): rechts = erledigt, links = löschen ---------- */

.swipe {
  position: relative;
  overflow: hidden;
}
.swipe-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  font-weight: 800;
  color: var(--surface);
  visibility: hidden;
}
.swipe-bg .i {
  width: 24px;
  height: 24px;
}
.swipe-bg.right {
  justify-content: flex-start;
  background: var(--notiz);
}
.swipe-bg.left {
  justify-content: flex-end;
  background: var(--danger);
}
.swipe.to-right .swipe-bg.right,
.swipe.to-left .swipe-bg.left {
  visibility: visible;
}
.swipe.armed .swipe-bg {
  font-size: 1.1rem;
}
.swipe > .row {
  position: relative;
  background: var(--bg);
  touch-action: pan-y;
}
.swipe > .row.snap {
  transition: transform 0.2s ease;
}
.swipe-hint {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- „+ Neu“ als Leiste über die ganze Breite (ersetzt den schwebenden Knopf) ----------
   Fester Hintergrund, die Seite endet darüber (.app hat unten genug Abstand) – nichts bleibt dahinter liegen. */
.fab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 10px max(16px, calc((100vw - 34rem) / 2 + 20px)) calc(env(safe-area-inset-bottom) + 10px);
  background: var(--bg);
  border-top: 2px solid var(--line);
}
.fab-bar:has(#fab[hidden]) {
  display: none;
}
.fab-bar .fab {
  position: static;
  transform: none;
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  justify-content: center;
  box-shadow: none;
}
.fab-bar .fab .fab-label {
  display: inline;
}
/* Rechts muss nichts mehr frei bleiben */
:root {
  --fab-space: 0px;
}
/* Flachere Kacheln, wenn darunter noch kleine Symbole kommen */
.tiles.compact .tile {
  min-height: 72px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px;
}
.tiles.compact .tile .i {
  flex: none;
}
/* Immer 2 nebeneinander (nie 3 + 1 übrig), und lange Namen wie „Medikamente“ laufen nicht mehr aus der Kachel */
.tiles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tile > span {
  min-width: 0;
}
.tile .name {
  hyphens: auto;
  overflow-wrap: anywhere;
}
/* Flache Kacheln: Symbol klein über dem Namen – so hat der Name die ganze Breite (passt auch auf schmale Handys) */
.tiles.compact .tile {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  min-height: 0;
  padding: 12px 14px;
}
.tiles.compact .tile .i {
  width: 24px;
  height: 24px;
}
.tiles.compact .tile .name {
  font-size: 1rem;
}

/* ---------- Zyklus (Koralle) ---------- */

.m-zyklus {
  --kind: var(--zyklus);
  --tint: var(--zyklus-tint);
}
.kind-zyklus {
  --kind: var(--zyklus);
}
/* Erwartete Tage: nur ein Ring, nicht ausgefüllt */
.kind-zyklus-guess {
  --kind: transparent;
}
.dot.kind-zyklus-guess {
  box-shadow: inset 0 0 0 2px var(--zyklus);
}
.row.kind-zyklus-guess .mark {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--zyklus);
}
.cycle-hero {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--zyklus-tint);
}
.cycle-hero .label {
  font-weight: 700;
  color: var(--ink-soft);
}
.cycle-hero .big {
  margin: 2px 0 4px;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.05;
}
.cycle-hero .big-line {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
}
.cycle-hero .form-actions {
  margin-top: 16px;
}
/* Ruhiger, durchgehender Zyklus-Balken statt vieler Einzelkästchen */
.cycle-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0;
  margin: 16px 0 8px;
  height: 12px;
  border-radius: 99px;
  background: var(--surface);
  overflow: hidden;
}
.cycle-strip .cd {
  height: 100%;
  background: transparent;
}
.cycle-strip .cd.flow {
  background: var(--zyklus);
}
.cycle-strip .cd.guess {
  background: var(--zyklus);
  opacity: 0.32;
}
.cycle-strip .cd.today {
  background: var(--ink);
  border-radius: 99px;
}
/* „Dein Rhythmus“: zwei ruhige Kästchen nebeneinander + Einstellungs-Zeile */
.cycle-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cycle-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--surface);
}
.cycle-stat .label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.cycle-stat .val {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
}
.cycle-pref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: var(--tap);
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}
.cycle-pref .i {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}
.cycle-add-past {
  margin-top: 12px;
}
/* Ruhiger Hinweis-Kasten (z. B. „Kalender einschalten?“) */
.info-box {
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line);
}
.info-box .btn-row {
  margin-top: 12px;
}

/* ---------- Gemeinsame Notiz-Listen ---------- */

.list-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.list-tabs::-webkit-scrollbar {
  display: none;
}
.list-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.list-tab .i {
  width: 18px;
  height: 18px;
}
.list-tab[aria-current='page'] {
  background: var(--notiz);
  box-shadow: none;
  color: var(--surface);
}
.list-tab.add {
  color: var(--notiz);
}
.list-members {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: -4px 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.list-members .i {
  width: 20px;
  height: 20px;
}
.row .by {
  display: block;
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.invite-code {
  margin: 12px 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--notiz-tint);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  user-select: all;
}
.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--tap);
  border-bottom: 2px solid var(--line);
}
.code-input {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* Gemeinsame Kalender: Zeile zum Verwalten im Fenster „Gemeinsame Kalender“ */
.member-row.plain-row {
  width: 100%;
  padding: 0;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.member-row.plain-row .i {
  width: 20px;
  height: 20px;
  vertical-align: -4px;
}

/* „Kurz erklärt“: Karten zum Durchblättern mit kleinen gezeichneten Bildern */
.guide {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.guide-stage {
  min-height: 420px;
}
.guide-stage h2 {
  margin: 4px 0 8px;
  font-size: 1.5rem;
}
.guide-step {
  margin: 16px 0 0;
}
.guide-picture {
  display: flex;
  justify-content: center;
  padding: 20px 0 4px;
  border-radius: var(--radius-big);
  background: var(--surface-2);
}
.guide-skip {
  margin-left: auto;
}
.guide-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.guide-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}
.guide-dots span.on {
  width: 22px;
  border-radius: 4px;
  background: var(--notiz);
}
.guide-nav {
  display: flex;
  gap: 12px;
}
.guide-nav .btn {
  flex: 1;
}
.guide-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.guide-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.guide-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--kind);
}
.guide-icon .i {
  width: 20px;
  height: 20px;
}
/* Mini-Handy */
.mock-phone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 170px;
  min-height: 200px;
  padding: 14px 12px 0;
  border: 3px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: var(--bg);
}
.mock-line {
  display: block;
  height: 7px;
  width: 80%;
  border-radius: 4px;
  background: var(--line);
}
.mock-line.short {
  width: 45%;
}
.mock-line.light {
  background: var(--focus-soft);
}
.mock-now {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 12px;
  background: var(--focus-bg);
}
.mock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface);
}
.mock-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--notiz);
}
.mock-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.mock-tile {
  height: 26px;
  border-radius: 8px;
}
.mock-tile.t-med {
  background: var(--med-tint);
}
.mock-tile.t-notiz {
  background: var(--notiz-tint);
}
.mock-tile.t-vertrag {
  background: var(--vertrag-tint);
}
.mock-tile.t-cal {
  background: var(--surface);
}
.mock-sheet {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding: 12px 10px;
  border-radius: 12px 12px 0 0;
  background: var(--surface);
}
.mock-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.mock-chip {
  padding: 2px 7px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 0.7rem;
  font-weight: 700;
}
.mock-chip.on {
  background: var(--notiz);
  box-shadow: none;
  color: var(--surface);
}
.mock-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0 -12px;
  padding: 10px;
  background: var(--notiz);
  color: var(--surface);
  font-weight: 800;
}
.mock-fab .i {
  width: 16px;
  height: 16px;
}
.mock-icons {
  display: grid;
  grid-template-columns: repeat(4, 52px);
  gap: 12px;
  padding-bottom: 16px;
}
.mock-icons.single {
  grid-template-columns: 96px;
}
.mock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--tint, var(--surface));
  color: var(--kind, var(--ink));
}
.mock-icon .i {
  width: 28px;
  height: 28px;
}
.mock-icon.big {
  width: 96px;
  height: 96px;
  border-radius: 28px;
}
.mock-icon.big .i {
  width: 52px;
  height: 52px;
}
.mock-share {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
}
.mock-person {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--notiz-tint);
  color: var(--notiz);
}
.mock-person.two {
  background: var(--med-tint);
  color: var(--med);
}
.mock-person .i {
  width: 30px;
  height: 30px;
}
.mock-code {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line);
  font-weight: 800;
  letter-spacing: 0.06em;
}

/* „In 30 Min.“ unter den Knöpfen der großen Karte – ruhig, aber gut zu treffen */
.now .snooze {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  margin-top: 4px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--focus-soft);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.now .snooze .i {
  width: 18px;
  height: 18px;
}

/* Notizen: Erledigtes (unten zugeklappt) mit Knopf „Zurückholen“ */
.row.is-done .t {
  color: var(--ink-soft);
  text-decoration: line-through;
}
.back-btn {
  flex: none;
  align-self: center;
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.9375rem;
}

/* „Nur 5 Minuten anfangen“ */
.starter-btn {
  margin-bottom: 12px;
}
.starter-task {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.starter-bar {
  height: 18px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}
.starter-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: var(--notiz);
  transition: width 1s linear;
}
@media (prefers-reduced-motion: reduce) {
  .starter-fill {
    transition: none;
  }
}
.starter-time {
  margin: 12px 0 0;
  font-size: 2.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.starter-done {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  font-size: 1.5rem;
  font-weight: 800;
}
.starter-done .i {
  width: 28px;
  height: 28px;
  color: var(--med);
}

/* Admin (Testphase): Seiten mit Aufrufen und Zeit */
.page-table {
  width: 100%;
  border-collapse: collapse;
}
.page-table th,
.page-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
.page-table th:first-child,
.page-table td:first-child {
  text-align: left;
  white-space: normal;
}
.page-table th {
  color: var(--ink-soft);
  font-weight: 700;
}

/* Medikamente: Verlauf (seit 1.8.0 als kleine Tabelle – eine Zeile pro Medikament und Uhrzeit, eine Spalte pro Tag) */
.hist-grid {
  width: 100%;
  margin-top: 12px;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
}
.hist-grid th,
.hist-grid td {
  padding: 0;
  text-align: center;
}
.hist-grid thead th {
  padding-bottom: 2px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
}
.hist-grid thead th.is-last {
  color: var(--ink);
}
.hist-grid .hist-name {
  width: 34%;
  padding-right: 6px;
  text-align: left;
  font-weight: 400;
  overflow: hidden;
}
.hist-name .t {
  display: block;
  overflow: hidden;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hist-name .s {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8rem;
}
.hist-cell {
  display: block;
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink-soft);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.hist-cell.is-taken {
  background: var(--med-tint);
  color: var(--med);
}
.hist-cell.is-missed {
  background: var(--vertrag-tint);
  color: var(--vertrag);
}
.hist-cell.is-skipped,
.hist-cell.is-open {
  box-shadow: inset 0 0 0 2px var(--line);
}
.hist-cell.is-none {
  background: transparent;
  cursor: default;
}
.hist-legend {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.hist-legend b {
  margin: 0 2px 0 8px;
}
.hist-legend b:first-child {
  margin-left: 0;
}

/* Tagebuch: für welchen Tag? (antippen → Gestern, Vorgestern, anderer Tag) */
.day-pick-row {
  margin: -4px 0 16px;
}
.day-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
}
.day-pick .i {
  width: 18px;
  height: 18px;
  margin: 0;
}

/* Tagebuch: Rückblick auf Woche oder Monat */
.review-btn.section {
  margin-top: 16px;
}
.review-options {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.review-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.review-option .body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.review-option .t {
  font-weight: 700;
}
.review-option .s {
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.review-option .i {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--tagebuch);
}
.review-option.is-ready {
  border-color: var(--tagebuch);
}
.review-option:disabled {
  opacity: 0.55;
  cursor: default;
}
.review-moods {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 1.5rem;
  line-height: 1;
}
.review-good {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--tagebuch-tint);
}
.review-good h3 {
  margin: 0 0 6px;
}
.review-good ul {
  margin: 0;
  padding-left: 1.2em;
}

/* Startseite anpassen: Bereiche am Griff verschieben */
.area-list.sortable .area-row {
  background: var(--surface);
  /* Die ganze Zeile lässt sich ziehen (Finger: kurz festhalten) – dabei keinen Text markieren, kein Menü */
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.area-list.sortable .area-row.holding {
  background: var(--surface-2);
}
@media (prefers-reduced-motion: no-preference) {
  .area-list.sortable .area-row {
    transition: background-color 0.2s ease;
  }
}
.area-list.sortable .area-row.dragging {
  position: relative;
  z-index: 2;
  border-radius: var(--radius-small);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.18);
}
/* Während des Ziehens: die anderen Zeilen (und der Strich) rutschen weich zur Seite, die gezogene klebt am Finger */
.area-list.is-dragging {
  user-select: none;
  -webkit-user-select: none;
}
.area-list.is-dragging .area-divider {
  position: relative;
  z-index: 1;
  background: var(--surface);
}
@media (prefers-reduced-motion: no-preference) {
  .area-list.is-dragging .area-row:not(.dragging),
  .area-list.is-dragging .area-divider {
    transition: transform 0.18s ease;
  }
}
.drag-handle {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  flex: none;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--ink-soft);
  cursor: grab;
  /* Ziehen statt Scrollen, solange der Finger auf dem Griff liegt */
  touch-action: none;
}
.dragging .drag-handle {
  cursor: grabbing;
}
.drag-handle .i {
  width: 24px;
  height: 24px;
}
.area-divider {
  padding: 14px 0 6px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 700;
  border-bottom: 2px solid var(--line);
}

/* Tagebuch: Verlauf – aktueller Monat offen, frühere Monate/Jahre aufklappbar, Zwischenzeilen pro Woche */
.diary-rows .week-sep {
  padding: 14px 0 2px;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 700;
}
.diary-month,
.diary-year {
  border-bottom: 2px solid var(--line);
}
.diary-month summary,
.diary-year summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  font-weight: 700;
  cursor: pointer;
}
.diary-month summary .grow,
.diary-year summary .grow {
  flex: 1;
}
.diary-month summary .face {
  font-size: 1.25rem;
}
.year-body {
  padding-left: 14px;
}
.year-body .diary-month:last-child {
  border-bottom: 0;
}
.month-body .diary-rows {
  margin-bottom: 8px;
}

/* Geburtstage (im Kalender, gleiche Farbe wie Termine) */
.kind-birthday {
  --kind: var(--termin);
}
.cal-day .cake {
  font-size: 0.8rem;
  line-height: 1;
}
.birthday-date {
  display: grid;
  grid-template-columns: 5em 1fr;
  gap: 8px;
}
.birthday-date input[type='number']:last-child {
  grid-column: 1 / -1;
}
.kind-switch .choices {
  margin: 0;
}
.section.birthdays .btn.quiet {
  margin-top: 12px;
}

/* Termin-Formular: Erinnern, Wiederholen, Weg zugeklappt */
details.more-options {
  margin: 8px 0 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
}
details.more-options summary {
  display: flex;
  align-items: center;
  min-height: 64px;
  cursor: pointer;
}
details.more-options summary .body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
details.more-options summary .t {
  font-weight: 700;
}
details.more-options summary .s {
  color: var(--ink-soft);
  font-size: 0.875rem;
}
details.more-options[open] {
  padding-bottom: 8px;
}

/* Aufklappbare Zeilen (Termin-Formular, Tagebuch-Monate/-Jahre): kleiner Pfeil rechts, zeigt nach unten, wenn offen */
details.more-options summary::after,
.diary-month summary::after,
.diary-year summary::after {
  content: '›';
  margin-left: auto;
  padding-left: 8px;
  color: var(--ink-soft);
  font-size: 1.5rem;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 0.15s;
}
details.more-options[open] > summary::after,
.diary-month[open] > summary::after,
.diary-year[open] > summary::after {
  transform: rotate(-90deg);
}
details.more-options summary::-webkit-details-marker,
.diary-month summary::-webkit-details-marker,
.diary-year summary::-webkit-details-marker {
  display: none;
}
.choice .i {
  margin-right: 6px;
}

/* ---------- Notizen neu (1.6.0): Karten mit Titel und Vorschau, Schreiben, Abhak-Liste, Ordner, Suche, Papierkorb ---------- */

.note-group + .note-group {
  margin-top: 8px;
}
.note-month {
  margin: 18px 4px 8px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  font-weight: 700;
}
.note-cards {
  list-style: none;
  margin: 0;
  padding: 0;
}
.note-cards > li {
  margin-bottom: 8px;
  border-radius: var(--radius);
}
.note-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  touch-action: pan-y;
}
.swipe > .note-card.snap {
  transition: transform 0.2s ease;
}
.note-card .note-done {
  width: 36px;
  height: 36px;
  margin-top: 2px;
  border-width: 2.5px;
}
.note-open {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.note-text-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.note-text-col .nt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 700;
  font-size: 1.0625rem;
  overflow-wrap: anywhere;
}
.note-text-col .np {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}
.note-text-col .nc,
.note-text-col .nm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.note-text-col .nc {
  gap: 6px;
  color: var(--notiz);
  font-weight: 700;
}
.note-text-col .nm > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.note-text-col .nc .i,
.note-text-col .nm .i {
  width: 16px;
  height: 16px;
}
.note-text-col .when {
  color: var(--notiz);
  font-weight: 700;
}
.note-text-col mark {
  border-radius: 3px;
  background: var(--notiz-tint);
  color: inherit;
}
.note-card.is-done .nt {
  color: var(--ink-soft);
  text-decoration: line-through;
}
.note-thumb {
  position: relative;
  flex: none;
}
img.note-thumb-img {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-small);
  object-fit: cover;
}
.note-thumb .more {
  position: absolute;
  right: -4px;
  bottom: -4px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
}
details.done-list .note-cards {
  margin-top: 4px;
}
.trash-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  margin-top: 16px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 700;
  text-decoration: none;
}
.trash-link .grow {
  flex: 1;
}
.trash-link .i {
  width: 20px;
  height: 20px;
}
.trash-info {
  font-size: 0.9375rem;
}
.note-card.trashed {
  align-items: center;
}
.btn.danger-text {
  margin-top: 16px;
  color: var(--danger);
}

/* Ordner: kleiner Farbpunkt */
.fdot {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fc, var(--notiz));
}
.choice .fdot {
  margin-right: 6px;
  vertical-align: 1px;
}
.fc-violett {
  --fc: var(--notiz);
}
.fc-tuerkis {
  --fc: var(--med);
}
.fc-bernstein {
  --fc: var(--vertrag);
}
.fc-koralle {
  --fc: var(--zyklus);
}
.fc-blau {
  --fc: var(--tagebuch);
}
.fc-gruen {
  --fc: var(--ablage);
}
.list-tab[aria-current='page'] .fdot {
  box-shadow: 0 0 0 2px var(--surface);
}

/* Kopfzeile mit mehreren Knöpfen (Suche, Mitglieder, Ordner bearbeiten) */
.top-actions {
  display: flex;
  align-items: center;
}
.top-actions .icon-btn:last-child {
  margin-right: -14px;
}

/* Suche */
.search-top input.note-search {
  flex: 1;
  width: 100%;
  min-height: var(--tap);
  padding: 0 18px;
  border: 2px solid var(--notiz);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.search-top input.note-search:focus {
  outline: none;
}

/* „+“ bei den Reitern: Ordner oder gemeinsame Liste */
.new-choices {
  display: grid;
  gap: 10px;
}
.new-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.new-choice > .i {
  flex: none;
  width: 26px;
  height: 26px;
  color: var(--notiz);
}
.new-choice .body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.new-choice .t {
  font-weight: 700;
}
.new-choice .s {
  color: var(--ink-soft);
  font-size: 0.875rem;
}

/* Schreiben: erste Zeile groß und fett, darunter der Rest – sieht aus wie EIN Feld */
.note-editor {
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.note-editor:focus-within {
  border-color: var(--notiz);
}
.note-editor textarea {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  resize: none;
}
.note-editor textarea.note-title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.3;
}
.note-editor textarea.note-body {
  margin-top: 6px;
  min-height: 3.2em;
  font-size: 1.05rem;
}
/* Leer, darunter eine Abhak-Liste: nur eine Zeile hoch */
.note-editor textarea.note-body.slim {
  min-height: 1.6em;
}
.note-hint {
  margin: 6px 4px 0;
  color: var(--ink-soft);
  font-size: 0.8125rem;
}
.note-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
}
.note-tool {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 96px;
  height: 76px;
  padding: 0 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}
.note-tool .i {
  width: 24px;
  height: 24px;
  color: var(--notiz);
}
details.note-remind {
  margin-top: 14px;
}
details.note-remind summary {
  gap: 12px;
}
details.note-remind summary > .i {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--notiz);
}

/* Abhak-Liste in einer Notiz */
.check-block {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 2px solid var(--line);
}
.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}
.check-box {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2.5px solid var(--notiz);
  border-radius: 8px;
  background: transparent;
  color: transparent;
  cursor: pointer;
}
.check-box .i {
  width: 20px;
  height: 20px;
  stroke-width: 3;
}
.check-box.on {
  background: var(--notiz);
  color: var(--surface);
}
.check-item input.check-text {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 6px 4px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
}
.check-item input.check-text:focus {
  border-bottom-color: var(--notiz);
}
.check-item.done input.check-text {
  color: var(--ink-soft);
  text-decoration: line-through;
}
.check-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--notiz);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.check-add .i,
.check-reset .i {
  width: 20px;
  height: 20px;
}
/* Unter der Liste: links „+ Punkt“, rechts „Alle wieder offen“ (ab 2 Häkchen) */
.check-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
}
.check-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-left: auto;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.check-all-done {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-small);
  background: var(--notiz-tint);
  font-weight: 700;
}
.check-all-done .btn {
  min-height: 44px;
}

/* ---------- 1.9.0: Meine Sachen, „Anders …“-Felder, Tagebuch-Suche ---------- */

/* Unsichtbar, aber für Screenreader da */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.btn.small {
  min-height: 44px;
  padding: 0 16px;
  font-size: 0.9375rem;
}
/* Zahl + Einheit („Anders …“): erscheint unter den Knöpfen */
.amount-field {
  margin-top: 10px;
}
.amount-field input {
  max-width: 110px;
}
.amount-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.amount-line .amount-field {
  flex: 1;
  margin-top: 0;
}
.field .amount-line {
  margin-top: 10px;
}
.intro .intro-claim {
  font-size: 1.15rem;
  font-weight: 700;
}
.search-snippet mark {
  border-radius: 3px;
  background: var(--tagebuch-tint);
  color: inherit;
  font-weight: 700;
}

/* Liste „Meine Sachen“ */
.filter-chips {
  margin: 4px 0 12px;
}
.thing-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.thing-item {
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line);
}
.thing-item .thing-row {
  padding: 12px 14px;
  border-bottom: 0;
  background: transparent;
}
.thing-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}
.thing-lines .tl {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.thing-lines .tl .i {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
}
.thing-lines .tl.due {
  color: var(--vertrag);
  font-weight: 700;
}
.thing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}

/* Eine Sache: Regelmäßiges oben */
.task-card {
  margin-bottom: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--ablage-tint);
}
.task-card.due {
  box-shadow: inset 0 0 0 3px var(--ablage);
}
.task-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 1.15rem;
}
.task-card .task-every {
  color: var(--ink-soft);
}
.task-card .task-due {
  margin: 6px 0 2px;
  font-size: 1.35rem;
  font-weight: 800;
}
.task-card .btn {
  margin-top: 12px;
}
.task-card .link-quiet {
  margin-top: 6px;
}
.task-history summary {
  margin-top: 10px;
  color: var(--ink-soft);
  cursor: pointer;
}
.task-history ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

/* Formular: Abschnitte und Regelmäßiges */
.thing-section {
  margin: 10px 0;
}
.thing-section summary .s {
  overflow-wrap: anywhere;
}
.task-editor {
  margin: 8px 0 14px;
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 2px var(--line);
}

/* ---------- 1.10.0: Packlisten (Himmelblau), Bereiche ein/aus, mehrere Medikamente auf einmal ---------- */

.m-packlisten {
  --kind: var(--packen);
  --tint: var(--packen-tint);
}
.kind-packlisten {
  --kind: var(--packen);
}

/* Startseite anpassen: Schalter rechts in jeder Zeile, ausgeschaltete Bereiche darunter */
.area-list.with-switch .area-row > .switch {
  margin-right: 2px;
}
.area-list.with-switch .area-text strong {
  overflow-wrap: anywhere;
}
.area-row.is-off .area-icon {
  opacity: 0.7;
}
@media (max-width: 420px) {
  .area-list.with-switch .area-link {
    gap: 10px;
  }
  .area-list.with-switch .area-icon {
    width: 38px;
    height: 38px;
  }
  .area-list.with-switch .star-btn,
  .area-list.with-switch .drag-handle {
    width: 44px;
  }
}

/* Medikamente: Kopfzeile über mehreren zur selben Uhrzeit, mit „Alle genommen“ */
.check-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 14px 0 4px;
  color: var(--ink-soft);
  font-weight: 800;
}
.check-group .btn {
  min-height: 44px;
}

/* Packliste: Kopf mit Fortschritt, wann, mit wem */
.pack-head {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--packen-tint);
}
.pack-progress {
  display: block;
  width: 100%;
  height: 10px;
  margin-bottom: 10px;
  border: 0;
  border-radius: 5px;
  background: var(--surface);
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
}
.pack-progress::-webkit-progress-bar {
  background: var(--surface);
  border-radius: 5px;
}
.pack-progress::-webkit-progress-value {
  background: var(--packen);
  border-radius: 5px;
}
.pack-progress::-moz-progress-bar {
  background: var(--packen);
  border-radius: 5px;
}
.pack-status {
  margin: 0 0 6px;
  font-size: 1.125rem;
  font-weight: 800;
}
.pack-when {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.pack-when .i {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--packen);
}
.pack-when > span {
  min-width: 0;
}
.pack-head .list-members {
  margin-top: 4px;
}

/* Tabletten für die Reise */
.pack-meds {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 2px var(--med-tint);
}
.pack-meds h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 1rem;
}
.pack-meds h3 .i {
  width: 20px;
  height: 20px;
  color: var(--med);
}
.pack-meds ul {
  margin: 0 0 6px;
  padding-left: 1.2em;
}
.pack-meds li.warn {
  color: var(--danger);
}
.pack-meds-hint {
  margin: 0 0 14px;
}

/* Punkte zum Abhaken */
.pack-section {
  margin: 18px 0 2px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.pack-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pack-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 0;
  border: 0;
  border-bottom: 2px solid var(--line);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pack-item .t {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.pack-box {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 3px solid var(--packen);
  border-radius: 10px;
  color: transparent;
}
.pack-box .i {
  width: 22px;
  height: 22px;
  stroke-width: 3;
}
.pack-item.done .pack-box {
  background: var(--packen);
  color: var(--surface);
}
.pack-item.done .t {
  color: var(--ink-soft);
  text-decoration: line-through;
}
.pack-add {
  margin: 4px 0 6px;
}
.pack-add .inline input {
  flex: 1;
  min-width: 0;
}
.pack-add .check-add {
  color: var(--packen);
}
.pack-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid var(--line);
}
.pack-edit-row input,
input.pack-edit-section {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
}
input.pack-edit-section {
  display: block;
  width: 100%;
  margin-top: 16px;
  color: var(--ink-soft);
  font-weight: 800;
}
.pack-edit-row input:focus,
input.pack-edit-section:focus {
  border-bottom-color: var(--packen);
}

/* Hinweis mit Knopf: lange Texte umbrechen statt aus dem Bild laufen (1.10.0) */
.toast.with-action {
  width: max-content;
  border-radius: 24px;
  white-space: normal;
}
.toast-action {
  flex: none;
  white-space: nowrap;
}

/* Leiste oben im Browser: „Haluna als App – Installieren“ (install.js) */
.install-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 34rem;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 10px) 8px 10px var(--gutter);
  background: var(--surface);
  border-bottom: 2px solid var(--line);
}
body.with-install-bar .app {
  padding-top: 16px;
}
.install-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 11px;
}
.install-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.install-text span {
  color: var(--ink-soft);
  font-size: 0.8125rem;
}
.install-bar .btn {
  flex: none;
  min-height: 44px;
  white-space: nowrap;
}
.install-bar .icon-btn {
  flex: none;
  width: 44px;
  height: 44px;
  color: var(--ink-soft);
}
@media (max-width: 360px) {
  .install-text span {
    display: none;
  }
}

/* Passwortfeld mit Sichtbarkeits-Auge */
.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrap input {
  padding-right: 52px;
}
.pw-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pw-toggle:hover {
  color: var(--ink);
}
.pw-toggle svg {
  width: 22px;
  height: 22px;
}

/* Roter Schiebe-Balken für Gefahrenzone (wie iPhone-Schieberegler) */
.slide-danger {
  position: relative;
  height: 58px;
  margin-top: 16px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--danger) 42%, var(--line));
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.slide-danger-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: color-mix(in srgb, var(--danger) 28%, transparent);
  pointer-events: none;
}
.slide-danger-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 24px 0 64px;
  color: var(--danger);
  font-weight: 700;
  font-size: 0.9375rem;
  text-align: center;
  pointer-events: none;
}
.slide-danger-thumb {
  position: absolute;
  left: 4px;
  top: 4px;
  z-index: 2;
  width: 50px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}
.slide-danger.dragging .slide-danger-thumb {
  cursor: grabbing;
}
.slide-danger:not(.dragging) .slide-danger-thumb,
.slide-danger:not(.dragging) .slide-danger-fill {
  transition: transform 0.18s ease, width 0.18s ease;
}
.slide-danger.is-done {
  background: var(--danger);
}
.slide-danger.is-done .slide-danger-label {
  color: #fff;
  padding-left: 24px;
}

/* Einladungs-Assistent (erst aufs Handy holen) & Notfall-Code */
.invite-install-card {
  margin-top: 16px;
  padding: 20px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: var(--surface);
}
.invite-install-card h2 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.invite-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: var(--radius-small);
  border: 2px dashed var(--line);
  background: var(--bg);
}
.invite-code-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  word-break: break-all;
}
.code-entry {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}
.text-link {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: underline;
  cursor: pointer;
}
.text-link:hover {
  color: var(--ink);
}

/* Externe Rechtslinks unten (Datenschutz / Impressum / Nutzung auf haluna.app) */
.legal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin: 10px 0 8px;
  font-size: 0.875rem;
}
.legal-foot a {
  color: var(--ink-soft);
  text-decoration: underline;
}
.legal-foot a:hover {
  color: var(--ink);
}

/* Admin: Einmal-Einladungen */
.invite-form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.invite-form-row input {
  flex: 1 1 180px;
}
.invite-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.invite-row {
  padding: 12px 14px;
  border-radius: var(--radius-small);
  border: 2px solid var(--line);
  background: var(--surface);
}
.invite-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.invite-badge {
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg);
}
.invite-badge.open {
  color: var(--notiz);
}
.invite-badge.used {
  color: var(--ink-soft);
}
.invite-badge.expired {
  color: var(--danger);
}
.invite-row-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
