/* Control – Oberfläche. Dunkel, ruhig, Systemschrift, keine externen Ressourcen. */
:root {
  --bg: #0e1116;
  --flaeche: #161b22;
  --flaeche2: #1e2530;
  --flaeche3: #273040;
  --linie: #2b3441;
  --text: #e8ecf1;
  --gedaempft: #a3adbb;
  --akzent: #6cb6ff;
  --akzent-dunkel: #1d3b5c;
  --gut: #5fd08a;
  --warn: #f2c36b;
  --rot: #ff6b6b;
  --rot-dunkel: #5a1f24;
  --fokus: #9cd2ff;
  --radius: 14px;
  --sicher-o: env(safe-area-inset-top, 0px);
  --sicher-u: env(safe-area-inset-bottom, 0px);
  --sicher-l: env(safe-area-inset-left, 0px);
  --sicher-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
/* iOS zoomt bei Fokus, wenn Schrift < 16 px – daher überall mindestens 16 px */
input, select, textarea { font-size: 16px; }

button {
  cursor: pointer;
  border: 0;
  background: none;
  min-height: 44px;
  min-width: 44px;
  border-radius: 10px;
  touch-action: manipulation;
}
button:disabled { opacity: .45; cursor: default; }

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

a { color: var(--akzent); }

.noscript { padding: 24px; text-align: center; }

/* ---------- Grundgerüst ---------- */
.app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kopf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--sicher-o) + 6px) calc(var(--sicher-r) + 10px) 6px calc(var(--sicher-l) + 14px);
  background: var(--bg);
}
.kopf { gap: 6px; }
.kopf h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .2px; flex: 0 0 auto; }

