/* Public Power – Control Center · design tokens follow public-power.de:
   near-black with a green→teal brand gradient. Status colours are reserved for state. */

@font-face { font-family: "Inter"; src: url("../fonts/inter-latin.woff2") format("woff2-variations"), url("../fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-ext.woff2") format("woff2-variations"), url("../fonts/inter-latin-ext.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: dark;
  --bg: #0f1312; --bg-2: #121716; --panel: #161b1a; --panel-2: #1c2221; --panel-3: #232a28;
  --line: #252d2b; --line-2: #313b38;
  --tx: #eef2f0; --tx-2: #a8b2af; --tx-3: #85908c;
  --brand-a: #8cc63f; --brand-b: #1fa2b4; --brand: linear-gradient(110deg, var(--brand-a), var(--brand-b));
  --volt: #2fb8a2; --volt-2: #5fd3bf; --volt-ink: #06110f; --volt-bg: rgba(47, 184, 162, .13); --volt-line: rgba(47, 184, 162, .45);
  --ok: #4fd17e; --warn: #f3b443; --crit: #ff5c5c; --info: #6fb4dc; --stale: #6f7b78;
  --ok-bg: rgba(79, 209, 126, .12); --warn-bg: rgba(243, 180, 67, .13); --crit-bg: rgba(255, 92, 92, .13); --info-bg: rgba(111, 180, 220, .12); --stale-bg: rgba(111, 123, 120, .16);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px rgba(0,0,0,.25);
  --shadow-pop: 0 22px 60px rgba(0,0,0,.55);
  --blur: none;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #9085e9;
  --seq-0: #1a2120; --seq-1: #15302d; --seq-2: #1a4a44; --seq-3: #1f645b; --seq-4: #257f72; --seq-5: #2e9a89; --seq-6: #5bbfa9; --seq-7: #a9e3d3;
  --hatch: repeating-linear-gradient(135deg, rgba(111,123,120,.22) 0 7px, transparent 7px 15px);
  --f: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-body: 17px; --fs-ui: 16px; --fs-sm: 15px; --fs-min: 14px; --fs-h1: 30px; --fs-h2: 20px; --fs-h3: 18px;
  --fs-kpi: clamp(38px, 3.1vw, 60px); --fs-kpi-sm: clamp(26px, 1.9vw, 34px);
  --r-panel: 20px; --r-ctl: 12px; --r-chip: 999px;
  --nav-w: 236px; --puls-h: 72px; --gap: 18px; --pad: 28px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f1; --bg-2: #e6ecea; --panel: rgba(255,255,255,.82); --panel-2: rgba(246,249,248,.95); --panel-3: #eef3f2;
  --line: #d6dfdc; --line-2: #c3cfcb;
  --tx: #0f1a18; --tx-2: #3f4d4a; --tx-3: #596965;
  --volt: #138f80; --volt-2: #0e776a; --volt-ink: #ffffff; --volt-bg: rgba(19,143,128,.10); --volt-line: rgba(19,143,128,.40);
  --ok: #138a4c; --warn: #a96a05; --crit: #cf3434; --info: #2e6b9a; --stale: #7d8a87;
  --ok-bg: rgba(19,138,76,.10); --warn-bg: rgba(169,106,5,.11); --crit-bg: rgba(207,52,52,.09); --info-bg: rgba(46,107,154,.10); --stale-bg: rgba(125,138,135,.14);
  --shadow: 0 1px 2px rgba(16,24,22,.06), 0 10px 28px rgba(20,48,42,.08);
  --shadow-pop: 0 24px 60px rgba(20,48,42,.22);
  --blur: blur(16px) saturate(1.2);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #6250d6;
  --seq-0: #eef3f2; --seq-1: #d7f0ea; --seq-2: #b4e2d7; --seq-3: #86cebf; --seq-4: #54b3a2; --seq-5: #2e9586; --seq-6: #1c766b; --seq-7: #10544c;
  --hatch: repeating-linear-gradient(135deg, rgba(125,138,135,.20) 0 7px, transparent 7px 15px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tx); font-family: var(--f); font-size: var(--fs-body); line-height: 1.5; font-stretch: 100%;
  font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased; min-height: 100vh; }
:root[data-theme="dark"] body, :root:not([data-theme]) body { background: radial-gradient(1100px 620px at 85% -10%, rgba(31,162,180,.10), transparent 60%), radial-gradient(900px 600px at -10% 110%, rgba(140,198,63,.06), transparent 60%), var(--bg); background-attachment: fixed; }
:root[data-theme="light"] body { background: radial-gradient(900px 500px at 0% 0%, #fafcfb, transparent 70%), radial-gradient(800px 600px at 100% 10%, #d9efe9, transparent 60%), var(--bg); background-attachment: fixed; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--volt-bg); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--tx-2); }
.faint { color: var(--tx-3); }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: var(--fs-h1); letter-spacing: -.025em; font-weight: 750; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 .6em; }

/* ---------- boot / gate ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; gap: 22px; justify-items: center; }
.boot-bar { width: 220px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; position: relative; }
.boot-bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--volt); animation: boot 1.1s ease-in-out infinite; }
@keyframes boot { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.gate { display: grid; place-items: center; padding: 32px 16px; }
.gate-card { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); backdrop-filter: var(--blur); }
.gate-wide { width: min(760px, 100%); }
.gate-brand { display: flex; gap: 14px; align-items: center; color: var(--tx); margin-bottom: 24px; }
.gate-name { font-size: 24px; font-weight: 750; letter-spacing: -.02em; background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate-sub { color: var(--tx-2); font-size: var(--fs-sm); }
.gate h1 { margin-bottom: 8px; }
.gate-lead { color: var(--tx-2); }
.gate-form { display: grid; gap: 16px; margin-top: 8px; }
.gate-form fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 18px; display: grid; gap: 14px; margin: 0; }
.gate-form legend { padding: 0 8px; font-weight: 650; }
.gate-form label { display: grid; gap: 6px; font-size: var(--fs-ui); color: var(--tx-2); }
.gate-form input:not([type=checkbox]):not([type=radio]) { width: 100%; }
.gate-inline { display: flex !important; align-items: center; gap: 10px; }
.gate-radio { display: grid; gap: 8px; }
.gate-radio label { display: flex; gap: 10px; align-items: center; color: var(--tx); }
.gate-err { background: var(--crit-bg); border: 1px solid var(--crit); color: var(--tx); padding: 12px 14px; border-radius: 12px; margin: 12px 0; }
.gate-demo { background: var(--warn-bg); border: 1px solid var(--warn); padding: 8px 12px; border-radius: 10px; margin-bottom: 12px; font-weight: 600; }
.gate-hint { color: var(--tx-3); font-size: var(--fs-sm); margin: 4px 0 0; }
.gate-check ul { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.gate-check li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 12px; border-radius: 10px; background: var(--panel-2); font-size: var(--fs-ui); }
.gate-check li b { font-weight: 500; color: var(--tx-2); text-align: right; word-break: break-all; }
.gate-check li.ok span::before { content: "✓ "; color: var(--ok); }
.gate-check li.bad span::before { content: "! "; color: var(--warn); font-weight: 800; }

/* ---------- controls ---------- */
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-ctl); padding: 10px 12px; font-size: var(--fs-ui); min-height: 44px; }
input:focus, select:focus, textarea:focus { border-color: var(--volt); outline: none; box-shadow: 0 0 0 3px var(--volt-bg); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--volt); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: var(--r-ctl);
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--tx); font-size: var(--fs-ui); font-weight: 560; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--volt-line); background: var(--panel-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: transparent; color: #08110f; font-weight: 650; }
.btn-primary:hover { filter: brightness(1.08); background: var(--brand); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--tx-2); }
.btn-ghost:hover { background: var(--panel-2); color: var(--tx); }
.btn-lg { min-height: 50px; font-size: 17px; padding: 10px 20px; }
.btn-sm { min-height: 34px; padding: 4px 10px; font-size: var(--fs-sm); }
.btn-danger { border-color: var(--crit); color: var(--crit); }
.icon { width: 20px; height: 20px; flex: none; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: var(--fs-ui); color: var(--tx-2); cursor: pointer; min-height: 36px; font-weight: 540; }
.seg button[aria-pressed="true"] { background: var(--panel-3); color: var(--tx); box-shadow: 0 0 0 1px var(--line-2) inset; }
:root[data-theme="light"] .seg button[aria-pressed="true"] { background: #fff; }
.seg button:hover { color: var(--tx); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-chip); border: 1px solid var(--line-2); font-size: var(--fs-min); background: var(--panel-2); white-space: nowrap; }
.chip button { border: 0; background: none; padding: 0 0 0 2px; cursor: pointer; color: var(--tx-2); font-size: 16px; line-height: 1; }
.kbd { display: inline-block; min-width: 24px; text-align: center; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; font-size: var(--fs-min); color: var(--tx-2); background: var(--panel-2); }

