/*
 * Ausbildungsplattform BAWZ Florian Deutschlandsberg
 *
 * Gestaltung nach Apples Oberflächen: Systemschrift, gruppierte Listen,
 * große Titel, Sheets von unten, Glas nur auf den festen Leisten.
 * Zuerst fürs Handy (390 px) gebaut, ab 640 px Tablet, ab 1024 px Schreibtisch.
 * Feuerwehr-Rot aus dem Kopfbanner ist der einzige Akzent, Orange (Flamme)
 * und Grün nur für Fortschritt und richtige Antworten.
 */

:root {
  color-scheme: light;

  /* Flächen */
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #f7f7fa;
  --fuellung: rgba(118, 118, 128, 0.12);
  --fuellung-2: rgba(118, 118, 128, 0.08);
  --druck: rgba(0, 0, 0, 0.06);

  /* Schrift */
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #8e8e93;
  --ink-4: #c7c7cc;

  /* Akzent — Kopfbanner des BFV Deutschlandsberg */
  --rot: #b3202b;
  --rot-dunkel: #951a23;
  --rot-hell: rgba(179, 32, 43, 0.1);
  --orange: #e0761c;
  --orange-hell: rgba(224, 118, 28, 0.12);

  /* Status */
  --gruen: #1f8a3a;
  --gruen-voll: #34c759;
  --gruen-hell: rgba(52, 199, 89, 0.14);
  --gelb: #a65f00;
  --gelb-voll: #ff9f0a;
  --gelb-hell: rgba(255, 159, 10, 0.14);
  --blau: var(--ink-2);
  --blau-hell: var(--fuellung);

  /* Linien */
  --linie: rgba(60, 60, 67, 0.16);
  --linie-stark: rgba(60, 60, 67, 0.29);

  --radius: 16px;
  --radius-s: 12px;
  --radius-l: 22px;

  /* Bewegung (Apple/Vaul-Kurven) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);

  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;

  --oben: env(safe-area-inset-top, 0px);
  --unten: env(safe-area-inset-bottom, 0px);
  --kopf: 44px;
  --tab: 50px;
  --rand: 16px;
  --sidebar: 264px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4,
.btn,
.tab,
.chip,
.nav a {
  hyphens: none;
  text-wrap: balance;
}

p,
dd,
.lese-text {
  hyphens: auto;
  hyphenate-limit-chars: 18 6 5;
}

a {
  color: var(--rot);
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button,
a,
label {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(179, 32, 43, 0.4);
  outline-offset: 2px;
  border-radius: 10px;
}

img {
  max-width: 100%;
}

/* ------------------------------------------------------------------ Laden */

.app-lade,
.ladeanzeige {
  display: grid;
  place-items: center;
  min-height: 40vh;
}
.app-lade {
  min-height: 100dvh;
}
.spinner {
  display: block;
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--fuellung);
  border-top-color: var(--ink-3);
  border-radius: 50%;
  animation: dreh 0.6s linear infinite;
}
@keyframes dreh {
  to {
    transform: rotate(360deg);
  }
}

/* ----------------------------------------------------- Anmeldung & Profilwahl */