.segment {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}
.segment-innen {
  display: inline-flex;
  background: var(--flaeche2);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
  max-width: 100%;
}
.segment button {
  min-height: 44px;
  min-width: 0;
  padding: 0 9px;
  border-radius: 9px;
  color: var(--gedaempft);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.segment button[aria-checked="true"] { background: var(--akzent); color: #06121f; }
.segment .lang { display: none; }
@media (min-width: 560px) {
  .segment .lang { display: inline; }
  .segment .kurz { display: none; }
}

.knopf-symbol {
  font-size: 22px;
  line-height: 1;
  color: var(--gedaempft);
  flex: 0 0 auto;
}
.knopf-symbol:hover { color: var(--text); }

.reiter {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0 calc(var(--sicher-r) + 8px) 0 calc(var(--sicher-l) + 8px);
  border-bottom: 1px solid var(--linie);
  flex: 0 0 auto;
}
.reiter::-webkit-scrollbar { display: none; }
.reiter button {
  flex: 0 0 auto;
  padding: 0 14px;
  border-radius: 0;
  color: var(--gedaempft);
  font-size: 16px;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.reiter button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--akzent); }
/* Verschiebbare Reiterleiste: ausgeblendeter Rand zeigt, dass es weitergeht */
.reiter.mehr-rechts { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.reiter.mehr-links { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); }
.reiter.mehr-links.mehr-rechts { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
@media (max-width: 430px) {
  .reiter { gap: 0; }
  .reiter button { padding: 0 10px; font-size: 15px; }
}

.inhalt {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px calc(var(--sicher-r) + 12px) 20px calc(var(--sicher-l) + 12px);
}

/* ---------- Unten: Eingabe ---------- */
.unten {
  flex: 0 0 auto;
  background: var(--flaeche);
  border-top: 1px solid var(--linie);
  padding: 8px calc(var(--sicher-r) + 10px) calc(var(--sicher-u) + 8px) calc(var(--sicher-l) + 10px);
}
.eingabe { display: flex; align-items: flex-end; gap: 8px; }
.mikro {
  width: 56px; height: 56px;
  min-width: 56px;
  border-radius: 50%;
  background: var(--akzent);
  color: #06121f;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.mikro svg { width: 26px; height: 26px; fill: currentColor; }
.mikro.aufnahme { background: var(--rot); color: #fff; animation: puls 1.2s ease-in-out infinite; }
.mikro.arbeitet { background: var(--flaeche3); color: var(--text); }
@keyframes puls {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, .65); }
  70% { box-shadow: 0 0 0 14px rgba(255, 107, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .mikro.aufnahme { animation: none; }
  .laden::after { animation: none !important; }
}

.textfeld {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  max-height: 140px;
  resize: none;
  border: 1px solid var(--linie);
  background: var(--bg);
  border-radius: 22px;
  padding: 10px 14px;
  line-height: 1.35;
  font-size: 16px;
}
.textfeld:focus-visible { outline: 2px solid var(--fokus); outline-offset: 0; }
.senden {
  min-width: 48px; min-height: 48px;
  border-radius: 50%;
  background: var(--flaeche3);
  color: var(--text);
  font-size: 20px;
  flex: 0 0 auto;
}
.senden:not(:disabled) { background: var(--akzent-dunkel); color: var(--akzent); }

.aufnahme-anzeige {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  font-variant-numeric: tabular-nums;
}
.aufnahme-anzeige .punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--rot); }
.aufnahme-anzeige .zeit { font-size: 18px; font-weight: 600; }
.aufnahme-anzeige .info { color: var(--gedaempft); font-size: 14px; }
.abbrechen {
  margin-left: auto;
  padding: 0 14px;
  background: var(--flaeche3);
  color: var(--text);
}

.bezug {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--gedaempft);
  margin: 0 0 6px 4px;
}
.bezug span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bezug b { color: var(--text); font-weight: 600; }
.bezug button { min-height: 44px; min-width: 44px; color: var(--gedaempft); font-size: 16px; }

.leiste-info {
  font-size: 14px;
  color: var(--text);
  background: var(--akzent-dunkel);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 0 0 8px;
}

/* ---------- Allgemeine Bausteine ---------- */
.leer, .laden, .fehlertext {
  color: var(--gedaempft);
  text-align: center;
  padding: 28px 12px;
}
.fehlertext { color: var(--rot); }
.laden::after {
  content: "";
  display: inline-block;
  width: 14px; height: 14px;
  margin-left: 8px;
  vertical-align: -2px;
  border: 2px solid var(--gedaempft);
  border-right-color: transparent;
  border-radius: 50%;
  animation: drehen .8s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }

.knopf {
  padding: 0 16px;
  background: var(--flaeche3);
  color: var(--text);
  font-weight: 600;
}
.knopf.primaer { background: var(--akzent); color: #06121f; }
.knopf.gefahr { background: var(--rot-dunkel); color: #ffd3d3; }
.knopf.klein { min-height: 44px; font-size: 15px; padding: 0 12px; }  /* SPEC §8: Tippflächen ≥ 44 px */

.abzeichen {
  display: inline-block;
  font-size: 12px;
  line-height: 1.2;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--flaeche3);
  color: var(--gedaempft);
  white-space: nowrap;
  vertical-align: 1px;
}
.abzeichen.warn { background: #4a3a14; color: var(--warn); }
.abzeichen.gut { background: #173a26; color: var(--gut); }
.abzeichen.blau { background: var(--akzent-dunkel); color: var(--akzent); }

.hinweiskarte {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--akzent-dunkel);
  border-radius: var(--radius);
  padding: 4px 4px 4px 12px;
  margin-bottom: 12px;
}
.hinweiskarte .hk-text {
  flex: 1 1 auto;
  text-align: left;
  padding: 8px 0;
  min-height: 44px;
  border-radius: 8px;
  font-size: 15px;
}
.hinweiskarte .hk-text small { display: block; color: var(--akzent); font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.hinweiskarte .hk-zu { color: var(--gedaempft); }

.hinweis-oben {
  color: var(--gedaempft);
  font-size: 14px;
  margin: 0 4px 10px;
}

/* Listen */
.liste { list-style: none; margin: 0; padding: 0; }
.eintrag {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--flaeche);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0 0 8px;
}
.eintrag:active { background: var(--flaeche2); }
.eintrag .zeile1 { display: flex; align-items: baseline; gap: 10px; }
.eintrag .titel { flex: 1 1 auto; font-weight: 650; min-width: 0; overflow-wrap: anywhere; }
.eintrag .wann { flex: 0 0 auto; color: var(--gedaempft); font-size: 13px; white-space: nowrap; }
.eintrag .unter {
  color: var(--gedaempft);
  font-size: 14px;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.eintrag .abzeichen { margin-top: 6px; }

/* Detail */
.zurueck {
  color: var(--akzent);
  padding: 0 8px 0 2px;
  font-weight: 600;
  margin: -4px 0 4px -2px;
}
.detail h2 { font-size: 21px; margin: 4px 2px 6px; overflow-wrap: anywhere; }
.detail .meta { color: var(--gedaempft); font-size: 14px; margin: 0 2px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.detail .karte { background: var(--flaeche); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.detail h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .6px; color: var(--gedaempft); margin: 18px 4px 8px; }
.chatliste .eintrag { padding: 10px 14px; }

/* Markdown */
.md { overflow-wrap: anywhere; }
.md p { margin: 0 0 .6em; }
.md p:last-child { margin-bottom: 0; }
.md h4 { font-size: 16px; margin: .8em 0 .3em; }
.md ul, .md ol { margin: .2em 0 .6em; padding-left: 1.3em; }
.md li { margin: .15em 0; }
.md code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em; background: var(--flaeche3); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--bg); border: 1px solid var(--linie); border-radius: 10px; padding: 10px; overflow-x: auto; margin: .4em 0 .7em; }
.md pre code { background: none; padding: 0; font-size: 13px; white-space: pre; }
.md blockquote { margin: .4em 0; padding-left: 10px; border-left: 3px solid var(--linie); color: var(--gedaempft); }

/* ---------- Control-Chat ---------- */
.chat-kopf {
  position: sticky;
  top: -12px;
  z-index: 2;
  margin: -12px -12px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--linie);
}
.status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--gedaempft);
  min-height: 52px;
}
.status .st-text { flex: 1 1 auto; min-width: 0; }
.status .st-text.laeuft { color: var(--text); }
.status .st-text.fehler { color: var(--rot); }
.status .knopf { min-height: 44px; flex: 0 0 auto; white-space: nowrap; }