/* truth / status badges */
.truth { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-min); font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 6px; border: 1px solid currentColor; line-height: 1.4; white-space: nowrap; }
.truth.live { color: var(--ok); }
.truth.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2s ease-out infinite; }
.truth.last, .truth.hist { color: var(--stale); }
.truth.calc { color: var(--info); }
.truth.est { color: var(--volt); border-style: dashed; }
.truth.unv { color: var(--warn); }
.truth.demo { color: var(--warn); border-style: dashed; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 7px transparent; } }
.sev { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: var(--fs-min); padding: 3px 9px; border-radius: 7px; white-space: nowrap; }
.sev.crit { color: var(--crit); background: var(--crit-bg); }
.sev.warn { color: var(--warn); background: var(--warn-bg); }
.sev.info { color: var(--info); background: var(--info-bg); }
.sev.ok { color: var(--ok); background: var(--ok-bg); }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: var(--r-chip); font-weight: 650; font-size: var(--fs-sm); white-space: nowrap; }
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pill.on { color: var(--ok); background: var(--ok-bg); }
.pill.on .dot { animation: pulse 2.2s ease-out infinite; }
.pill.off { color: var(--crit); background: var(--crit-bg); }
.pill.unk { color: var(--stale); background: var(--stale-bg); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
.nav { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; border-right: 1px solid var(--line); background: var(--bg-2); overflow-y: auto; }
:root[data-theme="light"] .nav { background: rgba(255,255,255,.55); backdrop-filter: var(--blur); }
.nav-brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 18px; text-decoration: none; }
.nav-brand b { display: block; font-size: 19px; font-weight: 750; letter-spacing: -.02em; background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-brand small { display: block; color: var(--tx-3); font-size: var(--fs-min); line-height: 1.2; }
.nav a.item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--tx-2); text-decoration: none; font-size: var(--fs-ui); font-weight: 540; position: relative; }
.nav a.item:hover { background: var(--panel); color: var(--tx); }
.nav a.item[aria-current="page"] { background: var(--panel-2); color: var(--tx); box-shadow: 0 0 0 1px var(--line) inset; }
.nav a.item[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav a.item .badge { margin-left: auto; min-width: 24px; padding: 0 7px; border-radius: 999px; font-size: var(--fs-min); font-weight: 700; text-align: center; }
.nav a.item .badge.crit { background: var(--crit); color: #fff; }
.nav a.item .badge.warn { background: var(--warn-bg); color: var(--warn); }
.nav a.item .badge.info { background: var(--info-bg); color: var(--tx-2); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.nav-foot { margin-top: auto; display: grid; gap: 6px; padding-top: 12px; }
.nav-foot .btn { justify-content: flex-start; }
.nav-k { display: flex; justify-content: space-between; align-items: center; color: var(--tx-3); font-size: var(--fs-min); padding: 8px 12px; border-radius: 10px; border: 1px dashed var(--line-2); cursor: pointer; background: none; width: 100%; }
.main { min-width: 0; display: flex; flex-direction: column; }
.page { padding: 24px var(--pad) 80px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--tx-2); margin-top: 4px; }
.demo-band { background: repeating-linear-gradient(135deg, var(--warn-bg) 0 14px, transparent 14px 28px); border-bottom: 1px solid var(--warn); color: var(--warn); font-weight: 650; font-size: var(--fs-sm); padding: 6px var(--pad); }

/* puls bar */
.puls { position: sticky; top: 0; z-index: 30; display: flex; align-items: stretch; gap: 0; min-height: var(--puls-h); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.2); overflow-x: auto; scrollbar-width: none; }
.puls::-webkit-scrollbar { display: none; }
.puls.warn { box-shadow: inset 0 -3px 0 var(--warn); }
.puls.stale { box-shadow: inset 0 -3px 0 var(--crit); }
.pi { display: grid; align-content: center; gap: 1px; padding: 8px 18px; border: 0; border-right: 1px solid var(--line); background: none; text-align: left; cursor: pointer; min-width: max-content; color: var(--tx); }
.pi:hover { background: var(--panel); }
.pi b { font-size: 23px; font-weight: 720; letter-spacing: -.02em; line-height: 1.15; display: flex; align-items: baseline; gap: 4px; }
.pi b small { font-size: 16px; color: var(--tx-3); font-weight: 560; font-stretch: 100%; }
.pi span { font-size: var(--fs-min); color: var(--tx-2); }
.pi.crit b { color: var(--crit); }
.pi.warn b { color: var(--warn); }
.pi .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 2px; align-self: center; }
.pulse-sync { margin-left: auto; display: flex; align-items: center; gap: 12px; padding: 8px 18px; min-width: max-content; border-left: 1px solid var(--line); }
.pulse-sync .msg { display: grid; line-height: 1.25; }
.pulse-sync .msg b { font-size: var(--fs-ui); font-weight: 650; }
.pulse-sync .msg span { font-size: var(--fs-min); color: var(--tx-2); }
.pulse-sync.warn .msg b { color: var(--warn); }
.pulse-sync.stale .msg b { color: var(--crit); }
.ring { width: 30px; height: 30px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .bg { stroke: var(--line-2); }
.ring .fg { stroke: var(--volt); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* focus bar */
.focusbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--volt-line); background: var(--volt-bg); margin-bottom: 16px; }
.focusbar .lbl { font-weight: 700; color: var(--volt); letter-spacing: .03em; font-size: var(--fs-sm); }

