@font-face { font-family: Anton; src: url(/schrift/anton.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Inter; font-weight: 500; src: url(/schrift/inter500.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Inter; font-weight: 600; src: url(/schrift/inter600.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Inter; font-weight: 700; src: url(/schrift/inter700.woff2) format('woff2'); font-display: swap; }

:root {
  --rot: #c80f2e; --gelb: #ffd100; --nacht: #0c1018;
  --grund: #0c1018; --flaeche: #151b27; --flaeche2: #1d2535; --linie: #2a3446;
  --text: #eef1f6; --leise: #9aa6ba; --gut: #2fbf71; --warn: #ffb020;
  --r: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--grund); color: var(--text); font: 500 15px/1.45 Inter, -apple-system, system-ui, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 16px; }
footer { text-align: center; color: var(--leise); font-size: 12px; padding: 18px 16px 26px; }
a { color: var(--gelb); }
h1, h2, h3 { font-family: Anton, Impact, sans-serif; font-weight: 400; letter-spacing: .3px; text-transform: uppercase; margin: 0 0 12px; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; }
.laden { color: var(--leise); }

/* Kopf */
header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(12,16,24,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--linie); }
.marke { display: flex; text-decoration: none; font-family: Anton, Impact, sans-serif; font-size: 20px; line-height: 1; }
.marke .m1 { background: var(--rot); color: #fff; padding: 6px 8px; }
.marke .m2 { background: var(--gelb); color: #000; padding: 6px 8px; text-transform: uppercase; }
nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav a { color: var(--text); text-decoration: none; padding: 7px 11px; border-radius: 8px; font-weight: 600; font-size: 14px; }
nav a.aktiv { background: var(--flaeche2); color: var(--gelb); }
nav .rechts { margin-left: auto; }

/* Bausteine */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); padding: 16px; }
.karte + .karte { margin-top: 14px; }
button, .knopf { font: 600 14px Inter, system-ui, sans-serif; border: 1px solid var(--linie); background: var(--flaeche2); color: var(--text);
  border-radius: 8px; padding: 9px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
button:hover:not(:disabled), .knopf:hover { border-color: #46546d; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.haupt, .knopf.haupt { background: var(--rot); border-color: var(--rot); color: #fff; }
button.gelb, .knopf.gelb { background: var(--gelb); border-color: var(--gelb); color: #000; }
button.klein { padding: 5px 9px; min-height: 32px; font-size: 13px; }
button.weg { background: transparent; border-color: transparent; color: var(--leise); }
button.gefahr { color: #ff8095; }
button.an { background: var(--gelb); color: #000; border-color: var(--gelb); }
.reihe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.reihe.zwischen { justify-content: space-between; }
.leise { color: var(--leise); font-size: 13px; }
.stapel > * + * { margin-top: 12px; }
label.feld { display: block; }
label.feld > span { display: block; font-size: 12px; font-weight: 700; color: var(--leise); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%; font: 500 16px Inter, system-ui, sans-serif; color: var(--text); background: #0f141e; border: 1px solid var(--linie); border-radius: 8px; padding: 9px 11px; }
textarea { resize: vertical; min-height: 64px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gelb); outline-offset: -1px; }
input[type=range] { width: 100%; accent-color: var(--gelb); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--gelb); }
.pflicht::after { content: ' *'; color: var(--gelb); }
.hinweis { border-left: 3px solid var(--gelb); background: #1a1f12; padding: 10px 12px; border-radius: 0 8px 8px 0; font-size: 13px; }
.hinweis.rot { border-color: var(--rot); background: #241218; }
.hinweis ul { margin: 4px 0 0; padding-left: 18px; }
.warnung { color: var(--warn); font-size: 13px; }
.fehlerbox { color: #ff8095; font-size: 14px; }
.zeilenliste .zeile { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.zeilenliste .zeile input.kurz { flex: 0 0 34%; }

/* Anmeldung */
.login { max-width: 380px; margin: 8vh auto 0; }
.login .marke { font-size: 30px; margin-bottom: 18px; }

/* Listen */
.liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.eintrag { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.eintrag .bild { aspect-ratio: 4/5; max-height: 220px; width: 100%; object-fit: cover; background: var(--flaeche2); display: block; }
.eintrag .inhalt { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.eintrag .titel { font-weight: 700; font-size: 16px; }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
.streifen { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.slidekarte { flex: 0 0 86px; border: 2px solid var(--linie); border-radius: 8px; overflow: hidden; background: var(--flaeche2); cursor: pointer; position: relative; scroll-snap-align: start; padding: 0; min-height: 0; display: block; }
.slidekarte.aktiv { border-color: var(--gelb); }
.slidekarte .vb { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; background: #0a0e16; }
.slidekarte .nr { position: absolute; top: 4px; left: 4px; background: rgba(0,0,0,.7); font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.slidekarte .art { font-size: 11px; font-weight: 700; padding: 4px 5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slidekarte .ohne { aspect-ratio: 4/5; display: grid; place-items: center; font-size: 24px; color: var(--leise); }
.slidekarte.neu { display: grid; place-items: center; color: var(--gelb); font-size: 13px; font-weight: 700; aspect-ratio: auto; min-height: 130px; border-style: dashed; }
.fotowahl { display: flex; gap: 8px; flex-wrap: wrap; }
.fotowahl .foto { width: 72px; height: 72px; border: 2px solid var(--linie); border-radius: 8px; overflow: hidden; position: relative; padding: 0; min-height: 0; }
.fotowahl .foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fotowahl .foto.aktiv { border-color: var(--gelb); }
.fotowahl .foto .px { position: absolute; bottom: 2px; right: 2px; background: var(--rot); color: #fff; font-size: 10px; font-weight: 700; padding: 0 4px; border-radius: 3px; }
.fotowahl .foto .x { position: absolute; top: 1px; right: 1px; background: rgba(0,0,0,.75); color: #fff; border: 0; width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 50%; font-size: 13px; justify-content: center; }
.fotowahl .hoch { width: 72px; height: 72px; border: 2px dashed var(--linie); border-radius: 8px; display: grid; place-items: center; text-align: center; font-size: 11px; color: var(--gelb); cursor: pointer; font-weight: 700; padding: 4px; }
.vorschau { position: relative; background: #05070b; border-radius: 8px; overflow: hidden; aspect-ratio: 4/5; display: grid; place-items: center; }
.vorschau img { width: 100%; height: 100%; object-fit: contain; display: block; }
.vorschau .leer { color: var(--leise); text-align: center; padding: 20px; font-size: 14px; }
.vorschau .lauf { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.7); font-size: 11px; padding: 3px 8px; border-radius: 10px; }
.leinwand { position: relative; width: 100%; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 8px; overflow: hidden; background: #000; }
.leinwand canvas { display: block; width: 100%; height: auto; }
.modus { display: flex; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
.modus button { border: 0; border-radius: 0; flex: 1; }
.typwahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.typwahl button { justify-content: flex-start; text-align: left; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; }
.typwahl button small { color: var(--leise); font-weight: 500; font-size: 11px; }
.typwahl button.an small { color: #333; }
.klebend { position: sticky; top: 70px; }
@media (max-width: 900px) { .klebend { position: static; } }

/* Video */
.schach { background-color: #3a4456; background-image: linear-gradient(45deg, #2d3646 25%, transparent 25%), linear-gradient(-45deg, #2d3646 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, #2d3646 75%), linear-gradient(-45deg, transparent 75%, #2d3646 75%);
  background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0; }
.vbild { width: 100%; border-radius: 8px; overflow: hidden; display: grid; place-items: center; position: relative; }
.vbild.quer { aspect-ratio: 16/9; } .vbild.hoch { aspect-ratio: 9/16; max-height: 70vh; margin: 0 auto; width: auto; height: 70vh; }
@media (max-width: 900px) { .vbild.hoch { height: auto; width: 70%; max-height: none; } }
.vbild img, .vbild video { width: 100%; height: 100%; object-fit: contain; display: block; }
.jobs { display: grid; gap: 10px; }
.job { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); padding: 12px; display: grid; gap: 8px; }
.balken { height: 8px; background: var(--flaeche2); border-radius: 4px; overflow: hidden; }
.balken > div { height: 100%; background: var(--gelb); transition: width .5s; }
.marke-status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--flaeche2); }
.marke-status.fertig { background: #12361f; color: #7be3a6; } .marke-status.fehler { background: #3a1219; color: #ff8095; } .marke-status.laeuft { background: #3a3110; color: var(--gelb); }
.kartenwahl .lkarte { height: 300px; border-radius: 8px; border: 1px solid var(--linie); }
.treffer { display: grid; gap: 4px; margin-top: 6px; }
.treffer button { justify-content: flex-start; text-align: left; min-height: 36px; font-weight: 500; font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--flaeche2); border: 1px solid var(--linie); border-radius: 16px; padding: 4px 6px 4px 12px; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.chip button { min-height: 0; padding: 0 6px; border: 0; background: none; font-size: 15px; }

table { width: 100%; border-collapse: collapse; }
td, th { padding: 10px 6px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: middle; }
th { font-size: 12px; color: var(--leise); text-transform: uppercase; }
.pwbox { font: 700 20px ui-monospace, Menlo, monospace; background: #0f141e; border: 1px dashed var(--gelb); padding: 10px 12px; border-radius: 8px; user-select: all; }
@media (max-width: 640px) {
  .tabelle-mobil thead { display: none; }
  .tabelle-mobil tr { display: block; border-bottom: 1px solid var(--linie); padding: 8px 0; }
  .tabelle-mobil td { display: block; border: 0; padding: 3px 0; }
}

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #222b3b; border: 1px solid var(--linie); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-weight: 600; opacity: 0; transition: .25s; pointer-events: none; z-index: 99; max-width: calc(100% - 32px); }
#toast.zeigen { opacity: 1; transform: translateX(-50%); }
#toast.fehler { border-color: var(--rot); }
.leaflet-container { background: #0f141e; font: inherit; }

/* Handy: Kopf kompakt, Menü als waagerechte Leiste */
@media (max-width: 640px) {
  header { position: static; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  nav { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; gap: 2px; }
  nav a { white-space: nowrap; padding: 6px 9px; font-size: 13px; }
  nav .rechts { margin-left: 0; }
  main { padding: 12px; }
  h1 { font-size: 26px; }
  .karte { padding: 13px; }
}
