:root {
  --bg: #f2f2f7;
  --karte: #ffffff;
  --tinte: #1c1d21;
  --grau: #8e8e93;
  --linie: rgba(60, 60, 67, 0.14);
  --akzent: #0c7d6e;
  --akzent-dunkel: #0a685c;
  --mint: #d9f4ee;
  --rot: #d0342b;
  --gruen: #1f9d55;
  --blau: #0a84ff;
  --orange: #ff9500;
  --lila: #af52de;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--tinte);
  min-height: 100vh;
}

/* Navigationsleiste oben */

#navleiste {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 54px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 12px;
  background: rgba(249, 249, 251, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--linie);
}

#navZurueck {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  border: none;
  background: none;
  color: var(--akzent);
  font: inherit;
  font-size: 16.5px;
  cursor: pointer;
  padding: 6px 8px 6px 0;
}
#navZurueck:active { opacity: 0.5; }
#navZurueck[hidden] { display: none; }

#navTitel {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  max-width: 55vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#navTitel svg { border-radius: 7px; flex: none; }
#navTitel b { font-weight: 750; }

.nav-platz { justify-self: end; width: 22px; }

/* Inhalt */

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 72px 16px 110px;
}

.seite { animation: erscheinen 0.18s ease; }
.seite.rein-rechts { animation: reinRechts 0.32s cubic-bezier(0.3, 0.75, 0.35, 1); }
.seite.rein-links { animation: reinLinks 0.32s cubic-bezier(0.3, 0.75, 0.35, 1); }
@keyframes erscheinen { from { opacity: 0; } to { opacity: 1; } }
@keyframes reinRechts { from { transform: translateX(72px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes reinLinks { from { transform: translateX(-72px); opacity: 0; } to { transform: none; opacity: 1; } }

.gross-titel { font-size: 31px; font-weight: 750; letter-spacing: -0.02em; margin: 6px 4px 4px; }
.unterzeile { color: var(--grau); font-size: 14.5px; margin: 0 4px 18px; line-height: 1.45; }

.kopf-mit-chip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Gruppen und Zeilen im iOS-Stil */

.gruppen-titel {
  font-size: 13px;
  font-weight: 600;
  color: var(--grau);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 22px 18px 7px;
}

.gruppe {
  background: var(--karte);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 1px 1px rgba(15, 18, 24, 0.03);
}

.gruppe-inhalt { padding: 6px 16px 16px; }
.gruppe-inhalt:first-child { padding-top: 2px; }

.zeile {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.zeile + .zeile { border-top: 0.5px solid var(--linie); }
.zeile:active { background: #ececf0; }
.zeile.aus { opacity: 0.45; pointer-events: none; }

.zeilen-icon {
  width: 31px;
  height: 31px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
}

.zeilen-text { flex: 1; min-width: 0; }
.zeilen-text .titel { font-size: 16px; display: block; }
.zeilen-text small { display: block; font-size: 13px; color: var(--grau); margin-top: 1px; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--akzent-dunkel);
  font-weight: 700;
  font-size: 16px;
  display: grid;
  place-items: center;
  flex: none;
}

.pfeil { color: #c7c7cc; flex: none; }

.zeile.akzent-zeile .titel { color: var(--akzent); font-weight: 600; }
.zeile.rot-zeile .titel { color: var(--rot); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e4e4e9;
  color: #5d5f66;
  flex: none;
}
.chip.live { background: #ddf3e4; color: #17663a; }
.chip.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gruen); }

.leer {
  text-align: center;
  color: var(--grau);
  padding: 46px 24px;
  font-size: 15px;
  line-height: 1.6;
}

.banner {
  background: var(--mint);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
  color: #0a584e;
  width: 100%;
  border: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.banner b { display: block; margin-bottom: 2px; }

/* Formulare */

label { display: block; font-size: 13.5px; font-weight: 600; color: #3c3e44; margin: 15px 0 6px; }
label .optional { color: #a3a4aa; font-weight: 500; }

input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  border: 1px solid transparent;
  background: #f1f1f5;
  border-radius: 11px;
  padding: 11px 13px;
  font: inherit;
  font-size: 15.5px;
  color: var(--tinte);
  transition: border-color 0.15s, background 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--akzent);
  background: #fff;
}
textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
textarea.gross { min-height: 170px; }
textarea.prompt { min-height: 320px; font-size: 13.5px; }

.hinweis { font-size: 13px; color: var(--grau); margin-top: 7px; line-height: 1.45; }

.knopfzeile { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }

.primaer, .sekundaer {
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.primaer { background: var(--akzent); color: #fff; }
.primaer:hover { background: var(--akzent-dunkel); }
.sekundaer { background: #e4e4e9; color: var(--tinte); }
.sekundaer:hover { background: #dadae0; }
.breit { width: 100%; }
.klein { font-size: 13.5px; padding: 8px 15px; }
button:disabled { opacity: 0.55; cursor: default; pointer-events: none; }

.quelle-hinweis { font-size: 12.5px; color: var(--grau); }

/* Testanruf */

.test-buehne { text-align: center; padding: 26px 16px 22px; }
.test-kreis {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--mint);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: var(--akzent-dunkel);
  transition: background 0.3s;
}
.test-kreis.aktiv { background: var(--akzent); color: #fff; animation: atmen 1.6s ease-in-out infinite; }
@keyframes atmen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(12, 125, 110, 0.28); }
  50% { box-shadow: 0 0 0 16px rgba(12, 125, 110, 0); }
}
.test-status { font-size: 14.5px; color: var(--grau); min-height: 22px; margin-bottom: 16px; }
.test-status.aktiv { color: var(--akzent-dunkel); font-weight: 600; }

/* Anrufe */

.anruf-kopf {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.anruf + .anruf { border-top: 0.5px solid var(--linie); }
.anruf-kopf:active { background: #ececf0; }
.anruf-kopf .zeit { font-weight: 600; font-size: 15px; }
.anruf-kopf .dauer { color: var(--grau); font-size: 13px; flex: none; }
.anruf-detail { padding: 2px 15px 15px; }

.erfasst-tabelle { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 12px 0; font-size: 14px; }
.erfasst-tabelle dt { color: var(--grau); }
.erfasst-tabelle dd { font-weight: 550; }
.termin-treffer {
  background: var(--mint);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
  color: #0a584e;
  margin: 10px 0;
  font-weight: 600;
}

.transkript { margin-top: 10px; }
.transkript summary { cursor: pointer; font-size: 13.5px; color: var(--akzent); font-weight: 600; }
.transkript-zeilen { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.sprechblase { font-size: 13.5px; line-height: 1.5; padding: 8px 12px; border-radius: 12px; max-width: 88%; }
.sprechblase.assistent { background: #eef0f4; align-self: flex-start; }
.sprechblase.anrufer { background: var(--mint); align-self: flex-end; }
.sprechblase .wer { display: block; font-size: 11px; font-weight: 700; color: var(--grau); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }

/* Anleitung + Nummern */

.schritte { font-size: 14.5px; line-height: 1.65; color: #3c3e44; padding: 4px 16px 16px; }
.schritte p { margin-bottom: 10px; }
.schritte b { display: block; }
code {
  background: #eef0f4;
  border-radius: 6px;
  padding: 2px 7px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  white-space: nowrap;
}

.nummern-zeile { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.nummern-zeile select { flex: 1; min-width: 200px; width: auto; }

/* Meldungen */

#meldungen {
  position: fixed;
  bottom: 104px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  width: min(480px, calc(100vw - 40px));
}
.meldung {
  background: rgba(28, 29, 33, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: auftauchen 0.25s ease;
}
.meldung.fehler { background: rgba(160, 42, 34, 0.94); }
.meldung.gut { background: rgba(14, 106, 92, 0.94); }
@keyframes auftauchen {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tab-Leiste unten */

#tableiste {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 76px;
  padding: 9px 0 max(14px, env(safe-area-inset-bottom));
  background: rgba(249, 249, 251, 0.85);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--linie);
}
#tableiste button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: none;
  background: none;
  color: var(--grau);
  font: inherit;
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
  min-width: 84px;
}
#tableiste button.aktiv { color: var(--akzent); }

@media (max-width: 480px) {
  main { padding: 66px 12px 106px; }
  .gross-titel { font-size: 27px; }
}

/* PIN-Schloss */

.schloss { max-width: 320px; margin: 16vh auto 0; text-align: center; }
.schloss-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 650;
  margin-bottom: 8px;
}
.schloss-logo svg { border-radius: 8px; }
.schloss-logo b { font-weight: 750; }
.schloss-text { color: var(--grau); font-size: 14.5px; margin-bottom: 22px; }
.schloss input { text-align: center; font-size: 20px; letter-spacing: 0.35em; margin-bottom: 12px; }