.verlauf { display: flex; flex-direction: column; gap: 10px; }
.blase {
  max-width: 88%;
  border-radius: 18px;
  padding: 10px 14px;
  overflow-wrap: anywhere;
}
.blase.thomas {
  align-self: flex-end;
  background: var(--akzent-dunkel);
  border-bottom-right-radius: 6px;
  white-space: pre-wrap;
}
.blase.agent {
  align-self: flex-start;
  background: var(--flaeche);
  border-bottom-left-radius: 6px;
  max-width: 94%;
}
.blase .fuss { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 6px; font-size: 12px; color: var(--gedaempft); white-space: normal; }
.blase.agent .fuss { justify-content: flex-start; }
.blase .kurzfassung {
  font-size: 16px;
  font-weight: 600;
  border-left: 3px solid var(--akzent);
  padding-left: 10px;
}
.blase .kurzfassung .label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--akzent); font-weight: 700; margin-bottom: 2px; }
.blase details { margin-top: 8px; }
.blase summary {
  cursor: pointer;
  color: var(--akzent);
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
  list-style: none;
}
.blase summary::-webkit-details-marker { display: none; }
.blase summary::before { content: "▸"; margin-right: 6px; }
.blase details[open] summary::before { content: "▾"; }
.blase .ganz { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--linie); }
.blase.lokal { opacity: .8; }

