/* MarModify Zentrale
   Gleiche DNA wie das Dental-Dashboard: Geist, Tinte statt Schwarz, Türkis als Marke.
   Signatur-Detail: der ruhig pulsierende Live-Punkt. Er zeigt jederzeit, dass die
   Zentrale verbunden ist, und wird grau, sobald sie es nicht ist. */

@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist-latin.woff2') format('woff2-variations'), url('/fonts/geist-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --grund: oklch(0.972 0.005 205);
  --flaeche: #ffffff;
  --flaeche-2: oklch(0.982 0.004 205);
  --flaeche-3: oklch(0.955 0.006 205);
  --tinte: oklch(0.2 0.02 228);
  --tinte-2: oklch(0.42 0.016 222);
  --tinte-3: oklch(0.55 0.012 216);
  --linie: oklch(0.905 0.007 212);
  --linie-2: oklch(0.94 0.005 212);
  --haarlinie: oklch(0.2 0.02 228 / 0.08);
  --nacht: #0e1a2b;
  --nacht-2: #15283d;
  --marke: oklch(0.8 0.12 195);
  --marke-tief: oklch(0.49 0.095 202);
  --marke-zart: oklch(0.955 0.035 195);
  --rot: oklch(0.56 0.2 25);
  --rot-zart: oklch(0.958 0.028 25);
  --gelb: oklch(0.6 0.13 65);
  --gelb-zart: oklch(0.966 0.042 88);
  --gruen: oklch(0.52 0.13 155);
  --gruen-zart: oklch(0.96 0.035 155);
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 20px;
  --radius-xl: 28px;
  --schatten-1: 0 1px 2px oklch(0.2 0.02 228 / 0.05), 0 0 0 1px var(--haarlinie);
  --schatten-2: 0 12px 32px -12px oklch(0.2 0.02 228 / 0.22), 0 2px 6px oklch(0.2 0.02 228 / 0.06), 0 0 0 1px var(--haarlinie);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --oben: env(safe-area-inset-top, 0px);
  --unten: env(safe-area-inset-bottom, 0px);
  --links: env(safe-area-inset-left, 0px);
  --rechts: env(safe-area-inset-right, 0px);
  --tabbar: 56px;
  --seite: 16px;
}

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

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--grund);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Geist', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--tinte);
  background: var(--grund);
  font-feature-settings: 'ss01' on;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

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

input,
textarea,
select {
  font-size: 16px;
}

button,
a,
[role='button'] {
  touch-action: manipulation;
}

button,
[role='button'],
.chip,
.tab {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

a {
  color: var(--marke-tief);
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--marke-tief);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Eigene display-Werte (Knöpfe, Leisten) dürfen das hidden-Attribut nie aushebeln. */
[hidden] {
  display: none !important;
}

.unsichtbar {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.zahl {
  font-variant-numeric: tabular-nums;
}

/* ---------- Grundgerüst ---------- */

#app {
  min-height: 100dvh;
}

.rahmen {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100dvh;
}

.seitenleiste {
  display: none;
}

#inhalt {
  min-width: 0;
  min-height: 100dvh;
}

.seite {
  padding: calc(var(--oben) + 12px) calc(var(--seite) + var(--rechts)) calc(var(--tabbar) + var(--unten) + 32px) calc(var(--seite) + var(--links));
}

body[data-ohne-leiste] .seite {
  padding-bottom: calc(var(--unten) + 32px);
}

/* Kompakte Kopfzeile, die beim Scrollen erscheint (wie die Titelzeile in iOS) */
.kopfleiste {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  height: calc(var(--oben) + 44px);
  padding-top: var(--oben);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  background: oklch(0.985 0.004 205 / 0.82);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 var(--haarlinie);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition:
    opacity 160ms var(--ease-out),
    transform 160ms var(--ease-out);
}

.kopfleiste.sichtbar {
  opacity: 1;
  transform: none;
}

.titelzeile {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 20px;
}

.grosstitel {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.032em;
}

.untertitel {
  margin: 6px 0 0;
  color: var(--tinte-3);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.abschnitt {
  margin: 28px 0 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.abschnitt h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 620;
  letter-spacing: -0.018em;
}

.abschnitt a,
.abschnitt button.textknopf {
  font-size: 15px;
}

/* ---------- Untere Leiste (Telefon) ---------- */

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px calc(8px + var(--rechts)) calc(var(--unten) + 4px) calc(8px + var(--links));
  background: oklch(0.99 0.003 205 / 0.86);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 -1px 0 var(--haarlinie);
}

body[data-ohne-leiste] .tabbar {
  display: none;
}

.tab {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 4px 0 2px;
  border: 0;
  background: none;
  color: var(--tinte-3);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms var(--ease-out);
}

.tab:active {
  transform: scale(0.94);
}

.tab svg {
  width: 26px;
  height: 26px;
}

.tab[aria-current='page'] {
  color: var(--tinte);
}

.tab[aria-current='page'] svg {
  stroke-width: 2.1;
}

.tab .zaehler {
  position: absolute;
  top: 0;
  left: calc(50% + 6px);
}

/* ---------- Seitenleiste (breiter Bildschirm) ---------- */

