@font-face {
  font-family: "Jost";
  src: url("fonts/Jost-var.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f3f3f1;
  --flaeche: #ffffff;
  --text: #1f2328;
  --leise: #5f666d;
  --linie: #d6d8da;
  --akzent: #2b3640;
  --akzent-text: #ffffff;
  --fehler: #9b2c2c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16191c;
    --flaeche: #1e2226;
    --text: #e8eaec;
    --leise: #9aa2a9;
    --linie: #424a52;
    --akzent: #b9c6d3;
    --akzent-text: #16191c;
    --fehler: #e3a5a5;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Jost", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.45;
  font-weight: 400;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
h1 { font-size: 1.2rem; margin: 0; font-weight: 600; letter-spacing: .01em; }
h2 { font-size: .78rem; margin: 28px 0 10px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--leise); }
.leise { color: var(--leise); }
.klein { font-size: .88rem; }
.fehler { color: var(--fehler); min-height: 1.4em; margin: .25rem 0; font-size: .92rem; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; }

.ansicht { max-width: 720px; margin: 0 auto; min-height: 100%; padding: 0 18px 28px; }

/* Anmeldung */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 4px;
  padding: 32px 26px 26px; margin-top: 10vh; }
.karte h1 { font-size: 1.55rem; font-weight: 600; margin-top: 14px; }
.marke { width: 34px; height: 34px; color: var(--akzent); stroke-width: 1.3; }
.untertitel { color: var(--leise); margin: 4px 0 6px; }

label { display: block; margin: 16px 0 0; font-size: .74rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--leise); }
label input { margin-top: 5px; }
input, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: 4px; padding: 11px 12px;
  text-transform: none; letter-spacing: normal;
}
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--akzent); outline-offset: 1px;
}

button { font: inherit; cursor: pointer; border: 0; border-radius: 4px; color: var(--text);
  background: transparent; }
button.primaer { background: var(--akzent); color: var(--akzent-text); padding: 12px 18px;
  font-weight: 500; letter-spacing: .03em; width: 100%; margin-top: 16px; }
button.primaer.klein { width: auto; margin: 0; padding: 8px 14px; font-size: .92rem; }
button.sekundaer { background: transparent; border: 1px solid var(--linie); padding: 11px 18px;
  font-weight: 500; }
button.sekundaer:hover { border-color: var(--leise); }
button.link { color: var(--leise); text-decoration: underline; text-underline-offset: 3px;
  padding: 8px 4px; font-size: .92rem; }
button.icon { width: 44px; height: 44px; flex: none; border-radius: 4px; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; }
button.icon:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
button:disabled { opacity: .5; cursor: default; }
#login-form .link { display: block; margin: 10px auto 0; }

.leiste { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 14px) 0 12px; position: sticky; top: 0;
  background: var(--bg); z-index: 5; border-bottom: 1px solid var(--linie); margin-bottom: 14px; }
.leiste-mitte { flex: 1; min-width: 0; text-align: center; }
.leiste-mitte h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.05rem; }
.leiste-links { white-space: nowrap; }
.platz { width: 44px; }
#chat-tag { width: auto; border: 0; background: transparent; color: var(--leise);
  padding: 0; text-align: center; font-size: .88rem; }

/* Liste der Baustellen */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li button { width: 100%; text-align: left; background: var(--flaeche);
  border: 1px solid var(--linie); padding: 16px 16px; margin-bottom: 8px; border-radius: 4px;
  font-weight: 500; }
.liste li button:hover { border-color: var(--leise); }
.zeile-form { display: flex; gap: 8px; margin-top: 18px; }
.zeile-form .primaer { width: auto; margin: 0; }

/* Chat / Protokoll */
.ansicht.chat { display: flex; flex-direction: column; height: 100dvh; padding-bottom: 0; }
.verlauf { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px 0 12px; }
.blase { background: var(--flaeche); border: 1px solid var(--linie); border-left: 3px solid var(--akzent);
  border-radius: 4px; padding: 10px 14px 12px; position: relative; }