/* ---------- To-do ---------- */
.neu-todo { background: var(--flaeche); border-radius: var(--radius); padding: 10px; margin-bottom: 14px; }
.neu-zeile { display: flex; gap: 8px; }
.neu-zeile input[type="text"] {
  flex: 1 1 auto; min-width: 0;
  min-height: 44px;
  border: 1px solid var(--linie);
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 12px;
}
.schnellwahl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.schnellwahl button {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--flaeche2);
  color: var(--gedaempft);
  font-size: 15px;
}
.schnellwahl button[aria-pressed="true"] { background: var(--akzent); color: #06121f; font-weight: 600; }
.schnellwahl input[type="date"] {
  min-height: 44px;
  border: 1px solid var(--linie);
  background: var(--bg);
  border-radius: 10px;
  padding: 4px 8px;
}

.abschnitt { margin-bottom: 16px; }
.abschnitt > h3, .abschnitt > summary {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--gedaempft);
  margin: 0 4px 6px;
  font-weight: 700;
}
.abschnitt > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; list-style: none; }
.abschnitt > summary::-webkit-details-marker { display: none; }
.abschnitt > summary::before { content: "▸"; margin-right: 8px; font-size: 15px; color: var(--akzent); }
.abschnitt[open] > summary::before { content: "▾"; }
.abschnitt h4 { font-size: 14px; color: var(--gedaempft); margin: 10px 4px 6px; font-weight: 600; }
.abschnitt.heute > h3 { color: var(--akzent); }
.todo {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--flaeche);
  border-radius: 12px;
  margin: 0 0 6px;
  padding: 2px 12px 2px 0;
  min-height: 48px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.todo.gewaehlt { background: var(--akzent-dunkel); }
.todo input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 22px; height: 22px;
  margin: 13px 10px 13px 14px;
  border: 2px solid var(--gedaempft);
  border-radius: 50%;                 /* Auswahl = Kreis, nicht Häkchen (Häkchen sähe wie „erledigt“ aus) */
  background: transparent;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.todo input[type="checkbox"]::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--akzent);
  transform: scale(0);
}
.todo input[type="checkbox"]:checked { border-color: var(--akzent); }
.todo input[type="checkbox"]:checked::before { transform: scale(1); }
.todo .t-text { flex: 1 1 auto; min-width: 0; padding: 10px 0; overflow-wrap: anywhere; }
.todo .abzeichen { margin-left: 6px; }
.todo.erledigt .t-text { color: var(--gedaempft); text-decoration: line-through; }

.aktionsleiste {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 8px;
}
.aktionsleiste .abgesetzt { margin-left: 14px; }
.aktionsleiste .anzahl { font-size: 14px; color: var(--gedaempft); margin-right: auto; padding-left: 4px; }

/* ---------- Star Trek ---------- */
.st-leiste {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--sicher-o) + 2px) calc(var(--sicher-r) + 8px) 2px calc(var(--sicher-l) + 6px);
  background: var(--bg);
  border-bottom: 1px solid var(--linie);
  flex: 0 0 auto;
}
.st-leiste button, .st-leiste a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--akzent);
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
}
.st-leiste a { margin-left: auto; font-size: 15px; }
.st-rahmen { flex: 1 1 auto; position: relative; background: #000; margin-bottom: var(--sicher-u); } /* Home-Balken frei */
.st-rahmen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.app.startrek .kopf, .app.startrek .reiter, .app.startrek .inhalt, .app.startrek .unten { display: none; }

/* ---------- Login ---------- */
.login {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--sicher-o) + 20px) calc(var(--sicher-r) + 20px) calc(var(--sicher-u) + 20px) calc(var(--sicher-l) + 20px);
  overflow-y: auto;
}
.login form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login h1 { margin: 0 0 8px; font-size: 30px; text-align: center; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--gedaempft); }
.login input[type="text"], .login input[type="password"] {
  min-height: 48px;
  border: 1px solid var(--linie);
  background: var(--flaeche);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
}
.login .haken { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; color: var(--text); }
.login .haken input { width: 22px; height: 22px; accent-color: var(--akzent); }
.login .knopf { min-height: 50px; font-size: 17px; }
.login .fehlertext { padding: 0; text-align: center; min-height: 1.4em; }