.profilwahl {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: calc(var(--oben) + 32px) 20px calc(var(--unten) + 32px);
}
.profilwahl-box {
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.profilwahl-titel {
  margin-top: 22px;
  font-size: 30px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.profilwahl-text {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 16px;
}
.profilwahl-box > div:first-child {
  margin-bottom: 26px;
}

/* Anmeldung wie bei kursbuchung.bfvdl.at (Sascha, 04.11.2026): Karte mit dem
   Kopfbanner oben, kompakte Felder, eckiger roter Knopf, Fußzeile darunter.
   Hell und dunkel nach Systemeinstellung — der Banner bleibt immer weiß. */
.login {
  --l-grund-a: #f8f9fb;
  --l-grund-b: #f2f4f6;
  --l-karte: #ffffff;
  --l-linie: #e2e6ea;
  --l-feldlinie: #cdd4da;
  --l-ink: #14181c;
  --l-ink-2: #545d66;
  --l-ink-3: #8a949d;
  --l-rot: #b3202b;
  --l-ring: rgba(179, 32, 43, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 100dvh;
  padding: calc(var(--oben) + 24px) 16px calc(var(--unten) + 24px);
  background: linear-gradient(var(--l-grund-a), var(--l-grund-b));
  color: var(--l-ink);
}
@media (prefers-color-scheme: dark) {
  .login {
    --l-grund-a: #1c2025;
    --l-grund-b: #0f1114;
    --l-karte: #171a1e;
    --l-linie: #2a3038;
    --l-feldlinie: #3a424c;
    --l-ink: #eef1f4;
    --l-ink-2: #aeb6bf;
    --l-ink-3: #7c8690;
    --l-rot: #e0434e;
    --l-ring: #3a1a1e;
    color-scheme: dark;
  }
}
.login-karte {
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  border: 1px solid var(--l-linie);
  border-radius: 16px;
  background: var(--l-karte);
  box-shadow: 0 12px 32px rgba(20, 24, 28, 0.06);
}
.login-kopf {
  border-bottom: 1px solid var(--l-linie);
  background: #ffffff;
}
.login-kopf img {
  display: block;
  width: 100%;
  height: auto;
}
.login-inhalt {
  display: grid;
  gap: 16px;
  padding: 24px 28px 28px;
}
.login-inhalt h1 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.login-inhalt .sub {
  margin-top: 2px;
  color: var(--l-ink-2);
  font-size: 13.5px;
}
.login .feld {
  display: grid;
  gap: 6px;
}
.login .feld > label {
  margin: 0;
  padding: 0;
  color: var(--l-ink-2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
}
/* 16 px Schrift, sonst zoomt das iPhone beim Antippen hinein */
.login .feld .eingabe {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--l-feldlinie);
  border-radius: 8px;
  background: var(--l-karte);
  color: var(--l-ink);
  font-size: 16px;
  box-shadow: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.login .feld .eingabe::placeholder {
  color: var(--l-ink-3);
}
.login .feld .eingabe:focus {
  border-color: var(--l-rot);
  background: var(--l-karte);
  outline: none;
  box-shadow: 0 0 0 3px var(--l-ring);
}
.login .btn.primaer {
  min-height: 44px;
  margin-top: 0;
  border: 1px solid var(--l-rot);
  border-radius: 8px;
  background: var(--l-rot);
  box-shadow: none;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.login .btn.primaer:active:not(:disabled) {
  background: var(--l-rot);
  filter: brightness(0.92);
}
.login-formular {
  display: grid;
  gap: 16px;
}
.login-vergessen {
  margin-top: 0;
  text-align: center;
}
.login-vergessen button {
  min-height: 32px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--l-ink-2);
  font-size: 13px;
  font-weight: 600;
}
.login-vergessen button:active {
  opacity: 0.7;
}
.login .fehler-zeile {
  color: var(--l-rot);
  font-size: 13.5px;
  font-weight: 550;
}
.login-fuss {
  max-width: 400px;
  color: var(--l-ink-3);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

/* --------------------------------------------------------------- Gerüst */

.shell {
  min-height: 100dvh;
}

.inhalt {
  padding-top: calc(var(--oben) + var(--kopf));
  padding-bottom: calc(var(--unten) + var(--tab) + 32px);
  overflow-x: clip;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 4px var(--rand) 0;
}

body.fokus .inhalt {
  padding-top: 0;
  padding-bottom: calc(var(--unten) + 32px);
}
body.fokus .topbar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}

/* Kopfleiste: durchsichtig, bis der große Titel darunter verschwindet. */
.topbar {
  position: fixed;
  z-index: 30;
  transition:
    opacity 0.25s ease,
    transform 0.35s var(--ease-sheet);
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--oben) + var(--kopf));
  padding: var(--oben) 8px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(247, 247, 250, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: inset 0 -0.5px 0 var(--linie);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.topbar.kompakt::before {
  opacity: 1;
}
.topbar h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.2s ease,
    transform 0.25s var(--ease-out);
}
.topbar.kompakt h1 {
  opacity: 1;
  transform: none;
}
.topbar-rechts {
  justify-self: end;
  padding-right: 8px;
}
.topbar-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  border-radius: 50%;
  transition: transform 0.16s var(--ease-out);
}
.topbar-avatar:active {
  transform: scale(0.92);
}
.topbar-avatar .avatar {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

/* Tab-Leiste */
.tabbar {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: calc(var(--tab) + var(--unten));
  padding-bottom: var(--unten);
  background: rgba(249, 249, 251, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: inset 0 0.5px 0 var(--linie);
  transition: transform 0.35s var(--ease-sheet);
}
body.fokus .tabbar {
  transform: translateY(100%);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding-top: 2px;
  border: 0;
  background: none;
  color: #999;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
}
.tab svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.7;
  transition: transform 0.16s var(--ease-out);
}
.tab:active svg {
  transform: scale(0.88);
}
.tab.aktiv {
  color: var(--rot);
}
.tab.aktiv svg {
  stroke-width: 2.1;
}

/* Seitenleiste (Schreibtisch) */
.sidebar {
  display: none;
}

/* Seitenwechsel: kurz einblenden, Detail schiebt sich von rechts herein */
.seite-rein {
  animation: seiteRein 0.24s var(--ease-out) backwards;
}
@keyframes seiteRein {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.schieben-rein {
  animation: schiebenRein 0.42s var(--ease-sheet) backwards;
}
@keyframes schiebenRein {
  from {
    opacity: 0;
    transform: translateX(28%);
  }
}
.schieben-zurueck {
  animation: schiebenZurueck 0.42s var(--ease-sheet) backwards;
}
@keyframes schiebenZurueck {
  from {
    opacity: 0;
    transform: translateX(-12%);
  }
}

/* ------------------------------------------------------------ Seitenkopf */

.seitenkopf {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 22px;
}
.seitenkopf h2 {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.seitenkopf p {
  max-width: 62ch;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.45;
}
.seitenkopf .rechts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
@media (max-width: 639px) {
  .seitenkopf .rechts .btn {
    flex: 1 1 auto;
  }
}

.zurueck-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: -6px 0 0 -6px;
  padding: 0 8px 0 2px;
  border: 0;
  background: none;
  color: var(--rot);
  font-size: 17px;
  font-weight: 400;
}
.zurueck-link svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.4;
}

.abschnitt-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 4px 8px;
}
.abschnitt-kopf h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.schnellwahl {
  display: flex;
  gap: 2px;
  margin-right: -10px;
}

.ueberzeile {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0;
}

.fussnote-text {
  margin: 14px 4px 0;
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- Karten */

.karte {
  min-width: 0;
  background: var(--surface);
  border-radius: var(--radius);
}
.karte + .karte {
  margin-top: 14px;
}
.karte-kopf {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 6px;
}
.karte-kopf > svg {
  color: var(--rot);
  flex-shrink: 0;
}
.karte-kopf h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.karte-kopf .rechts,
.karte-kopf > .ueberzeile:last-child {
  margin-left: auto;
}
.karte-inhalt {
  padding: 16px 18px;
}

.raster {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

/* --------------------------------------------------------------- Knöpfe */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  --rand-x: 20px;
  gap: 7px;
  min-height: 44px;
  padding: 0 var(--rand-x);
  border: 0;
  border-radius: 999px;
  background: var(--fuellung);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  transition:
    transform 0.16s var(--ease-out),
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}
.btn svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  stroke-width: 2;
}
/* Der Text steht genau in der Mitte, das Symbol links daneben (Sascha, 04.11.2026):
   das Symbol nimmt keinen Platz in der Mitte ein, beide Seiten bekommen gleich viel Rand dazu. */
.btn:not(.icon):has(> svg:first-child) {
  padding-inline: calc(var(--rand-x) + 26px);
}
.btn:not(.icon) > svg:first-child {
  margin-left: -26px;
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
  background-color: rgba(118, 118, 128, 0.2);
}
.btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.btn.primaer {
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 55%),
    var(--rot);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.35),
    0 1px 2px rgba(149, 26, 35, 0.3),
    0 6px 16px -8px rgba(179, 32, 43, 0.7);
}
.btn.primaer:active:not(:disabled) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 55%),
    var(--rot-dunkel);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.18),
    0 1px 1px rgba(149, 26, 35, 0.25);
}
.btn.still {
  background: transparent;
  color: var(--rot);
  font-weight: 500;
  padding: 0 12px;
}
.btn.still:active:not(:disabled) {
  background: var(--rot-hell);
}
.btn.gefahr {
  background: var(--rot-hell);
  color: var(--rot);
}
.btn.gefahr:active:not(:disabled) {
  background: rgba(179, 32, 43, 0.18);
}
.btn.gross {
  --rand-x: 26px;
  min-height: 52px;
  font-size: 17px;
}
.btn.klein {
  --rand-x: 14px;
  min-height: 36px;
  font-size: 15px;
}
.btn.klein::after {
  content: '';
  position: absolute;
  inset: -4px;
}
.btn.voll {
  width: 100%;
}
.btn.icon {
  width: 44px;
  padding: 0;
}
.btn.icon.klein {
  width: 36px;
}
.btn.icon.still {
  color: var(--ink);
}
.gelernt-knopf {
  background: var(--gruen-hell);
  color: var(--gruen);
}
.gelernt-knopf:active:not(:disabled) {
  background: rgba(52, 199, 89, 0.22);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) {
    background-color: rgba(118, 118, 128, 0.17);
  }
  .btn.primaer:hover:not(:disabled) {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 55%),
      #a51d27;
  }
  .btn.still:hover:not(:disabled) {
    background: var(--rot-hell);
  }
  .btn.gefahr:hover:not(:disabled) {
    background: rgba(179, 32, 43, 0.16);
  }
}