/* ---------- panels & grid ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.c12 { grid-column: span 12; } .c9 { grid-column: span 9; } .c8 { grid-column: span 8; } .c7 { grid-column: span 7; } .c6 { grid-column: span 6; }
.c5 { grid-column: span 5; } .c4 { grid-column: span 4; } .c3 { grid-column: span 3; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow); backdrop-filter: var(--blur); min-width: 0; position: relative; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; flex-wrap: wrap; }
.panel-h h2, .panel-h h3 { display: flex; align-items: center; gap: 10px; }
.panel-h .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-b { padding: 14px 20px 20px; }
.panel-note { color: var(--tx-3); font-size: var(--fs-sm); padding: 0 20px 16px; }
.empty-state { padding: 26px 20px; color: var(--tx-2); text-align: center; }
.empty-state b { display: block; color: var(--tx); font-size: var(--fs-h3); margin-bottom: 4px; }
.lowdata { display: inline-flex; gap: 6px; align-items: center; color: var(--warn); font-size: var(--fs-min); }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-panel); overflow: hidden; border: 1px solid var(--line); }
.kpi { background: var(--panel); padding: 16px 18px 14px; display: grid; gap: 4px; align-content: start; border: 0; text-align: left; cursor: pointer; color: var(--tx); position: relative; backdrop-filter: var(--blur); }
.kpi:hover { background: var(--panel-2); }
.kpi .lbl { color: var(--tx-2); font-size: var(--fs-sm); display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.kpi .val { font-size: clamp(25px, 1.8vw, 34px); font-weight: 720; line-height: 1.08; letter-spacing: -.03em; white-space: nowrap; }
.kpi .val small { font-size: .5em; color: var(--tx-2); font-weight: 560; margin-left: 4px; font-stretch: 100%; }
.kpi .delta { font-size: var(--fs-sm); color: var(--tx-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta .up { color: var(--ok); font-weight: 650; }
.delta .down { color: var(--crit); font-weight: 650; }
.kpi .spark { height: 30px; margin-top: 2px; }
.bigkpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 20px; }
.bigkpi { display: grid; gap: 0; border: 0; background: none; text-align: left; color: var(--tx); cursor: pointer; padding: 4px 0; border-radius: 10px; }
.bigkpi .val { font-size: var(--fs-kpi); font-weight: 760; line-height: 1.02; letter-spacing: -.035em; }
.bigkpi .val small { font-size: .42em; font-weight: 560; color: var(--tx-2); margin-left: 4px; font-stretch: 100%; letter-spacing: 0; }
.bigkpi .lbl { color: var(--tx-2); font-size: var(--fs-ui); }
.bigkpi:hover .val { color: var(--volt-2); }
:root[data-theme="light"] .bigkpi:hover .val { color: var(--volt); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 24px; }
.fact { display: grid; gap: 2px; }
.fact .k { color: var(--tx-2); font-size: var(--fs-sm); display: flex; gap: 8px; align-items: center; }
.fact .v { font-size: 20px; font-weight: 620; font-stretch: 106%; }
.fact .v a, .linkish { text-decoration: none; border-bottom: 1px dotted var(--tx-3); cursor: pointer; }
.fact .v a:hover, .linkish:hover { border-bottom-color: var(--volt); color: var(--volt-2); }
:root[data-theme="light"] .linkish:hover { color: var(--volt); }

/* ---------- Lage (attention queue) ---------- */
.lage-head { font-size: 26px; font-weight: 680; font-stretch: 110%; letter-spacing: -.01em; }
.lage-head.calm { color: var(--ok); }
.lage { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lage li { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: start; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--stale); }
.lage li.crit { border-left-color: var(--crit); }
.lage li.warn { border-left-color: var(--warn); }
.lage li.info { border-left-color: var(--info); }
.lage li.dim { opacity: .62; }
.lage .t { font-weight: 640; font-size: var(--fs-body); cursor: pointer; }
.lage .t:hover { color: var(--volt-2); }
:root[data-theme="light"] .lage .t:hover { color: var(--volt); }
.lage .r { color: var(--tx-2); font-size: var(--fs-sm); grid-column: 2 / 4; }
.lage .timer { font-size: 20px; font-weight: 650; font-stretch: 110%; text-align: right; white-space: nowrap; }
.lage .acts { grid-column: 2 / 4; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.menu { position: relative; display: inline-block; }
.menu-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 180px; background: var(--panel-3); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; box-shadow: var(--shadow-pop); display: grid; }
:root[data-theme="light"] .menu-pop { background: #fff; }
.menu-pop button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: var(--fs-ui); }
.menu-pop button:hover { background: var(--panel-2); }

