/* Krany – Oberfläche nach Corporate Design 1.0 (Tiefgrün + Limette, Bricolage Grotesque + Instrument Sans) */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/instrument-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/bricolage-grotesque-latin.woff2") format("woff2");
}

/* Hell (Standard) */
:root {
  --bg: #FFFFFF; --surface: #F3F6EF; --fill: #DDE5DC; --separator: #DDE5DC; --line: #B4C2B9;
  --label: #05211C; --label-2: #4A5A54;
  --signal: #C6F21E; --on-signal: #05211C; --signal-soft: #E9F8B8;
  --accent: #05211C;                       /* Text-Aktionen: Tiefgrün, unterstrichen mit Limette */
  --ok: #1E7A3C; --warn: #9A5B00; --error: #C1291F;
  --ok-fill: #1E7A3C1A; --warn-fill: #9A5B001A; --error-fill: #C1291F14;
  --media: #05211C; --logo-field: #05211C; --logo-t: #FFFFFF;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --r-chip: 8px; --r-field: 12px; --r-card: 20px; --r-sheet: 28px; --r-pill: 999px;
  --hit: 44px;
  --ease: cubic-bezier(.2, 0, 0, 1); --t-fast: 150ms; --t-base: 250ms; --t-slow: 400ms;
  --glass: #FFFFFFC7; --blur: 20px;
  color-scheme: light;
}
/* Dunkel – folgt dem System, außer es wurde „Hell“ gewählt … */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #05211C; --surface: #0B2E27; --fill: #143B33; --separator: #143B33; --line: #2F5A4F;
    --label: #EEF4EC; --label-2: #A6B8B1;
    --signal-soft: #C6F21E29; --accent: #C6F21E;
    --ok: #3FCB6A; --warn: #F5B547; --error: #FF7A6E;
    --ok-fill: #3FCB6A1F; --warn-fill: #F5B5471F; --error-fill: #FF7A6E1F;
    --media: #021511; --logo-field: transparent; --logo-t: #FFFFFF;
    --glass: #05211CC7;
    color-scheme: dark;
  }
}
/* … oder fest „Dunkel“ gewählt */
:root[data-theme="dark"] {
  --bg: #05211C; --surface: #0B2E27; --fill: #143B33; --separator: #143B33; --line: #2F5A4F;
  --label: #EEF4EC; --label-2: #A6B8B1;
  --signal-soft: #C6F21E29; --accent: #C6F21E;
  --ok: #3FCB6A; --warn: #F5B547; --error: #FF7A6E;
  --ok-fill: #3FCB6A1F; --warn-fill: #F5B5471F; --error-fill: #FF7A6E1F;
  --media: #021511; --logo-field: transparent; --logo-t: #FFFFFF;
  --glass: #05211CC7;
  color-scheme: dark;
}
@media (prefers-contrast: more) { :root { --label-2: #2E3B36; --line: #4A5A54; } :root[data-theme="dark"] { --label-2: #D0DCD7; --line: #A6B8B1; } }
@media (prefers-reduced-transparency: reduce) { :root, :root[data-theme="dark"] { --glass: var(--bg); } }
@media (prefers-reduced-motion: reduce) { :root { --t-fast: 0ms; --t-base: 0ms; --t-slow: 0ms; } html { scroll-behavior: auto !important; } }

/* ---------- Grundlagen ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 1.0625rem;      /* Body 17/26 */
  line-height: 1.625rem;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.num, time { font-variant-numeric: tabular-nums; }

h1, .t1, .t3 { font-family: var(--font); margin: 0; }
h1 { font-size: 2.125rem; line-height: 2.5625rem; font-weight: 700; letter-spacing: -0.02em; }   /* Large Title */
.t1 { font-size: 1.75rem; line-height: 2.125rem; font-weight: 600; letter-spacing: -0.015em; }  /* Title 1 */
.t3 { font-size: 1.25rem; line-height: 1.5625rem; font-weight: 600; }                            /* Title 3 */
.eyebrow { margin: 0 0 4px; font-size: 0.6875rem; line-height: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--label-2); }
.footnote { font-size: 0.8125rem; line-height: 1.125rem; color: var(--label-2); margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Schwebende Navigation (einzige Glas-Ebene) ---------- */
.bar {
  position: sticky; top: 0; z-index: 10;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.4) blur(var(--blur));
  backdrop-filter: saturate(1.4) blur(var(--blur));
  border-bottom: 1px solid var(--separator);
  padding-top: env(safe-area-inset-top);
}
.bar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 12px 20px; min-height: 64px;
}
.logo { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; color: var(--label); }
.wordmark { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.bar nav { display: flex; gap: 4px; }
.bar nav a {
  color: var(--label-2); text-decoration: none; font-size: 0.9375rem; font-weight: 500;
  padding: 8px 12px; border-radius: var(--r-pill); min-height: 36px; display: inline-flex; align-items: center;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.bar nav a:hover { background: var(--fill); color: var(--label); }
.bar nav a.active { color: var(--label); background: var(--fill); }

/* ---------- Seitenaufbau ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
section { padding: 48px 0; scroll-margin-top: 72px; }
section + section { border-top: 1px solid var(--separator); }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }

.card { background: var(--surface); border-radius: var(--r-card); padding: 24px; border: 0; margin: 0; }

.notice {
  margin-top: 24px; padding: 12px 16px; border-radius: var(--r-field);
  background: var(--warn-fill); color: var(--label); font-size: 0.9375rem; line-height: 1.375rem;
}
.notice strong { color: var(--warn); }

/* ---------- Status-Chip: Symbol + Wort ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--r-chip);
  font-size: 0.9375rem; line-height: 1.25rem; font-weight: 500;
  background: var(--fill); color: var(--label);
}
.chip .sym { font-size: 0.75rem; line-height: 1; }
.chip.ok { background: var(--ok-fill); color: var(--ok); }
.chip.warn { background: var(--warn-fill); color: var(--warn); }
.chip.error { background: var(--error-fill); color: var(--error); }
.chip.idle { background: var(--fill); color: var(--label-2); }

/* ---------- Livebild ---------- */
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.frame { margin: 0; }
.frame-img {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--media); border-radius: var(--r-sheet);
}
.frame-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.stamp {
  position: absolute; left: 16px; top: 16px;
  background: var(--stamp); color: #FFFFFF;
  font-size: 0.8125rem; line-height: 1.125rem; font-weight: 500; font-variant-numeric: tabular-nums;
  padding: 4px 10px; border-radius: var(--r-chip);
}
.frame figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 12px; }