/* -------------------------------------------------------------- Eingaben */

.feld {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.feld > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  padding-left: 4px;
}
.feld .hilfe,
.hilfe {
  font-size: 13px;
  color: var(--ink-3);
  padding-left: 4px;
}

.eingabe {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 14px;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--fuellung-2);
  box-shadow: inset 0 0 0 1px transparent;
  font-size: 17px; /* unter 16 px zoomt iOS beim Antippen */
  line-height: 1.3;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition:
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}
.eingabe::placeholder {
  color: var(--ink-3);
}
.eingabe:focus {
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1.5px var(--rot),
    0 0 0 4px var(--rot-hell);
}
textarea.eingabe {
  min-height: 96px;
  resize: vertical;
}
select.eingabe {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
input[type='date'].eingabe {
  min-height: 46px;
}
input[type='checkbox'] {
  accent-color: var(--rot);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Segmentschalter */
.segment {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--anzahl), minmax(0, 1fr));
  padding: 2px;
  border-radius: 10px;
  background: var(--fuellung);
  min-height: 40px;
}
.segment-marke {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc((100% - 4px) / var(--anzahl));
  border-radius: 8px;
  background: var(--surface);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.12),
    0 3px 1px rgba(0, 0, 0, 0.04);
  opacity: 0;
  transition:
    transform 0.32s var(--ease-sheet),
    opacity 0.2s ease;
}
.segment.gewaehlt .segment-marke {
  opacity: 1;
}
.segment-option {
  position: relative;
  z-index: 1;
  border: 0;
  background: none;
  min-height: 36px;
  font-size: 15px;
  font-weight: 500;
  transition: transform 0.15s var(--ease-out);
}
.segment-option:active {
  transform: scale(0.94);
}
.segment-option[aria-checked='true'] {
  font-weight: 650;
}

/* ------------------------------------------------------- Kleine Anzeigen */

.abzeichen,
.wert-pille {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--fuellung);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.abzeichen.gruen,
.wert-pille.gruen {
  background: var(--gruen-hell);
  color: var(--gruen);
}
.abzeichen.gelb,
.wert-pille.gelb {
  background: var(--gelb-hell);
  color: var(--gelb);
}
.abzeichen.rot,
.wert-pille.rot {
  background: var(--rot-hell);
  color: var(--rot);
}

.balken {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--fuellung);
  overflow: hidden;
}
.balken > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: inherit;
  background: var(--rot);
  transform-origin: left center;
  transition: transform 0.5s var(--ease-out);
}
.balken.fein {
  height: 4px;
}
.balken.gruen > i {
  background: var(--gruen-voll);
}
.balken.gelb > i {
  background: var(--gelb-voll);
}

.punkt-farbe {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--rot);
}
.punkt-farbe.gruen {
  background: var(--gruen-voll);
}
.punkt-farbe.gelb {
  background: var(--gelb-voll);
}

.hinweis {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  background: var(--fuellung-2);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.45;
}
.hinweis svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--ink-3);
}
.hinweis.warn {
  background: var(--orange-hell);
}
.hinweis.gut {
  background: var(--gruen-hell);
}
.test-ansicht > .hinweis {
  margin-bottom: 14px;
}

