/*
 * Reporter. Grundtöne und Markenfarben aus dem Planer (planer/app/public/stil.css),
 * dazu ein Blau als einzige Akzentfarbe für die Hauptaktion. Hell und dunkel an
 * einer Stelle; data-theme am <html> übersteuert die Systemeinstellung.
 */
@font-face { font-family: "Mona Sans"; src: url("/schriften/Mona-Sans.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

:root {
  --grund: #f6f3ee; --karte: #fffdfa; --karte-2: #f0ece4; --rand: #e3ddd2;
  --schrift: #232a33; --leise: #6b6f76;
  --akzent: #1f5fbf; --akzent-schrift: #ffffff; --akzent-zart: #e3ecfa;
  --warn: #9b2335; --ok: #1a5c3a; --gelb: #8a5e12;
  --m-rk: #b95c2a; --m-pawcademy: #1a5c3a; --m-polismedia: #8a6a32;
  --schatten: 0 1px 2px rgba(35, 42, 51, .06), 0 6px 18px rgba(35, 42, 51, .08);
  --leiste-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --grund: #16181c; --karte: #1e2127; --karte-2: #262a31; --rand: #333842;
    --schrift: #ebe8e2; --leise: #a19f9a;
    --akzent: #6ea8ff; --akzent-schrift: #0d1b33; --akzent-zart: #1d2a40;
    --warn: #e0707e; --ok: #62b98a; --gelb: #e2b25a;
    --m-rk: #e08a5a; --m-pawcademy: #5fb58a; --m-polismedia: #d0ae6c;
    --schatten: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --grund: #16181c; --karte: #1e2127; --karte-2: #262a31; --rand: #333842;
  --schrift: #ebe8e2; --leise: #a19f9a;
  --akzent: #6ea8ff; --akzent-schrift: #0d1b33; --akzent-zart: #1d2a40;
  --warn: #e0707e; --ok: #62b98a; --gelb: #e2b25a;
  --m-rk: #e08a5a; --m-pawcademy: #5fb58a; --m-polismedia: #d0ae6c;
  --schatten: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--grund); color: var(--schrift); }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Mona Sans", "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
  min-height: 100dvh; overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a { color: var(--akzent); }
[hidden] { display: none !important; }

/* Kopf */
.kopf {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; background: color-mix(in srgb, var(--grund) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--rand);
}
.kopf-knopf { border: 0; background: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; }
.kopf-titel { font-size: 1.15rem; margin: 0; flex: 1; font-weight: 700; letter-spacing: -.01em; }
.marken-wahl { display: flex; gap: 6px; }
.marken-leiste { max-width: 720px; margin: 0 auto; padding: 10px 16px 0; }
.bereich-wahl { flex: none; padding: 2px; }
.bereich-wahl button { min-height: 34px; padding: 0 10px; font-size: .82rem; }
.erledigt-knopf { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--rand); background: none; flex: none; display: grid; place-items: center; }
.erledigt-knopf.an { background: var(--ok); border-color: var(--ok); color: #fff; }
.todo { display: flex; gap: 12px; align-items: flex-start; padding: 10px 2px; border-bottom: 1px solid var(--rand); }
.todo:last-child { border-bottom: 0; }
.todo .text { flex: 1; min-width: 0; }
.todo.erledigt .text { text-decoration: line-through; color: var(--leise); }
.prio { width: 8px; align-self: stretch; border-radius: 4px; flex: none; }
.prio.hoch { background: var(--warn); } .prio.mittel { background: var(--gelb); } .prio.niedrig { background: var(--ok); } .prio.ohne { background: var(--rand); }
.termin { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rand); }
.termin:last-child { border-bottom: 0; }
.termin time { width: 54px; flex: none; font-variant-numeric: tabular-nums; font-weight: 600; }
.termin .ort { font-size: .82rem; color: var(--leise); }
.mail { padding: 10px 0; border-bottom: 1px solid var(--rand); }
.mail:last-child { border-bottom: 0; }
.mail.ungelesen .betreff { font-weight: 700; }
.mail .auszug { color: var(--leise); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gruss { font-size: 1.5rem; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.01em; }
.marke-chip { border: 1px solid var(--rand); background: var(--karte); border-radius: 999px; padding: 4px 10px; font-size: .78rem; min-height: 32px; }
.marke-chip[aria-pressed="true"] { background: var(--akzent); color: var(--akzent-schrift); border-color: var(--akzent); }

main { padding: 12px 16px calc(var(--leiste-h) + env(safe-area-inset-bottom) + 28px); max-width: 720px; margin: 0 auto; }

/* Untere Leiste mit rundem Plus */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--leiste-h) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--karte) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--rand);
}
.reiter { position: relative; border: 0; background: none; height: var(--leiste-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--leise); font-size: .7rem; }
.reiter.aktiv { color: var(--akzent); font-weight: 600; }
.plus {
  justify-self: center; align-self: center; width: 60px; height: 60px; margin-bottom: 14px; border-radius: 50%; border: 0;
  background: var(--akzent); color: var(--akzent-schrift); display: grid; place-items: center; box-shadow: 0 6px 18px color-mix(in srgb, var(--akzent) 40%, transparent);
  transition: transform .15s ease;
}
.plus svg { width: 30px; height: 30px; stroke-width: 2.4; }
.plus:active { transform: scale(.94); }
.zaehler { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #fff; font-size: .68rem; line-height: 18px; text-align: center; }

/* Seitenmenü */
.schleier { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; }
.menue {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(84vw, 320px); z-index: 41; background: var(--karte); border-right: 1px solid var(--rand);
  padding: calc(env(safe-area-inset-top) + 16px) 16px 16px; overflow-y: auto; animation: hinein .2s ease;
}
@keyframes hinein { from { transform: translateX(-100%); } to { transform: none; } }
.menue-kopf { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.menue-kopf small { display: block; color: var(--leise); }
.menue-liste { display: flex; flex-direction: column; gap: 4px; }
.menue-liste > a, .menue-liste > button, .menue-liste form button { text-align: left; border: 0; background: none; padding: 12px 10px; border-radius: 10px; text-decoration: none; color: var(--schrift); min-height: 44px; width: 100%; }
.menue-liste > a:active, .menue-liste > button:active { background: var(--karte-2); }
.menue-gruppe { padding: 10px; }
.menue-gruppe > span { display: block; color: var(--leise); font-size: .85rem; margin-bottom: 6px; }
.menue-bald { color: var(--leise); font-size: .85rem; padding: 0 10px; }

/* Bausteine */
.karte { background: var(--karte); border: 1px solid var(--rand); border-radius: 16px; padding: 14px; box-shadow: var(--schatten); margin-bottom: 10px; }
.karte h3 { margin: 0 0 4px; font-size: 1rem; }
.karte.antippbar { cursor: pointer; }
.karte.antippbar:active { background: var(--karte-2); }
.zeile { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.zeile.zwischen { justify-content: space-between; }
.leise { color: var(--leise); }
small.leise, .klein { font-size: .82rem; }
.etikett { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; padding: 2px 8px; border-radius: 999px; background: var(--karte-2); color: var(--leise); }
.etikett.rk { background: color-mix(in srgb, var(--m-rk) 16%, transparent); color: var(--m-rk); }
.etikett.pawcademy { background: color-mix(in srgb, var(--m-pawcademy) 16%, transparent); color: var(--m-pawcademy); }
.etikett.polismedia { background: color-mix(in srgb, var(--m-polismedia) 18%, transparent); color: var(--m-polismedia); }
.etikett.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.etikett.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.etikett.akzent { background: var(--akzent-zart); color: var(--akzent); }
.leer { text-align: center; color: var(--leise); padding: 48px 12px; }
.leer svg { width: 44px; height: 44px; opacity: .5; }
.tag-kopf { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--leise); margin: 18px 4px 8px; }

button.haupt, .knopf {
  border: 0; border-radius: 14px; min-height: 48px; padding: 0 18px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button.haupt { background: var(--akzent); color: var(--akzent-schrift); }
button.haupt:disabled { opacity: .45; }
.knopf { background: var(--karte-2); color: var(--schrift); border: 1px solid var(--rand); }
.knopf.warn { color: var(--warn); }
button.leise { border: 0; background: none; min-height: 44px; padding: 0 12px; color: var(--leise); }
.breit { width: 100%; }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; }
.knopfreihe > * { flex: 1 1 auto; }

label { display: block; font-size: .88rem; color: var(--leise); margin: 10px 0 4px; }
input[type="text"], input[type="url"], input[type="email"], input[type="date"], input[type="password"], input:not([type]), textarea, select {
  width: 100%; border: 1px solid var(--rand); background: var(--karte); border-radius: 12px; padding: 12px; font-size: 16px; color: var(--schrift);
}
textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--akzent); outline-offset: 1px; }
input[type="range"] { width: 100%; accent-color: var(--akzent); height: 32px; }