/* ---------- Einstellungen (Vollbild-Blatt) ---------- */
.blatt {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.blatt-kopf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--sicher-o) + 6px) calc(var(--sicher-r) + 10px) 6px calc(var(--sicher-l) + 16px);
  border-bottom: 1px solid var(--linie);
}
.blatt-kopf h2 { margin: 0; font-size: 20px; flex: 1 1 auto; }
.blatt-inhalt {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px calc(var(--sicher-r) + 14px) calc(var(--sicher-u) + 28px) calc(var(--sicher-l) + 14px);
}
.gruppe { background: var(--flaeche); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.gruppe h3 { margin: 0 0 10px; font-size: 16px; }
.gruppe h3 small { color: var(--gedaempft); font-weight: 400; font-size: 14px; }
.feld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; font-size: 14px; color: var(--gedaempft); }
.feld select {
  min-height: 44px;
  border: 1px solid var(--linie);
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text);
}
.klein-hinweis { font-size: 13px; color: var(--gedaempft); margin: 2px 0 10px; }
.schalter-zeile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--linie);
}
.schalter-zeile:last-child { border-bottom: 0; }
.schalter-zeile .sz-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.schalter-zeile .sz-text small { display: block; color: var(--gedaempft); font-size: 13px; }
.schalter {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 51px; height: 31px;
  border-radius: 999px;
  background: var(--flaeche3);
  position: relative;
  cursor: pointer;
  margin: 0;
  transition: background .15s;
}
.schalter::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
.schalter:checked { background: var(--gut); }
.schalter:checked::after { transform: translateX(20px); }
.schalter:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; }