.leer {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 40px 24px;
  text-align: center;
}
.leer svg {
  width: 40px;
  height: 40px;
  color: var(--ink-4);
  margin-bottom: 6px;
  stroke-width: 1.5;
}
.leer b {
  font-size: 17px;
  font-weight: 600;
}
.leer p {
  max-width: 40ch;
  color: var(--ink-2);
  font-size: 15px;
}
.leer .btn {
  margin-top: 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(180deg, #a8a8ad, #86868b);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.avatar.gross {
  width: 46px;
  height: 46px;
  font-size: 17px;
}
.avatar.ausbilder {
  background: linear-gradient(180deg, #cf3a43, var(--rot));
}

.kachel-symbol {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex-shrink: 0;
  color: #fff;
  background: var(--rot);
}
.kachel-symbol svg {
  width: 21px;
  height: 21px;
  stroke-width: 2;
}
.kachel-symbol.orange {
  background: var(--orange);
}
.kachel-symbol.gruen {
  background: var(--gruen-voll);
}
.kachel-symbol.grau {
  background: #8e8e93;
}

/* ---------------------------------------------------- Gruppierte Listen */

.liste,
.profil-liste {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}
.liste-zeile,
.profil-eintrag {
  --einzug: 16px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  text-align: left;
  text-decoration: none;
  transition: background-color 0.3s ease;
}
.liste-zeile + .liste-zeile::before,
.profil-eintrag + .profil-eintrag::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--einzug);
  right: 0;
  height: 0.5px;
  background: var(--linie);
}
button.liste-zeile:active,
a.liste-zeile:active,
.profil-eintrag:active {
  background: var(--druck);
  transition: none;
}
.zeile-text,
.profil-eintrag .name {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.zeile-text b,
.profil-eintrag .name b {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.zeile-text span,
.profil-eintrag .name span {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.35;
  margin-top: 1px;
}
.zeile-symbol {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--rot);
  color: #fff;
}
.zeile-symbol svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.liste-zeile:has(.zeile-symbol) {
  --einzug: 58px;
}
.liste-zeile:has(.avatar),
.profil-eintrag {
  --einzug: 64px;
}
.liste-zeile:has(.auswahl-kreis) {
  --einzug: 54px;
}
.zeile-wert {
  color: var(--ink-3);
  font-size: 15px;
  flex-shrink: 0;
}
.zeile-pfeil,
.profil-eintrag > svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--ink-4);
  stroke-width: 2.6;
}
.profil-zeile {
  border-radius: var(--radius);
  background: var(--surface-2);
}

/* Runder Abhakkreis wie in Erinnerungen */
.auswahl-kreis {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1.6px var(--ink-4);
  color: transparent;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.25s var(--ease-out);
}
.auswahl-kreis svg {
  width: 15px;
  height: 15px;
  stroke-width: 3;
  transform: scale(0.6);
  transition: transform 0.3s var(--ease-out);
}
[aria-checked='true'] > .auswahl-kreis,
[aria-checked='true'] .auswahl-kreis,
.fertig > .auswahl-kreis {
  background: var(--rot);
  box-shadow: none;
  color: #fff;
}
[aria-checked='true'] > .auswahl-kreis svg,
[aria-checked='true'] .auswahl-kreis svg,
.fertig > .auswahl-kreis svg {
  transform: none;
}
button:active > .auswahl-kreis,
.haken-knopf:active .auswahl-kreis {
  transform: scale(0.88);
}
.lernweg-zeile {
  min-height: 48px;
}
.lernweg-zeile .zeile-text b {
  font-size: 16px;
}
.lernweg-zeile.fertig .zeile-text b {
  color: var(--ink-2);
}

/* Testauswahl */
.auswahl-aktion {
  position: sticky;
  bottom: calc(var(--unten) + var(--tab) + 10px);
  z-index: 5;
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-l);
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.05);
}
.auswahl-fuss {
  text-align: center;
  font-size: 14px;
  color: var(--ink-2);
}

