/* JARVIS – Oberfläche (Redesign). Alle Gestaltungswerte stehen zentral in :root. */
:root {
  /* Farben – warm, ohne Blau. Koralle nur für Navigation und wichtige Aktionen. */
  --coral: #E5544F;
  --coral-strong: #C94440;
  --coral-soft: #FBE9E7;
  --bg: #FAF8F5;
  --sidebar: #F2EEE9;
  --surface: #FFFFFF;
  --surface-2: #F6F3EF;
  --hover: rgba(70, 50, 40, .05);
  --pressed: rgba(70, 50, 40, .09);
  --line: rgba(60, 44, 36, .12);
  --line-strong: rgba(60, 44, 36, .2);
  --text: #1E1C1A;
  --text-2: #6B645E;
  --text-3: #98908A;
  --ok: #2E8F57;
  --ok-soft: #E6F3EA;
  --warn: #C97A12;
  --warn-soft: #FBF0DF;
  --err: #C2362B;
  --err-soft: #FBE7E4;
  --idle: #8E8781;
  --idle-soft: #EFECE8;
  --demo: #7A5A2F;
  --demo-soft: #F4ECDD;
  --on-coral: #FFFFFF;
  --link: var(--coral-strong);
  --bar-bg: rgba(250, 248, 245, .88);
  --backdrop: rgba(30, 20, 15, .3);
  --toast-bg: rgba(30, 28, 26, .92);
  --media-bg: #1E1C1A;
  --skel: #EDE8E2;
  --occ-b: #F2B8B5;
  --occ-fewo: #E3C9A0;
  --field-bg: #FFFFFF;
  --login-glow: rgba(229, 84, 79, .10);

  /* Schrift – Systemschrift, wenige Größen */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --fs-title: 26px;
  --fs-h2: 17px;
  --fs-body: 14px;
  --fs-small: 12.5px;
  --fs-tiny: 11px;
  --lh: 1.45;

  /* Abstände, Radien, Schatten */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
  --shadow: 0 1px 2px rgba(40, 28, 20, .06), 0 1px 1px rgba(40, 28, 20, .03);
  --shadow-pop: 0 12px 40px rgba(40, 28, 20, .18);
  --sidebar-w: 232px;
  --row-h: 44px;
  --focus: 0 0 0 3px rgba(229, 84, 79, .35);
  color-scheme: light;
}

/* Dunkle Darstellung – abgestufte Anthrazitflächen, Koralle als gezielter Akzent */
:root[data-theme="dark"] {
  color-scheme: dark;
  --coral: #E9605A;
  --coral-strong: #F27C76;
  --coral-soft: rgba(233, 96, 90, .17);
  --link: #F48A84;
  --bg: #161514;
  --sidebar: #1C1B19;
  --surface: #232120;
  --surface-2: #2C2A28;
  --hover: rgba(255, 255, 255, .05);
  --pressed: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .17);
  --text: #F3F0EC;
  --text-2: #ABA49D;
  --text-3: #837C76;
  --ok: #5BC98A;
  --ok-soft: rgba(91, 201, 138, .14);
  --warn: #EBA845;
  --warn-soft: rgba(235, 168, 69, .14);
  --err: #FF7B6E;
  --err-soft: rgba(255, 123, 110, .14);
  --idle: #918A84;
  --idle-soft: rgba(255, 255, 255, .07);
  --demo: #D9B783;
  --demo-soft: rgba(217, 183, 131, .14);
  --bar-bg: rgba(22, 21, 20, .86);
  --backdrop: rgba(0, 0, 0, .55);
  --toast-bg: rgba(60, 57, 54, .96);
  --media-bg: #0E0D0C;
  --skel: #34312E;
  --occ-b: rgba(233, 96, 90, .38);
  --occ-fewo: rgba(217, 183, 131, .45);
  --field-bg: #1C1B19;
  --login-glow: rgba(233, 96, 90, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-pop: 0 16px 48px rgba(0, 0, 0, .55);
  --focus: 0 0 0 3px rgba(233, 96, 90, .5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: var(--fs-body)/var(--lh) var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
h1, h2, h3, p { margin: 0; }
.secondary { color: var(--text-2); }
.tertiary { color: var(--text-3); }
.small { font-size: var(--fs-small); }
.tiny { font-size: var(--fs-tiny); }
.mono { font-family: var(--mono); font-size: var(--fs-small); }
.num { font-variant-numeric: tabular-nums; }
.break { overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- Marke */
.mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--coral);
  color: var(--on-coral); font-weight: 700; font-size: 16px; letter-spacing: -.02em; flex: none; }
.mark.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 28px; }
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; }
.boot .mark { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }

/* ---------------------------------------------------------------- Grundgerüst */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; background: var(--sidebar); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: var(--s4) var(--s3); gap: var(--s4); }
.brand { display: flex; align-items: center; gap: var(--s3); padding: var(--s1) var(--s2) var(--s2); }
.brand strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--text-2); font-size: var(--fs-small); line-height: 1.2; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: var(--s3); height: 34px; padding: 0 var(--s3); border-radius: var(--r-sm);
  color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--hover); }