/* Signatur: Zeitleiste – links fest (aufgenommen), rechts gepunktet (geplant), Punkt = jetzt */
.timeline { padding: 20px 4px 4px; }
.tl-track { position: relative; height: 15px; }
.tl-done, .tl-plan { position: absolute; top: 6px; height: 3px; }
.tl-done { left: 0; width: 0; background: var(--label); border-radius: 2px; }
.tl-plan {
  left: 0; right: 0;
  background-image: radial-gradient(circle, var(--label-2) 1.5px, transparent 1.6px);
  background-size: 6.5px 3px; background-repeat: repeat-x; background-position: left center;
  z-index: 0;
}
.tl-done { z-index: 1; }
.tl-now {
  position: absolute; top: 0; left: 0; width: 15px; height: 15px; margin-left: -7.5px;
  background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 2.5px var(--bg); z-index: 2;
}
.timeline.off .tl-now { background: var(--label-2); }
.tl-labels { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; font-size: 0.8125rem; line-height: 1.125rem; color: var(--label-2); font-variant-numeric: tabular-nums; }
.tl-labels #tlText { color: var(--label); font-weight: 500; text-align: center; }

/* ---------- Zustand ---------- */
.facts h2 { margin-bottom: 8px; }
.facts dl { margin: 0; }
.facts .f { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--separator); }
.facts .f:last-child { border-bottom: 0; }
.facts dt { color: var(--label-2); font-size: 0.9375rem; line-height: 1.25rem; }
.facts dd { margin: 0; text-align: right; font-size: 0.9375rem; line-height: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts dd small { display: block; font-weight: 400; color: var(--label-2); font-size: 0.8125rem; line-height: 1.125rem; }
.facts dd.error { color: var(--error); }
.facts dd.warn { color: var(--warn); }
.btn-col { display: grid; gap: 8px; margin-top: 16px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons: Kapsel, 44 px ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--hit); padding: 0 20px; border-radius: var(--r-pill); border: 0;
  font-size: 0.9375rem; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer;
  transition: background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
}
.btn.primary { background: var(--signal); color: var(--on-signal); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--fill); color: var(--label); }
.btn.secondary:hover { background: var(--separator); }
.btn.text { background: transparent; color: var(--accent); padding: 0 12px; }
.btn.text:hover { background: var(--signal-soft); }
.btn.destructive { background: transparent; color: var(--error); }
.btn.destructive:hover { background: var(--error-fill); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.live-on { background: var(--signal-soft); color: var(--accent); }

/* ---------- Bildarchiv ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 24px 16px; }
.shot {
  background: none; border: 0; padding: 0; color: var(--label); text-align: left; cursor: zoom-in;
  font: inherit; border-radius: var(--r-card);
}
.shot img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block;
  background: var(--fill); border-radius: var(--r-field);
  transition: opacity var(--t-fast) var(--ease);
}
.shot:hover img { opacity: .88; }
.shot span { display: flex; justify-content: space-between; gap: 8px; padding: 8px 2px 0; font-size: 0.9375rem; line-height: 1.25rem; }
.shot span b { font-weight: 600; font-variant-numeric: tabular-nums; }
.shot span i { font-style: normal; color: var(--label-2); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.day { grid-column: 1 / -1; margin: 0; font-size: 1.0625rem; line-height: 1.375rem; font-weight: 600; padding-top: 8px; }
.day:not(:first-child) { padding-top: 24px; }
.more { text-align: center; padding-top: 32px; }
.empty { color: var(--label-2); grid-column: 1 / -1; margin: 0; }

/* ---------- Formular ---------- */
form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
fieldset.card { display: grid; gap: 16px; align-content: start; min-width: 0; }
legend.t3 { float: left; width: 100%; padding: 0; margin-bottom: 0; display: flex; align-items: center; gap: 8px; }
legend + * { clear: both; }
.tag { font-size: 0.75rem; line-height: 1rem; font-weight: 500; color: var(--label-2); background: var(--fill); padding: 2px 8px; border-radius: var(--r-chip); }
label { display: grid; gap: 6px; font-size: 0.9375rem; line-height: 1.25rem; font-weight: 500; color: var(--label); }
.field-label { display: block; font-size: 0.9375rem; line-height: 1.25rem; font-weight: 500; margin-bottom: 6px; }
input[type=text], input[type=url], input[type=password], input[type=number], input[type=time], select {
  min-height: var(--hit); width: 100%;
  border: 1px solid var(--separator); background: var(--bg); color: var(--label);
  border-radius: var(--r-field); padding: 0 12px; font-size: 1.0625rem; font-weight: 400;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--t-fast) var(--ease);
}
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--signal-soft); }
input:disabled { opacity: .5; }
input[type=range] { accent-color: var(--accent); width: 100%; min-height: 28px; }
.val { color: var(--label-2); font-weight: 400; font-variant-numeric: tabular-nums; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { margin: -8px 0 0; font-size: 0.8125rem; line-height: 1.125rem; color: var(--label-2); }

/* Wochentage als Segmente */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 36px; padding: 0 10px; border-radius: var(--r-pill);
  background: var(--fill); color: var(--label-2); font-size: 0.9375rem; font-weight: 500; cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.seg input:checked + span { background: var(--signal-soft); color: var(--accent); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Schalter */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 500; min-height: 32px; }
.switch input {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0;
  width: 44px; height: 26px; border-radius: var(--r-pill); background: var(--separator); position: relative; cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #FFFFFF; transition: transform var(--t-fast) var(--ease);
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }

.form-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-foot .err { color: var(--error); }
.form-foot .okmsg { color: var(--ok); }

/* ---------- Protokoll ---------- */
pre#logBox {
  margin: 0; padding: 16px 20px; overflow: auto; max-height: 420px;
  font: 0.8125rem/1.25rem ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--label-2); white-space: pre-wrap; word-break: break-word;
}