/* ---------- Rack (compact) ---------- */
.racks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: var(--gap); }
.rack { padding: 16px 18px 18px; display: grid; gap: 12px; align-content: start; }
.rack.offline { border-color: color-mix(in srgb, var(--crit) 45%, var(--line)); }
.rack-h { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; }
.rack > * { min-width: 0; }
.rack-name { font-size: 20px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; text-decoration: none; cursor: pointer; overflow-wrap: break-word; }
.rack-name:hover { color: var(--volt-2); }
:root[data-theme="light"] .rack-name:hover { color: var(--volt); }
.rack-id { color: var(--tx-3); font-size: var(--fs-min); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rack-tools { display: flex; gap: 6px; align-items: center; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--tx-2); cursor: pointer; }
.icon-btn:hover { color: var(--tx); border-color: var(--volt-line); }
.rack-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rm { display: grid; gap: 0; min-width: 0; }
.rm .k { color: var(--tx-3); font-size: var(--fs-min); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm .v { font-size: 16px; font-weight: 640; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm .v.crit { color: var(--crit); }
.rm .v.warn { color: var(--warn); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; position: relative; }
.slot { position: relative; height: 88px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); overflow: hidden; padding: 7px 8px;
  display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; text-align: left; color: var(--tx); font-size: var(--fs-min); font-family: inherit; }
.slot:hover { border-color: var(--volt-line); }
.slot .no { font-size: 13px; color: var(--tx-3); font-weight: 650; position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; line-height: 1; }
.slot .fill { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--lvl, 0) * 1%);
  background: linear-gradient(to top, color-mix(in srgb, var(--fc) 46%, transparent), color-mix(in srgb, var(--fc) 16%, transparent)); border-top: 2px solid var(--fc); transition: height .8s ease, background .8s ease; }
:root[data-theme="light"] .slot .fill { background: linear-gradient(to top, color-mix(in srgb, var(--fc) 36%, transparent), color-mix(in srgb, var(--fc) 12%, transparent)); }
.hchip { cursor: pointer; font-family: inherit; }
.hchip:hover { filter: brightness(1.15); }
.modal { position: fixed; z-index: 96; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(900px, calc(100vw - 32px)); max-height: 86vh; overflow: auto; background: var(--panel-3);
  border: 1px solid var(--line-2); border-radius: 20px; padding: 20px 22px 22px; box-shadow: var(--shadow-pop); animation: fade .15s ease; }
:root[data-theme="light"] .modal { background: #fff; }
.modal-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.modal-h h2 { font-size: 22px; margin: 0; }
.hints { margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--info-bg); border: 1px solid color-mix(in srgb, var(--info) 40%, transparent); display: grid; gap: 6px; }
@media (max-width: 860px) { .modal { inset: 0; left: 0; top: 0; transform: none; width: 100vw; max-height: none; height: 100%; border-radius: 0; padding: calc(14px + var(--safe-t)) 14px calc(24px + var(--safe-b)); } }
.slot .bot { position: relative; z-index: 1; display: grid; gap: 3px; }
.slot .lvl { font-size: 23px; font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.slot .lvl small { font-size: 13px; color: var(--tx-2); font-weight: 600; letter-spacing: 0; margin-left: 1px; }
.tmp { display: inline-flex; align-items: center; gap: 3px; width: fit-content; font-size: 13px; font-weight: 650; color: var(--tx-2); background: color-mix(in srgb, var(--bg) 55%, transparent); padding: 1px 6px; border-radius: 6px; line-height: 1.4; }
.tmp.warm { color: #1a1204; background: var(--warn); }
.tmp.hot { color: #fff; background: var(--crit); animation: hot 1.6s ease-in-out infinite; }
@keyframes hot { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--crit) 30%, transparent); } }
.slot.empty { border: 1.5px dashed color-mix(in srgb, var(--crit) 65%, transparent); background: transparent; justify-content: flex-start; gap: 2px; }
.slot.empty.alarm { border-style: solid; border-color: var(--crit); background: var(--crit-bg); }
.slot.empty .x { position: relative; z-index: 1; display: flex; align-items: center; gap: 4px; }
.slot.empty .x svg { width: 18px; height: 18px; color: var(--crit); flex: none; }
.slot.empty.spare .x svg { opacity: .6; }
.slot.empty .lbl { font-weight: 800; color: var(--crit); letter-spacing: .05em; font-size: 13px; }
.slot.empty .since { font-size: 15px; font-weight: 700; white-space: nowrap; letter-spacing: -.02em; position: relative; z-index: 1; }
.slot.empty .why { color: var(--tx-2); font-size: 13px; line-height: 1.2; position: relative; z-index: 1; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.slot.empty.alarm .why { color: var(--crit); font-weight: 650; }
.slot.fault { border-color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
.slot .flt { position: relative; z-index: 1; font-size: 13px; font-weight: 750; color: var(--warn); }
.rack.stale .slots::after { content: ""; position: absolute; inset: -4px; border-radius: 14px; background: var(--hatch); pointer-events: none; }
.rack.stale .slot { filter: grayscale(1); opacity: .45; }
.stale-cover { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; text-align: center; gap: 4px; pointer-events: none; }
.stale-cover .q { font-size: 44px; font-weight: 800; line-height: 1; color: var(--tx); }
.stale-cover b { font-size: 17px; letter-spacing: .04em; }
.stale-cover span { color: var(--tx-2); font-size: var(--fs-sm); }
.stale-cover > * { text-shadow: 0 1px 10px var(--bg), 0 0 2px var(--bg); }
.racks.compact { grid-template-columns: 1fr; gap: 10px; }
.rack-row { display: grid; grid-template-columns: minmax(220px, 1.4fr) auto repeat(5, minmax(90px, .6fr)) minmax(200px, 2fr); gap: 14px; align-items: center; padding: 12px 18px; }
.mini-slots { display: flex; gap: 4px; flex-wrap: wrap; }
.mini-slots i { width: 14px; height: 26px; border-radius: 4px; background: var(--panel-3); border: 1px solid var(--line-2); position: relative; overflow: hidden; }
.mini-slots i::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--lvl, 0) * 1%); background: var(--fc, var(--brand-a)); opacity: .85; }
.mini-slots i.e { border: 1.5px solid var(--crit); background: var(--crit-bg); }
.mini-slots i.f { border-color: var(--warn); }
.mini-slots i.h { border-color: var(--crit); box-shadow: 0 0 0 1px var(--crit); }
.rebal { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; padding: 10px 14px; border-radius: 14px; border: 1px dashed var(--info); background: var(--info-bg); margin-bottom: 14px; }
.rebal b { color: var(--info); }
.rebal .it { display: inline-flex; align-items: center; gap: 6px; }
.rebal .it button { border: 0; background: none; color: var(--tx-3); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }

/* ---------- confirm dialog ---------- */
.dialog { position: fixed; z-index: 95; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)); background: var(--panel-3); border: 1px solid var(--line-2); border-radius: 20px; padding: 22px; box-shadow: var(--shadow-pop); display: grid; gap: 12px; animation: fade .15s ease; }
:root[data-theme="light"] .dialog { background: #fff; }
.dialog h2 { font-size: 21px; }
.dialog .row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- wallboard ---------- */
.wall-fit { transform-origin: top left; }
.wall-grid { display: grid; grid-template-columns: minmax(300px, 22%) 1fr; gap: 16px; align-items: start; }
.wall-side { display: grid; gap: 16px; }
.wall-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.wall-kpis .bigkpi .val { font-size: 40px; }

/* ---------- mobile sheet ---------- */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: var(--panel-3); border-top: 1px solid var(--line-2); border-radius: 22px 22px 0 0; padding: 10px 14px calc(18px + var(--safe-b)); box-shadow: var(--shadow-pop); animation: slideup .2s ease; display: grid; gap: 4px; }
:root[data-theme="light"] .sheet { background: #fff; }
.sheet .grab { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 2px auto 8px; }
.sheet-h { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; }
.sheet-h .grab { grid-column: 2; }
.sheet-h .icon-btn { grid-column: 3; }
.sheet a, .sheet button.it { display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: 12px; color: var(--tx); text-decoration: none; font-size: 17px; border: 0; background: none; width: 100%; text-align: left; font-family: inherit; }
.sheet a:active, .sheet button.it:active { background: var(--panel-2); }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
.mhead { display: none; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); }
.tbl th { text-align: left; font-weight: 600; color: var(--tx-2); font-size: var(--fs-sm); padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; position: sticky; top: 0; background: var(--panel); z-index: 1; }
:root[data-theme="light"] .tbl th { background: #f6f8fb; }
.tbl th button { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.tbl th button[aria-sort] { color: var(--tx); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--panel-2); }
.tbl td.r, .tbl th.r { text-align: right; white-space: nowrap; }
.tbl .sub { color: var(--tx-3); font-size: var(--fs-min); display: block; }
.tbl tr.flag td { color: var(--tx-3); }
.tbl-scroll { max-height: 520px; overflow: auto; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 0 0; flex-wrap: wrap; color: var(--tx-2); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .grow { flex: 1 1 220px; }
.sticky-tools { position: sticky; top: var(--puls-h); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); padding: 12px 0; margin: -12px 0 14px; border-bottom: 1px solid var(--line); }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5, 9, 14, .5); z-index: 50; animation: fade .2s ease; }
:root[data-theme="light"] .scrim { background: rgba(30, 45, 65, .25); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(860px, 100vw); z-index: 60; background: var(--bg); border-left: 1px solid var(--line-2); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; animation: slidein .2s cubic-bezier(.2,.8,.2,1); }
:root[data-theme="light"] .drawer { background: #f1f5f9; }
.drawer.under { transform: translateX(-28px) scale(.985); opacity: .5; pointer-events: none; }
.drawer-h { display: flex; gap: 12px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.drawer-h .crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--tx-3); font-size: var(--fs-sm); flex: 1; min-width: 0; }
.drawer-h .crumbs button { border: 0; background: none; color: var(--tx-2); cursor: pointer; padding: 2px 4px; font-size: var(--fs-sm); }
.drawer-h .crumbs b { color: var(--tx); font-weight: 600; }
.drawer-b { flex: 1; overflow-y: auto; padding: 20px 24px 60px; display: grid; gap: 18px; align-content: start; grid-auto-rows: max-content; }
.drawer-b:focus { outline: none; }
.drawer-b .panel { box-shadow: none; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.dossier-title { display: grid; gap: 6px; }
.dossier-title h1 { font-size: 28px; }
.kv { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 0; font-size: var(--fs-ui); }
.kv > div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv > div:nth-child(odd) { color: var(--tx-2); padding-right: 12px; }
.kv code, code.raw { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14.5px; color: var(--tx-2); word-break: break-all; }
details.raw { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
details.raw summary { cursor: pointer; color: var(--tx-2); }

/* ---------- palette ---------- */
.palette { position: fixed; z-index: 80; top: 12vh; left: 50%; transform: translateX(-50%); width: min(720px, calc(100vw - 32px)); background: var(--panel-3);
  border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-pop); overflow: hidden; animation: fade .15s ease; }
:root[data-theme="light"] .palette { background: #fff; }
.palette input { width: 100%; border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; background: transparent !important; font-size: 20px !important; padding: 18px 20px !important; box-shadow: none !important; }
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: 56vh; overflow-y: auto; }
.palette li.grp { padding: 10px 12px 4px; color: var(--tx-3); font-size: var(--fs-min); font-weight: 600; }
.palette li.it { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: var(--fs-ui); }
.palette li.it small { color: var(--tx-3); }
.palette li.it[aria-selected="true"] { background: var(--volt-bg); box-shadow: 0 0 0 1px var(--volt-line) inset; }
.palette .hint { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--tx-3); font-size: var(--fs-min); }

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 90; display: grid; gap: 8px; }
.toast { background: var(--panel-3); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow-pop); max-width: 420px; animation: fade .2s ease; }
.toast.err { border-color: var(--crit); }
.toast.ok { border-color: var(--ok); }

