/* MEIN BRAIN – Zentrale Übersicht. Reines CSS, keine Webfonts, keine externen Ressourcen. */

:root {
  color-scheme: light dark;

  --bg: #f1f4f8;
  --flaeche: #ffffff;
  --flaeche-2: #f6f8fb;
  --text: #141c27;
  --text-2: #475466;
  --rand: #d8dee8;
  --rand-stark: #b3bfce;
  --eingabe-rand: #76849a;
  --fokus: #1a5fd1;

  --akzent-knopf: #1d4f9f;
  --akzent-text: #174384;
  --marke: #14284b;
  --marke-2: #234a86;
  --nummer-bg: #14284b;

  --gefahr-voll: #b4232c;
  --gefahr-text: #9c1c24;
  --gefahr-rand: #e0a6a9;

  --schatten: 0 1px 2px rgba(16, 24, 40, 0.06), 0 6px 16px rgba(16, 24, 40, 0.05);

  --rand-l: max(16px, env(safe-area-inset-left));
  --rand-r: max(16px, env(safe-area-inset-right));

  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1017;
    --flaeche: #151c26;
    --flaeche-2: #1a2330;
    --text: #e8edf4;
    --text-2: #a9b6c6;
    --rand: #263143;
    --rand-stark: #3a485c;
    --eingabe-rand: #75849b;
    --fokus: #8db8f7;

    --akzent-knopf: #346fc9;
    --akzent-text: #8db8f7;
    --marke: #0d1a33;
    --marke-2: #1a3868;
    --nummer-bg: #34588f;

    --gefahr-voll: #c0353d;
    --gefahr-text: #ff9a9f;
    --gefahr-rand: #7a3238;

    --schatten: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.25);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--schrift);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4,
p,
ol,
ul {
  margin-top: 0;
}

[tabindex="-1"]:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--fokus);
  outline-offset: 2px;
}

button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nur-lesen {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sprung {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--flaeche);
  color: var(--akzent-text);
  font-weight: 600;
}

.sprung:focus {
  top: 8px;
}

.noscript {
  padding: 16px;
  background: #fff3cd;
  color: #3d2e00;
}

/* ---------- Bereichsfarben (Farbton je Bereich, Kontraste für Text geprüft) ---------- */

:root {
  --h: 220;
  --s: 10%;
}

[data-bereich="inb"] {
  --h: 215;
  --s: 58%;
}
[data-bereich="veyrento"] {
  --h: 185;
  --s: 60%;
}
[data-bereich="regenbogen"] {
  --h: 335;
  --s: 55%;
}
[data-bereich="ferienwohnung"] {
  --h: 30;
  --s: 62%;
}
[data-bereich="weitere"] {
  --h: 265;
  --s: 48%;
}
[data-bereich="privat"] {
  --h: 220;
  --s: 9%;
}
[data-bereich="system"] {
  --h: 150;
  --s: 42%;
}

[data-bereich] {
  --b-streifen: hsl(var(--h) var(--s) 42%);
  --b-voll: hsl(var(--h) var(--s) 32%);
  --b-voll-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
  [data-bereich] {
    --b-streifen: hsl(var(--h) var(--s) 62%);
    --b-voll: hsl(var(--h) var(--s) 26%);
    --b-voll-text: hsl(var(--h) 80% 91%);
  }
}

/* ---------- Markenband und Kopf ---------- */

.marke-band,
.kopf {
  background: linear-gradient(160deg, var(--marke-2) 0%, var(--marke) 70%);
  color: #ffffff;
}

.marke-band {
  padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--rand-r) 12px var(--rand-l);
}

.kopf {
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 0 24px;
}

.kopf-innen {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--rand-r) 0 var(--rand-l);
}

.kopf-leiste {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.marke {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1280px;
  margin: 0 auto;
}

.kopf-leiste .marke {
  margin: 0;
}

.marke-symbol {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex: none;
}

.marke-name {
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
}

.knopf-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
  touch-action: manipulation;
}

.knopf-icon:hover {
  background: rgba(255, 255, 255, 0.2);
}

.knopf-icon:focus-visible {
  outline-color: #ffffff;
}

.knopf-icon.dreht .icon {
  animation: dreh 0.9s linear infinite;
}