.segment { display: flex; background: var(--karte-2); border-radius: 12px; padding: 3px; gap: 3px; }
.segment button { flex: 1; border: 0; background: none; border-radius: 9px; min-height: 38px; font-size: .88rem; }
.segment button[aria-pressed="true"] { background: var(--karte); box-shadow: var(--schatten); font-weight: 600; }

/* Auswahlblatt */
.blatt {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--karte); border-radius: 22px 22px 0 0; border-top: 1px solid var(--rand);
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 12px); box-shadow: 0 -8px 30px rgba(0, 0, 0, .18); animation: hoch .2s ease;
}
@keyframes hoch { from { transform: translateY(100%); } to { transform: none; } }
.blatt-griff { width: 40px; height: 5px; border-radius: 3px; background: var(--rand); margin: 4px auto 14px; }
.plus-raster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.plus-raster button {
  border: 1px solid var(--rand); background: var(--karte-2); border-radius: 18px; min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-weight: 600;
}
.plus-raster button svg { width: 30px; height: 30px; color: var(--akzent); }
.plus-raster button:first-child { grid-column: span 2; background: var(--akzent); color: var(--akzent-schrift); border-color: var(--akzent); }
.plus-raster button:first-child svg { color: var(--akzent-schrift); }

/* Vollbild-Ebene */
.ebene { position: fixed; inset: 0; z-index: 50; background: var(--grund); display: flex; flex-direction: column; animation: hoch .18s ease; }
.ebene-kopf { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 6px) 8px 6px; border-bottom: 1px solid var(--rand); background: var(--grund); }
.ebene-kopf h2 { flex: 1; font-size: 1.05rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ebene-inhalt { flex: 1; overflow-y: auto; padding: 16px 16px 24px; -webkit-overflow-scrolling: touch; }
.ebene-fuss { padding: 10px 16px calc(env(safe-area-inset-bottom) + 10px); border-top: 1px solid var(--rand); background: var(--karte); }
.ebene-inhalt > .eng { max-width: 640px; margin: 0 auto; }

/* Sprechen */
.aufnahme { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 12px; }
.aufnahme canvas { width: 100%; height: 90px; }
.zeit { font-variant-numeric: tabular-nums; font-size: 2.2rem; font-weight: 300; letter-spacing: .02em; }
.mikro {
  width: 104px; height: 104px; border-radius: 50%; border: 0; background: var(--akzent); color: var(--akzent-schrift); display: grid; place-items: center;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--akzent) 45%, transparent);
}
.mikro svg { width: 44px; height: 44px; }
.mikro.laeuft { background: var(--warn); animation: puls 1.4s ease-in-out infinite; }
.mikro.laeuft svg { width: 34px; height: 34px; }
@keyframes puls { 50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--warn) 18%, transparent); } }