.fortsetzen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
}
.fortsetzen .zeile-text {
  min-width: 180px;
}
.fortsetzen-knoepfe {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* ---------------------------------------------------------------- Tabellen */

.tabellen-huelle {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tabelle {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.tabelle th {
  padding: 10px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
  border-bottom: 0.5px solid var(--linie);
}
.tabelle td {
  padding: 12px 16px;
  vertical-align: top;
  border-bottom: 0.5px solid var(--linie);
}
.tabelle tr:last-child td {
  border-bottom: 0;
}
.tabelle .rechts,
.tabelle th.rechts {
  text-align: right;
}
.tabelle td.stark {
  font-weight: 620;
}

@media (max-width: 639px) {
  /* Tabellen werden zu lesbaren Zeilen statt seitlich zu scrollen */
  .tabelle thead {
    display: none;
  }
  .tabelle,
  .tabelle tbody {
    display: block;
  }
  .tabelle tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--linie);
  }
  .tabelle tr:last-child {
    border-bottom: 0;
  }
  .tabelle td {
    display: block;
    padding: 0;
    border: 0;
  }
  .tabelle td.rechts {
    margin-left: auto;
  }
  .lese-tabelle td:first-child {
    font-weight: 650;
  }
  .lese-tabelle td:nth-child(2) {
    flex: 1 1 60%;
    font-weight: 600;
  }
  .lese-tabelle td:nth-child(n + 3) {
    flex-basis: 100%;
    font-size: 15px;
    color: var(--ink-2);
  }
  .lese-tabelle td:nth-child(n + 3)::before {
    content: attr(data-label) ': ';
    color: var(--ink-3);
  }
  .lese-tabelle td.leer-zelle:nth-child(n + 3) {
    display: none;
  }
}

/* --------------------------------------------------------- Sheets & Dialoge */

.dialog-huelle {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.dialog-huelle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.dialog-huelle.offen::before {
  opacity: var(--abdunkeln, 1);
}
.dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(100dvh - var(--oben) - 10px);
  padding-bottom: var(--unten);
  border-radius: 14px 14px 0 0;
  background: var(--surface);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform 0.5s var(--ease-sheet);
}
.dialog-huelle.offen .dialog {
  transform: none;
}
.dialog-huelle:not(.offen) .dialog {
  transition-duration: 0.32s;
}
.dialog-kopf {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 16px 60px 8px;
  touch-action: none;
  cursor: grab;
  flex-shrink: 0;
}
.dialog-griff {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: rgba(60, 60, 67, 0.3);
  transform: translateX(-50%);
}
.dialog-kopf h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}
.dialog-zu {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--fuellung);
  color: var(--ink-2);
  transition: transform 0.16s var(--ease-out);
}
.dialog-zu::after {
  content: '';
  position: absolute;
  inset: -7px;
}
.dialog-zu:active {
  transform: scale(0.9);
}
.dialog-zu svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.6;
}
.dialog-inhalt {
  display: grid;
  gap: 16px;
  padding: 8px var(--rand) 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.dialog-inhalt .liste,
.dialog-inhalt .profil-liste {
  background: var(--surface-2);
}
.dialog-text {
  color: var(--ink-2);
  font-size: 16px;
  text-align: center;
}
.dialog-fuss {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  padding: 10px var(--rand) 14px;
  flex-shrink: 0;
}
.dialog-fuss .btn {
  width: 100%;
  min-height: 50px;
  font-size: 17px;
}

/* Mitteilungen von oben */
.toasts {
  position: fixed;
  z-index: 80;
  top: calc(var(--oben) + 8px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(100%, 440px);
  padding: 12px 18px 12px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.16),
    0 1px 3px rgba(0, 0, 0, 0.08);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  pointer-events: auto;
  touch-action: none;
  opacity: 0;
  transform: translateY(calc(-100% - 20px));
  transition:
    transform 0.5s var(--ease-sheet),
    opacity 0.3s ease;
}
.toast.da {
  opacity: 1;
  transform: none;
}
.toast.weg {
  transition-duration: 0.3s;
}
.toast-symbol {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--ink-3);
  color: #fff;
}
.toast-symbol svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.6;
}
.toast.gut .toast-symbol {
  background: var(--gruen-voll);
}
.toast.fehler .toast-symbol {
  background: var(--rot);
}

/* Bildbetrachter */
.bild-lupe {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.bild-lupe.offen {
  opacity: 1;
}
.lupe-flaeche {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(var(--oben) + 56px) 8px calc(var(--unten) + 44px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.lupe-flaeche img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  user-select: none;
  -webkit-user-select: none;
  transform: scale(0.96);
  transition: transform 0.35s var(--ease-out);
}
.bild-lupe.offen .lupe-flaeche img {
  transform: none;
}
.bild-lupe.gross .lupe-flaeche {
  display: block;
  padding: 0;
}
.bild-lupe.gross .lupe-flaeche img {
  width: 260%;
  max-width: none;
  max-height: none;
  border-radius: 0;
}
.lupe-zu {
  position: fixed;
  top: calc(var(--oben) + 10px);
  right: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.lupe-zu svg {
  stroke-width: 2.6;
}
.lupe-hilfe {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--unten) + 14px);
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}
.bild-lupe.gross .lupe-hilfe {
  opacity: 0;
}

.lupe-hinweis {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.62);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}
.lupe-hinweis svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.6;
}

/* --------------------------------------------------------------- Ringe */

.ring {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--rot);
}
.ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-spur,
.ring-wert {
  fill: none;
  stroke: currentColor;
}
.ring-spur {
  opacity: 0.16;
}
.ring-wert {
  stroke-linecap: round;
  animation: ringFuellen 1.1s var(--ease-out) backwards;
}
@keyframes ringFuellen {
  from {
    stroke-dashoffset: var(--umfang);
  }
}
.ring-text {
  position: relative;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.ring.orange,
.ringe .orange {
  color: var(--orange);
}
.ring.gruen,
.ringe .gruen {
  color: var(--gruen-voll);
}
.ring.gelb {
  color: var(--gelb-voll);
}
.ringe .rot {
  color: var(--rot);
}

/* ================================================================ Dienstplan */

.fehler-zeile {
  display: none;
  color: var(--rot);
  font-size: 14px;
  font-weight: 550;
}
.fehler-zeile.sichtbar {
  display: block;
}
.link-knopf {
  align-self: flex-end;
  min-height: 40px;
  margin: 2px -6px -8px auto;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--rot);
  font-size: 15px;
}
.vergessen {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 6px 4px 4px;
  text-align: center;
  color: var(--ink-2);
}
.vergessen p:first-of-type {
  color: var(--ink);
  font-size: 19px;
}
.mono {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-weight: 500;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.gedimmt {
  color: var(--ink-2);
}
.gedimmt .zeile-text b {
  color: var(--ink-2);
}
.gefahr-text {
  color: var(--rot);
}
.hilfe.mittig {
  margin: 4px 8px;
  text-align: center;
}
.formular {
  display: grid;
  gap: 16px;
}
.feld-paar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.loesch-knopf {
  justify-self: start;
  margin-top: 4px;
}
.formular fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--surface-2);
}
.formular legend {
  float: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}
.formular fieldset .btn {
  justify-self: start;
}