.nav a[aria-current="page"] { background: var(--coral); color: #fff; }
.nav a[aria-current="page"] svg { color: #fff; }
.nav svg { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.nav .badge { margin-left: auto; }
.nav a[aria-current="page"] .badge { background: rgba(255,255,255,.25); color: #fff; }
.sidebar-foot { margin-top: auto; display: grid; gap: var(--s2); padding: 0 var(--s2); justify-items: start; }
.sidebar-foot .btn.plain { padding: 0; min-height: 24px; }
.main { min-width: 0; padding: var(--s6) var(--s6) var(--s7); outline: none; }
.main:focus, .main:focus-visible { box-shadow: none; outline: none; }
.page { max-width: 1120px; margin: 0 auto; display: grid; gap: var(--s5); }
.page > *, .cols > *, .section > *, .split > * { min-width: 0; }
.toolbar input[type=file] { padding-top: 4px; max-width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.page-head h1 { font-size: var(--fs-title); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.page-head .sub { color: var(--text-2); margin-top: var(--s1); }
.crumb { display: inline-flex; align-items: center; gap: var(--s1); color: var(--text-2); font-size: var(--fs-small); margin-bottom: var(--s2); }
.crumb:hover { color: var(--link); }
.crumb svg { width: 14px; height: 14px; }
.mobile-bar, .tabbar { display: none; }

/* ---------------------------------------------------------------- Abschnitte & Listen (Systemeinstellungen-Stil) */
.section { display: grid; gap: var(--s2); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding: 0 var(--s1); }
.section-head h2 { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -.01em; }
.section-head .aside { color: var(--text-2); font-size: var(--fs-small); }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: var(--s3); min-height: var(--row-h); padding: var(--s2) var(--s4); position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: var(--s4); right: 0; border-top: 1px solid var(--line); }
.row.with-icon + .row.with-icon::before { left: 52px; }
a.row, button.row { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
a.row:hover, button.row:hover { background: var(--hover); }
a.row:active, button.row:active { background: var(--pressed); }
.row[aria-current="true"] { background: var(--coral-soft); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.row-title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--text-2); font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub.wrap { white-space: normal; overflow-wrap: anywhere; }
.row-end { display: flex; align-items: center; gap: var(--s2); color: var(--text-2); font-size: var(--fs-small); flex: none; }
.chev { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.row-icon { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }
.row-icon svg { width: 16px; height: 16px; }
.thumb { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--surface-2) center/cover no-repeat; flex: none;
  display: grid; place-items: center; color: var(--text-3); font-weight: 600; }
.thumb.lg { width: 64px; height: 64px; }

/* Schlüssel-Wert-Liste */
.kv { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; }
.kv > div { display: contents; }
.kv dt, .kv dd { margin: 0; padding: var(--s2) var(--s4); border-top: 1px solid var(--line); }
.kv > div:first-child dt, .kv > div:first-child dd { border-top: 0; }
.kv dt { color: var(--text-2); }
.kv dd { overflow-wrap: anywhere; }

/* Karten nur für Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s3); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: var(--s3) var(--s4); }
.stat .label { color: var(--text-2); font-size: var(--fs-small); }
.stat .value { font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .hint { color: var(--text-3); font-size: var(--fs-tiny); margin-top: 2px; }

/* ---------------------------------------------------------------- Status */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); font-weight: 500; white-space: nowrap; color: var(--text-2); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); flex: none; }
.status.ok::before { background: var(--ok); }
.status.work::before { background: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
.status.wait::before { background: var(--idle); }
.status.warn::before { background: var(--warn); }
.status.err { color: var(--err); }
.status.err::before { background: var(--err); }
.status.demo::before { background: var(--demo); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: var(--fs-tiny); font-weight: 600;
  background: var(--idle-soft); color: var(--text-2); white-space: nowrap; line-height: 18px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.work { background: var(--coral-soft); color: var(--link); }
.pill.demo { background: var(--demo-soft); color: var(--demo); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--err); color: #fff; font-size: var(--fs-tiny);
  font-weight: 600; display: inline-grid; place-items: center; }
.badge.neutral { background: var(--idle-soft); color: var(--text-2); }

/* Live-Anzeige */
.live { display: flex; align-items: center; gap: 6px; font-size: var(--fs-small); color: var(--text-2); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.live.on { color: var(--ok); }
.live.on::before { background: var(--ok); }
.live.wait::before { background: var(--warn); }
.live.compact { font-size: 0; gap: 0; }

/* Hinweise */
.note { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--surface-2);
  border: 1px solid var(--line); }
.note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--text-2); }
.note.warn { background: var(--warn-soft); border-color: rgba(201, 122, 18, .25); }
.note.warn svg { color: var(--warn); }
.note.err { background: var(--err-soft); border-color: rgba(194, 54, 43, .25); }
.note.err svg { color: var(--err); }
.note.demo { background: var(--demo-soft); border-color: rgba(122, 90, 47, .25); }
.note .note-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.note .note-body > * + * { margin-top: var(--s1); }
.note a, .link { color: var(--link); font-weight: 500; }
.note a:hover, .link:hover { text-decoration: underline; }

/* Leer, Laden, Fehler */
.empty { text-align: center; padding: var(--s6) var(--s4); color: var(--text-2); display: grid; gap: var(--s2); justify-items: center; }
.empty svg { width: 28px; height: 28px; color: var(--text-3); }
.empty strong { color: var(--text); font-weight: 600; }
.skeleton { display: grid; gap: 0; }
.skeleton .row div { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--skel), var(--surface-2));
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- Bedienelemente */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 var(--s4); border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { background: var(--pressed); }
.btn.primary { background: var(--coral); border-color: var(--coral); color: var(--on-coral); }
.btn.primary:hover { background: var(--coral-strong); }
.btn.danger { color: var(--err); }
.btn.plain { border-color: transparent; background: none; color: var(--text-2); padding: 0 var(--s2); }
.btn.plain:hover { background: var(--hover); color: var(--text); }
.btn.sm { min-height: 28px; padding: 0 var(--s3); font-size: var(--fs-small); }
.btn.block { width: 100%; min-height: 40px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.icon-btn { width: 36px; height: 36px; border: 0; background: none; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--link); cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; }

.field-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.field { display: grid; gap: 2px; padding: var(--s2) var(--s4); }
.field + .field { border-top: 1px solid var(--line); }
.field span { font-size: var(--fs-tiny); color: var(--text-2); font-weight: 500; }
.field input { border: 0; outline: none; background: none; padding: 2px 0; font-size: 16px; }
.field:focus-within { box-shadow: inset 3px 0 0 var(--coral); }
.input, select.input { height: 32px; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); min-width: 0; }
.input:focus { outline: none; box-shadow: var(--focus); border-color: var(--coral); }
.toolbar { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.toolbar .input.grow { flex: 1; min-width: 180px; }

.seg { display: inline-flex; padding: 2px; background: var(--idle-soft); border-radius: 8px; gap: 2px; }
.seg button { border: 0; background: none; padding: 0 var(--s3); height: 28px; border-radius: 6px; font-size: var(--fs-small); font-weight: 500;
  color: var(--text-2); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Aufklappbar */
details.more { border-top: 1px solid var(--line); }
.group > details.more:first-child { border-top: 0; }
details.more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s2); min-height: var(--row-h);
  padding: var(--s2) var(--s4); color: var(--text-2); font-weight: 500; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3); transform: rotate(-45deg); transition: transform .15s; }
details.more[open] > summary::after { transform: rotate(45deg); }
details.more > summary:hover { background: var(--hover); }
details.more .more-body { padding: 0 var(--s4) var(--s4); overflow-wrap: anywhere; min-width: 0; }
details.more > summary > * { min-width: 0; }
details.more .more-body.flush { padding: 0; }

/* Fortschritt */
.bar { height: 6px; border-radius: 3px; background: var(--idle-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--coral); border-radius: 3px; }
.bar.ok > i { background: var(--ok); }
.bar.warn > i { background: var(--warn); }
.bar.indet > i { width: 30%; animation: indet 1.8s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }

/* Schritte */
.steps { display: grid; }
.step { display: grid; grid-template-columns: 20px 1fr auto; gap: var(--s3); align-items: start; padding: var(--s2) var(--s4); position: relative; }
.step + .step { border-top: 1px solid var(--line); }
.step .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); margin-top: 4px; justify-self: center; }
.step.fertig .dot { background: var(--ok); border-color: var(--ok); }
.step.läuft .dot { border-color: var(--coral); background: var(--coral-soft); }
.step.fehler .dot { background: var(--err); border-color: var(--err); }
.step .msg { color: var(--err); font-size: var(--fs-small); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Zweispaltig (Liste + Detail) */
.split { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: var(--s5); align-items: start; }
.split .detail { position: sticky; top: var(--s5); display: grid; gap: var(--s4); min-width: 0; }
.detail-head { display: flex; align-items: center; gap: var(--s3); }
.detail-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s5); align-items: start; }

/* Systemzustand */
.health { display: flex; align-items: center; gap: var(--s4); padding: var(--s4); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow); }
.health .orb { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--idle-soft); color: var(--idle); }
.health .orb svg { width: 22px; height: 22px; }
.health.ok .orb { background: var(--ok-soft); color: var(--ok); }
.health.warn .orb { background: var(--warn-soft); color: var(--warn); }
.health.err .orb { background: var(--err-soft); color: var(--err); }
.health h2 { font-size: var(--fs-h2); font-weight: 600; }
.health .meta { margin-left: auto; text-align: right; color: var(--text-2); font-size: var(--fs-small); }

/* Medien */
.outputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s3); padding: var(--s4); }
.output { display: grid; gap: var(--s2); align-content: start; min-width: 0; }
.output .meta > span { min-width: 0; }
.output video, .output img { width: 100%; border-radius: var(--r-sm); background: var(--media-bg); display: block; }
.output video { aspect-ratio: 9 / 16; object-fit: contain; }
.output img { aspect-ratio: 4 / 5; object-fit: cover; background: var(--surface-2); }
.output .caption { white-space: pre-wrap; font-size: var(--fs-small); background: var(--surface-2); border-radius: var(--r-sm); padding: var(--s3);
  max-height: 280px; overflow: auto; overflow-wrap: anywhere; }
.output .meta { display: flex; justify-content: space-between; gap: var(--s2); font-size: var(--fs-small); color: var(--text-2); }
.output .meta a { color: var(--link); font-weight: 500; }

/* Hotel */
.occ { overflow-x: auto; }
.occ table { border-collapse: collapse; font-size: var(--fs-tiny); min-width: 640px; width: 100%; }
.occ th, .occ td { padding: 0; text-align: center; height: 26px; border-bottom: 1px solid var(--line); }
.occ th { font-weight: 500; color: var(--text-2); padding: 4px 2px; }
.occ td.u { text-align: left; padding: 0 var(--s3); white-space: nowrap; font-size: var(--fs-small); position: sticky; left: 0; background: var(--surface); }
.occ td.c i { display: block; height: 16px; margin: 0 1px; border-radius: 3px; }
.occ td.b i { background: var(--occ-b); }
.occ td.bk i { background: var(--coral); }
.occ td.fewo.b i { background: var(--occ-fewo); }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; color: var(--text-2); font-size: var(--fs-small); padding: var(--s2) var(--s4); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }

/* Protokoll */
.day-head { position: sticky; top: 0; z-index: 1; padding: var(--s2) var(--s4); background: var(--surface-2); color: var(--text-2);
  font-size: var(--fs-small); font-weight: 600; border-bottom: 1px solid var(--line); }