/* Fotos */
.foto-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.foto { position: relative; background: var(--karte); border: 1px solid var(--rand); border-radius: 12px; overflow: hidden; }
.foto img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.foto input { border: 0; border-top: 1px solid var(--rand); border-radius: 0; font-size: 14px; padding: 8px; }
.foto .weg { position: absolute; top: 6px; right: 6px; border: 0; width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; }
.foto .stand { position: absolute; left: 6px; top: 6px; }

/* Wohin */
.ziel-gruppe { margin: 14px 0 6px; }
.ziel-gruppe h4 { margin: 0 0 6px; font-size: .85rem; color: var(--leise); font-weight: 600; }
.ziel { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--rand); background: var(--karte); border-radius: 12px; margin-bottom: 6px; min-height: 48px; }
.ziel input[type="radio"], .ziel input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--akzent); flex: none; margin: 0; }
.ziel .name { flex: 1; }
.ziel select { width: auto; max-width: 46%; padding: 6px 8px; font-size: 14px; border-radius: 8px; }
.ziel.gewaehlt { border-color: var(--akzent); background: var(--akzent-zart); }

/* Prüfen */
.kanal-reiter { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.kanal-reiter button { flex: none; border: 1px solid var(--rand); background: var(--karte); border-radius: 999px; padding: 6px 12px; min-height: 36px; font-size: .85rem; }
.kanal-reiter button[aria-pressed="true"] { background: var(--akzent); color: var(--akzent-schrift); border-color: var(--akzent); }
.vorschau-post { background: var(--karte); border: 1px solid var(--rand); border-radius: 16px; overflow: hidden; margin-bottom: 12px; }
.vorschau-kopf { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.vorschau-kopf .avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .8rem; }
.vorschau-text { padding: 0 12px 12px; white-space: pre-wrap; word-wrap: break-word; }
.vorschau-text .mehr { color: var(--leise); }
.vorschau-text .ab-hier { color: var(--leise); }
.vorschau-bild img, .vorschau-bild video { width: 100%; display: block; background: #000; }
.vorschau-bild video { max-height: 70vh; }
.hinweis { border-radius: 12px; padding: 10px 12px; font-size: .9rem; margin: 8px 0; background: var(--karte-2); }
.hinweis.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }
.hinweis.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.aenderung del { color: var(--warn); text-decoration: line-through; }
.aenderung ins { color: var(--ok); text-decoration: underline; }
.folien { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
.folien img { width: 78%; flex: none; scroll-snap-align: start; border-radius: 8px; }

/* Video */
.kamera { position: fixed; inset: 0; background: #000; z-index: 60; display: flex; flex-direction: column; }
.kamera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kamera video.spiegel { transform: scaleX(-1); }
.kamera .zonen { position: absolute; inset: 0; pointer-events: none; }
.kamera .zonen::before, .kamera .zonen::after { content: ""; position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255, 255, 255, .35); }
.kamera .zonen::before { top: 13%; }
.kamera .zonen::after { bottom: 22%; }
.kamera-oben { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; color: #fff; }
.kamera-oben button { border: 0; background: rgba(0, 0, 0, .45); color: #fff; border-radius: 999px; min-height: 40px; padding: 0 14px; }
.kamera .spick { position: relative; z-index: 2; margin: 0 12px; max-height: 26vh; overflow-y: auto; background: rgba(0, 0, 0, .5); color: #fff; padding: 10px 12px; border-radius: 12px; font-size: 1.15rem; line-height: 1.35; }
.kamera-unten { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(env(safe-area-inset-bottom) + 18px); display: flex; align-items: center; justify-content: space-between; color: #fff; }
.ausloeser { width: 80px; height: 80px; border-radius: 50%; border: 5px solid #fff; background: #e23b3b; }
.ausloeser.laeuft { border-radius: 24px; transform: scale(.8); }
.kamera-unten .zeit { font-size: 1.3rem; min-width: 70px; }
.kamera-unten button.klein-knopf { border: 0; background: rgba(0, 0, 0, .45); color: #fff; border-radius: 999px; min-height: 40px; padding: 0 12px; font-size: .85rem; }

.buehne { position: relative; width: min(100%, 360px); margin: 0 auto 12px; aspect-ratio: 9 / 16; container-type: size; background: #000; border-radius: 14px; overflow: hidden; }
.buehne video { width: 100%; height: 100%; object-fit: cover; display: block; }
.untertitel-ebene { position: absolute; left: 0; right: 0; display: flex; justify-content: center; pointer-events: none; }
.untertitel-ebene span { display: inline-block; text-align: center; font-weight: 700; white-space: pre; line-height: 1.18; }
.buehne .spielen { position: absolute; inset: 0; border: 0; background: transparent; }
.fortschritt { height: 8px; border-radius: 4px; background: var(--karte-2); overflow: hidden; }
.fortschritt > i { display: block; height: 100%; background: var(--akzent); width: 0; transition: width .2s; }
.block-liste { display: flex; flex-direction: column; gap: 6px; }
.block { display: flex; gap: 8px; align-items: center; }
.block time { font-size: .75rem; color: var(--leise); font-variant-numeric: tabular-nums; width: 42px; flex: none; }
.block input { padding: 8px 10px; font-size: 15px; }
.block.aktiv input { border-color: var(--akzent); }
.regler { display: grid; grid-template-columns: 70px 1fr 44px; align-items: center; gap: 8px; }
.regler span { font-size: .85rem; color: var(--leise); }
.regler output { font-size: .8rem; text-align: right; font-variant-numeric: tabular-nums; }

/* Meldungen */
.meldungen { position: fixed; left: 12px; right: 12px; bottom: calc(var(--leiste-h) + env(safe-area-inset-bottom) + 16px); z-index: 80; display: flex; flex-direction: column; gap: 8px; pointer-events: none; align-items: center; }
.meldung-chip { pointer-events: auto; background: var(--schrift); color: var(--grund); border-radius: 14px; padding: 10px 14px; box-shadow: var(--schatten); max-width: 520px; font-size: .92rem; animation: hoch .2s ease; }
.meldung-chip.fehler { background: var(--warn); color: #fff; }

/* Rückfrage */
dialog.frage { border: 0; border-radius: 18px; padding: 20px; max-width: 360px; width: calc(100% - 32px); background: var(--karte); color: var(--schrift); box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
dialog.frage::backdrop { background: rgba(0, 0, 0, .4); }
dialog.frage h3 { margin: 0 0 8px; }
dialog.frage p { margin: 0 0 16px; color: var(--leise); }

/* Anmeldung */
body.anmeldung { display: grid; place-items: center; padding: 24px 16px; }
.anmelde-karte { width: min(100%, 360px); background: var(--karte); border: 1px solid var(--rand); border-radius: 20px; padding: 24px; text-align: center; box-shadow: var(--schatten); }
.anmelde-karte h1 { margin: 8px 0 16px; }
.anmelde-karte form { text-align: left; }
.anmelde-karte button { width: 100%; margin-top: 16px; }
.anmelde-karte .meldung { color: var(--warn); }

@media (min-width: 760px) {
  .plus-raster { grid-template-columns: repeat(5, 1fr); }
  .plus-raster button:first-child { grid-column: auto; }
}