/* ---------- Meldung (Toast) ---------- */
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--sicher-u) + 92px);
  z-index: 30;
  max-width: min(92vw, 520px);
  width: max-content;
  background: #2b3646;
  color: var(--text);
  border-radius: 12px;
  padding: 6px 6px 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
  font-size: 15px;
}
.toast.fehler { background: var(--rot-dunkel); color: #ffe0e0; }
.toast .t-msg { padding: 8px 0; }
.toast button { color: var(--akzent); font-weight: 700; padding: 0 10px; }
.toast.fehler button { color: #fff; }
.toast.ohne-knopf { padding-right: 14px; }

/* ---------- Umbau mit CONTROL (SPEC §10) ---------- */
:root {
  --umbau: #ffb454;
  --umbau-dunkel: #3d2a0c;
  --umbau-linie: #8a5a17;
}
.knopf-umbau {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid var(--umbau-linie);
  background: transparent;
  color: var(--umbau);
  font-size: 14px;
  font-weight: 700;
  position: relative;
}
.knopf-umbau .symbol { font-size: 16px; line-height: 1; }
.knopf-umbau.an { background: var(--umbau); border-color: var(--umbau); color: #1d1204; }
.knopf-umbau.laeuft::after {
  content: "";
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gut);
}
@media (max-width: 359px) {
  .knopf-umbau .wort { display: none; }
}
.segment-innen.umbau-modus button[aria-checked="false"] { color: var(--gedaempft); }
.segment-innen.umbau-modus .vorgemerkt { box-shadow: inset 0 0 0 1px var(--linie); }

.umbau-balken {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--umbau-dunkel);
  border-bottom: 2px solid var(--umbau);
  color: #ffe2b8;
  padding: 4px 4px 4px 12px;
}
.umbau-balken .ub-text { flex: 1 1 auto; min-width: 0; padding: 6px 0; }
.umbau-balken b { display: block; color: var(--umbau); font-size: 15px; }
.umbau-balken small { display: block; font-size: 13px; color: #e9cfa8; }
.umbau-balken .ub-zu { color: var(--umbau); font-size: 18px; }

.unten.umbau { border-top: 2px solid var(--umbau); }
.unten.umbau .textfeld { border-color: var(--umbau-linie); }
.unten.umbau .mikro:not(.aufnahme):not(.arbeitet) { background: var(--umbau); color: #1d1204; }

/* ---------- Foto/Video hochladen (SPEC §12) ---------- */
.kamera {
  width: 48px; height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: var(--flaeche3);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.medien { margin: 0 0 8px; }
.medien-info {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 14px;
  background: var(--akzent-dunkel);
  border-radius: 10px;
  padding: 4px 4px 4px 12px;
  margin-bottom: 6px;
}
.medien-info .knopf { background: var(--flaeche3); color: var(--text); white-space: nowrap; flex: 0 0 auto; }
.medien-leiste {
  display: flex; gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  padding: 2px 2px 4px;
}
.mv { position: relative; flex: 0 0 112px; width: 112px; display: flex; flex-direction: column; gap: 4px; scroll-snap-align: start; }
.mv-bild {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 112px; height: 84px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--flaeche3);
}
.mv-bild img, .mv-bild video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mv-ersatz { font-size: 20px; font-weight: 700; color: var(--gedaempft); }
.mv-dauer, .miniatur .dauer {
  position: absolute; left: 4px; bottom: 4px;
  font-size: 12px; line-height: 1.3;
  background: rgba(0, 0, 0, .7); color: #fff;
  border-radius: 6px; padding: 1px 5px;
  font-variant-numeric: tabular-nums;
}
.mv-dauer:empty { display: none; }
.mv-zu {
  position: absolute; top: 0; right: 0;
  width: 44px; height: 44px; padding: 0;
  color: #fff; font-size: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(0, 0, 0, .75) 0 15px, transparent 16px);
}
.mv-balken { display: block; height: 4px; border-radius: 2px; background: var(--flaeche3); overflow: hidden; }
.mv-fuellung { display: block; height: 100%; width: 0; background: var(--akzent); transition: width .3s; }
.mv.fertig .mv-fuellung { background: var(--gut); }
.mv.fehler .mv-fuellung { background: var(--rot); }
.mv-text { font-size: 12px; line-height: 1.3; color: var(--gedaempft); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; white-space: pre-line; }
.mv.fertig .mv-text { color: var(--gut); }
.mv.fehler .mv-text { color: var(--rot); }
.mv-nochmal { min-height: 44px; font-size: 14px; background: var(--flaeche3); color: var(--text); padding: 0 8px; }
@media (prefers-reduced-motion: reduce) { .mv-fuellung { transition: none; } }

.medien-blatt { position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column; justify-content: flex-end; }
.mb-hinter { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.mb-tafel {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--flaeche);
  border-radius: 18px 18px 0 0;
  padding: 16px calc(var(--sicher-r) + 16px) calc(var(--sicher-u) + 16px) calc(var(--sicher-l) + 16px);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .45);
}
.mb-tafel h2 { margin: 0 0 2px; font-size: 18px; }
.mb-tafel .klein-hinweis { margin: 0; }
.mb-wahl {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  min-height: 60px;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--flaeche3);
  font-size: 17px; font-weight: 600;
  cursor: pointer;
}
.mb-wahl:focus-within { outline: 2px solid var(--fokus); outline-offset: 2px; }
.mb-symbol { font-size: 24px; line-height: 1; }
.datei-eingabe { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.mb-abbrechen { min-height: 50px; background: var(--bg); color: var(--text); }

.miniaturen { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.miniatur { position: relative; display: block; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--flaeche3); }
.miniaturen .miniatur:only-child { width: 200px; height: 150px; }
.miniatur img { display: block; width: 100%; height: 100%; object-fit: cover; }
.miniatur.ohne img { display: none; }
.miniatur.ohne::after { content: "🖼"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.miniatur.video.ohne::after { content: "🎬"; }

/* ---------- Korrektur K: offene Sprachaufnahme, Knopfreihe ---------- */
.aufnahme-offen {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--flaeche); border-radius: 12px; padding: 6px 8px 6px 12px; margin: 0 0 8px;
  font-size: 14px;
}
.aufnahme-offen.fehler { border-left: 3px solid var(--rot); }
.aufnahme-offen .ao-text { flex: 1 1 160px; min-width: 0; color: var(--text); }
.aufnahme-anzeige .info.warn { color: var(--rot); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; }