.foot { max-width: 1200px; margin: 0 auto; padding: 32px 20px 48px; border-top: 1px solid var(--separator); }

/* ---------- Bildansicht ---------- */
dialog#lightbox {
  border: 0; padding: 0; background: var(--surface); color: var(--label);
  width: min(96vw, 1400px); border-radius: var(--r-sheet); overflow: hidden;
}
dialog#lightbox::backdrop { background: #05211CCC; }
#lbImg { width: 100%; max-height: 78vh; object-fit: contain; display: block; background: var(--media); }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; font-size: 0.9375rem; }

/* ---------- Rückmeldung ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  background: var(--label); color: var(--bg);
  padding: 12px 20px; border-radius: var(--r-pill); font-size: 0.9375rem; font-weight: 500;
  opacity: 0; pointer-events: none; max-width: calc(100vw - 32px);
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--error); color: #FFFFFF; }

/* ---------- Breakpoints 1024 / 640 ---------- */
@media (max-width: 1024px) {
  .live-grid { grid-template-columns: 1fr; }
  form { grid-template-columns: 1fr; }
}
@media (min-width: 1280px) {
  .bar-inner, main, .foot { padding-left: 32px; padding-right: 32px; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.75rem; line-height: 2.125rem; }
  .bar-inner { flex-wrap: wrap; gap: 8px; padding-bottom: 8px; }
  .bar nav { width: 100%; overflow-x: auto; margin: 0 -8px; scrollbar-width: none; }
  .bar nav::-webkit-scrollbar { display: none; }
  section { padding: 32px 0; scroll-margin-top: 112px; }
  .card { padding: 20px; }
  .frame-img { border-radius: var(--r-card); }
  .row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
}