/* ---------- charts ---------- */
.chart { width: 100%; min-height: 120px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--tx-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.band { background: var(--volt-bg); border: 1px solid var(--volt-line); }
.legend i.line { height: 3px; border-radius: 2px; background: var(--volt); vertical-align: 3px; }
.legend i.dash { height: 0; border-top: 2px dashed var(--tx-3); background: none; vertical-align: 4px; border-radius: 0; }
.year { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px 22px; }
.month h4 { margin: 0 0 6px; font-size: var(--fs-ui); font-weight: 650; display: flex; justify-content: space-between; }
.month h4 small { color: var(--tx-3); font-weight: 500; }
.month .dow, .month .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.month .dow span { font-size: var(--fs-min); color: var(--tx-3); text-align: center; }
.month .days button { aspect-ratio: 1; border: 0; border-radius: 6px; font-size: var(--fs-min); color: var(--tx-2); background: var(--seq-0); cursor: pointer; padding: 0; font-variant-numeric: tabular-nums; }
.month .days button.z { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.month .days button.fut { opacity: .35; cursor: default; }
.month .days button:hover { outline: 2px solid var(--volt); }
.month .days button.sel { outline: 2px solid var(--tx); }
.month .days button.today { box-shadow: inset 0 0 0 2px var(--tx); }
.scale { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--tx-2); }
.scale .bar { display: flex; gap: 2px; }
.scale .bar i { width: 26px; height: 12px; border-radius: 3px; }
.anom { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.anom li { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); display: grid; gap: 2px; cursor: pointer; }
.anom li:hover { border-color: var(--volt-line); }
.anom li b { font-weight: 640; }
.anom li span { color: var(--tx-2); font-size: var(--fs-sm); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--tx-2); font-weight: 560; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: var(--fs-ui); }
.tabs a[aria-current="page"] { color: var(--tx); border-bottom-color: var(--volt); }
.tabs a:hover { color: var(--tx); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 70px 16px 1fr; gap: 10px; padding: 8px 0; align-items: start; }
.timeline .tm { color: var(--tx-2); font-size: var(--fs-sm); text-align: right; padding-top: 1px; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; background: var(--stale); }
.timeline .dot.crit { background: var(--crit); } .timeline .dot.warn { background: var(--warn); } .timeline .dot.ok { background: var(--ok); } .timeline .dot.info { background: var(--info); } .timeline .dot.note { background: var(--volt); }
.timeline .tx { font-size: var(--fs-ui); }
.timeline .tx small { display: block; color: var(--tx-3); font-size: var(--fs-min); }
.daysep { font-weight: 650; padding: 14px 0 4px; color: var(--tx-2); border-bottom: 1px solid var(--line); }
.runlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.runlist li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); cursor: pointer; }
.runlist li:hover { box-shadow: 0 0 0 1px var(--volt-line) inset; }
.runlist .tm { font-size: 20px; font-weight: 650; font-stretch: 110%; text-align: right; grid-row: span 2; align-self: center; }
.runlist .tm.long { color: var(--warn); }
.runlist small { color: var(--tx-3); font-size: var(--fs-min); }
.check-list { display: grid; gap: 12px; }
.check { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--panel); }
.check h3 { display: flex; gap: 10px; align-items: center; font-size: var(--fs-h3); }
.check .res { color: var(--tx-2); margin: 6px 0 8px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 18px; }
.formgrid label, .field { display: grid; gap: 6px; font-size: var(--fs-ui); color: var(--tx-2); align-content: start; }
.savebar { position: sticky; bottom: 0; z-index: 25; display: flex; gap: 10px; padding: 14px 0; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.formgrid label small, .field small { color: var(--tx-3); font-size: var(--fs-min); }
.qr { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; }
.qr img, .qr svg { display: block; width: 200px; height: 200px; }
.wall .nav { display: none; }
.wall .shell { grid-template-columns: 1fr; }
.wall .page { padding: 20px 26px; }

/* ---------- responsive ---------- */
@media (max-width: 1500px) { .c7.r-wide, .c5.r-wide { grid-column: span 12; } }
@media (max-width: 1280px) {
  :root { --nav-w: 76px; --pad: 22px; }
  .nav a.item span.l, .nav-brand div, .nav-k span, .nav-foot .btn span.l { display: none; }
  .nav a.item { justify-content: center; }
  .nav a.item .badge { position: absolute; top: 2px; right: 2px; min-width: 20px; padding: 0 5px; }
  .c4, .c3 { grid-column: span 6; } .c8, .c9, .c7, .c5 { grid-column: span 12; }
  .bigkpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.m-only { display: none !important; }
@media (max-width: 860px) {
  :root { --pad: 14px; --gap: 12px; --fs-h1: 25px; --fs-body: 16px; --r-panel: 18px; }
  .m-only { display: revert !important; }
  input, select, textarea { font-size: 16px !important; }
  body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--safe-t); background: var(--bg); z-index: 46; pointer-events: none; }
  html, body { overscroll-behavior-y: none; }
  .m-hide { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around; gap: 0; padding: 6px 4px calc(6px + var(--safe-b)); z-index: 45;
    border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(18px) saturate(1.3); overflow: visible; }
  .nav-brand, .nav-sep, .nav-foot, .nav-k { display: none; }
  .nav a.item, .nav button.item { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 14px; letter-spacing: -.01em; justify-content: center; align-items: center; border-radius: 12px; border: 0; background: none; color: var(--tx-2); font-family: inherit; }
  .nav a.item span.l, .nav button.item span.l { display: block !important; white-space: nowrap; }
  .nav a.item[aria-current="page"] { background: none; box-shadow: none; color: var(--tx); }
  .nav a.item[aria-current="page"] .icon { color: var(--volt-2); }
  .nav a.item[aria-current="page"]::before { display: none; }
  .nav a.item .badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 20px; padding: 0 5px; margin: 0; font-size: 13px; }
  .puls { padding-top: var(--safe-t); min-height: calc(62px + var(--safe-t)); background: var(--bg-2); }
  .pi { padding: 6px 12px; }
  .pi b { font-size: 20px; }
  .pulse-sync { padding: 6px 12px; }
  .pulse-sync .msg span { display: none; }
  .demo-band { padding-top: calc(6px + var(--safe-t)); }
  .page { padding: 16px var(--pad) calc(96px + var(--safe-b)); }
  .page-head { margin-bottom: 12px; }
  .c6, .c4, .c3 { grid-column: span 12; }
  .rack-row { grid-template-columns: 1fr 1fr; }
  .rack { padding: 14px; gap: 10px; }
  .rack-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bigkpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
  .bigkpi .val { font-size: 34px; }
  .kv { grid-template-columns: 1fr; }
  .kv > div:nth-child(odd) { padding-bottom: 0; border-bottom: 0; }
  .drawer { width: 100vw; border-left: 0; }
  .drawer-h { padding: calc(10px + var(--safe-t)) 14px 10px; }
  .drawer-b { padding: 14px 14px calc(40px + var(--safe-b)); }
  .slots { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 7px; }
  .lage li { grid-template-columns: 1fr auto; padding: 10px 12px; }
  .lage li > .sev { grid-column: 1 / 3; justify-self: start; }
  .lage .r, .lage .acts { grid-column: 1 / 3; }
  .lage-head { font-size: 22px; }
  .lage .timer { font-size: 17px; }
  .facts { grid-template-columns: 1fr 1fr; gap: 10px 16px; }
  .fact .v { font-size: 17px; }
  .toolbar { gap: 8px; }
  .seg button { padding: 6px 10px; }
  .toasts { left: 12px; right: 12px; bottom: calc(84px + var(--safe-b)); }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .sticky-tools { top: calc(62px + var(--safe-t)); }
  .wall-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media (forced-colors: active) { .slot.empty { border: 2px solid CanvasText; } }