.blase .kopfzeile { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--leise); margin-bottom: 4px; }
.blase .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.blase.wartet { border-style: dashed; border-left-style: dashed; opacity: .7; }
.blase img { display: block; max-width: 100%; max-height: 340px; border-radius: 2px; margin-bottom: 8px; }
.aktionen { display: none; gap: 16px; margin-top: 8px; }
.blase.offen .aktionen { display: flex; }
.aktionen button { font-size: .86rem; color: var(--leise); text-decoration: underline;
  text-underline-offset: 3px; padding: 2px 0; }
.blase textarea { margin-top: 4px; margin-bottom: 8px; }
.leer { text-align: center; color: var(--leise); margin: auto; max-width: 34ch; }

.status { font-size: .88rem; color: var(--leise); padding: 4px 2px 0; }
.status.aufnahme { color: var(--fehler); font-weight: 500; }
.eingabe { display: flex; align-items: flex-end; gap: 2px;
  padding: 8px 0 calc(env(safe-area-inset-bottom) + 8px); border-top: 1px solid var(--linie); }
.eingabe textarea { resize: none; max-height: 140px; }
.eingabe .senden { color: var(--akzent); }
@media (prefers-color-scheme: dark) { .eingabe .senden { color: var(--text); } }
#mikro-knopf.laeuft { background: var(--fehler); color: #fff; animation: puls 1.4s infinite; }
@keyframes puls { 50% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { #mikro-knopf.laeuft { animation: none; } }

/* Fenster */
.fenster { position: fixed; inset: 0; background: rgba(15, 18, 20, .55); z-index: 10; overflow-y: auto; }
.fenster-inhalt { background: var(--bg); max-width: 640px; margin: 0 auto; min-height: 100%;
  padding: 0 18px 28px; }
.fenster-inhalt textarea { min-height: 4.5em; text-transform: none; }
.mitte { text-align: center; padding: 40px 0; color: var(--leise); }
.knopfreihe { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.knopfreihe .primaer, .knopfreihe .sekundaer { flex: 1; margin-top: 0; text-align: center; }
a.primaer, a.sekundaer { display: block; border-radius: 4px; padding: 12px 18px; font-weight: 500;
  letter-spacing: .03em; text-decoration: none; text-align: center; flex: 1; }
a.primaer { background: var(--akzent); color: var(--akzent-text); }
a.sekundaer { border: 1px solid var(--linie); color: var(--text); }

/* Büro-Einstellungen */
.modus { border: 0; padding: 0; margin: 16px 0 0; display: flex; gap: 18px; flex-wrap: wrap; }
.radio { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--text);
  font-size: .95rem; letter-spacing: normal; text-transform: none; font-weight: 400; }
.radio input { width: auto; margin: 0; }

.kopf-vorschau { display: flex; align-items: stretch; border: 1px solid #555; border-radius: 2px;
  background: #fff; color: #1f2328; min-height: 76px; margin-bottom: 4px; }
.kv-logo, .kv-qr { display: flex; align-items: center; justify-content: center; padding: 6px; }
.kv-logo { flex: 0 0 30%; border-right: 1px solid #777; }
.kv-qr { flex: 0 0 18%; border-left: 1px solid #777; }
.kv-logo:not(:has(img:not([hidden]))), .kv-qr:not(:has(img:not([hidden]))) { display: none; }
.kv-logo img, .kv-qr img { max-width: 100%; max-height: 64px; object-fit: contain; }
.kv-text { flex: 1; padding: 8px 10px; font-size: .8rem; line-height: 1.35; font-weight: 400; }
.kv-text strong { display: block; font-size: .92rem; font-weight: 600; }

.bildzeile { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--linie); }
.bildknoepfe { display: flex; align-items: center; gap: 6px; }
button.sekundaer.klein { padding: 7px 12px; font-size: .9rem; }

.mitglieder li { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 4px;
  padding: 10px 14px; margin-bottom: 8px; overflow-wrap: anywhere; }
.mitglieder .rolle { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--leise); }
.codebox { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.codebox code { flex: 1; background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: 4px; padding: 10px 12px; font-size: 1.05rem; letter-spacing: .05em; overflow-wrap: anywhere; }

.lizenz-text { font-size: 1.15rem; font-weight: 500; margin: 0 0 6px; }
#lizenz-abschnitt a.sekundaer { display: inline-block; margin-top: 8px; flex: none; }
#tagebuch-knopf { white-space: nowrap; }