.ev { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--s3); align-items: start; }
.ev .time { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: var(--fs-small); padding-top: 1px; }
.ev pre { margin: var(--s2) 0 0; font-family: var(--mono); font-size: var(--fs-tiny); white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--surface-2); border-radius: var(--r-sm); padding: var(--s2) var(--s3); color: var(--text-2); }
.ev details summary { cursor: pointer; list-style: none; }
.ev details summary::-webkit-details-marker { display: none; }

/* Tabellen (nur wo Spalten nötig sind) */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; color: var(--text-2); font-size: var(--fs-small); padding: var(--s2) var(--s4); border-bottom: 1px solid var(--line); }
.table td { padding: var(--s2) var(--s4); border-top: 1px solid var(--line); vertical-align: top; }
.table tr:first-child td { border-top: 0; }
.table .r { text-align: right; }
.table-wrap { overflow-x: auto; }

/* ---------------------------------------------------------------- Dialoge, Blatt, Hinweis */
.confirm { border: 0; border-radius: var(--r-lg); padding: var(--s5); width: min(380px, calc(100% - 32px)); box-shadow: var(--shadow-pop); }
.confirm::backdrop { background: var(--backdrop); }
.confirm h2 { font-size: var(--fs-h2); font-weight: 600; margin-bottom: var(--s2); }
.confirm-actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s5); }
.toast { position: fixed; left: 50%; bottom: calc(var(--s5) + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  background: var(--toast-bg); color: #fff; padding: var(--s2) var(--s4); border-radius: 999px; font-size: var(--fs-small); box-shadow: var(--shadow-pop);
  max-width: calc(100% - 32px); }
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--backdrop); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; background: var(--bg); border-radius: 16px 16px 0 0; padding: var(--s2) var(--s4)
  calc(var(--s5) + env(safe-area-inset-bottom)); box-shadow: var(--shadow-pop); display: grid; gap: var(--s4); }
.sheet-grip { width: 36px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto; }

/* ---------------------------------------------------------------- Tablet */
@media (max-width: 1100px) {
  :root { --sidebar-w: 200px; }
  .main { padding: var(--s5) var(--s5) var(--s7); }
  .split { grid-template-columns: 1fr; }
  .split .detail { position: static; border-top: 1px solid var(--line); padding-top: var(--s5); }
}

/* ---------------------------------------------------------------- iPhone */
@media (max-width: 760px) {
  :root { --fs-title: 24px; --row-h: 48px; }
  .app { display: block; }
  .sidebar { display: none; }
  .mobile-bar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; position: sticky; top: 0; z-index: 20;
    padding: calc(env(safe-area-inset-top)) var(--s2) 0; height: calc(48px + env(safe-area-inset-top));
    background: var(--bar-bg); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
    border-bottom: 1px solid var(--line); }
  .mobile-bar h1 { transition: opacity .15s; opacity: 0; }
  .scrolled .mobile-bar h1, .mobile-bar.detail h1 { opacity: 1; }
  .mobile-bar h1 { font-size: var(--fs-h2); font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; grid-column: 2; }
  .mobile-bar #m-back { grid-column: 1; }
  .mobile-bar .live { grid-column: 3; justify-self: center; }
  .main { padding: var(--s4) var(--s4) calc(84px + env(safe-area-inset-bottom)); }
  .page { gap: var(--s4); }
  .page-head .crumb { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom)); background: var(--bar-bg);
    backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 6px 0; min-height: 48px; border: 0; background: none;
    font-size: 10.5px; font-weight: 500; color: var(--text-2); position: relative; cursor: pointer; }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar [aria-current="page"] { color: var(--coral); }
  .tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); height: 16px; min-width: 16px; font-size: 10px; padding: 0 4px; }
  .split { display: block; }
  .split .detail { display: none; }
  .health { flex-wrap: wrap; }
  .health .meta { margin-left: 0; text-align: left; width: 100%; padding-left: 56px; }
  .kv { grid-template-columns: minmax(96px, 38%) 1fr; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 36px; }
  .seg button { height: 34px; }
  .input, select.input { height: 40px; font-size: 16px; }
  .outputs { grid-template-columns: repeat(2, 1fr); padding: var(--s3); }
  .ev { grid-template-columns: 52px 1fr; }
  .ev .ev-end { grid-column: 2; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .section-head { flex-direction: column; align-items: flex-start; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Lange Datei- und Ordnernamen umbrechen statt abschneiden */
.row-title > span:first-child:has(.break) { white-space: normal; overflow-wrap: anywhere; }
.stack { display: grid; gap: var(--s3); padding: 0 var(--s4) var(--s4); }
.stack > * { min-width: 0; }
.toolbar input[type=file] { width: 100%; min-width: 0; flex: 1 1 100%; }

/* ---------------------------------------------------------------- Formularfelder: Autofill ohne fremde Farben */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text); caret-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--field-bg) inset; box-shadow: 0 0 0 1000px var(--field-bg) inset;
  transition: background-color 9999s ease-out 0s;
}
::selection { background: var(--coral-soft); }
.dark-only { display: none; }
:root[data-theme="dark"] .dark-only { display: initial; }
:root[data-theme="dark"] .light-only { display: none; }