/* ---------------- Wartung ---------------- */
.mchip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-chip); font-size: var(--fs-min); font-weight: 600;
  background: var(--warn-bg); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); text-decoration: none; white-space: nowrap; }
.mchip:hover { filter: brightness(1.12); }
.lchip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--r-chip); font-size: var(--fs-min); font-weight: 600; white-space: nowrap;
  border: 1px solid var(--line-2); color: var(--tx-2); }
.lchip.hot { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.mstat { display: inline-block; padding: 2px 9px; border-radius: var(--r-chip); font-size: var(--fs-min); font-weight: 600; border: 1px solid var(--line-2); color: var(--tx-2); }
.mstat.open { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.mstat.wip { background: var(--volt-bg); color: var(--volt); border-color: color-mix(in srgb, var(--volt) 35%, transparent); }
.mstat.done { color: var(--tx-2); }
.mstat.void { color: var(--tx-3); text-decoration: line-through; }
.tbl tr.mrow-open td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.mbanner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: var(--gap); border-left: 4px solid var(--warn); color: var(--tx); }
.mbanner b { display: block; }
.mbanner .muted { font-size: var(--fs-ui); }
.mprot { display: block; margin-top: 4px; white-space: pre-wrap; color: var(--tx-2); }

@media print { .nav, .puls, .toolbar, .btn { display: none !important; } .shell { display: block; } .panel { break-inside: avoid; box-shadow: none; } }

.tiles-dim { filter: brightness(.62) invert(1) contrast(.9) hue-rotate(180deg) saturate(.4) brightness(.9); }
.hchip { font-size: var(--fs-min); font-weight: 650; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--warn); color: var(--warn); background: var(--warn-bg, transparent); }
.hchip.crit { border-color: var(--crit); color: var(--crit); background: var(--crit-bg); }
.revpick { display: grid; gap: 8px; margin-bottom: 14px; }
.revopt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; background: var(--panel-2); }
.revopt.on { border-color: var(--volt-line); box-shadow: inset 0 0 0 1px var(--volt-line); }
.revopt small { display: block; color: var(--tx-3); font-size: var(--fs-min); font-weight: 400; }
.revopt .num { text-align: right; font-weight: 650; }
details.adv { border-top: 1px solid var(--line); padding-top: 12px; }
details.adv summary { cursor: pointer; color: var(--tx-2); font-size: var(--fs-ui); }
.tbl tr.dim td { opacity: .5; }
.slot.empty.rented { border: 1.5px dashed var(--info); background: color-mix(in srgb, var(--info) 8%, transparent); }
.slot.empty.rented .lbl { color: var(--info); }
.slot.empty.rented .why { color: var(--tx-2); }
.slot.empty.rented.paid { border: 1.5px solid var(--ok); background: var(--ok-bg); }
.slot.empty.rented.paid .lbl, .slot.empty.rented.paid .since { color: var(--ok); }
.runlist .tm.gratis { color: var(--info); }
.runlist .tm.paid { color: var(--ok); }
.runlist .tm small { font-size: 12px; font-weight: 600; margin-right: 2px; }
.slot.empty.rented .x { flex-wrap: nowrap; white-space: nowrap; min-width: 0; }
.slot.empty.rented .lbl { font-size: 12px; letter-spacing: .02em; white-space: nowrap; }
.slot.empty.rented .since { font-size: 15px; letter-spacing: -.03em; }
.slot.empty.rented.gratis .since { font-size: 19px; }
.slot.empty.rented .why { white-space: nowrap; text-overflow: ellipsis; display: block; }
/* rented slot: gentle breathing glow so rentals stand out */
.slot.empty.rented { animation: rentglow 2.6s ease-in-out infinite; --gc: var(--info); }
.slot.empty.rented.paid { --gc: var(--ok); }
@keyframes rentglow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gc) 0%, transparent), inset 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 14px 2px color-mix(in srgb, var(--gc) 45%, transparent), inset 0 0 18px color-mix(in srgb, var(--gc) 22%, transparent); } }
.slot.empty.rented::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gc) 26%, transparent), transparent 70%); opacity: .55; animation: rentfade 2.6s ease-in-out infinite; }
@keyframes rentfade { 0%, 100% { opacity: .25; } 50% { opacity: .75; } }
/* wallboard: popup for a new rental */
.rentpop { position: fixed; z-index: 97; left: 50%; top: 18%; transform: translateX(-50%); width: min(720px, calc(100vw - 40px)); padding: 28px 32px 22px; border-radius: 26px;
  background: var(--panel-3); border: 2px solid var(--ok); box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 18%, transparent), 0 30px 80px rgba(0,0,0,.55); animation: popin .35s cubic-bezier(.2,1.4,.4,1); overflow: hidden; }
