/* Sichtseite (Web-Fassung des Reiters SICHT) und Grundlage der Portalseiten (portal.css ergänzt nur).
   Farben seit 2.2.680 das neutrale Grau von Fassung I, dieselben Werte wie das Kundenportal (portal.css, Zweig kundenportal) (David 2026-11-01: nicht mehr
   das bräunliche #2B2926), nur dunkel (Schnittplatz, Regel 8.9). Flache Tasten, Flächen statt Kanten,
   keine Versalien, Bernstein nur für Stelle, Auswahl und „hier geht es weiter“. */
:root {
  --korpus: #141416; --leiste: #18181A; --gehoben: #29292C; --hover: #323236; --versenkt: #1C1C1E;
  --eingabe: #111113; --glas: #0B0B0D; --seite: #101012;
  --kante: #0E0E10; --licht: #404044; --trenn: #2E2E31; --zeile: #242427;
  --text: #E4E4E2; --beschriftung: #BDBDC0; --mono-text: #B2B2B6; --graviert: #9A9AA0; --tertiaer: #8A8A90;
  --amber: #F2A93B; --amber-hell: #F5B858; --amber-text: #1A1306; --amber-dim: #9A6A22;
  --amber-flaeche: rgba(242, 169, 59, .16);
  --rot: #FF6159; --rot-text: #FF8A82; --gruen: #5FD08A;
  --rund: 8px; --rund-klein: 6px;
  --rand: 20px;            /* Luft zum Fensterrand: Kopf, Leiste, Timeline */
  --ui: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: Consolas, ui-monospace, 'SF Mono', Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--korpus); color: var(--text); font: 13px/1.4 var(--ui);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; color-scheme: dark; }
button { font: inherit; color: var(--beschriftung); background: var(--gehoben); border: 0;
  border-radius: var(--rund-klein); padding: 5px 12px; cursor: pointer; transition: background .12s, color .12s; }
button:hover:not(:disabled) { color: var(--text); background: var(--hover); }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--eingabe); border: 1px solid var(--trenn);
  border-radius: var(--rund-klein); padding: 5px 9px; }
input::placeholder, textarea::placeholder { color: var(--tertiaer); }
input:focus { border-color: var(--amber-dim); outline: none; }
a { color: var(--amber); }

/* ---------- Startseite ---------- */
.start { max-width: 1100px; margin: 0 auto; padding: 44px var(--rand) 60px; }
.start h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; }
.start .unter { color: var(--graviert); margin: 0 0 28px; }
.tage { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px 20px; }
.tag { display: block; text-decoration: none; color: var(--text); }
.tag img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--glas);
  border-radius: 10px; transition: transform .2s; }
.tag:hover img { transform: scale(1.02); }
.tag .txt { padding: 10px 2px 0; }
.tag .titel { font-size: 15px; font-weight: 600; }
.tag .info { color: var(--graviert); font-size: 12px; margin-top: 2px; }
.start .fuss { color: var(--graviert); font-size: 12px; margin-top: 36px; }

/* ---------- Sichtfenster ---------- */
.app { display: grid; height: 100%; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "kopf kopf" "mon seite" "tl seite"; }
.kopf { grid-area: kopf; display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 var(--rand);
  background: var(--leiste); border-bottom: 1px solid var(--kante); min-width: 0; }
.kopf .zurueck { color: var(--graviert); text-decoration: none; font-weight: 500; white-space: nowrap; }
.kopf .zurueck:hover { color: var(--text); }
.kopf .titel { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf .titel span { color: var(--graviert); font-weight: 400; }
.kopf .platz { flex: 1; }
.kopf label { color: var(--graviert); font-size: 12px; }
.kopf #name { width: 170px; }

.mon { grid-area: mon; display: flex; flex-direction: column; min-height: 0; background: var(--glas); }
.mon-flaeche { flex: 1; min-height: 0; display: flex; }
.kacheln { position: relative; flex: 1; min-width: 0; }
.kachel { position: absolute; background: #000; overflow: hidden; cursor: pointer; border: 1px solid transparent; }
.kachel.aus { display: none; }
.kachel.gross { cursor: default; }
.kachel.insta { cursor: grab; }
.kachel.insta:active { cursor: grabbing; }
.kachel.marker-kamera { border-color: var(--amber); }
.kachel video, .kachel canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.kachel video.unsichtbar { opacity: 0; pointer-events: none; }
.kachel.leer video, .kachel.leer canvas { visibility: hidden; }   /* Luecke: keine Aufnahme, nichts Altes zeigen */
.kachel .vorschau { position: absolute; inset: 0; background-repeat: no-repeat; pointer-events: none; }
.kachel .name { position: absolute; left: 8px; top: 6px; font-size: 11px; color: var(--beschriftung);
  background: rgba(11,11,13,.7); padding: 2px 7px; border-radius: 5px; pointer-events: none;
  white-space: nowrap; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; }
.kachel .name b { color: var(--amber); font-weight: 600; margin-right: 4px; }
.kachel .q { position: absolute; right: 8px; top: 6px; font: 10px var(--mono); color: var(--graviert);
  background: rgba(11,11,13,.7); padding: 2px 6px; border-radius: 5px; pointer-events: none; }
.kachel .lage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--graviert); font-size: 12px; pointer-events: none; }
.kachel .lage.wartet { background: rgba(11,11,13,.35); }