/* =========================================================
   Ergänzungen für die Cloud-Oberfläche
   ========================================================= */
.view[hidden] { display: none !important; }
.crumb { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 0.9375rem; font-weight: 500; text-decoration: none; color: var(--accent); min-height: 28px; }
.sub { color: var(--label-2); margin: 4px 0 0; font-size: 0.9375rem; line-height: 1.25rem; }

/* Kamerakarten in der Übersicht */
.cams { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.cam-card { display: block; background: var(--surface); border-radius: var(--r-card); overflow: hidden; text-decoration: none; color: var(--label); transition: transform var(--t-fast) var(--ease); }
.cam-card:hover { transform: translateY(-2px); }
.cam-card .ph { aspect-ratio: 16 / 9; background: var(--fill); display: block; width: 100%; object-fit: cover; }
.cam-card .ph.none { display: flex; align-items: center; justify-content: center; color: var(--label-2); font-size: 0.9375rem; }
.cam-card .body { padding: 16px 16px 20px; display: grid; gap: 8px; }
.cam-card .title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cam-card h3 { margin: 0; font-size: 1.0625rem; line-height: 1.375rem; font-weight: 600; }
.cam-card .meta { font-size: 0.8125rem; line-height: 1.125rem; color: var(--label-2); font-variant-numeric: tabular-nums; }
.cam-card.inactive { opacity: .6; }
.chip.small { font-size: 0.8125rem; padding: 3px 8px; white-space: nowrap; }

/* Listen (Alarme, Befehle, Filme) */
.list { background: var(--surface); border-radius: var(--r-card); overflow: hidden; }
.list .li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 12px 16px; min-height: 44px; border-bottom: 1px solid var(--separator); }
.list .li:last-child { border-bottom: 0; }
.list .li .when { font-size: 0.8125rem; color: var(--label-2); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.list .li .what { font-size: 0.9375rem; line-height: 1.375rem; }
.list .li .what small { display: block; color: var(--label-2); font-size: 0.8125rem; line-height: 1.125rem; }
.list .li .sym { font-size: 0.75rem; }
.list .li .sym.ok { color: var(--ok); } .list .li .sym.warn { color: var(--warn); } .list .li .sym.error { color: var(--error); } .list .li .sym.idle { color: var(--label-2); }
.list .empty-row { padding: 16px; color: var(--label-2); font-size: 0.9375rem; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar select { width: auto; min-width: 200px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--separator); }
.inline-form label { flex: 1; min-width: 160px; }

video.film { width: 100%; border-radius: var(--r-field); background: var(--media); display: block; aspect-ratio: 16 / 9; }

/* Dialoge */
dialog.sheet { border: 0; border-radius: var(--r-sheet); padding: 0; background: var(--surface); color: var(--label); width: min(560px, calc(100vw - 32px)); }
dialog.sheet::backdrop { background: #05211CA6; }
dialog.sheet form, dialog.sheet .sheet-body { display: grid; gap: 16px; padding: 24px; grid-template-columns: 1fr; }
dialog.sheet .btn-row { justify-content: flex-end; }
.secret { font: 0.9375rem/1.375rem ui-monospace, "SF Mono", Menlo, monospace; background: var(--bg); border-radius: var(--r-field); padding: 12px; word-break: break-all; user-select: all; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 0.9375rem; }
.kv dt { color: var(--label-2); } .kv dd { margin: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; word-break: break-all; }

/* Anmeldung */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(400px, 100%); display: grid; gap: 20px; }
.login .logo { margin-bottom: 8px; }
.login .err { color: var(--error); margin: 0; font-size: 0.9375rem; }

@media (max-width: 1024px) { .split { grid-template-columns: minmax(0, 1fr); } }
#films .card > * { min-width: 0; }
.list .li .what { overflow-wrap: anywhere; }
@media (max-width: 640px) { .list .li .when { white-space: normal; max-width: 80px; } }

/* =========================================================
   Plattform: Portal, Player, Verwaltung, Anmeldung
   ========================================================= */
textarea { font: inherit; color: var(--label); background: var(--bg); border: 1px solid var(--separator); border-radius: var(--r-field); padding: 10px 12px; width: 100%; resize: vertical; }
textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--signal-soft); }
textarea.code { font: 0.8125rem/1.25rem ui-monospace, "SF Mono", Menlo, monospace; }
.side { display: grid; gap: 16px; align-content: start; }
.side .card { display: grid; gap: 12px; }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); } .muted { color: var(--label-2); }
.btn.text.danger-text { color: var(--error); }
.btn.text.danger-text:hover { background: var(--error-fill); }
.btn.icon { padding: 0; width: var(--hit); }
.center { text-align: center; }