@keyframes popin { from { transform: translateX(-50%) scale(.85); opacity: 0; } }
.rentpop .k { color: var(--ok); font-weight: 750; letter-spacing: .08em; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.rentpop h2 { font-size: 44px; line-height: 1.1; margin: 8px 0 6px; letter-spacing: -.02em; }
.rentpop .d { font-size: 24px; color: var(--tx-2); }
.rentpop .d b { color: var(--tx); }
.rentpop .bar { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--ok); animation: popbar linear forwards; }
@keyframes popbar { from { width: 100%; } to { width: 0; } }
.rentpop .close { position: absolute; top: 16px; right: 16px; }
.rentpop.ret { border-color: var(--volt); box-shadow: 0 0 0 6px color-mix(in srgb, var(--volt) 18%, transparent), 0 30px 80px rgba(0,0,0,.55); }
.rentpop.ret .k { color: var(--volt-2); }
.rentpop.ret .bar { background: var(--volt); }
.rentpop .retk { display: flex; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.rentpop .retk > div { flex: 1 1 200px; display: grid; gap: 2px; padding: 12px 16px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line-2); }
.rentpop .retk .v { font-size: 34px; font-weight: 750; letter-spacing: -.02em; }
.rentpop .retk .l { font-size: 15px; color: var(--tx-3); }
.rentpop .more { margin-top: 10px; font-size: 16px; color: var(--tx-3); }
/* ---------- Anpassen (arrange boxes) ---------- */
.arr-item { min-width: 0; display: grid; }
.arr-item > * { min-width: 0; }
.arr-barwrap { position: sticky; top: calc(var(--puls-h, 64px) + 6px); z-index: 28; margin: 0 0 16px; padding: 12px 16px; border-radius: 16px; border: 1.5px solid var(--volt-line); background: color-mix(in srgb, var(--panel-3) 94%, transparent); backdrop-filter: blur(10px); display: grid; gap: 10px; box-shadow: var(--shadow-pop); }
.arr-top { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; }
.arr-top b { display: inline-flex; gap: 8px; align-items: center; color: var(--volt-2); }
.arr-opts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.arr-zone { outline: 2px dashed var(--line-2); outline-offset: 6px; border-radius: 14px; min-height: 120px; position: relative; }
.arr-zl { grid-column: 1 / -1; font-size: var(--fs-min); color: var(--tx-3); letter-spacing: .06em; text-transform: uppercase; }
.arr-edit { position: relative; border-radius: 16px; outline: 1.5px solid var(--volt-line); outline-offset: 2px; cursor: grab; align-content: start; gap: 6px; }
.arr-edit:active { cursor: grabbing; }
.arr-edit .arr-body { pointer-events: none; opacity: .78; max-height: 300px; overflow: hidden; }
.arr-over { outline: 3px solid var(--volt); outline-offset: 3px; }
.arr-new { outline-color: var(--ok); }
.arr-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); flex-wrap: wrap; }
.arr-grip { display: inline-flex; gap: 8px; align-items: center; font-weight: 650; font-size: var(--fs-ui); }
.arr-tools { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.arr-tools .icon-btn { width: 30px; height: 30px; }
.arr-tools .btn-sm { padding: 3px 9px; }
.arr-tools .btn.on { border-color: var(--volt); color: var(--volt-2); }
.arr-newb { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: #08110f; background: var(--ok); border-radius: 6px; padding: 1px 6px; }
.wall-main { display: grid; gap: 16px; align-content: start; }
.wall-grid.side-right { grid-template-columns: 1fr minmax(300px, 22%); }
.wall-grid.side-right > .wall-side { order: 2; }
.arr-bar { cursor: grab; touch-action: none; user-select: none; }
.arr-edit { cursor: default; }
.arr-dragging { opacity: .45; }
.arr-empty { grid-column: 1 / -1; display: grid; place-items: center; min-height: 100px; color: var(--tx-3); border: 2px dashed var(--line-2); border-radius: 14px; }