.gruss {
  margin: 0;
  font-size: clamp(1.55rem, 1.15rem + 2vw, 2.2rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.kopf-datum {
  margin: 6px 0 0;
  font-size: 1.05rem;
  color: #ffffff;
}

.kopf-stand {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: #cbd8ec;
}

/* ---------- Rahmen und Spalten ---------- */

.ansicht-schmal {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.mitte {
  flex: 1;
  display: grid;
  place-items: start center;
  padding: 24px var(--rand-r) calc(32px + env(safe-area-inset-bottom, 0px)) var(--rand-l);
}

.mitte > .ladeanzeige {
  align-self: center;
}

.tafel {
  width: 100%;
  max-width: 440px;
  padding: 22px 20px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 16px;
  box-shadow: var(--schatten);
}

.tafel h1 {
  margin-bottom: 4px;
  font-size: 1.45rem;
  line-height: 1.25;
}

.rahmen {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px var(--rand-r) calc(40px + env(safe-area-inset-bottom, 0px)) var(--rand-l);
}

.spalten {
  display: block;
}

.spalte {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}

.spalte + .spalte {
  margin-top: 28px;
}

@media (min-width: 1024px) {
  .rahmen {
    padding-top: 28px;
  }

  .spalten {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
  }

  .spalte + .spalte {
    margin-top: 0;
  }
}

.abschnittstitel {
  margin: 0 0 12px;
  font-size: 1.12rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.005em;
}

/* ---------- Hinweise (Banner) ---------- */

.hinweise {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.hinweise:empty {
  display: none;
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  border: 1px solid hsl(var(--e-h) var(--e-s) 78%);
  border-radius: 12px;
  background: hsl(var(--e-h) var(--e-s) 95%);
  color: hsl(var(--e-h) var(--e-s) 18%);
  font-size: 0.95rem;
}

.banner p {
  flex: 1 1 240px;
  margin: 0;
  min-width: 0;
}

.banner-warnung {
  --e-h: 38;
  --e-s: 85%;
}

.banner-fehler {
  --e-h: 355;
  --e-s: 70%;
}

.banner-info {
  --e-h: 215;
  --e-s: 60%;
}

@media (prefers-color-scheme: dark) {
  .banner {
    border-color: hsl(var(--e-h) calc(var(--e-s) - 30%) 30%);
    background: hsl(var(--e-h) calc(var(--e-s) - 30%) 17%);
    color: hsl(var(--e-h) 80% 88%);
  }
}

/* ---------- Buttons und Felder ---------- */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}

.knopf-primaer {
  background: var(--akzent-knopf);
  color: #ffffff;
}

.knopf-primaer:hover {
  filter: brightness(1.1);
}

.knopf-sekundaer {
  background: var(--flaeche);
  border-color: var(--eingabe-rand);
  color: var(--text);
}

.knopf-sekundaer:hover {
  background: var(--flaeche-2);
}

.knopf-gefahr {
  background: var(--flaeche);
  border-color: var(--gefahr-rand);
  color: var(--gefahr-text);
}

.knopf-gefahr-voll {
  background: var(--gefahr-voll);
  color: #ffffff;
}

.knopf-text {
  min-height: 44px;
  padding: 0 8px;
  color: var(--akzent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.knopf-voll {
  width: 100%;
  margin-top: 14px;
}

.knopf[disabled],
.schalter[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.feld {
  display: grid;
  gap: 6px;
  margin: 14px 0;
}

.feld label {
  font-weight: 600;
  font-size: 0.93rem;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--eingabe-rand);
  border-radius: 10px;
  background: var(--flaeche);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

input[type="text"]:focus-visible,
input[type="password"]:focus-visible {
  outline: 3px solid var(--fokus);
  outline-offset: 1px;
}

.haken {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 4px 0;
  font-weight: 600;
  cursor: pointer;
}

.haken input {
  width: 22px;
  height: 22px;
  flex: none;
  accent-color: var(--akzent-knopf);
}

.hilfe {
  margin: 0.4rem 0 1rem;
  color: var(--text-2);
  font-size: 0.93rem;
}

.hilfe.klein {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
}

.fehlertext {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--gefahr-rand);
  border-radius: 10px;
  color: var(--gefahr-text);
  font-size: 0.93rem;
}

.fehlertext.info {
  border-color: var(--rand-stark);
  color: var(--text);
}

.ladeanzeige {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-2);
}

.ladeanzeige.klein {
  margin: 12px 0 0;
  justify-content: flex-start;
  font-size: 0.88rem;
}

.kreisel {
  width: 22px;
  height: 22px;
  flex: none;
  border: 3px solid var(--rand-stark);
  border-top-color: var(--akzent-knopf);
  border-radius: 50%;
  animation: dreh 0.8s linear infinite;
}

@keyframes dreh {
  to {
    transform: rotate(360deg);
  }
}

.schritte {
  display: grid;
  gap: 18px;
  margin: 18px 0;
  padding-left: 1.3rem;
}

.schritte .knopf {
  margin-top: 8px;
}

.schluesselbox {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.schluessel {
  flex: 1 1 200px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px dashed var(--rand-stark);
  border-radius: 10px;
  background: var(--flaeche-2);
  font: 600 1rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}

.kopier-hilfe {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---------- Etiketten und Kürzel ---------- */

.etiketten {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.kuerzel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--b-voll, #3a4658);
  color: var(--b-voll-text, #ffffff);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.2;
  white-space: nowrap;
}

.kuerzel .icon {
  width: 0.95em;
  height: 0.95em;
}

.etikett {
  --e-h: 220;
  --e-s: 10%;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid hsl(var(--e-h) var(--e-s) 78%);
  border-radius: 999px;
  background: hsl(var(--e-h) var(--e-s) 94%);
  color: hsl(var(--e-h) var(--e-s) 21%);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.etikett .icon {
  width: 0.95em;
  height: 0.95em;
}

.etikett[data-stil="sofort"] {
  --e-h: 355;
  --e-s: 70%;
}
.etikett[data-stil="freigabe"] {
  --e-h: 220;
  --e-s: 65%;
}
.etikett[data-stil="offen"] {
  --e-h: 38;
  --e-s: 85%;
}
.etikett[data-stil="wartet"],
.etikett[data-stil="nichts_neues"],
.etikett[data-stil="frist"] {
  --e-h: 220;
  --e-s: 12%;
}
.etikett[data-stil="nicht_verbunden"] {
  --e-h: 220;
  --e-s: 10%;
  border-style: dashed;
}
.etikett[data-stil="automatisch"] {
  --e-h: 160;
  --e-s: 45%;
}
.etikett[data-stil="erledigt"],
.etikett[data-stil="ok"] {
  --e-h: 140;
  --e-s: 50%;
}
.etikett[data-stil="ki"] {
  --e-h: 270;
  --e-s: 50%;
}
.etikett[data-stil="luecke"] {
  --e-h: 38;
  --e-s: 85%;
  border-style: dashed;
}
.etikett[data-stil="dringend"],
.etikett[data-stil="frist-heute"],
.etikett[data-stil="fehler"] {
  --e-h: 355;
  --e-s: 70%;
}
.etikett[data-stil="frist-bald"],
.etikett[data-stil="hinweis"] {
  --e-h: 38;
  --e-s: 85%;
}
.etikett[data-stil="vertraulich"] {
  --e-h: 220;
  --e-s: 12%;
  border-style: dashed;
}

/* Kräftige Etiketten für „Sofort“ und „Deine Freigabe“ */
.etikett[data-stil="sofort"],
.etikett[data-stil="freigabe"] {
  border-color: hsl(var(--e-h) var(--e-s) 38%);
  background: hsl(var(--e-h) var(--e-s) 38%);
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .etikett {
    border-color: hsl(var(--e-h) var(--e-s) 32%);
    background: hsl(var(--e-h) calc(var(--e-s) - 25%) 20%);
    color: hsl(var(--e-h) 80% 86%);
  }

  .etikett[data-stil="sofort"],
  .etikett[data-stil="freigabe"] {
    border-color: hsl(var(--e-h) var(--e-s) 44%);
    background: hsl(var(--e-h) var(--e-s) 42%);
    color: #ffffff;
  }
}

/* ---------- Karten und Einträge ---------- */

.karten {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.karte {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px 12px 12px;
  border: 1px solid var(--rand);
  border-left: 4px solid var(--b-streifen, var(--rand-stark));
  border-radius: 14px;
  background: var(--flaeche);
  box-shadow: var(--schatten);
}

.karte.ohne-nummer {
  grid-template-columns: minmax(0, 1fr);
}

.nummer {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--nummer-bg);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
}

.nummer.hoch {
  background: var(--gefahr-voll);
}

.karte-inhalt {
  min-width: 0;
}

.eintrag-text {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.eintrag-detail {
  margin: 2px 0 0;
  color: var(--text-2);
  font-size: 0.93rem;
  overflow-wrap: anywhere;
}

.eintrag-link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-height: 44px;
  margin-top: 2px;
  color: var(--akzent-text);
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.eintrag-link .domain {
  color: var(--text-2);
  font-weight: 400;
}

.eintraege {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.eintrag {
  padding: 10px 12px;
  border: 1px solid var(--rand);
  border-left: 4px solid var(--rand-stark);
  border-radius: 10px;
  background: var(--flaeche-2);
}

.eintrag[data-dringlichkeit="hoch"] {
  border-left-color: var(--gefahr-voll);
}

.eintrag[data-dringlichkeit="mittel"] {
  border-left-color: #c98a12;
}

.leer {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--rand-stark);
  border-radius: 12px;
  color: var(--text-2);
  font-size: 0.95rem;
}

.unterzeile {
  margin: 14px 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}

.unterzeile:first-child {
  margin-top: 0;
}

.fehlerbox,
.hinweisbox {
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 0.9rem;
}

.fehlerbox {
  border-color: var(--gefahr-rand);
  color: var(--gefahr-text);
}

.hinweisbox {
  border-color: var(--rand-stark);
  color: var(--text);
  background: var(--flaeche);
}

/* ---------- Aufklapper ---------- */

.aufklapper-liste {
  display: grid;
  gap: 10px;
}

.aufklapper {
  border: 1px solid var(--rand);
  border-radius: 14px;
  background: var(--flaeche);
  box-shadow: var(--schatten);
  overflow: hidden;
}

.aufklapper[data-bereich] {
  border-left: 4px solid var(--b-streifen);
}

.aufklapper.vertraulich {
  border-style: dashed;
  border-color: var(--rand-stark);
  border-left-style: solid;
  background: repeating-linear-gradient(135deg, var(--flaeche) 0 14px, var(--flaeche-2) 14px 28px);
}

.aufklapper-titel {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
}

.aufklapper-knopf {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 14px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.aufklapper-knopf:hover {
  background: rgba(127, 140, 160, 0.1);
}

.aufklapper-knopf:focus-visible {
  outline-offset: -3px;
}

.aufklapper-text {
  flex: 1;
  min-width: 0;
}

.aufklapper-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.aufklapper-zaehler {
  display: block;
  color: var(--text-2);
  font-size: 0.86rem;
}

.aufklapper-zaehler strong {
  color: var(--text);
}

.aufklapper .chevron {
  margin-left: auto;
  transition: transform 0.18s ease;
}

.aufklapper-knopf[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.aufklapper-feld {
  padding: 14px 14px 16px;
  border-top: 1px solid var(--rand);
}

.abschnitt + .abschnitt {
  margin-top: 20px;
}

.abschnitt-titel {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.abschnitt-meta {
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

/* ---------- Datenquellen, Tage ---------- */

.quellen {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quelle {
  padding: 10px 12px;
  border: 1px solid var(--rand);
  border-radius: 10px;
  background: var(--flaeche-2);
}

.quelle-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.quelle-titel {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.quelle-meta {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.tage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-knopf {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 56px;
  padding: 8px 12px;
  border: 1px solid var(--eingabe-rand);
  border-radius: 10px;
  background: var(--flaeche);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.tag-knopf:hover {
  background: var(--flaeche-2);
}

.tag-knopf[aria-current="date"] {
  border-color: var(--akzent-knopf);
  box-shadow: inset 0 0 0 2px var(--akzent-knopf);
}

.tag-datum {
  font-weight: 650;
  font-size: 0.93rem;
}

.tag-zahl {
  color: var(--text-2);
  font-size: 0.82rem;
}

/* ---------- Einstellungen ---------- */

.einstellung + .einstellung {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--rand);
}

.einstellung-titel {
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 700;
}

.knopfzeile {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.schalter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.schalter-wert {
  margin-left: 8px;
  color: var(--text-2);
  font-weight: 400;
}

.schalter-spur {
  position: relative;
  flex: none;
  width: 52px;
  height: 30px;
  border-radius: 15px;
  background: var(--eingabe-rand);
  transition: background 0.15s ease;
}

.schalter-spur::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.15s ease;
}

.schalter[aria-checked="true"] .schalter-spur {
  background: var(--akzent-knopf);
}

.schalter[aria-checked="true"] .schalter-spur::after {
  transform: translateX(22px);
}

.neuer-zugang {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid hsl(38 85% 70%);
  border-radius: 12px;
  background: hsl(38 85% 95%);
  color: hsl(38 85% 16%);
}

.neuer-zugang .schluessel {
  background: #ffffff;
  color: #141c27;
  border-color: hsl(38 40% 60%);
  font-size: 0.88rem;
  letter-spacing: 0;
}

@media (prefers-color-scheme: dark) {
  .neuer-zugang {
    border-color: hsl(38 40% 32%);
    background: hsl(38 40% 15%);
    color: hsl(38 80% 88%);
  }
}

.fusszeile {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 0.82rem;
}

.fusszeile .icon {
  margin-top: 2px;
}

/* ---------- Dialog und Meldung ---------- */

.dialog {
  width: calc(100% - 32px);
  max-width: 440px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--flaeche);
  color: var(--text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

.dialog::backdrop {
  background: rgba(8, 14, 24, 0.6);
}

.dialog form {
  padding: 20px;
}

.dialog-titel {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.dialog-text {
  margin: 0 0 18px;
  color: var(--text-2);
}

.dialog-knoepfe {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.meldung {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  max-width: min(92vw, 520px);
  padding: 12px 16px;
  border-radius: 12px;
  background: #16202c;
  color: #ffffff;
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.meldung.sichtbar {
  opacity: 1;
  transform: translate(-50%, 0);
}

.meldung.fehler {
  background: #8f1d25;
}

@media (prefers-color-scheme: dark) {
  .meldung {
    background: #e8edf4;
    color: #0b1017;
  }

  .meldung.fehler {
    background: #ffb3b6;
    color: #3b0a0e;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .kreisel,
  .knopf-icon.dreht .icon {
    animation-duration: 3s;
  }
}