/* Monatskopf mit Blättern */
.monat-kopf {
  gap: 4px;
}
.monat-zeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.monat-zeile h2 {
  min-width: 0;
  font-size: clamp(25px, 8.2vw, 34px);
  white-space: nowrap;
}
.monat-wahl {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  margin-right: -10px;
}
.monat-kopf p .heute-knopf {
  display: inline;
  min-height: 0;
  margin: 0 0 0 8px;
  padding: 0;
  font-size: inherit;
}
.monat-wahl .btn.icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.4;
}

.meine-karte,
.export-karte {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px 16px;
}
.meine-text,
.export-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.meine-text b,
.export-text b {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.meine-text span,
.export-text span {
  color: var(--ink-2);
  font-size: 14px;
}
.export-karte {
  flex-wrap: wrap;
}
.export-text {
  flex: 1;
}
.export-karte .btn {
  flex-basis: 100%;
}

.problem-hinweis {
  align-items: center;
  width: 100%;
  margin-bottom: 14px;
  border: 0;
  color: var(--ink);
  text-align: left;
}
.problem-hinweis > span {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.problem-hinweis b {
  font-weight: 600;
}
.problem-hinweis > span > span {
  color: var(--ink-2);
  font-size: 14px;
}
.problem-hinweis svg:first-child {
  color: var(--orange);
}

/* Monatsraster */
.monatsraster {
  padding: 8px 6px 10px;
  touch-action: pan-y;
}
.monatsraster.von-rechts .raster-tage {
  animation: raster-rechts 0.28s var(--ease-out) backwards;
}
.monatsraster.von-links .raster-tage {
  animation: raster-links 0.28s var(--ease-out) backwards;
}
@keyframes raster-rechts {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
}
@keyframes raster-links {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
}
.raster-kopf,
.raster-tage {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.raster-wt {
  padding: 2px 0 6px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.raster-wt.wochenende {
  color: var(--ink-2);
}
.raster-tag {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 54px;
  padding: 4px 0 6px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink);
  transition: background-color 0.3s ease;
}
.raster-tag:active {
  background: var(--druck);
  transition: none;
}
.raster-nr {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.raster-tag.heute .raster-nr {
  color: var(--rot);
  font-weight: 700;
}
.raster-tag.mein .raster-nr {
  background: var(--rot);
  color: #fff;
  font-weight: 650;
}
.raster-tag.fremd {
  color: var(--ink-4);
}
.raster-tag.fremd .raster-punkte {
  opacity: 0.4;
}
.raster-tag.vorbei:not(.fremd) .raster-nr {
  color: var(--ink-3);
}
.raster-tag.vorbei.mein .raster-nr {
  background: var(--ink-3);
  color: #fff;
}
.raster-tag.leer::after {
  content: '';
  position: absolute;
  inset: 3px 4px;
  border: 1.5px dashed rgba(179, 32, 43, 0.28);
  border-radius: 11px;
  pointer-events: none;
}
.raster-tag.problem::before {
  content: '';
  position: absolute;
  top: 4px;
  right: calc(50% - 21px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gelb-voll);
  box-shadow: 0 0 0 2px var(--surface);
}
.raster-punkte {
  display: flex;
  justify-content: center;
  gap: 3px;
  height: 7px;
}
.raster-punkte i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
}
.raster-punkte i.mehr {
  width: auto;
  height: 7px;
  box-shadow: none;
  color: var(--ink-3);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  line-height: 7px;
}
.raster-lern {
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--ink-4);
}
.raster-namen {
  display: none;
}

.legende {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 10px 4px 0;
  color: var(--ink-2);
  font-size: 12px;
}
.legende span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.legende i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.legende i.bunt {
  background: conic-gradient(#9562b2 0 25%, #ffff00 0 50%, #00b050 0 75%, #00b0f0 0);
}
.legende i.lern {
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--ink-4);
}
.legende i.leer-muster {
  width: 12px;
  height: 12px;
  border: 1.5px dashed rgba(179, 32, 43, 0.45);
  border-radius: 4px;
}

/* Tagesliste */
.tag-zeile {
  --einzug: 68px;
  align-items: center;
  gap: 14px;
  min-height: 58px;
}
.tag-datum {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 38px;
  line-height: 1.1;
}
.tag-datum small {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.tag-datum b {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.tag-datum.wochenende small {
  color: var(--rot);
}
.tag-zeile.heute .tag-datum b {
  color: var(--rot);
}
.tag-zeile.vorbei .tag-datum b {
  color: var(--ink-3);
}
.tag-leute {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}
.tag-frei {
  color: var(--ink-3);
  font-size: 15px;
}
.tag-zeile:not(.vorbei) .tag-frei {
  color: var(--rot);
}
.tag-warnung {
  flex-shrink: 0;
  color: var(--gelb-voll);
}
.chip-name {
  --farbe: #c7c7cc;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 26px;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--farbe) 20%, var(--surface));
  color: var(--ink);
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.01em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.chip-name i {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--farbe);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.2);
}
.chip-name.ehrenamt {
  background: rgba(255, 0, 0, 0.1);
}
.chip-name.zweit {
  background: var(--fuellung-2);
  color: var(--ink-2);
  font-weight: 500;
}
.tag-zeile.mein {
  background: rgba(179, 32, 43, 0.05);
}

/* Tages-Sheet */
.tag-zeit {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -4px 0 14px;
  color: var(--ink-2);
  font-size: 15px;
}
.tag-zeit svg {
  width: 16px;
  height: 16px;
}
.tag-sheet .hinweis {
  margin-bottom: 4px;
}
.tag-sheet .abschnitt-kopf {
  align-items: center;
  margin: 18px 4px 8px;
}
.tag-sheet .abschnitt-kopf h3 {
  font-size: 19px;
}
.zahl-pille {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--fuellung);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.leer-liste .zeile-text span {
  font-size: 16px;
}
.personen-zeile {
  --einzug: 42px;
  gap: 12px;
}
.person-farbe {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.25);
}
.person-farbe.gross {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}
.personen-zeile .zeile-text b {
  overflow-wrap: anywhere;
}
.personen-zeile .segment {
  flex-shrink: 0;
  width: 128px;
}
.personen-zeile .segment-option {
  min-height: 30px;
  font-size: 13px;
}
/* Schmale Handys: Dienst/Schule-Schalter unter den Namen, Knöpfe untereinander */
@media (max-width: 379px) {
  .personen-zeile:has(.segment) {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 8px;
  }
  .personen-zeile:has(.segment) .segment {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    width: 140px;
  }
  .personen-zeile:has(.segment) .weg-knopf {
    grid-column: 3;
    grid-row: 1;
  }
}
.weg-knopf {
  flex-shrink: 0;
  margin-right: -10px;
  color: var(--ink-3);
}
.personen-zeile:disabled {
  opacity: 1;
  cursor: default;
}
.personen-zeile:disabled .zeile-text b {
  color: var(--ink-3);
}
.zeile-plus {
  flex-shrink: 0;
  color: var(--rot);
  stroke-width: 2.4;
}
.zeile-haken {
  flex-shrink: 0;
  color: var(--gruen);
  stroke-width: 2.6;
}
.zeile-warnung {
  flex-shrink: 0;
  color: var(--gelb-voll);
}
.zeile-symbol.warn {
  background: var(--gelb-voll);
}
.tag-aktionen {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 22px;
}
.tag-aktionen > .voll,
.tag-aktionen > .hilfe {
  grid-column: 1 / -1;
}
.wahl-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 10px;
  margin: -6px 0 10px;
}
.wahl-kopf b {
  font-size: 17px;
  font-weight: 600;
}
.wahl-kopf .zurueck-link {
  margin: 0 0 0 -8px;
}
.suche {
  margin-bottom: 12px;
}
.wahl-flaeche {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 44px;
  margin: -10px 0 -10px -16px;
  padding: 10px 0 10px 16px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
button.wahl-flaeche:active {
  background: var(--druck);
}
.ehrenamt-wahl,
.kontakt-zeile {
  padding-right: 6px;
  gap: 2px;
}
.ehrenamt-wahl .btn.icon {
  flex-shrink: 0;
  color: var(--rot);
}
.ehrenamt-wahl.da .zeile-text b {
  color: var(--ink-3);
}
.kontakt-zeile {
  --einzug: 64px;
}
.kontakt-zeile .btn.icon {
  flex-shrink: 0;
  color: var(--rot);
}
.zeile-text .zeile-status {
  align-self: flex-start;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--fuellung);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}
.zeile-text .zeile-status.gelb {
  background: var(--gelb-hell);
  color: var(--gelb);
}
.zeile-text .zeile-status.gruen {
  background: var(--gruen-hell);
  color: var(--gruen);
}

/* Auswertung */
.zaehl-zeile {
  --einzug: 42px;
}
.zaehl-zeile:not(:has(.person-farbe)) {
  padding-left: 42px;
}
.zaehl-wert {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  line-height: 1.15;
}
.zaehl-wert b {
  font-size: 20px;
  font-weight: 600;
}
.zaehl-wert small {
  color: var(--ink-3);
  font-size: 13px;
}
.zaehl-zeile.summe .zeile-text b {
  font-weight: 650;
}

.farb-wahl {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.farb-knopf {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  transition: transform 0.16s var(--ease-out);
}
.farb-knopf:active {
  transform: scale(0.92);
}
.farb-knopf[aria-checked='true'] {
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.18),
    0 0 0 3px var(--surface),
    0 0 0 5px var(--ink);
}

/* ===================================================================== Tablet */

@media (min-width: 640px) {
  :root {
    --rand: 24px;
  }
  .raster.k2,
  .raster.k4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .raster.k3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .raster.auto {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
  .raster > .karte + .karte {
    margin-top: 0;
  }
  .portrait-raster {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }
  .abschnitt-raster {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
  .stufe-spalten {
    grid-template-columns: 1fr 1fr;
  }
  .antwort-raster {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .frage-raster {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .modus-raster {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .uep-kopf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .uep-kopf > .feld:last-child {
    grid-column: 1 / -1 !important;
  }
  .beispiel-zeile {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .held-knoepfe {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
  }
  .ueben-knoepfe {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
  }
  .lese-tabelle.zweispaltig {
    column-count: 2;
    column-gap: 26px;
  }

  /* Dialoge als Karte in der Mitte */
  .dialog-huelle {
    align-items: center;
    padding: 24px;
  }
  .dialog {
    width: min(540px, 100%);
    max-height: min(86vh, 900px);
    padding-bottom: 0;
    border-radius: 20px;
    box-shadow:
      0 24px 64px rgba(0, 0, 0, 0.22),
      0 2px 8px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transform: scale(0.96);
    transition:
      transform 0.24s var(--ease-out),
      opacity 0.18s ease;
  }
  .dialog-huelle.offen .dialog {
    opacity: 1;
  }
  .dialog-huelle:not(.offen) .dialog {
    transition-duration: 0.16s;
  }
  .dialog.breit {
    width: min(900px, 100%);
  }
  .dialog-griff {
    display: none;
  }
  .dialog-kopf {
    cursor: default;
    touch-action: auto;
    padding-top: 14px;
  }
  .dialog-inhalt {
    padding: 8px 22px 20px;
  }
  .dialog-fuss {
    flex-direction: row;
    justify-content: flex-end;
    padding: 12px 18px 16px;
    box-shadow: inset 0 0.5px 0 var(--linie);
  }
  .dialog-fuss .btn {
    width: auto;
    min-height: 42px;
    font-size: 15px;
  }
  .dialog-text {
    text-align: left;
  }
}

/* ============================================================== Schreibtisch */

@media (min-width: 1024px) {
  :root {
    --rand: 40px;
    --kopf: 52px;
  }
  body {
    font-size: 15px;
  }
  .tabbar,
  .topbar-avatar {
    display: none;
  }
  .sidebar {
    position: fixed;
    z-index: 25;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    width: var(--sidebar);
    padding: 18px 12px 14px;
    background: #f6f6f8;
    box-shadow: inset -0.5px 0 0 var(--linie);
  }
  .sidebar-kopf {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 10px 22px;
  }
  .sidebar-kopf .flamme {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }
  .sidebar-kopf .marke b {
    display: block;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.2;
  }
  .sidebar-kopf .marke span {
    display: block;
    font-size: 12px;
    color: var(--ink-2);
  }
  .nav {
    display: grid;
    align-content: start;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
  }
  .nav-gruppe {
    display: grid;
    gap: 2px;
  }
  .nav-gruppe + .nav-gruppe {
    margin-top: 16px;
  }
  .nav-titel {
    padding: 6px 10px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3);
  }
  .nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 9px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.15s ease;
  }
  .nav a:hover {
    background: rgba(0, 0, 0, 0.045);
  }
  .nav a.aktiv {
    background: var(--rot-hell);
    color: var(--rot);
  }
  .nav-symbol {
    display: grid;
    place-items: center;
    color: var(--rot);
  }
  .nav-symbol svg {
    width: 19px;
    height: 19px;
  }
  .sidebar-fuss {
    padding-top: 10px;
    box-shadow: inset 0 0.5px 0 var(--linie);
  }
  .profil-knopf {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: none;
    text-align: left;
    transition: background-color 0.15s ease;
  }
  .profil-knopf:hover {
    background: rgba(0, 0, 0, 0.045);
  }
  .profil-knopf .name {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
  }
  .profil-knopf .name b {
    font-size: 14px;
    font-weight: 600;
  }
  .profil-knopf .name span {
    font-size: 12px;
    color: var(--ink-2);
  }
  .profil-knopf > svg {
    color: var(--ink-3);
  }
  .topbar {
    left: var(--sidebar);
  }
  .inhalt {
    margin-left: var(--sidebar);
    padding-bottom: 56px;
  }
  body.fokus .inhalt {
    padding-bottom: 56px;
  }
  .seitenkopf h2 {
    font-size: 40px;
  }
  .seitenkopf {
    margin-bottom: 26px;
  }
  .raster.k4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .karte {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  }
  .liste-zeile,
  .profil-eintrag,
  .zeile-text b,
  .unterlage-text b {
    font-size: 16px;
  }
  .eingabe {
    min-height: 42px;
    font-size: 15px;
    padding: 9px 13px;
  }
  .btn {
    min-height: 40px;
    font-size: 15px;
  }
  .btn.gross {
    min-height: 48px;
    font-size: 16px;
  }
  .btn.klein {
    min-height: 32px;
    font-size: 14px;
  }
  .auswahl-aktion {
    bottom: 20px;
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .auswahl-aktion .btn {
    width: auto;
  }
  .auswahl-fuss {
    text-align: left;
    padding-left: 6px;
  }
  .uep-kopf {
    grid-template-columns: 220px repeat(3, minmax(0, 1fr));
  }
  .uep-kopf > .feld:last-child {
    grid-column: span 2 !important;
  }
  .ringe-karte {
    padding: 26px;
  }
  .start-oben {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 14px;
  }
  .start-oben .start-aktionen {
    margin-top: 0;
  }
  .start-oben .aktion-kachel {
    min-height: 0;
  }
  .ringe svg {
    width: 150px;
    height: 150px;
  }
  .kk-buehne {
    height: 440px;
  }
  .lupe-flaeche img {
    max-width: min(100%, 1400px);
  }
  .bild-lupe.gross .lupe-flaeche img {
    width: 180%;
  }
}

/* Dienstplan am Schreibtisch: Namen direkt im Monatsraster */
@media (min-width: 1024px) {
  .monatsraster {
    padding: 10px 10px 12px;
  }
  .raster-tage {
    gap: 4px;
  }
  .raster-tag {
    align-items: stretch;
    min-height: 112px;
    padding: 6px;
    background: var(--surface-2);
  }
  .raster-tag.fremd {
    background: none;
  }
  .raster-nr {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }
  .raster-tag.problem::before {
    right: 8px;
    top: 10px;
  }
  .raster-punkte,
  .raster-lern {
    display: none;
  }
  .raster-namen {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
  }
  .raster-namen .chip-name {
    min-height: 22px;
    padding: 1px 7px 1px 6px;
    font-size: 12.5px;
  }
  .tag-zeile {
    min-height: 54px;
  }
}

/* ================================================== Bewegung & Transparenz */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .dialog,
  .toast,
  .kk,
  .kk-innen,
  .tabbar,
  .segment-marke {
    transition-property: opacity !important;
    transition-duration: 0.2s !important;
  }
  .kk-innen.gedreht {
    transform: rotateY(180deg);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar::before,
  .tabbar {
    background: #f7f7fa;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ===================================================================== Druck */

@media print {
  .sidebar,
  .topbar,
  .tabbar,
  .toasts {
    display: none !important;
  }
  .inhalt {
    margin-left: 0;
    padding: 0;
  }
  body {
    background: #fff;
  }
}