/* ---------------------------------------------------------------- Darstellung (Hell · Dunkel · System) */
.appearance { display: grid; gap: 6px; }
.appearance .label { font-size: var(--fs-tiny); color: var(--text-3); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.seg.appear { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
.seg.appear button { padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.seg.appear svg { width: 14px; height: 14px; flex: none; }

/* ---------------------------------------------------------------- Anmeldung */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; background:
  radial-gradient(900px 520px at 50% -10%, var(--login-glow), transparent 70%), var(--bg); }
.login-top { display: flex; justify-content: flex-end; padding: calc(var(--s4) + env(safe-area-inset-top)) var(--s5) 0; }
.login-top .seg.appear { width: auto; }
.login-top .seg.appear button { padding: 0 var(--s3); }
.login-main { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: var(--s5); }
.login-panel { width: min(400px, 100%); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
.login-card { grid-template-columns: minmax(0, 1fr); }
.login-brand { display: flex; align-items: center; gap: var(--s3); justify-content: center; }
.login-brand .mark { width: 44px; height: 44px; border-radius: 12px; font-size: 22px; box-shadow: 0 6px 18px rgba(229, 84, 79, .28); }
.login-brand strong { display: block; font-size: 19px; letter-spacing: -.01em; line-height: 1.15; }
.login-brand small { display: block; color: var(--text-2); font-size: var(--fs-small); }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow), 0 20px 60px rgba(40, 28, 20, .06);
  padding: var(--s6) var(--s5) var(--s5); display: grid; gap: var(--s4); }
.login-card h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; text-align: center; }
.login-card .lead { text-align: center; color: var(--text-2); margin-top: calc(-1 * var(--s3)); }
.lfield { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.lfield label { font-size: var(--fs-small); font-weight: 600; color: var(--text-2); }
.lfield .control { position: relative; display: flex; align-items: center; background: var(--field-bg); border: 1px solid var(--line-strong);
  border-radius: var(--r); transition: border-color .15s, box-shadow .15s; }
.lfield .control:focus-within { border-color: var(--coral); box-shadow: var(--focus); }
.lfield input { flex: 1; min-width: 0; width: 100%; height: 44px; padding: 0 var(--s3); border: 0; outline: none; background: transparent; font-size: 16px; border-radius: var(--r); }
.lfield input::placeholder { color: var(--text-3); }
.lfield .reveal { flex: none; height: 32px; margin-right: 6px; padding: 0 var(--s2); border: 0; border-radius: var(--r-sm); background: none;
  color: var(--text-2); font-size: var(--fs-small); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.lfield .reveal:hover { background: var(--hover); color: var(--text); }
.lfield .reveal svg { width: 16px; height: 16px; }
.login-card.has-error .control { border-color: var(--err); }
.login-card.has-error .control:focus-within { box-shadow: 0 0 0 3px var(--err-soft); }
.login-error { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s2) var(--s3); border-radius: var(--r-sm); background: var(--err-soft);
  color: var(--err); font-size: var(--fs-small); font-weight: 500; }
.login-error svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.caps { font-size: var(--fs-tiny); color: var(--warn); font-weight: 600; }
.btn.login-btn { min-height: 46px; font-size: 15px; font-weight: 600; border-radius: var(--r); margin-top: var(--s1); }
.btn.login-btn[aria-busy="true"] { cursor: progress; opacity: .85; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-foot { text-align: center; color: var(--text-3); font-size: var(--fs-tiny); padding: var(--s4) var(--s5) calc(var(--s4) + env(safe-area-inset-bottom)); }
@keyframes nudge { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.login-card.shake { animation: nudge .35s ease; }
@media (max-width: 760px) {
  .login { grid-template-rows: auto auto 1fr; }
  .login-top { justify-content: center; padding-top: calc(var(--s3) + env(safe-area-inset-top)); }
  .login-main { place-items: start center; padding: var(--s5) var(--s4) var(--s4); }
  .login-card { padding: var(--s5) var(--s4) var(--s4); border-radius: 16px; }
  .login-foot { align-self: end; }
}

/* =====================================================================================
   JARVIS v4 – räumliche Ebenen: Atmosphäre (Hintergrund) · Inhalt (deckend) · Bedienung (Glas)
   Glas nur für Navigation, Suche und kurze Menüs – nie für Listen, Tabellen oder Formulare.
   ===================================================================================== */
:root {
  --text-3: #766F69;               /* WCAG 1.4.3: ≥ 4,5:1 auf Grund- und Inhaltsfläche */
  --panel: #FFFFFF;                /* erhöhtes Panel */
  --glass: rgba(255, 252, 249, .72);
  --glass-solid: #FBF9F6;
  --glass-edge: rgba(255, 255, 255, .85);
  --glass-line: rgba(60, 44, 36, .10);
  --glass-shadow: 0 10px 30px rgba(60, 40, 30, .10), 0 1px 0 rgba(255, 255, 255, .7) inset;
  --atmo-1: rgba(229, 84, 79, .10);
  --atmo-2: rgba(232, 190, 150, .16);
  --nav-sel: rgba(229, 84, 79, .11);
  --nav-sel-text: #B8403B;
  --hero-from: #FFF7F3;
  --hero-to: #FFFFFF;
  --r-xl: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="dark"] {
  --text-3: #9A938C;
  --panel: #262422;
  --glass: rgba(38, 36, 34, .66);
  --glass-solid: #262422;
  --glass-edge: rgba(255, 255, 255, .10);
  --glass-line: rgba(255, 255, 255, .08);
  --glass-shadow: 0 14px 40px rgba(0, 0, 0, .45), 0 1px 0 rgba(255, 255, 255, .06) inset;
  --atmo-1: rgba(233, 96, 90, .10);
  --atmo-2: rgba(120, 90, 70, .10);
  --nav-sel: rgba(233, 96, 90, .16);
  --nav-sel-text: #F48A84;
  --hero-from: #2A2624;
  --hero-to: #222020;
}
html { scrollbar-color: var(--line-strong) transparent; }
body { background: var(--bg); }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60vw 40vw at 85% -10%, var(--atmo-1), transparent 60%),
              radial-gradient(50vw 40vw at -10% 110%, var(--atmo-2), transparent 60%); }

/* Glas-Material (Bedienebene) mit deckender Ausweichvariante */
.glass { background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: var(--glass-solid); } }
@media (prefers-reduced-transparency: reduce) { .glass, .glass-bar { background: var(--glass-solid) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; } }
@media (prefers-contrast: more) { :root { --line: rgba(60, 44, 36, .3); --text-2: #4F4943; --text-3: #5E5751; } :root[data-theme="dark"] { --line: rgba(255,255,255,.28); --text-2: #CFC8C1; --text-3: #B9B2AB; } }

/* Schwebende Seitenleiste (Mac) */
.app { grid-template-columns: calc(var(--sidebar-w) + 12px) 1fr; }
.sidebar { position: sticky; top: 12px; height: calc(100dvh - 24px); margin: 12px 0 12px 12px; border-radius: var(--r-xl); border-right: 0;
  background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .sidebar { background: var(--glass-solid); } }
@media (prefers-reduced-transparency: reduce) { .sidebar { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; } }
/* feiner Auswahlzustand: Koralltönung statt Vollfläche */
.nav a { position: relative; transition: background .15s var(--ease); }
.nav a[aria-current="page"] { background: var(--nav-sel); color: var(--nav-sel-text); font-weight: 600; }
.nav a[aria-current="page"] svg { color: var(--nav-sel-text); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -6px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--coral); }
.nav a[aria-current="page"] .badge { background: var(--err); color: #fff; }
.nav .kbd { margin-left: auto; font-size: var(--fs-tiny); color: var(--text-3); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.nav-search { display: flex; align-items: center; gap: var(--s2); height: 32px; padding: 0 var(--s3); border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--text-3); cursor: pointer; font-size: var(--fs-small); width: 100%; }
.nav-search:hover { color: var(--text-2); border-color: var(--line-strong); }
.nav-search svg { width: 15px; height: 15px; }
.nav-search kbd { margin-left: auto; font: inherit; font-size: var(--fs-tiny); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.btn.primary { box-shadow: 0 4px 14px rgba(229, 84, 79, .28); }

/* Inhaltsflächen: deckend, abgestimmte Rundungen */
.group, .stat, .health { border-radius: var(--r-lg); }
.group { background: var(--panel); }

/* Seitenwechsel & Rückmeldung (ruhig, kurz) */
.main.enter .page { animation: page-in .22s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
a.row, button.row, .tile { transition: background .12s var(--ease), transform .12s var(--ease), box-shadow .15s var(--ease); }
a.row:active, .tile:active { transform: scale(.992); }
.flash { animation: flash .6s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 var(--coral-soft); } 40% { box-shadow: 0 0 0 6px var(--coral-soft); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------------------------------------------------------------- Kopfbereich mit kompaktem Status */
.headbar { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.headbar h1 { font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.headbar .sub { color: var(--text-2); margin-top: 4px; }
.sys { position: relative; }
.sys > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--s2); height: 34px; padding: 0 var(--s3) 0 var(--s3);
  border-radius: 999px; font-size: var(--fs-small); font-weight: 500; }
.sys > summary::-webkit-details-marker { display: none; }
.sys > summary .dotx { width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.sys.ok > summary .dotx { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.sys.warn > summary .dotx { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.sys.err > summary .dotx { background: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }
.sys .menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(360px, calc(100vw - 32px)); border-radius: var(--r-lg); padding: var(--s2); }
.sys .menu .row { min-height: 40px; }
.sys .menu .menu-foot { padding: var(--s2) var(--s4) var(--s1); font-size: var(--fs-tiny); color: var(--text-3); }

/* ---------------------------------------------------------------- Die Mitte (Arbeitsstand) */
.hero { position: relative; overflow: hidden; border-radius: var(--r-xl); border: 1px solid var(--line); box-shadow: var(--shadow), 0 20px 50px rgba(60, 40, 30, .08);
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); display: grid; grid-template-columns: 1fr auto; gap: var(--s5); padding: var(--s5); align-items: center; min-height: 168px; }
.hero::after { content: ""; position: absolute; inset: auto -10% -60% 40%; height: 120%; background: radial-gradient(closest-side, var(--atmo-1), transparent); pointer-events: none; }
.hero > * { position: relative; z-index: 1; min-width: 0; }
.hero .eyebrow { font-size: var(--fs-tiny); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--nav-sel-text); }
.hero h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; overflow-wrap: anywhere; }
.hero .meta { color: var(--text-2); margin-top: 4px; }
.hero .actions { margin-top: var(--s4); }
.hero .cover { width: 132px; aspect-ratio: 4 / 5; border-radius: var(--r-lg); background: var(--surface-2) center/cover; box-shadow: 0 12px 30px rgba(0,0,0,.18); position: relative; }
.hero .cover .play { position: absolute; inset: auto 10px 10px auto; }
.hero.err { background: linear-gradient(135deg, var(--err-soft), var(--panel)); }
.hero.err .eyebrow { color: var(--err); }
.hero.compact { min-height: 0; grid-template-columns: 1fr; padding: var(--s4) var(--s5); }
.play { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(20, 16, 14, .55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.35); }
.play svg { width: 18px; height: 18px; margin-left: 2px; }

/* Live-Ablauf aus den echten Arbeitsschritten */
.flow { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 6px; margin-top: var(--s4); }
.flow a { display: grid; gap: 6px; text-decoration: none; color: var(--text-2); font-size: var(--fs-tiny); font-weight: 600; min-width: 0; }
.flow .seg-bar { height: 6px; border-radius: 3px; background: var(--idle-soft); position: relative; overflow: hidden; }
.flow .done .seg-bar { background: var(--ok); }
.flow .now .seg-bar { background: var(--coral-soft); }
.flow .now .seg-bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--coral); border-radius: 3px; animation: indet 1.6s ease-in-out infinite; }
.flow .fail .seg-bar { background: var(--err); }
.flow .now { color: var(--nav-sel-text); }
.flow .fail { color: var(--err); }
.flow .lbl { display: flex; gap: 4px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow .lbl svg { width: 13px; height: 13px; flex: none; }

/* Schnellzugriffe */
.quick { display: flex; gap: var(--s2); flex-wrap: wrap; }
.quick .btn { min-height: 34px; border-radius: 999px; }
.quick .btn svg { color: var(--text-2); }

/* Ruhige Leerzeile statt großer Leer-Box */
.quiet { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); color: var(--text-2); font-size: var(--fs-small); }
.quiet svg { width: 16px; height: 16px; color: var(--ok); flex: none; }
.quiet.idle svg { color: var(--text-3); }
.section.prominent .group { border-color: rgba(194, 54, 43, .35); box-shadow: 0 0 0 3px var(--err-soft); }
.tag { display: inline-flex; align-items: center; padding: 0 7px; border-radius: 6px; font-size: var(--fs-tiny); font-weight: 600; line-height: 18px; background: var(--idle-soft); color: var(--text-2); }
.tag.req { background: var(--warn-soft); color: var(--warn); }
.tag.opt { background: var(--idle-soft); color: var(--text-2); }

/* ---------------------------------------------------------------- Medienbibliothek (Cover-Raster) */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: var(--s4); }
.tile { position: relative; display: block; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 5; box-shadow: var(--shadow); isolation: isolate; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(40, 28, 20, .18); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 44px; font-weight: 700; color: var(--text-3);
  background: radial-gradient(circle at 30% 20%, var(--atmo-1), transparent 60%), var(--surface-2); }
.tile .shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(12, 10, 9, .78)); }
.tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s3); color: #fff; display: grid; gap: 4px; }
.tile .cap strong { font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.tile .cap span { font-size: var(--fs-tiny); color: rgba(255,255,255,.82); }
.tile .badge-top { position: absolute; top: var(--s2); left: var(--s2); }
.tile .play { position: absolute; top: var(--s2); right: var(--s2); width: 34px; height: 34px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: var(--fs-tiny); font-weight: 600;
  background: rgba(20, 16, 14, .6); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ccc; }
.chip.ok::before { background: #5BC98A; } .chip.work::before { background: #F27C76; } .chip.err::before { background: #FF7B6E; } .chip.warn::before { background: #EBA845; }

/* Projektdetail: Vorschau zuerst */
.p-hero { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: var(--s5); align-items: start; }
.p-hero .stage { border-radius: var(--r-xl); overflow: hidden; background: var(--media-bg); box-shadow: 0 18px 44px rgba(0,0,0,.22); position: relative; aspect-ratio: 9 / 16; }
.p-hero .stage video, .p-hero .stage img { width: 100%; height: 100%; object-fit: contain; display: block; }
.p-hero .stage .poster-btn { position: absolute; inset: 0; border: 0; background: center/cover no-repeat; cursor: pointer; display: grid; place-items: center; }
.p-hero .stage .poster-btn .play { width: 64px; height: 64px; }
.p-hero .stage .poster-btn .play svg { width: 26px; height: 26px; }
.p-hero .info { display: grid; gap: var(--s4); align-content: start; }

/* ---------------------------------------------------------------- Schnellsuche (⌘K) */
.palette { position: fixed; inset: 0; z-index: 60; display: grid; place-items: start center; padding: 12vh var(--s4) var(--s4); background: var(--backdrop); }
.palette .box { width: min(620px, 100%); border-radius: var(--r-xl); overflow: hidden; animation: pop .16s var(--ease); background: var(--glass-solid); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .palette .box { background: var(--glass); } }
@keyframes pop { from { opacity: 0; transform: scale(.98) translateY(-4px); } }
.palette input { width: 100%; height: 54px; border: 0; outline: none; background: transparent; padding: 0 var(--s5) 0 48px; font-size: 17px; color: var(--text); }
.palette .in { position: relative; border-bottom: 1px solid var(--line); }
.palette .in svg { position: absolute; left: 18px; top: 17px; width: 20px; height: 20px; color: var(--text-3); }
.palette .res { max-height: min(56vh, 460px); overflow: auto; padding: var(--s2); }
.palette .res .grp { padding: var(--s2) var(--s3) 4px; font-size: var(--fs-tiny); font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.palette .res a { border-radius: var(--r); }
.palette .res a[aria-selected="true"] { background: var(--nav-sel); }
.palette .hint { padding: var(--s2) var(--s4); font-size: var(--fs-tiny); color: var(--text-3); border-top: 1px solid var(--line); display: flex; gap: var(--s4); }

/* ---------------------------------------------------------------- Mobile: schwebende Glas-Tableiste */
@media (max-width: 760px) {
  .app { display: block; }
  .tabbar { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); border-radius: 26px; padding: 4px 6px; grid-template-columns: repeat(4, 1fr);
    background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow); }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .tabbar { background: var(--glass-solid); } }
  .tabbar a, .tabbar button { min-height: 52px; border-radius: 20px; }
  .tabbar [aria-current="page"] { background: var(--nav-sel); color: var(--nav-sel-text); }
  .mobile-bar { background: var(--bar-bg); border-bottom-color: transparent; grid-template-columns: 44px 1fr 44px; }
  .scrolled .mobile-bar { border-bottom-color: var(--line); }
  .mobile-bar .m-search { grid-column: 3; justify-self: center; }
  .main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .headbar h1 { font-size: 28px; }
  .hero { grid-template-columns: 1fr; padding: var(--s4); gap: var(--s3); min-height: 0; }
  .hero .cover { width: 100%; aspect-ratio: auto; height: 132px; order: -1; }
  .hero h2 { font-size: 20px; }
  .flow { grid-template-columns: 1fr; gap: 2px; }
  .flow a { grid-template-columns: 6px 1fr; gap: var(--s3); align-items: center; min-height: 34px; }
  .flow .seg-bar { height: 22px; width: 6px; }
  .lib { grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
  .p-hero { grid-template-columns: 1fr; }
  .p-hero .stage { max-height: 70vh; aspect-ratio: 9 / 16; width: min(100%, 360px); justify-self: center; }
  .palette { padding-top: calc(env(safe-area-inset-top) + 12px); }
  .sys .menu { position: fixed; left: 16px; right: 16px; top: auto; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .page, .palette .box { animation: none; } .tile:hover { transform: none; } }

.sidebar #live { display: none; }
.login-top .seg.appear { background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-radius: 10px; }
.login-card { background: var(--panel); }

/* iPhone: Reihenfolge Aufmerksamkeit → aktive Arbeit → Ergebnisse; kompakter Ablauf und Schnellzugriffe */
@media (max-width: 760px) {
  .sys-extra { display: none; }
  .sys > summary { height: 32px; }
  .quick { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--s4)); padding: 2px var(--s4); scrollbar-width: none; }
  .quick::-webkit-scrollbar { display: none; }
  .quick .btn { flex: none; }
  .flow { grid-template-columns: repeat(var(--n, 4), 1fr); gap: 4px; }
  .flow a { grid-template-columns: 1fr; gap: 6px; min-height: 0; }
  .flow .seg-bar { height: 6px; width: auto; }
  .flow a .lbl { display: none; }
  .flow a.now .lbl, .flow a.fail .lbl { display: flex; position: absolute; left: 0; right: 0; bottom: 0; }
  .flow { position: relative; padding-bottom: 22px; }
  .hero h2 { font-size: 19px; }
}