@media (min-width: 900px) {
  :root {
    --seite: 32px;
  }

  .rahmen {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .tabbar {
    display: none;
  }

  .seitenleiste {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 28px 16px 20px;
    background: var(--flaeche);
    box-shadow: 1px 0 0 var(--haarlinie);
  }

  .seitenleiste .logo {
    width: 132px;
    height: auto;
    margin: 0 10px 6px;
  }

  .seitenleiste .marke-zusatz {
    margin: 0 10px 22px;
    color: var(--tinte-3);
    font-size: 13px;
    font-weight: 560;
    letter-spacing: 0.01em;
  }

  .seitenleiste .tab {
    grid-template-columns: 24px 1fr auto;
    justify-items: start;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-m);
    font-size: 15px;
    font-weight: 540;
  }

  .seitenleiste .tab svg {
    width: 22px;
    height: 22px;
  }

  .seitenleiste .tab .zaehler {
    position: static;
  }

  .seitenleiste .tab[aria-current='page'] {
    background: var(--flaeche-3);
  }

  .seitenleiste .fuss {
    margin-top: auto;
    padding: 0 10px;
    color: var(--tinte-3);
    font-size: 13px;
  }

  .seite {
    padding: 40px var(--seite) 48px;
  }

  body[data-ohne-leiste] .seite {
    padding-bottom: 48px;
  }

  .kopfleiste {
    display: none;
  }

  .grosstitel {
    font-size: 36px;
  }
}

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

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 140ms var(--ease-out),
    background-color 160ms ease,
    opacity 160ms ease;
}

.knopf:active:not(:disabled) {
  transform: scale(0.97);
}

.knopf:disabled {
  opacity: 0.45;
  cursor: default;
}

.knopf svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.knopf.primaer {
  background: var(--nacht);
  color: #fff;
}

.knopf.zweit {
  background: var(--flaeche);
  color: var(--tinte);
  box-shadow: inset 0 0 0 1px var(--linie);
}

.knopf.zart {
  background: var(--flaeche-3);
  color: var(--tinte);
}

.knopf.marke {
  background: var(--marke);
  color: var(--nacht);
}

.knopf.gefahr {
  background: var(--rot-zart);
  color: var(--rot);
}

.knopf.klein {
  min-height: 34px;
  padding: 0 14px;
  font-size: 14px;
}

.knopf.breit {
  width: 100%;
}

.knopf.laedt {
  position: relative;
  color: transparent !important;
}

.knopf.laedt::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--lade-farbe, #fff) transparent var(--lade-farbe, #fff) transparent;
  animation: drehen 600ms linear infinite;
}

.knopf.zweit.laedt::after,
.knopf.zart.laedt::after {
  --lade-farbe: var(--tinte);
}

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

.textknopf {
  border: 0;
  background: none;
  padding: 6px 0;
  color: var(--marke-tief);
  font-weight: 560;
  cursor: pointer;
}

.symbolknopf {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--flaeche);
  color: var(--tinte);
  box-shadow: var(--schatten-1);
  cursor: pointer;
  transition: transform 140ms var(--ease-out);
}

.symbolknopf:active {
  transform: scale(0.94);
}

.symbolknopf svg {
  width: 20px;
  height: 20px;
}

.symbolknopf.flach {
  background: transparent;
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .knopf.primaer:hover:not(:disabled) {
    background: var(--nacht-2);
  }
  .knopf.zweit:hover:not(:disabled) {
    box-shadow: inset 0 0 0 1px oklch(0.85 0.01 212);
  }
  .knopf.zart:hover:not(:disabled) {
    background: oklch(0.935 0.007 205);
  }
  .seitenleiste .tab:hover:not([aria-current='page']) {
    background: var(--flaeche-2);
    color: var(--tinte);
  }
  .zeile:hover {
    background: var(--flaeche-2);
  }
  .textknopf:hover {
    text-decoration: underline;
  }
}

/* ---------- Zähler, Chips, Punkte ---------- */

.zaehler {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--marke-tief);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.zaehler.rot {
  background: var(--rot);
}

.zaehler.leise {
  background: var(--linie);
  color: var(--tinte-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--flaeche-3);
  color: var(--tinte-2);
}

.chip svg {
  width: 14px;
  height: 14px;
}

.chip.offen {
  background: var(--gelb-zart);
  color: var(--gelb);
}

.chip.uebernommen {
  background: var(--marke-zart);
  color: var(--marke-tief);
}

.chip.erledigt {
  background: var(--gruen-zart);
  color: var(--gruen);
}

.chip.dringend {
  background: var(--rot-zart);
  color: var(--rot);
}

.punkt {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tinte-3);
  flex: none;
}

.punkt.ok {
  background: var(--gruen);
}

.punkt.gestoert {
  background: var(--rot);
}

.punkt.rot {
  background: var(--rot);
}

/* Signatur: der Live-Punkt */
.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--tinte-3);
}

.live .punkt {
  position: relative;
  background: var(--marke-tief);
}

.live .punkt::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--marke);
  opacity: 0;
  animation: puls 2.4s var(--ease-out) infinite;
}

.live.getrennt .punkt {
  background: var(--tinte-3);
}

.live.getrennt .punkt::after {
  animation: none;
}

@keyframes puls {
  0% {
    transform: scale(0.6);
    opacity: 0.55;
  }
  70%,
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ---------- Karten und Listen ---------- */

.karte {
  background: var(--flaeche);
  border-radius: var(--radius-l);
  box-shadow: var(--schatten-1);
}

.liste {
  background: var(--flaeche);
  border-radius: var(--radius-l);
  box-shadow: var(--schatten-1);
  overflow: hidden;
}

.zeile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 10px 16px;
  border: 0;
  background: none;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  transition: background-color 120ms ease;
}

.zeile:active {
  background: var(--flaeche-3);
}

.zeile + .zeile::before,
.zeile + .zeile-gruppe::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 70px;
  height: 1px;
  background: var(--linie-2);
}

.zeile.ohne-symbol {
  grid-template-columns: minmax(0, 1fr) auto;
}

.zeile.ohne-symbol + .zeile::before {
  left: 16px;
}

.zeile .haupt {
  min-width: 0;
}