.leiste { display: flex; align-items: center; gap: 8px; padding: 8px var(--rand); background: var(--leiste);
  border-top: 1px solid var(--kante); }
.leiste .sym { width: 34px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.leiste .sym svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.leiste .sym svg .voll { fill: currentColor; stroke: none; }
.tc { font: 600 18px var(--mono); color: var(--amber); background: var(--glas); padding: 3px 12px; border-radius: var(--rund-klein);
  min-width: 140px; text-align: center; letter-spacing: .5px; margin: 0 4px; }
.leiste .platz { flex: 1; }
.leiste label { color: var(--graviert); font-size: 12px; }
.leiste .leise { color: var(--graviert); font-size: 11px; }

/* Timeline: Luft zum Rand und unten (David 2026-11-01: „unten zu eng“) */
.tl { position: relative; grid-area: tl; background: var(--versenkt); border-top: 1px solid var(--kante); user-select: none;
  padding: 12px var(--rand) 16px; }
/* „Ganze Szene“ sitzt in der leeren Ecke über den Spurnamen, auf Höhe des Lineals: keine eigene Zeile */
.tl-kopfzeile { position: absolute; left: var(--rand); top: 12px; width: 160px; height: 24px; display: flex; align-items: center; z-index: 2; }
.tl-kopfzeile .platz { display: none; }
.tl-kopfzeile button { height: 22px; padding: 0 10px; font-size: 12px; }
.tl-rumpf { position: relative; display: grid; grid-template-columns: 170px minmax(0, 1fr); }
.tl-namen div, .tl-spuren .spur, .tl-namen .lineal-n, .tl-spuren .lineal { height: 22px; }
.tl-namen { padding-right: 10px; }
.tl-namen div { font-size: 12px; color: var(--beschriftung); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; line-height: 22px; }
.tl-namen div b { color: var(--amber); font-weight: 600; margin-right: 4px; }
.tl-namen .lineal-n { height: 24px; }
.tl-spuren { position: relative; overflow: hidden; cursor: text; border-radius: var(--rund-klein); }
.tl-spuren .lineal { position: relative; height: 24px; border-bottom: 1px solid var(--trenn); }
.tl-spuren .lineal span { position: absolute; top: 3px; font: 10px var(--mono); color: var(--graviert); transform: translateX(3px);
  white-space: nowrap; border-left: 1px solid var(--trenn); padding-left: 4px; height: 18px; }
.tl-spuren .spur { position: relative; border-bottom: 1px solid var(--zeile); }
.tl-spuren .klotz { position: absolute; top: 4px; bottom: 4px; background: #5B76A0; border-radius: 3px; }
.tl-spuren .klotz.insta { background: #6E8A66; }
.tl-spuren .klotz.ton { background: #7A6E5C; }
.tl-spuren .klotz.ref { background: #8A6E9C; }
.tl-spuren .klotz.original { background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(0,0,0,.25) 4px 8px); }
.locator { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--amber); pointer-events: none; }
.faehnchen { position: absolute; top: 2px; width: 8px; height: 12px; margin-left: -1px; cursor: pointer;
  border-left: 2px solid var(--f, #3fb950); }
.faehnchen::after { content: ""; position: absolute; left: 0; top: 0; width: 7px; height: 6px; background: var(--f, #3fb950); }
.tl-scroll { height: 8px; position: relative; margin: 10px 0 0 170px; background: var(--zeile); border-radius: 4px; }
.tl-scroll .griff { position: absolute; top: 0; bottom: 0; background: var(--licht); border-radius: 4px; cursor: grab; }
.tl-scroll .griff:hover { background: #4A4A50; }

/* Seite: Marker */
.seite { grid-area: seite; display: flex; flex-direction: column; min-height: 0; background: var(--leiste);
  border-left: 1px solid var(--kante); }
.seite h2 { font-size: 14px; font-weight: 600; color: var(--text); margin: 0; padding: 16px 16px 8px;
  display: flex; align-items: center; gap: 8px; }
.seite h2 .zahl { color: var(--amber); }
/* Eingabe unten über dem Fuß, nah an Timeline und Leiste (dort setzt M die Stelle) */
.eingabe { padding: 12px 16px; border-top: 1px solid var(--kante); background: var(--leiste); }
.eingabe .feld { display: flex; align-items: flex-start; gap: 8px; padding: 0 4px 0 10px; border-radius: var(--rund);
  background: var(--eingabe); border: 1px solid var(--trenn); }
.eingabe .feld:focus-within { border-color: var(--amber-dim); }
.eingabe .stelle { font: 12px var(--mono); color: var(--amber); white-space: nowrap; padding-top: 10px; }
.eingabe #mtext { flex: 1; min-width: 0; background: none; border: 0; padding: 8px 4px; resize: none; overflow-y: auto;
  font: inherit; line-height: 1.45; color: var(--text); max-height: 160px; }
/* Marker ändern: Kopfzeile über dem Feld, Feld mit Bernstein-Rand, die Karte in Arbeit ebenso */
.aendern-kopf { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; font-size: 12px;
  font-weight: 600; color: var(--amber); }
.eingabe.aendern .feld { border-color: var(--amber); }
.eingabe #mtext:focus-visible { outline: none; }
.eingabe .zeile { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.eingabe select { max-width: 220px; font-size: 12px; padding: 4px 8px; background: var(--gehoben); }
.wahl { position: relative; }
.farbknopf { width: 30px; height: 26px; padding: 0; display: grid; place-items: center; }
.farbknopf .punkt { width: 12px; height: 12px; border-radius: 50%; background: var(--f); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.farben { position: absolute; left: 0; bottom: 34px; z-index: 20; display: flex; gap: 6px; padding: 8px;
  background: var(--gehoben); border-radius: var(--rund); box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.farben[hidden] { display: none; }
.farben button { width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 2px solid transparent; background: var(--f);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }   /* Schwarz sonst unsichtbar */
.farben button:hover:not(:disabled) { background: var(--f); transform: scale(1.12); }
.farben button[aria-pressed="true"] { border-color: var(--text); }
.liste { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; background: var(--leiste);
  padding: 4px 8px 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.liste .leer { color: var(--graviert); padding: 6px 4px; font-size: 12px; }
/* Marker als Karte (Vorschlag A, David 2026-11-01): oben Farbe, Stelle, Kamera, Name; der Text darunter in voller Breite */
.mz { position: relative; flex: none; padding: 10px 10px 12px 12px; border-radius: 10px; background: var(--gehoben);
  cursor: pointer; transition: background .12s; }
.mz:hover { background: var(--hover); }
.mz.gewaehlt { box-shadow: inset 0 0 0 1.5px var(--amber); }
.mz-kopf { display: flex; align-items: center; gap: 8px; min-height: 22px; font-size: 12px; }
.mz .punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--f); flex: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.mz .tc { font: 12px var(--mono); color: var(--amber); background: rgba(0,0,0,.25); border: 0; padding: 1px 7px;
  border-radius: 5px; min-width: 0; margin: 0; text-align: left; }
.mz .sp { font: 11px var(--mono); color: var(--beschriftung); background: rgba(0,0,0,.25); padding: 1px 6px; border-radius: 4px; }
.mz .wer { flex: 1; min-width: 0; text-align: right; color: var(--graviert); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mz .tx { margin-top: 7px; font-size: 13.5px; line-height: 1.45; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.mz .weg { width: 22px; height: 22px; padding: 0; background: none; border: 0; color: var(--tertiaer); opacity: 0; }
.mz:hover .weg, .mz.gewaehlt .weg, .mz .weg:focus-visible { opacity: 1; }
.mz .weg:hover { color: var(--rot-text); background: none; }
.mz .stift:hover { color: var(--text); }
.mz.in-arbeit { box-shadow: inset 0 0 0 1.5px var(--amber); background: var(--hover); }
.mz input { width: 100%; padding: 1px 4px; }
.seite .fuss { padding: 10px 16px; border-top: 1px solid var(--kante); display: flex; gap: 8px; align-items: center; }
.seite .fuss .stand { flex: 1; color: var(--graviert); font-size: 11px; }
.flash { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--gehoben); color: var(--text);
  border-radius: var(--rund); padding: 8px 16px; font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }

@media (max-width: 900px) {
  :root { --rand: 16px; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(260px, 1fr);
    grid-template-areas: "kopf" "mon" "tl" "seite"; height: auto; min-height: 100%; }
  .mon { height: 62vw; }
  .kopf #name { width: 110px; }
  .tl-rumpf { grid-template-columns: 96px minmax(0, 1fr); }
  .tl-scroll { margin-left: 96px; }
  .tl-kopfzeile { width: 92px; }
  .tl-kopfzeile button { padding: 0 6px; font-size: 11px; }
}

/* Runde 2 (David 2026-10-29): Marker-Knopf, Anordnung, Qualitaet, Tonspalte */
.marker-knopf { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; }
.marker-knopf svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.marker-knopf svg .voll { fill: var(--amber); stroke: none; }
#anordnung-bild rect { fill: none; stroke: currentColor; stroke-width: 1.1; }
.leiste .sym[aria-pressed="true"] { color: var(--amber); background: var(--amber-flaeche); }
button.link { background: none; border: 0; padding: 0; color: var(--graviert); text-decoration: underline; font-size: 11px; }
button.link:hover:not(:disabled) { color: var(--text); background: none; }
.tonspalte { width: 236px; flex: none; display: flex; flex-direction: column; background: var(--versenkt);
  border-left: 1px solid var(--kante); min-height: 0; }
.ts-kopf { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 6px 12px;
  font-size: 13px; font-weight: 600; color: var(--text); }
.ts-zeilen { flex: 1; overflow-y: auto; min-height: 0; }
.tz { display: grid; grid-template-columns: minmax(0, 1fr) 22px 22px; grid-template-rows: auto 22px; gap: 3px 4px;
  padding: 5px 10px 6px 12px; border-bottom: 1px solid var(--zeile); }
.tz .tn { font-size: 11px; color: var(--graviert); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: center; }
.tz.hoerbar .tn { color: var(--text); }
.tz .tn b { color: var(--amber); font-weight: 600; margin-right: 4px; }
.tz button { width: 22px; height: 18px; padding: 0; font: 600 10px var(--mono); border-radius: 4px; }
.tz button[aria-pressed="true"].m { background: #8A3530; color: #fff; }
.tz button[aria-pressed="true"].s { background: var(--amber); color: var(--amber-text); }
.tz .welle { grid-column: 1 / 4; position: relative; height: 22px; background: var(--glas); border-radius: 4px; overflow: hidden; }
.tz .welle canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.tz .pegel { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--gruen); width: 0; }
.tz.leise .welle canvas { opacity: .45; }
@media (max-width: 900px) {
  /* Handy: Tonspalte unter dem Bild statt daneben, sonst deckt sie die kleinen Kacheln zu */
  .mon { height: auto; }
  .mon-flaeche { flex-direction: column; }
  .kacheln { height: 62vw; flex: none; }
  .tonspalte { width: auto; max-height: 45vh; border-left: 0; border-top: 1px solid var(--kante); }
  .leiste { flex-wrap: wrap; }
}

/* Pruefanzeige (?pruefen=1) */
.kachel .pruef { display: none; }
.kachel .pruef-alt { position: absolute; left: 4px; bottom: 4px; right: 4px; font: 10px/1.3 var(--mono); color: #fff;
  background: rgba(0,0,0,.7); padding: 2px 5px; border-radius: 3px; pointer-events: none; }
#pruef-global { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; font: 11px/1.45 var(--mono); color: #000;
  background: rgba(242,169,59,.94); padding: 3px 8px; white-space: pre-wrap; pointer-events: none; }

/* Sparsam: Kachel kommt nicht mit (UX 3.10), leise wie die Qualitaetsanzeige */
.kachel .spar { position: absolute; right: 8px; bottom: 6px; font: 10px var(--mono); color: var(--graviert);
  background: rgba(11,11,13,.7); padding: 2px 6px; border-radius: 5px; pointer-events: auto; cursor: help; }
@media (hover: none) { .mz .weg { opacity: 1; } }