/* Kachel: Cover oben, Titel darunter – unabhängig vom Motiv lesbar */
.tile { aspect-ratio: auto; background: none; box-shadow: none; overflow: visible; border-radius: 0; display: grid; gap: var(--s2); }
.tile:hover { transform: none; box-shadow: none; }
.tile .art { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.tile:hover .art { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(40, 28, 20, .2); }
.tile:focus-visible { box-shadow: none; } .tile:focus-visible .art { box-shadow: var(--focus); }
.tile .cap { position: static; padding: 0 2px; color: var(--text); }
.tile .cap strong { text-shadow: none; font-size: 14px; }
.tile .cap span { color: var(--text-2); }
@media (max-width: 760px) { .hero.run .cover { display: none; } }
/* Kontrast (WCAG 2.2, 1.4.3/1.4.11): Text auf Koralle und Statustexte ≥ 4,5:1 */
:root { --btn-coral: #CC433E; --btn-coral-hover: #B53A35; --ok: #237A47; --warn: #9A5B08; }
:root[data-theme="dark"] { --btn-coral: #CC433E; --btn-coral-hover: #D9504A; --ok: #5BC98A; --warn: #EBA845; }
.btn.primary { background: var(--btn-coral); border-color: var(--btn-coral); }
.btn.primary:hover { background: var(--btn-coral-hover); border-color: var(--btn-coral-hover); }

/* ---------- Zwei-Faktor (Anmeldung & Sicherheit) ---------- */
.l2fa-qr { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 12px; border-radius: 12px; background: var(--surface-2); margin: 8px 0 12px; }
.l2fa-qr img { background: #fff; border-radius: 8px; padding: 6px; }
.l2fa-qr .mono { word-break: break-all; letter-spacing: .04em; }
.l2fa-links { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.l2fa-codes { columns: 2; gap: 24px; padding-left: 1.4em; margin: 8px 0 12px; font-size: .95rem; line-height: 1.8; }
.l2fa-check { display: flex; gap: 8px; align-items: center; margin: 12px 0; font-size: .9rem; }
.l2fa-check input { accent-color: var(--coral); width: 18px; height: 18px; }
.s2fa-codes { box-shadow: none; padding: 0; max-width: none; }
.s2fa-schritte { margin: 0 0 4px; padding-left: 1.2em; }
#login-2fa .lfield[hidden] { display: none; }

/* ---------------------------------------------------------------- iPhone (auch vom Home-Bildschirm): Menü, Dialoge, Scrollen */
html.scroll-sperre, html.scroll-sperre body { overflow: hidden; }
.sheet { overscroll-behavior: contain; }
.sheet-backdrop { touch-action: none; }
.sheet-panel { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden;
  max-height: calc(var(--vvh, 100dvh) - env(safe-area-inset-top) - 12px); }
.sheet-head { flex: none; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: var(--s2) var(--s2) var(--s2);
  border-bottom: 1px solid var(--line); }
.sheet-head .sheet-grip { grid-column: 1 / -1; margin-bottom: 4px; }
.sheet-head h2 { grid-column: 2; text-align: center; font-size: var(--fs-h2); font-weight: 600; margin: 0; }
.sheet-close { grid-column: 3; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--hover, rgba(127,127,127,.12)); color: var(--text);
  font-size: 16px; cursor: pointer; justify-self: center; }
#sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: grid; grid-auto-rows: max-content; gap: var(--s4); align-content: start; padding: var(--s3) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); }
#sheet-body > * { min-height: max-content; }
/* Dialoge passen in die sichtbare Höhe – auch bei offener Tastatur */
dialog.confirm { max-height: calc(var(--vvh, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px); overflow: auto; overscroll-behavior: contain; }
html .pmodal-body { max-height: calc(var(--vvh, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 96px); overscroll-behavior: contain; }
@media (max-width: 760px) {
  dialog.confirm.pmodal { margin: calc(var(--vvt, 0px) + env(safe-area-inset-top) + 8px) auto auto; }
  html .sprache { top: calc(64px + env(safe-area-inset-top)); max-height: calc(var(--vvh, 100dvh) - 80px - env(safe-area-inset-top)); }
  html .akt-panel { max-height: calc(var(--vvh, 100dvh) - 200px - env(safe-area-inset-top)); }
  .sys .menu { max-height: calc(var(--vvh, 100dvh) - 220px); overflow-y: auto; }
}

/* Tagesumsatz */
.ut-balken { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: var(--s4, 16px) var(--s3, 12px) var(--s3, 12px); margin-top: var(--s3, 12px); }
.ut-tag { display: grid; grid-template-rows: auto 120px auto; justify-items: center; gap: 6px; min-width: 0; }
.ut-wert { font-size: var(--fs-tiny, .78em); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ut-spur { width: 100%; max-width: 44px; height: 120px; display: flex; align-items: flex-end; }
.ut-fill { width: 100%; border-radius: 4px 4px 0 0; background: var(--line, rgba(127, 127, 127, .25)); }
.ut-tag.heute .ut-fill { background: var(--coral, #e8604c); }
.ut-tag.heute .ut-wert, .ut-tag.heute .ut-tagname { color: var(--text-1, inherit); font-weight: 700; }
.ut-tagname { font-size: var(--fs-tiny, .78em); color: var(--text-3); }
@media (max-width: 420px) { .ut-wert { font-size: 10px; } .ut-balken { gap: 3px; } }

/* Auslastung */
.ausl-balken { grid-template-columns: repeat(14, 1fr); gap: 4px; }
.ausl-balken .ut-tag.zukunft .ut-fill { background: transparent; border: 2px dashed var(--line, rgba(127, 127, 127, .35)); border-bottom: 0; }
.ausl-balken .ut-tag.zukunft .ut-tagname, .ausl-balken .ut-tag.zukunft .ut-wert { opacity: .7; }
.ausl-heute { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 12px var(--s4, 16px); margin-top: var(--s3, 12px); font-size: var(--fs-small, .9em); color: var(--text-2); }
.ausl-heute b { color: var(--text-1, inherit); font-size: 1.15em; }
@media (max-width: 520px) { .ausl-balken .ut-wert { font-size: 9px; } .ausl-balken { gap: 2px; padding-left: 6px; padding-right: 6px; } }

/* Aufklapp-Menü (statt langer Reiterleisten) */
.tmenu-zeile { margin: 0 0 var(--s4, 16px); }
details.tmenu { position: relative; display: inline-block; max-width: 100%; }
.tmenu-knopf { list-style: none; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px 0 16px; border-radius: 14px; cursor: pointer;
  background: var(--feld, var(--surface)); border: 1px solid var(--knopf-kante, var(--line)); color: var(--text); font-size: var(--fs-body, 15px); user-select: none; max-width: 100%; }
.tmenu-knopf::-webkit-details-marker { display: none; }
.tmenu-knopf:focus-visible { outline: none; box-shadow: var(--focus); }
.tmenu-titel { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3, #888); }
.tmenu-knopf b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmenu-knopf svg { flex: none; color: var(--text-2); transition: transform .15s ease; }
details.tmenu[open] .tmenu-knopf svg { transform: rotate(180deg); }
.tmenu-liste { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 260px; max-width: calc(100vw - 32px); padding: 8px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0, 0, 0, .16); display: grid; gap: 4px 8px; }
details.tmenu:not([open]) .tmenu-liste { display: none; }  /* zugeklappt nichts auslegen – sonst wird die Seite am Handy breiter */
.tmenu-liste.spalten { grid-template-columns: repeat(2, minmax(200px, 1fr)); }
.tmenu-gruppe { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tmenu-kopf { padding: 6px 12px 4px; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3, #888); }
.tmenu-liste button { all: unset; box-sizing: border-box; display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px; cursor: pointer;
  font-size: var(--fs-body, 15px); color: var(--text); white-space: nowrap; }
.tmenu-liste button:hover { background: var(--idle-soft); }
.tmenu-liste button:focus-visible { box-shadow: var(--focus); }
.tmenu-liste button[aria-pressed="true"] { background: var(--haupt, var(--text)); color: var(--haupt-text, var(--surface)); font-weight: 650; }
@media (max-width: 560px) {
  details.tmenu, .tmenu-knopf { display: flex; width: 100%; }
  .tmenu-knopf b { flex: 1; }
  .tmenu-liste { right: 0; min-width: 0; }
  .tmenu-liste.spalten { grid-template-columns: 1fr; }
  .tmenu-liste button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .tmenu-knopf svg { transition: none; } }

/* Handy „Mehr“: Gruppenüberschriften wie im Desktop-Menü */
.sheet-gruppe { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3, var(--text-2)); margin: var(--s4) var(--s2) var(--s2); }
.sheet-unterkopf { font-size: 12px; color: var(--text-2); padding: 8px var(--s4) 2px; }

/* Übersicht „Anreisen heute“: auf dem Handy darf der PIN-Status umbrechen, damit Zimmer und Gast lesbar bleiben */
@media (max-width: 560px) {
  .anr-row .row-end { flex: 0 1 40%; justify-content: flex-end; }
  .anr-row .row-end .pill { white-space: normal; text-align: right; line-height: 16px; padding: 3px 8px; border-radius: 10px; }
  .anr-row .row-title span, .anr-row .row-sub { white-space: normal; overflow: visible; text-overflow: clip; }
}
/* Rückrufliste */
.ar-karte .ar-erledigt .row-title span:first-child { color: var(--text-2); }
.ar-karte .ar-text { font-style: italic; }
/* Agenten */
.ag-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s3); margin: var(--s4) 0; }
.ag-karte { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 14px; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); cursor: pointer; min-width: 0; }
.ag-karte.ag-laeuft { border-color: var(--ok, #2e7d4f); box-shadow: 0 0 0 1px var(--ok, #2e7d4f) inset; }
.ag-karte.ag-fehler { border-color: var(--err, #c0392b); }
.ag-karte.ag-ueberfaellig { border-color: var(--warn, #c98a12); }
.ag-kopf { display: flex; align-items: center; gap: var(--s3); }
.ag-symbol { font-size: 26px; line-height: 1; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--fill, rgba(0,0,0,.04)); flex: none; }
.ag-titel { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); min-width: 0; }
.ag-titel strong { font-family: "Playfair Display", Georgia, serif; font-size: 1.05rem; }
.ag-aufgabe { margin: 0; color: var(--text-2); font-size: .88rem; line-height: 1.4; }
.ag-was { font-size: .9rem; overflow-wrap: anywhere; }
.ag-fuss { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; font-size: .8rem; color: var(--text-3); margin-top: auto; }
.ag-spur { display: flex; gap: 3px; }
.ag-spur i { flex: 1; height: 6px; border-radius: 3px; background: var(--ok, #2e7d4f); opacity: .7; max-width: 22px; }
.ag-spur i.err { background: var(--err, #c0392b); opacity: 1; }
.ag-verlauf { border-top: 1px solid var(--line); padding-top: var(--s2); display: grid; gap: 4px; font-size: .8rem; }
.ag-verlauf div { display: grid; grid-template-columns: 92px 1fr auto; gap: var(--s2); }
.ag-verlauf div span:nth-child(2) { overflow-wrap: anywhere; }
.ag-puls { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: middle; animation: ag-puls 1.4s ease-in-out infinite; }
@keyframes ag-puls { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .ag-puls { animation: none; } }
.ag-mini { display: block; text-decoration: none; color: inherit; }
.ag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.ag-chip { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--fill, rgba(0,0,0,.04)); font-size: 16px; border: 2px solid transparent; }
.ag-chip.ag-laeuft { border-color: var(--ok, #2e7d4f); }
.ag-chip.ag-fehler { border-color: var(--err, #c0392b); }
.ag-chip.ag-ueberfaellig { border-color: var(--warn, #c98a12); }
.ag-chip.ag-wartet { opacity: .5; }
@media (max-width: 480px) { .ag-raster { grid-template-columns: 1fr; } .ag-verlauf div { grid-template-columns: 78px 1fr; } .ag-verlauf div span:nth-child(3) { display: none; } }

/* ---------------------------------------------------------------- Agenten-Zentrale in 3D (immer dunkel, unabhängig vom Farbschema) */
#ag3d-slot:empty { display: none; }
.ag3d { display: grid; grid-template-columns: minmax(0, 1fr) 310px; margin: var(--s4) 0; border-radius: 18px; overflow: hidden; border: 1px solid rgba(255,255,255,.09);
  background: radial-gradient(90% 80% at 38% 48%, #121c2e 0%, #080b12 55%, #05070b 100%); color: #eef2f8; color-scheme: dark;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; }
.ag3d.ohne3d { grid-template-columns: 1fr; } .ag3d.ohne3d .ag3d-raum { display: none; }
.ag3d-raum { position: relative; aspect-ratio: 16 / 10; max-height: 74vh; min-height: 360px; overflow: hidden; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.ag3d-raum:active { cursor: grabbing; }
.ag3d-raum canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .8s ease; }
.ag3d.bereit canvas { opacity: 1; }
.ag3d-marken { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .8s ease; }
.ag3d.bereit .ag3d-marken { opacity: 1; }
.ag3d-marke { position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; pointer-events: auto; will-change: transform; }
.ag3d-ring { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(var(--f) var(--p, 0%), rgba(255,255,255,.14) 0); box-shadow: 0 0 18px -4px var(--f); }
.ag3d-ring > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #0b0f17; font-size: 17px; line-height: 1; }
.ag3d-marke[data-zustand="laeuft"] .ag3d-ring { box-shadow: 0 0 26px 0 var(--f); animation: ag3d-dreh 1.6s linear infinite; background: conic-gradient(var(--f), rgba(53,208,127,.15) 70%, var(--f)); }
.ag3d-marke[data-zustand="laeuft"] .ag3d-ring > span { animation: ag3d-dreh 1.6s linear infinite reverse; }
.ag3d-marke[data-zustand="wartet"] .ag3d-ring > span { opacity: .55; }
@keyframes ag3d-dreh { to { transform: rotate(360deg); } }
.ag3d-text { position: absolute; left: calc(100% + 9px); top: 50%; transform: translateY(-50%); display: grid; text-align: left; white-space: nowrap; text-shadow: 0 1px 8px #05070b, 0 0 2px #05070b; }
.ag3d-text { transition: opacity .25s ease; } .ag3d-marke.eng .ag3d-text { opacity: 0; pointer-events: none; }
.ag3d-marke.links .ag3d-text { left: auto; right: calc(100% + 9px); text-align: right; }
.ag3d-text b { font-size: 13px; font-weight: 650; letter-spacing: -.01em; }
.ag3d-text i { font-style: normal; font-size: 11.5px; color: var(--f); filter: brightness(1.15); }
.ag3d-marke[data-zustand="ok"] .ag3d-text i, .ag3d-marke[data-zustand="wartet"] .ag3d-text i { color: #9aa6b8; filter: none; }
.ag3d-marke:focus-visible { outline: none; } .ag3d-marke:focus-visible .ag3d-ring, .ag3d-marke.gewaehlt .ag3d-ring { outline: 2px solid #fff; outline-offset: 3px; }
.ag3d-kopf { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px; pointer-events: none; background: linear-gradient(#05070bcc, transparent); }
.ag3d-kopf > div { display: grid; gap: 3px; min-width: 0; }
.ag3d-kopf strong { font-size: 12px; font-weight: 600; color: #f0625f; }
.ag3d-kopf [data-z="stand"] { font-size: clamp(18px, 2.2vw, 26px); font-weight: 750; letter-spacing: -.025em; line-height: 1.15; text-wrap: balance; }
.ag3d-kopf [data-z="stand"].an { color: #35d07f; }
.ag3d-kopf [data-z="dran"] { font-size: 13px; color: #9aa6b8; } .ag3d-kopf em { font-style: normal; color: #ffb020; }
.ag3d-knopf { pointer-events: auto; flex: none; font: inherit; font-size: 13px; font-weight: 600; color: #eef2f8; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 8px 14px; min-height: 36px; cursor: pointer; }
.ag3d-knopf:hover { background: rgba(255,255,255,.16); } .ag3d-knopf:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ag3d-knopf.klein { padding: 0; width: 32px; min-height: 32px; margin-left: auto; }
.ag3d-legende { position: absolute; left: 20px; right: 20px; bottom: 12px; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 11.5px; color: #7f8a9c; pointer-events: none; }
.ag3d-seite { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.025); }
.ag3d-ticker { padding: 18px; min-height: 0; overflow: auto; flex: 1; }
.ag3d-ticker h3 { margin: 0 0 12px; font: inherit; font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.ag3d-live { width: 8px; height: 8px; border-radius: 50%; background: #35d07f; box-shadow: 0 0 10px #35d07f; animation: ag-puls 1.6s ease-in-out infinite; }
.ag3d-ticker ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ag3d-ticker li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 8px; border-radius: 10px; cursor: pointer; font-size: 13px; }
.ag3d-ticker li:hover { background: rgba(255,255,255,.06); } .ag3d-ticker li.leer { display: block; color: #9aa6b8; cursor: default; }
.ag3d-ticker time { color: #7f8a9c; font-size: 12px; padding-top: 1px; }
.ag3d-ticker li div { display: grid; gap: 1px; min-width: 0; } .ag3d-ticker li b { font-weight: 600; }
.ag3d-ticker li div span { color: #9aa6b8; overflow-wrap: anywhere; line-height: 1.35; }
.ag3d-ticker li.an div span { color: #35d07f; } .ag3d-ticker li.err div span { color: #ff8080; }
.ag3d-detail { padding: 18px; border-bottom: 1px solid rgba(255,255,255,.08); background: linear-gradient(color-mix(in srgb, var(--f) 12%, transparent), transparent); font-size: 13px; }
.ag3d-dkopf { display: flex; align-items: center; gap: 12px; }
.ag3d-dsym { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #0b0f17; border: 1px solid var(--f); font-size: 21px; flex: none; }
.ag3d-dkopf strong { display: block; font-size: 17px; font-weight: 700; letter-spacing: -.02em; } .ag3d-dzu { color: var(--f); font-size: 12.5px; }
.ag3d-detail p { margin: 12px 0; color: #b6c0cf; line-height: 1.45; }
.ag3d-detail dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; } .ag3d-detail dt { color: #7f8a9c; } .ag3d-detail dd { margin: 0; overflow-wrap: anywhere; } .ag3d-detail dd.err { color: #ff8080; }
.ag3d-spur { display: flex; gap: 3px; margin-top: 12px; } .ag3d-spur i { flex: 1; max-width: 16px; height: 5px; border-radius: 3px; background: #35d07f; opacity: .8; } .ag3d-spur i.err { background: #ff4d4d; opacity: 1; }
.ag3d.voll { position: fixed; inset: 0; z-index: 9999; margin: 0; border: 0; border-radius: 0; height: 100dvh; grid-template-columns: minmax(0, 1fr) 340px; }
.ag3d.voll .ag3d-raum { aspect-ratio: auto; max-height: none; height: 100%; }
html.ag3d-offen { overflow: hidden; }
@media (max-width: 860px) {
  .ag3d { grid-template-columns: 1fr; } .ag3d-raum { aspect-ratio: 1 / 1.32; min-height: 0; max-height: none; }
  .ag3d-seite { border-left: 0; border-top: 1px solid rgba(255,255,255,.08); } .ag3d-ticker { max-height: 300px; }
  .ag3d-ring { width: 32px; height: 32px; } .ag3d-ring > span { width: 27px; height: 27px; font-size: 14px; }
  .ag3d-text b { font-size: 12px; } .ag3d-text i { font-size: 11px; } .ag3d-detail { scroll-margin-bottom: 96px; }
  .ag3d-text { display: none; } .ag3d-marke[data-zustand="laeuft"] .ag3d-text, .ag3d-marke[data-zustand="fehler"] .ag3d-text, .ag3d-marke.gewaehlt .ag3d-text { display: grid; background: #05070bd9; padding: 3px 7px; border-radius: 7px; }
  .ag3d-kopf { padding: 14px; } .ag3d-legende { left: 14px; right: 14px; font-size: 11px; gap: 2px 12px; }
  .ag3d.voll { grid-template-columns: 1fr; grid-template-rows: minmax(56dvh, 1fr) auto; } .ag3d.voll .ag3d-raum { aspect-ratio: auto; } .ag3d.voll .ag3d-seite { max-height: 44dvh; overflow: auto; } .ag3d.voll .ag3d-ticker { max-height: none; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { .ag3d-marke[data-zustand="laeuft"] .ag3d-ring, .ag3d-marke[data-zustand="laeuft"] .ag3d-ring > span, .ag3d-live { animation: none; } .ag3d-raum canvas, .ag3d-marken { transition: none; } }

/* Reservierung aus Screenshot (Reservierungen, Chef-Ansicht) */
.rb-bild { display: grid; grid-template-columns: 1fr minmax(180px, 260px) auto; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4);
  margin-bottom: var(--s4); border: 1px dashed var(--line-strong); border-radius: var(--r-md, 12px); background: var(--surface-2); }
.rb-bild-text { display: grid; gap: 2px; min-width: 0; }
.rb-bild-text span { color: var(--text-2); font-size: 13px; }
.rb-wahl { cursor: pointer; white-space: nowrap; }
.rb-wahl.is-busy { opacity: .7; pointer-events: none; }
.rb-wahl:focus-within { outline: 2px solid var(--coral); outline-offset: 2px; }
.rb-ergebnis { grid-column: 1 / -1; font-size: 14px; }
.rb-ergebnis:empty { display: none; }
.rb-ok { color: #2E7D4F; font-weight: 700; }
.rb-fehler { color: var(--coral-strong, #B3261E); }
@media (max-width: 860px) { .rb-bild { grid-template-columns: 1fr; } .rb-wahl { justify-self: start; } }
/* Bäcker-Bestellung (Reservierungsseite und Startseite) */
.rb-baecker { display: grid; gap: 12px; padding: 16px 18px; margin: 0 0 var(--s4); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.rbb-kopf { display: grid; gap: 2px; }
.rbb-kopf strong { font-size: 17px; }
.rbb-sub, .rbb-fuer { color: var(--text-2); font-size: 13px; margin: 0; }
.rbb-fuer { font-weight: 600; color: var(--text); font-size: 14px; }
.rbb-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.rbb-tab { flex: none; border: 1px solid var(--line-strong); background: transparent; color: var(--text); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.rbb-tab span { font-weight: 400; color: var(--text-2); margin-left: 4px; }
.rbb-tab.an { background: var(--coral, #E8554F); border-color: transparent; color: #fff; }
.rbb-tab.an span { color: rgba(255, 255, 255, .85); }
.rbb-liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.rbb-liste li { display: grid; grid-template-columns: 3.2ch 1fr; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(127, 127, 127, .10); min-width: 0; }
.rbb-liste b { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; text-align: right; }
.rbb-liste span { font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.rbb-liste li.rbb-brot { background: rgba(232, 85, 79, .14); }
.rbb-leer { margin: 0; color: var(--text-2); }
.rbb-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
.rbb-edit { display: grid; gap: 8px; max-width: 520px; }
.rbb-zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.rbb-zwei label { display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
.rbb-h { margin: 6px 0 0; font-size: 13px; font-weight: 600; }
.rbb-zeile { display: grid; grid-template-columns: 1fr 110px; gap: 8px; align-items: center; }
@media (max-width: 640px) { .rbb-liste { grid-template-columns: 1fr; } .rbb-liste li { padding: 10px 14px; } .rbb-zwei { grid-template-columns: 1fr; } }
.rb-datei { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.rb-wahl { position: relative; }

/* Personalsuche */
.ps-karte .ga-rechts { gap: 12px; }
.ps-felder { display: grid; gap: 8px; }
.ps-notiz { height: auto; padding: 8px 12px; resize: vertical; line-height: 1.45; }
.ps-text { min-height: 0; height: auto; font-size: 14px; }
.ps-antwort { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.ps-mail summary, .ps-neu > summary, .ps-stelle > summary { cursor: pointer; }
.ps-mail .ga-frage { margin-top: 6px; }
.ps-loeschen { margin-left: auto; color: var(--coral-strong, #B3261E); }
.ps-stelle { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: var(--s4, 16px); }
.ps-stelle > summary { padding: var(--s3, 12px) var(--s4, 16px); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ps-stelle-titel { font-weight: 700; }
.ps-stelle-inhalt { padding: 0 var(--s4, 16px) var(--s4, 16px); display: grid; gap: 14px; }
.ps-textblock { display: grid; gap: 4px; margin-bottom: 10px; }
.ps-neu { margin: var(--s4, 16px) 0; padding: var(--s3, 12px) var(--s4, 16px); border: 1px dashed var(--line-strong, var(--line)); border-radius: var(--r); background: var(--surface-2); }
.ps-neu > summary { font-weight: 600; }
.ps-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.ps-breit { grid-column: 1 / -1; }
.ps-status { grid-template-columns: 64px minmax(160px, 220px); }
@media (max-width: 600px) { .ps-form { grid-template-columns: minmax(0, 1fr); } .ps-loeschen { margin-left: 0; } }

/* Darstellung mit vier Einträgen (Glas · Hell · Dunkel · System): auf schmalen Handys nur Symbole, Text bleibt für Screenreader */
@media (max-width: 480px) {
  .seg.appear button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .seg.appear button { padding-inline: 12px; }
}

/* Startseite auf dem Handy: lange Beträge dürfen die Kachel-Spalte nicht sprengen */
.stats > .stat { min-width: 0; }
@media (max-width: 640px) {
  .stats > .stat .value { font-size: clamp(20px, 6.2vw, 28px); overflow-wrap: anywhere; }
  .stats > .stat .label, .stats > .stat .tertiary { overflow-wrap: anywhere; }
}