/* Ansicht-Umschalter (Segmente) */
.seg-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-top: 16px; background: var(--fill); border-radius: var(--r-pill); flex-wrap: wrap; }
.seg-tabs button { border: 0; background: transparent; color: var(--label-2); font: inherit; font-size: 0.9375rem; font-weight: 500; min-height: 36px; padding: 0 16px; border-radius: var(--r-pill); cursor: pointer; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.seg-tabs button[aria-selected="true"] { background: var(--surface); color: var(--label); font-weight: 600; }
.pl-panel { padding-top: 16px; display: grid; gap: 12px; }
.pl-panel[data-panel="live"] { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.pl-panel[hidden] { display: none !important; }
.frame-img video { width: 100%; height: 100%; display: block; background: var(--media); }
.pl-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #A6B8B1; }
.tl-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-controls select { width: auto; flex: 1; min-width: 220px; }
.pl-range { width: 100%; accent-color: var(--accent); min-height: 32px; }
.tl-labels .pl-cur { color: var(--label); font-weight: 500; }
.film-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.film-item { display: grid; gap: 2px; text-align: left; background: var(--surface); border: 1px solid var(--separator); border-radius: var(--r-field); padding: 10px 12px; font: inherit; color: var(--label); cursor: pointer; min-height: var(--hit); }
.film-item.on { border-color: var(--accent); background: var(--signal-soft); }

/* Masken-Editor */
dialog.sheet.wide { width: min(1100px, calc(100vw - 32px)); }
.mask-stage { position: relative; border-radius: var(--r-field); overflow: hidden; background: var(--media); cursor: crosshair; touch-action: none; user-select: none; }
.mask-stage img { width: 100%; display: block; pointer-events: none; }
.mask { position: absolute; border: 2px solid var(--accent); background: #C6F21E40; border-radius: 4px; padding: 0; cursor: pointer; }
.mask:hover { background: #C1291F55; border-color: var(--error); }
.mask.ghost { pointer-events: none; border-style: dashed; }

/* Listen, Benutzer, Rechte */
.list.compact .li { padding: 8px 0; border-bottom: 1px solid var(--separator); background: none; }
.list.compact { background: none; }
.li.link { text-decoration: none; color: var(--label); }
.li.link:hover { background: var(--fill); }
.user-row { padding: 16px; border-bottom: 1px solid var(--separator); display: grid; gap: 12px; }
.user-row:last-child { border-bottom: 0; }
.user-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.perm-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pchip span { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: var(--r-pill); background: var(--fill); color: var(--label-2); font-size: 0.875rem; font-weight: 500; cursor: pointer; }
.pchip input:checked + span { background: var(--signal-soft); color: var(--accent); }
.pchip input:checked + span::before { content: "✓ "; white-space: pre; }
.pchip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
fieldset.checks { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
fieldset.checks legend { font-weight: 500; margin-bottom: 8px; font-size: 0.9375rem; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
label.check input { accent-color: var(--accent); width: 18px; height: 18px; }
label.check.small { font-size: 0.8125rem; color: var(--label-2); }
.kv2 { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: 0.9375rem; }
.kv2 dt { color: var(--label-2); } .kv2 dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.bars span { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }

/* Anmeldung */
.login .step { display: grid; gap: 16px; }
.login .step[hidden] { display: none; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--label); font-size: 0.9375rem; }
.qr { background: #FFFFFF; border-radius: var(--r-field); padding: 12px; width: 220px; justify-self: center; }
.qr svg { width: 100%; height: auto; display: block; }
.codes { list-style: none; margin: 0; padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; background: var(--bg); border-radius: var(--r-field); font: 1rem/1.5rem ui-monospace, "SF Mono", Menlo, monospace; }
details summary { cursor: pointer; color: var(--accent); font-size: 0.9375rem; }

/* Öffentliche Seite & Einbettung */
.pub { max-width: 1100px; margin: 0 auto; padding: 24px 20px 32px; }
.pub-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.pub-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--separator); }
body.embed { background: transparent; }
body.embed .pub { padding: 0; max-width: none; }
body.embed .pub-foot { margin-top: 8px; padding-top: 8px; border-top: 0; }
body.embed .frame-img { border-radius: var(--r-card); }
.pl-empty[hidden], .stamp[hidden] { display: none; }
.list.compact .li { grid-template-columns: auto minmax(0, 1fr); row-gap: 4px; }
.list.compact .li > :last-child:not(.what) { grid-column: 2; }
.list.compact .li .btn.text { padding: 0 8px; min-height: 32px; }
input[type=email], input[type=tel] {
  min-height: var(--hit); width: 100%; border: 1px solid var(--separator); background: var(--bg); color: var(--label);
  border-radius: var(--r-field); padding: 0 12px; font-size: 1.0625rem; font-weight: 400;
}
input[type=email]:focus, input[type=tel]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--signal-soft); }

/* =========================================================
   Krany CD 1.0 – Marke, Typografie, Bedienelemente
   ========================================================= */
body { transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease); }
h1, .t1, .t3, .wordmark { font-family: var(--font-display); font-weight: 700; }
h1 { font-size: 2.25rem; line-height: 2.5rem; letter-spacing: -0.025em; }       /* Large Title 36/40 */
.t1 { font-size: 1.75rem; line-height: 2.125rem; font-weight: 700; letter-spacing: -0.02em; }   /* Title 1 28/34 */
.t3 { font-size: 1.25rem; line-height: 1.5625rem; font-weight: 700; letter-spacing: -0.005em; } /* Title 3 20/25 */
.eyebrow { font-size: 0.75rem; letter-spacing: .06em; }

/* Links & Text-Aktionen: Tiefgrün mit Limette-Unterstrich (dunkel: Limette) */
a { color: var(--accent); text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.btn.text, details summary { color: var(--label); text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.btn.text:hover { background: var(--fill); }
.crumb { color: var(--label); }
.crumb:hover { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; }

/* Fokusring: 2 px Tiefgrün + 2 px Limette außen */
:focus-visible { outline: none; box-shadow: 0 0 0 2px #05211C, 0 0 0 4px var(--signal); }
.seg input:focus-visible + span, .pchip input:focus-visible + span { outline: none; box-shadow: 0 0 0 2px #05211C, 0 0 0 4px var(--signal); }
input:focus, select:focus, textarea:focus,
input[type=email]:focus, input[type=tel]:focus { border-color: var(--label); box-shadow: 0 0 0 3px var(--signal-soft); }

/* Logo: Kran-„T“ mit Limette-Punkt im tiefgrünen Feld + Wortmarke „krany“ */
.logo { gap: 10px; }
.mark { width: 32px; height: 32px; flex: none; display: block; }
.mark .f { fill: var(--logo-field); }
.mark .t { fill: var(--logo-t); }
.mark .d { fill: var(--signal); }
.wordmark { font-size: 1.625rem; line-height: 1; letter-spacing: -0.02em; text-transform: lowercase; padding-bottom: 3px; }
.logo.small { gap: 7px; }
.logo.small .mark { width: 20px; height: 20px; }
.logo.small .wordmark { font-size: 1rem; padding-bottom: 2px; }

/* Navigation */
.bar { border-bottom-color: var(--separator); }
.bar-inner { justify-content: flex-start; }
.bar nav { margin-left: auto; order: 1; }
.bar nav a.active { background: var(--signal-soft); color: var(--label); font-weight: 600; }
.theme-btn {
  order: 2; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--label-2); cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.theme-btn:hover { background: var(--fill); color: var(--label); }
.theme-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn g { display: none; }
.theme-btn:not([data-mode]) .i-auto, .theme-btn[data-mode="auto"] .i-auto,
.theme-btn[data-mode="light"] .i-light, .theme-btn[data-mode="dark"] .i-dark { display: inline; }
.theme-btn .i-auto .half { fill: currentColor; stroke: none; }

/* Buttons: Primär = Limette mit Tiefgrün, Sekundär = Moos */
.btn.primary { background: var(--signal); color: var(--on-signal); }
.btn.primary:hover { filter: brightness(.94); }
.btn.secondary { background: var(--fill); color: var(--label); }
.btn.secondary:hover { background: var(--line); }
.btn.live-on { background: var(--signal-soft); color: var(--label); }

/* Status-Chips: Kapsel, Symbol + Wort */
.chip { border-radius: var(--r-pill); font-weight: 600; }

/* Auswahl: Limette hell mit tiefgrüner Schrift */
.seg input:checked + span, .pchip input:checked + span { background: var(--signal-soft); color: var(--label); font-weight: 600; }
.seg-tabs button[aria-selected="true"] { background: var(--bg); }
.film-item.on { border-color: var(--label); background: var(--signal-soft); }
.switch input { background: var(--line); }
.switch input:checked { background: var(--signal); }
.switch input:checked::after { background: var(--on-signal); }
input[type=range], .pl-range, label.check input { accent-color: var(--accent); }

/* Felder */
input[type=text], input[type=url], input[type=password], input[type=number], input[type=time], select,
input[type=email], input[type=tel], textarea { border-color: var(--line); }

/* Bild & Zeitleiste: Zeitstempel als Limette-Kapsel, Abspielkopf Limette mit tiefgrünem Ring */
.stamp { background: var(--signal); color: var(--on-signal); border-radius: var(--r-pill); font-weight: 600; padding: 4px 12px; }
.tl-track { height: 18px; }
.tl-done, .tl-plan { top: 7.5px; }
.tl-now { width: 18px; height: 18px; margin-left: -9px; background: var(--signal); box-shadow: 0 0 0 2px #05211C, 0 0 0 4px var(--bg); }
.timeline.off .tl-now { background: var(--fill); }
dialog#lightbox::backdrop { background: #05211CCC; }
.toast { background: var(--label); color: var(--bg); }

@media (max-width: 640px) {
  h1 { font-size: 1.75rem; line-height: 2.125rem; }
  .bar nav { order: 3; margin-left: -8px; }
  .theme-btn { margin-left: auto; }
}

/* Krany – Cloud: Karten, Masken, Statistik */
.cam-card { border: 2px solid transparent; }
.cam-card:hover { transform: none; border-color: var(--label); }
.mask { border-color: var(--signal); background: #C6F21E40; }
.bars span { background: var(--label); opacity: .8; }
.bars span:last-child { background: var(--signal); opacity: 1; }
dialog.sheet::backdrop { background: #05211CA6; }
.pl-empty { color: #A6B8B1; }
.pub-foot .claim { font-family: var(--font-display); font-weight: 700; color: var(--label); }
.login-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
body.embed .theme-btn { display: none; }

/* Signatur-Zeitleiste: Linie Tiefgrün, Abspielkopf Limette mit tiefgrünem Ring */
.pl-range { -webkit-appearance: none; appearance: none; background: transparent; height: 32px; cursor: pointer; }
.pl-range::-webkit-slider-runnable-track { height: 3px; background: var(--label); border-radius: 2px; }
.pl-range::-moz-range-track { height: 3px; background: var(--label); border-radius: 2px; }
.pl-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: -8.5px; border-radius: 50%;
  background: var(--signal); border: 0; box-shadow: 0 0 0 2px #05211C, 0 0 0 4px var(--bg); cursor: grab;
}
.pl-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--signal); border: 0; box-shadow: 0 0 0 2px #05211C, 0 0 0 4px var(--bg); cursor: grab; }
.pl-range:focus-visible { box-shadow: none; }
.pl-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px #05211C, 0 0 0 5px var(--signal); }
.cam-card .title { flex-wrap: wrap; }

/* Aufnahmezeiten */
.sched-title { margin: 8px 0 0; font-size: 1.0625rem; line-height: 1.375rem; font-weight: 600; }
form.sched { display: grid; gap: 12px; }
form.sched .row { grid-template-columns: 1fr 1fr; }
form.sched .seg { gap: 4px; }
form.sched .seg span { min-width: 40px; padding: 0 8px; }
#schedWrap { display: grid; gap: 12px; align-items: stretch; }
.sched-times { display: grid; gap: 12px; }
.sched-times[hidden] { display: none; }
.switch small { display: block; font-size: 0.8125rem; line-height: 1.125rem; font-weight: 400; color: var(--label-2); }
.sched-plan-actions { margin-top: -4px; }
.sched-plan-actions [hidden] { display: none; }

/* Anmeldung: Text-Knöpfe, Projekte mit mehreren Kameras */
.login .center-btn { justify-self: center; }
.cam-tabs { margin: 0 0 24px; }
.cam-tabs a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: var(--r-pill); color: var(--label-2); text-decoration: none; font-size: 0.9375rem; font-weight: 500; }
.cam-tabs a[aria-current="page"] { background: var(--bg); color: var(--label); font-weight: 600; }
.cam-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cam-head .btn.text { margin-left: auto; }
input[type=date] { min-height: var(--hit); width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--label); border-radius: var(--r-field); padding: 0 12px; font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
input[type=date]:focus { border-color: var(--label); outline: none; box-shadow: 0 0 0 3px var(--signal-soft); }