.zeile .titel {
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kurzname {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12.5px;
  color: var(--tinte-2);
}

.zeile .unter {
  color: var(--tinte-3);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zeile .rechts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: var(--tinte-3);
  font-size: 13px;
}

.zeile .pfeil {
  color: var(--tinte-3);
  width: 18px;
  height: 18px;
}

.symbolkachel {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  flex: none;
  background: var(--k-grund, var(--flaeche-3));
  color: var(--k-farbe, var(--tinte-2));
}

.symbolkachel svg {
  width: 22px;
  height: 22px;
}

.symbolkachel.klein {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.symbolkachel.klein svg {
  width: 17px;
  height: 17px;
}

[data-farbe='teal'] {
  --k-grund: oklch(0.94 0.045 195);
  --k-farbe: oklch(0.45 0.09 200);
}
[data-farbe='blau'] {
  --k-grund: oklch(0.94 0.035 250);
  --k-farbe: oklch(0.48 0.13 255);
}
[data-farbe='gruen'] {
  --k-grund: oklch(0.945 0.04 155);
  --k-farbe: oklch(0.47 0.11 155);
}
[data-farbe='gold'] {
  --k-grund: oklch(0.955 0.05 85);
  --k-farbe: oklch(0.52 0.11 70);
}
[data-farbe='orange'] {
  --k-grund: oklch(0.95 0.045 50);
  --k-farbe: oklch(0.55 0.15 45);
}
[data-farbe='rot'] {
  --k-grund: oklch(0.95 0.035 25);
  --k-farbe: oklch(0.53 0.18 25);
}
[data-farbe='grau'] {
  --k-grund: oklch(0.94 0.008 220);
  --k-farbe: oklch(0.42 0.02 220);
}
[data-farbe='nacht'] {
  --k-grund: var(--nacht);
  --k-farbe: oklch(0.85 0.1 195);
}

.leer {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
  color: var(--tinte-3);
}

.leer svg {
  width: 32px;
  height: 32px;
  color: var(--tinte-3);
}

.leer strong {
  color: var(--tinte);
  font-weight: 600;
  font-size: 17px;
}

/* ---------- Überblick ---------- */

.held {
  position: relative;
  overflow: hidden;
  padding: 22px 22px 20px;
  border-radius: var(--radius-xl);
  color: #fff;
  background:
    radial-gradient(120% 130% at 100% 115%, oklch(0.5 0.09 200 / 0.62), transparent 58%),
    radial-gradient(80% 90% at 0% -20%, oklch(0.35 0.05 230 / 0.6), transparent 60%),
    var(--nacht);
  box-shadow: 0 18px 40px -18px oklch(0.25 0.05 225 / 0.55);
}

.held .gross {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.held .gross .zahl {
  font-size: 60px;
  line-height: 1;
  font-weight: 640;
  letter-spacing: -0.045em;
}

.held .gross span:last-child {
  font-size: 18px;
  font-weight: 520;
  color: oklch(0.92 0.02 210);
}

.held .teile {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 18px;
}

.held .teile .chip {
  background: oklch(1 0 0 / 0.1);
  color: oklch(0.95 0.01 210);
}

.held .teile .chip.dringend {
  background: oklch(0.6 0.2 25 / 0.28);
  color: oklch(0.92 0.06 25);
}

.held .knopf {
  background: #fff;
  color: var(--nacht);
}

.held.ruhig .gross .zahl {
  color: oklch(0.85 0.1 195);
}

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

@media (min-width: 900px) {
  .raster {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
  .ueberblick-oben {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
  }
}

.kanalkarte {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 0;
  text-align: left;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms var(--ease-out);
}

.kanalkarte:active {
  transform: scale(0.98);
}

.kanalkarte .kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanalkarte .name {
  font-weight: 620;
  letter-spacing: -0.012em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanalkarte .werte {
  color: var(--tinte-3);
  font-size: 14px;
}

.kanalkarte .werte b {
  color: var(--tinte);
  font-weight: 620;
}

.kennzahl {
  padding: 16px;
  display: grid;
  gap: 4px;
  text-decoration: none;
  color: inherit;
}

.kennzahl .label {
  color: var(--tinte-3);
  font-size: 14px;
  font-weight: 520;
}

.kennzahl .wert {
  font-size: 30px;
  line-height: 1.1;
  font-weight: 640;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.kennzahl .hinweis {
  font-size: 13px;
  color: var(--tinte-3);
}

.kennzahl[data-ton='gut'] .hinweis {
  color: var(--gruen);
}

.kennzahl[data-ton='warnung'] .hinweis {
  color: var(--gelb);
}

.kennzahl[data-ton='kritisch'] .wert,
.kennzahl[data-ton='kritisch'] .hinweis {
  color: var(--rot);
}

.hinweiskarte {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-l);
  background: var(--gelb-zart);
  color: oklch(0.38 0.07 65);
}

.hinweiskarte.marke {
  background: var(--marke-zart);
  color: oklch(0.32 0.06 205);
}

.hinweiskarte svg {
  width: 22px;
  height: 22px;
  margin-top: 1px;
}

.hinweiskarte strong {
  display: block;
  margin-bottom: 2px;
  color: var(--tinte);
}

.hinweiskarte p {
  margin: 0;
  font-size: 15px;
}

.hinweiskarte .knopf {
  margin-top: 12px;
}

/* ---------- Meldungs-Karte ---------- */

.meldung {
  background: var(--flaeche);
  border-radius: var(--radius-l);
  box-shadow: var(--schatten-1);
  overflow: hidden;
}

.meldung .mkopf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 0;
  color: var(--tinte-3);
  font-size: 13px;
}

.meldung .mkopf .quelle {
  font-weight: 600;
  color: var(--tinte-2);
}

.meldung .mkopf .rechts {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.meldung .mrumpf {
  padding: 8px 16px 14px;
}

.meldung h3 {
  margin: 0 0 4px;
  font-size: 16.5px;
  line-height: 1.3;
  font-weight: 620;
  letter-spacing: -0.014em;
}

.meldung .text {
  color: var(--tinte-2);
  font-size: 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.meldung .text a {
  font-weight: 560;
}

.meldung .linkknopf {
  margin-top: 12px;
}

.meldung .mfuss {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px 12px 16px;
  border-top: 1px solid var(--linie-2);
}

.meldung .mfuss .wer {
  margin-right: auto;
  color: var(--tinte-3);
  font-size: 13.5px;
}

.meldung .mfuss .wer b {
  color: var(--tinte);
  font-weight: 600;
}

.meldung.erledigt h3 {
  color: var(--tinte-2);
}

.meldung.markiert {
  animation: markiert 1600ms var(--ease-out);
}

@keyframes markiert {
  0%,
  30% {
    box-shadow: 0 0 0 3px var(--marke), var(--schatten-1);
  }
  100% {
    box-shadow: var(--schatten-1);
  }
}

.meldung .kanalbezug {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tinte-2);
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Chat ---------- */

.chatseite {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--grund);
}

.chatkopf {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: calc(var(--oben) + 8px) calc(12px + var(--rechts)) 10px calc(8px + var(--links));
  background: oklch(0.99 0.003 205 / 0.88);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 var(--haarlinie);
}

.chatkopf .wer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chatkopf .wer .name {
  font-weight: 640;
  letter-spacing: -0.015em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatkopf .wer .unter {
  color: var(--tinte-3);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zurueck {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 40px;
  padding: 0 8px 0 2px;
  border: 0;
  background: none;
  color: var(--marke-tief);
  font-weight: 560;
  text-decoration: none;
  cursor: pointer;
}

.zurueck svg {
  width: 24px;
  height: 24px;
}

.verlauf {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px calc(12px + var(--rechts)) 16px calc(12px + var(--links));
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Im Verlauf darf nichts gestaucht werden, sonst schneidet die Karte ihre Knöpfe ab. */
.verlauf > * {
  flex-shrink: 0;
}

.verlauf > .meldung {
  margin: 6px 0;
  max-width: 640px;
  width: 100%;
}

.tagtrenner {
  align-self: center;
  margin: 14px 0 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: oklch(0.2 0.02 228 / 0.06);
  color: var(--tinte-2);
  font-size: 12.5px;
  font-weight: 600;
}

.blase-gruppe {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: min(78%, 560px);
}

.blase-gruppe.mein {
  align-self: flex-end;
  align-items: flex-end;
}

.blase-gruppe .autor {
  margin: 4px 0 2px 12px;
  color: var(--tinte-3);
  font-size: 12.5px;
  font-weight: 600;
}

.blase {
  position: relative;
  padding: 8px 12px 6px;
  border-radius: 20px;
  background: var(--flaeche);
  box-shadow: var(--schatten-1);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15.5px;
}

.blase-gruppe:not(.mein) .blase:last-child {
  border-bottom-left-radius: 6px;
}

.blase-gruppe.mein .blase {
  background: var(--nacht);
  color: #fff;
  box-shadow: none;
}

.blase-gruppe.mein .blase:last-child {
  border-bottom-right-radius: 6px;
}

.blase-gruppe.mein .blase a {
  color: oklch(0.86 0.1 195);
}

.blase .zeit {
  float: right;
  margin: 6px 0 -2px 10px;
  font-size: 11.5px;
  color: var(--tinte-3);
  font-variant-numeric: tabular-nums;
}

.blase-gruppe.mein .blase .zeit {
  color: oklch(1 0 0 / 0.55);
}

.blase .zitat {
  display: block;
  margin: 0 0 6px;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--flaeche-3);
  font-size: 13.5px;
  color: var(--tinte-2);
  white-space: normal;
}

.blase-gruppe.mein .blase .zitat {
  background: oklch(1 0 0 / 0.1);
  color: oklch(1 0 0 / 0.8);
}

.blase .zitat b {
  display: block;
  color: var(--marke-tief);
  font-weight: 620;
}

.blase-gruppe.mein .blase .zitat b {
  color: oklch(0.86 0.1 195);
}

.blase .aufgabenstatus {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.neu-hinweis {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 5;
}

.eingabe {
  position: relative;
  z-index: 10;
  padding: 8px calc(12px + var(--rechts)) calc(var(--unten) + 10px) calc(12px + var(--links));
  background: oklch(0.99 0.003 205 / 0.9);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 -1px 0 var(--haarlinie);
}

.eingabe .zeile-eingabe {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.eingabe textarea {
  width: 100%;
  min-height: 42px;
  max-height: 160px;
  padding: 10px 16px;
  border: 0;
  border-radius: 21px;
  background: var(--flaeche);
  box-shadow: inset 0 0 0 1px var(--linie);
  resize: none;
  line-height: 1.35;
  outline: none;
}

.eingabe textarea:focus {
  box-shadow: inset 0 0 0 1.5px var(--marke-tief);
}

.senden {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--nacht);
  color: #fff;
  cursor: pointer;
  transition:
    transform 140ms var(--ease-out),
    opacity 160ms ease;
}

.senden:disabled {
  opacity: 0.3;
  cursor: default;
}

.senden:active:not(:disabled) {
  transform: scale(0.92);
}

.senden svg {
  width: 20px;
  height: 20px;
}

.antwortleiste {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 8px 8px 14px;
  border-radius: 14px;
  background: var(--flaeche-3);
  font-size: 14px;
}

.antwortleiste b {
  display: block;
  color: var(--marke-tief);
}

.antwortleiste span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--tinte-2);
}

.geteilt {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  height: 100dvh;
}

.geteilt-liste {
  overflow-y: auto;
  box-shadow: 1px 0 0 var(--haarlinie);
}

.geteilt-liste .seite {
  padding: 40px 20px 32px;
}

.geteilt-detail {
  min-width: 0;
  height: 100dvh;
}

.geteilt-detail .chatseite {
  height: 100dvh;
}

.geteilt-detail .chatkopf {
  padding-top: 14px;
  padding-left: 20px;
}

.geteilt-detail .verlauf {
  padding: 16px 32px 24px;
}

.geteilt-detail .eingabe {
  padding: 12px 32px 16px;
}

.zeile[aria-current='true'] {
  background: var(--marke-zart);
}

/* ---------- Aufgaben ---------- */

.filterleiste {
  display: flex;
  gap: 8px;
  margin: 0 calc(-1 * var(--seite)) 16px;
  padding: 2px var(--seite) 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filterleiste::-webkit-scrollbar {
  display: none;
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--flaeche);
  box-shadow: var(--schatten-1);
  color: var(--tinte-2);
  font-weight: 560;
  font-size: 14.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 140ms var(--ease-out);
}

.filter:active {
  transform: scale(0.96);
}

.filter[aria-pressed='true'] {
  background: var(--nacht);
  color: #fff;
  box-shadow: none;
}

.filter .zahl {
  color: var(--tinte-3);
  font-weight: 620;
}

.filter[aria-pressed='true'] .zahl {
  color: oklch(0.86 0.1 195);
}

.stapel {
  display: grid;
  gap: 12px;
}

@media (min-width: 1200px) {
  .stapel.zweispaltig {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* ---------- Formulare ---------- */

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

.feld label,
.feld .label {
  font-size: 14px;
  font-weight: 560;
  color: var(--tinte-2);
}

.eingabefeld {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--flaeche);
  box-shadow: inset 0 0 0 1px var(--linie);
  outline: none;
  transition: box-shadow 140ms ease;
}

.eingabefeld:focus {
  box-shadow: inset 0 0 0 2px var(--marke-tief);
}

.eingabefeld[readonly] {
  background: var(--flaeche-2);
  color: var(--tinte-2);
}

.eingabefeld.code {
  font-size: 28px;
  letter-spacing: 0.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding-left: 0.4em;
}

.feldhinweis {
  font-size: 13.5px;
  color: var(--tinte-3);
}

.fehlertext {
  min-height: 20px;
  margin: 4px 0 12px;
  color: var(--rot);
  font-size: 14.5px;
  font-weight: 520;
}

.schalter {
  position: relative;
  width: 51px;
  height: 31px;
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  border-radius: 999px;
  background: var(--linie);
  cursor: pointer;
  transition: background-color 200ms ease;
}

.schalter::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px oklch(0 0 0 / 0.18);
  transition: transform 220ms var(--ease-out);
}

.schalter:checked {
  background: var(--marke-tief);
}

.schalter:checked::after {
  transform: translateX(20px);
}

.segment {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: var(--flaeche-3);
}

.segment button {
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--tinte-2);
  font-size: 13.5px;
  font-weight: 560;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.segment button[aria-pressed='true'] {
  background: var(--flaeche);
  color: var(--tinte);
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.1), 0 0 0 0.5px oklch(0 0 0 / 0.06);
}

.einstellzeile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 12px 16px;
  position: relative;
}

.einstellzeile + .einstellzeile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 1px;
  background: var(--linie-2);
}

.einstellzeile .unter {
  display: block;
  font-size: 13.5px;
  color: var(--tinte-3);
}

.einstellzeile.gestapelt {
  grid-template-columns: 1fr;
}

.zeitfelder {
  display: flex;
  gap: 8px;
  align-items: center;
}

.zeitfelder input {
  min-height: 38px;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: var(--flaeche-3);
  font-variant-numeric: tabular-nums;
}

.symbolwahl {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.symbolwahl button,
.farbwahl button {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 0;
  border-radius: 12px;
  background: var(--flaeche-3);
  color: var(--tinte-2);
  cursor: pointer;
}

.symbolwahl button[aria-pressed='true'] {
  background: var(--nacht);
  color: #fff;
}

.symbolwahl svg {
  width: 22px;
  height: 22px;
}

.farbwahl {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.farbwahl button {
  background: var(--k-grund);
  color: var(--k-farbe);
  border-radius: 50%;
}

.farbwahl button[aria-pressed='true'] {
  box-shadow: 0 0 0 2px var(--flaeche), 0 0 0 4px var(--tinte);
}

.farbwahl button svg {
  width: 16px;
  height: 16px;
}

.geheimnis {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 15px;
  letter-spacing: 0.06em;
  word-break: break-all;
  padding: 12px 14px;
  border-radius: var(--radius-m);
  background: var(--flaeche-3);
}

.codeblock {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  padding: 12px 14px;
  border-radius: var(--radius-m);
  background: var(--nacht);
  color: oklch(0.92 0.02 210);
}

/* ---------- Anmeldung ---------- */

.auth {
  min-height: 100dvh;
  display: grid;
  align-content: start;
  justify-items: center;
  padding: calc(var(--oben) + 40px) 20px calc(var(--unten) + 32px);
  background:
    radial-gradient(90% 60% at 100% 0%, oklch(0.93 0.05 195 / 0.7), transparent 60%),
    var(--grund);
}

.auth-karte {
  width: 100%;
  max-width: 440px;
  padding: 28px 24px 24px;
}

.auth .logo {
  width: 150px;
  height: auto;
  display: block;
  margin-bottom: 28px;
}

.auth h1 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.auth .lead {
  margin: 0 0 24px;
  color: var(--tinte-3);
}

.auth .fussnote {
  margin-top: 20px;
  max-width: 440px;
  color: var(--tinte-3);
  font-size: 13.5px;
  text-align: center;
}

.schritte {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}

.schritte span {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: var(--linie);
}

.schritte span.an {
  background: var(--marke-tief);
}

.qr {
  display: block;
  width: 200px;
  height: 200px;
  margin: 8px auto 16px;
  padding: 12px;
  border-radius: var(--radius-l);
  background: #fff;
  box-shadow: var(--schatten-1);
}

/* ---------- Toast und Blatt ---------- */

.toast-bereich {
  position: fixed;
  inset: auto 0 calc(var(--tabbar) + var(--unten) + 16px) 0;
  z-index: 60;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}

body[data-ohne-leiste] .toast-bereich {
  bottom: calc(var(--unten) + 96px);
}

.toast {
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--nacht);
  color: #fff;
  font-size: 15px;
  font-weight: 520;
  box-shadow: 0 12px 32px -8px oklch(0 0 0 / 0.35);
  opacity: 1;
  transform: none;
  transition:
    opacity 200ms var(--ease-out),
    transform 200ms var(--ease-out);
  @starting-style {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.toast.fehler {
  background: var(--rot);
}

.toast.weg {
  opacity: 0;
  transform: translateY(8px);
}

.schleier {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: oklch(0.15 0.02 228 / 0.38);
  opacity: 1;
  transition: opacity 240ms var(--ease-out);
  @starting-style {
    opacity: 0;
  }
}

.schleier.weg {
  opacity: 0;
}

.blatt {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 71;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px calc(16px + var(--rechts)) calc(var(--unten) + 16px) calc(16px + var(--links));
  border-radius: 24px 24px 0 0;
  background: var(--grund);
  box-shadow: 0 -8px 40px oklch(0 0 0 / 0.18);
  transform: none;
  transition: transform 320ms var(--ease-drawer);
  @starting-style {
    transform: translateY(100%);
  }
}

.blatt.weg {
  transform: translateY(100%);
}

.blatt .griff {
  width: 36px;
  height: 5px;
  margin: 4px auto 14px;
  border-radius: 999px;
  background: var(--linie);
}

.blatt h2 {
  margin: 0 4px 14px;
  font-size: 20px;
  font-weight: 640;
  letter-spacing: -0.02em;
}

.blatt .aktionen {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.aktionsliste {
  display: grid;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: var(--flaeche);
  box-shadow: var(--schatten-1);
}

.aktionsliste button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  border: 0;
  background: none;
  font-size: 16px;
  font-weight: 520;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.aktionsliste button + button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 48px;
  right: 0;
  height: 1px;
  background: var(--linie-2);
}

.aktionsliste button:active {
  background: var(--flaeche-3);
}

.aktionsliste button svg {
  width: 20px;
  height: 20px;
  color: var(--tinte-2);
}

.aktionsliste button.gefahr {
  color: var(--rot);
}

.aktionsliste button.gefahr svg {
  color: var(--rot);
}

@media (min-width: 900px) {
  .blatt {
    inset: 50% auto auto 50%;
    width: min(520px, 92vw);
    max-height: 84dvh;
    padding: 20px 24px 24px;
    border-radius: 24px;
    transform: translate(-50%, -50%);
    transition:
      transform 220ms var(--ease-out),
      opacity 220ms var(--ease-out);
    @starting-style {
      transform: translate(-50%, -48%) scale(0.98);
      opacity: 0;
    }
  }
  .blatt.weg {
    transform: translate(-50%, -48%) scale(0.98);
    opacity: 0;
  }
  .blatt .griff {
    display: none;
  }
  .toast-bereich {
    bottom: 24px;
  }
}

.einladungsband {
  z-index: 90;
}

.versionsband {
  position: fixed;
  inset: calc(var(--oben) + 8px) 12px auto 12px;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  border-radius: 16px;
  background: var(--nacht);
  color: #fff;
  font-size: 14.5px;
  box-shadow: 0 12px 32px -8px oklch(0 0 0 / 0.35);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .live .punkt::after {
    display: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .tabbar,
  .kopfleiste,
  .chatkopf,
  .eingabe {
    background: var(--flaeche);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ===================================================================== Meetings */

body[data-vollbild] .seitenleiste,
body[data-vollbild] .tabbar {
  display: none;
}

body[data-vollbild] .rahmen {
  grid-template-columns: minmax(0, 1fr);
}

.meeting-start {
  display: grid;
  gap: 16px;
  padding: 20px;
  margin-bottom: 8px;
}

.meeting-start-text strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.015em;
}

.meeting-start-text span {
  color: var(--tinte-3);
}

.meeting-start-knoepfe {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (min-width: 900px) {
  .meeting-start {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

.meeting-karte {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.meeting-karte.live {
  box-shadow: 0 0 0 2px var(--marke), var(--schatten-1);
}

.meeting-karte-kopf {
  display: flex;
  gap: 12px;
  align-items: center;
}

.meeting-titel {
  font-weight: 620;
  letter-spacing: -0.012em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-unter {
  color: var(--tinte-3);
  font-size: 14px;
}

.meeting-code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13px;
  color: var(--tinte-2);
  padding: 8px 12px;
  border-radius: var(--radius-m);
  background: var(--flaeche-2);
  overflow-wrap: anywhere;
}

.meeting-karte-knoepfe {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ----- Vorschau vor dem Beitreten ----- */

.meeting-vorschau,
.meeting-ende {
  min-height: 100dvh;
  padding: calc(var(--oben) + 24px) calc(16px + var(--rechts)) calc(var(--unten) + 24px) calc(16px + var(--links));
  background:
    radial-gradient(90% 60% at 100% 0%, oklch(0.93 0.05 195 / 0.6), transparent 60%),
    var(--grund);
}

.meeting-ende {
  display: grid;
  place-items: center;
}

.vorschau-raster {
  display: grid;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .vorschau-raster {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
    align-items: center;
    min-height: calc(100dvh - 48px);
  }
}

.vorschau-bild {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 24px;
  background: var(--nacht);
  box-shadow: var(--schatten-2);
}

@media (min-width: 900px) {
  .vorschau-bild {
    aspect-ratio: 16 / 9;
  }
}

.vorschau-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.vorschau-aus {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: oklch(1 0 0 / 0.72);
  font-weight: 560;
}

.vorschau-leiste {
  position: absolute;
  left: 50%;
  bottom: 16px;
  display: flex;
  gap: 12px;
  transform: translateX(-50%);
}

.pegel {
  position: absolute;
  left: 16px;
  bottom: 30px;
  width: 64px;
  height: 6px;
  border-radius: 999px;
  background: oklch(1 0 0 / 0.18);
  overflow: hidden;
}

.pegel span {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--marke);
  transform-origin: left;
  transform: scaleX(var(--pegel, 0));
  transition: transform 80ms linear;
}

.vorschau-meldung {
  margin: 12px 4px 0;
  color: var(--rot);
  font-size: 14.5px;
  font-weight: 520;
}

.vorschau-meldung:empty {
  display: none;
}

.vorschau-geraete {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-l);
  background: var(--flaeche);
  box-shadow: var(--schatten-1);
}

.vorschau-geraete summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.vorschau-geraete summary::-webkit-details-marker {
  display: none;
}

.geraete {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.geraet-zeile {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--tinte-2);
}

.geraet-zeile svg {
  width: 20px;
  height: 20px;
}

select.eingabefeld {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  padding: 10px 36px 10px 14px;
  background-image: linear-gradient(45deg, transparent 50%, var(--tinte-3) 50%), linear-gradient(135deg, var(--tinte-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  text-overflow: ellipsis;
}

.vorschau-karte {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 28px 24px 24px;
  border-radius: var(--radius-xl);
  background: var(--flaeche);
  box-shadow: var(--schatten-2);
}

.vorschau-logo {
  display: block;
  width: 120px;
  height: auto;
  margin-bottom: 22px;
}

.vorschau-karte h1 {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.12;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.vorschau-karte .lead {
  margin: 0 0 20px;
  color: var(--tinte-3);
}

.knopf.gross {
  min-height: 52px;
  font-size: 16px;
}

.vorschau-nebenknoepfe {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.warten-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  background: var(--marke-zart);
  color: var(--marke-tief);
  font-size: 14px;
  font-weight: 620;
}

.warten-puls {
  position: relative;
  flex: none;
  width: 10px;
  height: 10px;
}

.warten-puls span,
.warten-puls::before,
.warten-puls::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--marke);
}

.warten-puls::before,
.warten-puls::after {
  opacity: 0;
  animation: wartenPuls 2.4s var(--ease-out) infinite;
}

.warten-puls::after {
  animation-delay: 1.2s;
}

@keyframes wartenPuls {
  0% {
    transform: scale(1);
    opacity: 0.45;
  }
  100% {
    transform: scale(3.2);
    opacity: 0;
  }
}

/* ----- runde Knöpfe (Vorschau und Raum) ----- */

.rund {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: oklch(1 0 0 / 0.14);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition:
    transform 140ms var(--ease-out),
    background-color 160ms ease;
}

.rund:active {
  transform: scale(0.94);
}

.rund svg {
  width: 23px;
  height: 23px;
}

.rund.aus {
  background: var(--rot);
}

.rund.an {
  background: var(--marke);
  color: var(--nacht);
}

.rund.auflegen {
  width: 68px;
  border-radius: 999px;
  background: var(--rot);
}

.rund-zahl {
  position: absolute;
  top: -2px;
  right: -2px;
}

@media (hover: hover) and (pointer: fine) {
  .rund:hover:not(.aus):not(.an):not(.auflegen) {
    background: oklch(1 0 0 / 0.22);
  }
}

/* ----- der Raum ----- */

.meeting-raum {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: #0a1420;
  color: #fff;
}

/* Feste Zeilen: das ausgeblendete Verbindungsband darf die Steuerleiste nicht in die Mitte schieben. */
.meeting-raum > .raum-kopf {
  grid-row: 1;
}

.meeting-raum > .raum-band {
  grid-row: 2;
}

.meeting-raum > .raum-mitte {
  grid-row: 3;
}

.meeting-raum > .steuerleiste {
  grid-row: 4;
}

.raum-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--oben) + 10px) calc(16px + var(--rechts)) 8px calc(16px + var(--links));
}

.raum-titel {
  display: grid;
  min-width: 0;
}

.raum-titel strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.raum-meta {
  color: oklch(1 0 0 / 0.6);
  font-size: 13.5px;
}

.raum-kopf-rechts {
  display: flex;
  align-items: center;
  gap: 10px;
}

.raum-link {
  background: oklch(1 0 0 / 0.12);
  color: #fff;
}

.raum-qualitaet {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.raum-qualitaet i {
  width: 4px;
  border-radius: 2px;
  background: oklch(1 0 0 / 0.25);
}

.raum-qualitaet i:nth-child(1) {
  height: 6px;
}
.raum-qualitaet i:nth-child(2) {
  height: 10px;
}
.raum-qualitaet i:nth-child(3) {
  height: 15px;
}

.raum-qualitaet[data-q='excellent'] i,
.raum-qualitaet[data-q='good'] i:nth-child(-n + 2),
.raum-qualitaet[data-q='poor'] i:nth-child(1) {
  background: var(--marke);
}

.raum-qualitaet[data-q='poor'] i:nth-child(1) {
  background: oklch(0.75 0.15 70);
}

.raum-band {
  margin: 0 16px 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: oklch(0.75 0.15 70 / 0.22);
  color: oklch(0.92 0.08 80);
  font-size: 14px;
  font-weight: 560;
  text-align: center;
}

.raum-mitte {
  display: flex;
  min-height: 0;
}

.buehne {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  padding: 4px calc(12px + var(--rechts)) 8px calc(12px + var(--links));
}

.buehne.mit-praesentation {
  grid-template-columns: minmax(0, 1fr) 240px;
}

.praesentation {
  position: relative;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #050b12;
}

.praesentation video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.praesentation-name {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: oklch(0 0 0 / 0.55);
  font-size: 13px;
}

.eigene-freigabe {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  height: 100%;
  color: oklch(1 0 0 / 0.8);
}

/* Größe je Kachel rechnet rasterSetzen() aus, das Raster steht mittig auf der Bühne. */
.kacheln {
  display: grid;
  grid-template-columns: repeat(var(--spalten, 1), var(--kachel-b, minmax(0, 1fr)));
  grid-auto-rows: var(--kachel-h, minmax(0, 1fr));
  justify-content: center;
  align-content: center;
  gap: 10px;
  min-height: 0;
}

.buehne.mit-praesentation .kacheln {
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: minmax(0, 150px);
  justify-content: stretch;
  align-content: start;
  overflow-y: auto;
}

@media (max-width: 899px) {
  .buehne.mit-praesentation {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 112px;
  }
  .buehne.mit-praesentation .kacheln {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 150px;
    grid-auto-rows: 100%;
    justify-content: start;
    overflow-x: auto;
    overflow-y: hidden;
  }

  /* Chat oder Teilnehmer offen: die Kacheln rücken in den sichtbaren Streifen über dem Blatt. */
  .meeting-raum.mit-panel .buehne {
    padding-bottom: max(8px, calc(min(75dvh, 640px) - 66px - var(--unten)));
  }
}

.kachel {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #13253a;
  transition: box-shadow 160ms ease;
}

.kachel video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 200ms ease;
}

.kachel.mit-bild video {
  opacity: 1;
}

.kachel.lokal video {
  transform: scaleX(-1);
}

.kachel-avatar {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.kachel-avatar span {
  display: grid;
  place-items: center;
  width: clamp(56px, 22%, 112px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: oklch(0.42 0.08 200);
  color: oklch(0.95 0.05 195);
  font-size: clamp(20px, 4vw, 38px);
  font-weight: 620;
  letter-spacing: 0.02em;
}

.kachel.mit-bild .kachel-avatar {
  display: none;
}

/* Signatur im Raum: wer spricht, bekommt den türkisen Rand. */
.kachel.spricht {
  box-shadow: 0 0 0 3px var(--marke), 0 0 28px oklch(0.8 0.12 195 / 0.35);
}

.kachel-fuss {
  position: absolute;
  left: 10px;
  bottom: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.kachel-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 10px;
  border-radius: 999px;
  background: oklch(0 0 0 / 0.5);
  font-size: 13px;
  font-weight: 560;
}

.kachel-mikro {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: oklch(0 0 0 / 0.5);
}

.kachel-mikro.aus {
  background: var(--rot);
}

.kachel-qualitaet {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: oklch(1 0 0 / 0.3);
}

.kachel-qualitaet[data-q='excellent'],
.kachel-qualitaet[data-q='good'] {
  background: var(--marke);
}

.kachel-qualitaet[data-q='poor'] {
  background: oklch(0.75 0.15 70);
}

.kachel-qualitaet[data-q='lost'] {
  background: var(--rot);
}

.steuerleiste {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px calc(12px + var(--rechts)) calc(var(--unten) + 14px) calc(12px + var(--links));
}

@media (max-width: 420px) {
  .steuerleiste {
    gap: clamp(4px, 1.6vw, 8px);
  }
  .steuerleiste .rund {
    width: clamp(40px, 11.5vw, 46px);
    height: clamp(40px, 11.5vw, 46px);
  }
  .steuerleiste .rund.auflegen {
    width: calc(clamp(40px, 11.5vw, 46px) + 8px);
  }
}

.ton-hinweis {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 45;
  transform: translate(-50%, -50%);
}

.audio-ablage {
  display: none;
}

/* Seitenleiste im Raum: hell, damit Chat und Liste gut lesbar sind */
.raum-panel {
  width: 360px;
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 4px 12px 8px 0;
  border-radius: 20px;
  background: var(--flaeche);
  color: var(--tinte);
  overflow: hidden;
}

@media (max-width: 899px) {
  .raum-panel {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    width: auto;
    height: min(75dvh, 640px);
    margin: 0;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -12px 40px oklch(0 0 0 / 0.35);
    padding-bottom: var(--unten);
  }
}

.panel-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 10px 18px;
  box-shadow: 0 1px 0 var(--linie-2);
  font-size: 17px;
}

.panel-chat,
.panel-leute {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px;
}

.chat-zeile {
  margin-bottom: 12px;
}

.chat-wer {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
  font-weight: 620;
}

.chat-wer span {
  color: var(--tinte-3);
  font-weight: 450;
}

.chat-text {
  margin-top: 2px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.chat-zeile.eigen .chat-wer {
  color: var(--marke-tief);
}

.panel-eingabe {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 12px 12px;
  box-shadow: 0 -1px 0 var(--linie-2);
}

.chat-feld {
  width: 100%;
  min-height: 42px;
  max-height: 120px;
  padding: 10px 14px;
  border: 0;
  border-radius: 21px;
  background: var(--flaeche-3);
  resize: none;
  outline: none;
}

.panel-abschnitt {
  margin: 8px 4px 6px;
  color: var(--tinte-3);
  font-size: 13px;
  font-weight: 600;
}

.person {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
}

.person.warten {
  grid-template-columns: 36px minmax(0, 1fr);
  padding: 10px;
  margin-bottom: 6px;
  border-radius: 14px;
  background: var(--marke-zart);
}

.person.warten .person-knoepfe {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

.person-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--nacht);
  color: oklch(0.86 0.1 195);
  font-size: 13px;
  font-weight: 650;
}

.person-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 560;
}

.person-name span {
  display: block;
  color: var(--tinte-3);
  font-size: 12.5px;
  font-weight: 450;
}

.person-mikro {
  color: var(--tinte-2);
}

.person-mikro.aus {
  color: var(--rot);
}

.person-knoepfe {
  display: flex;
  gap: 2px;
}

.panel-fuss {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .warten-puls::before,
  .warten-puls::after {
    display: none;
  }
}
