/* Verteilungen */

@font-face {
  font-family: "Urbanist";
  src: url("/static/fonts/urbanist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Urbanist";
  src: url("/static/fonts/urbanist-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  --red: #ec0048;
  --red-hover: #c9003d;
  --red-ink: #d10040;          /* red used as text on light grounds */
  --red-soft: rgba(236, 0, 72, .09);
  --petrol: #97d6df;
  --petrol-soft: #e3f3f5;
  --t-ms: #4f2f9e;             /* Mittelspannung */
  --t-tr: #7d55c7;             /* Transformator */
  --t-sh: #00509b;             /* Schalthaus */
  --t-hv: var(--ink);             /* Hauptverteilung */
  --t-uv: #0b8f8d;             /* Unterverteilung */
  --ok: #066b50;
  --warn: #965900;
  --err: #d10040;

  --bg: #f3f7f8;
  --surface: #ffffff;
  --surface-2: #eef4f5;
  --surface-3: #e3eced;
  --ink: #181919;
  --ink-2: #3c4040;
  --ink-3: #5e6363;
  --line: #d6e1e2;
  --line-soft: #e6eeef;
  --shadow-sm: 0 1px 2px rgba(24, 25, 25, .06), 0 1px 1px rgba(24, 25, 25, .04);
  --shadow-md: 0 6px 18px -6px rgba(24, 25, 25, .14), 0 2px 4px rgba(24, 25, 25, .05);
  --shadow-lg: 0 24px 60px -18px rgba(24, 25, 25, .32), 0 8px 18px -8px rgba(24, 25, 25, .12);
  --focus: 0 0 0 3px rgba(236, 0, 72, .28);

  --stage: #0d0e0e;            /* the dark stage, both themes */
  --stage-ink: #f4f8f8;
  --stage-ink-2: #aab4b6;
  --stage-line: rgba(151, 214, 223, .14);

  --r-sm: 6px; --r: 10px; --r-lg: 16px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --font: "Urbanist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --header-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --red-ink: #ff3d76;
  --red-soft: rgba(255, 61, 118, .12);
  --petrol-soft: rgba(151, 214, 223, .1);
  --t-ms: #b49cf3;
  --t-tr: #d2c2fb;
  --t-sh: #5aa9f0;
  --t-hv: var(--ink);
  --t-uv: #2fc6c2;
  --ok: #2fcf96;
  --warn: #ffbe5b;
  --err: #ff5c8a;

  --bg: #0f1111;
  --surface: #171919;
  --surface-2: #1e2121;
  --surface-3: #262a2a;
  --ink: #eef4f5;
  --ink-2: #c3cccd;
  --ink-3: #939c9d;
  --line: #2c3131;
  --line-soft: #232727;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 22px -8px rgba(0, 0, 0, .6), 0 2px 4px rgba(0, 0, 0, .3);
  --shadow-lg: 0 28px 70px -20px rgba(0, 0, 0, .8), 0 8px 18px -8px rgba(0, 0, 0, .5);
  --focus: 0 0 0 3px rgba(255, 61, 118, .35);
  color-scheme: dark;
}

/* ── Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 64px); }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.5; font-weight: 400;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; font-feature-settings: "ss01";
}
[x-cloak] { display: none !important; }
::selection { background: var(--red); color: #fff; }
input, textarea, select, button { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }

/* ── Controls ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  height: 38px; padding: 0 .95rem; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 500; font-size: .9rem; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .15s var(--ease-out), box-shadow .15s;
}
.btn:hover { border-color: var(--ink-3); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: var(--err); background: var(--red-soft); }
.btn.sm { height: 32px; padding: 0 .7rem; font-size: .84rem; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn.block { width: 100%; }

.field { display: grid; gap: .35rem; }
.field > span { font-size: .8rem; font-weight: 500; color: var(--ink-2); }
.input, .field input, .field select, .field textarea, .cell-input {
  width: 100%; height: 40px; padding: 0 .8rem; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: .95rem; transition: border-color .15s, box-shadow .15s; outline: none;
}
.field textarea { height: auto; padding: .6rem .8rem; resize: vertical; min-height: 72px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .cell-input:focus { border-color: var(--red); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235e6363' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.2rem !important; }
input[type="checkbox"] { accent-color: var(--red); width: 16px; height: 16px; }
input[type="file"] { font-size: .85rem; color: var(--ink-2); }
input[type="file"]::file-selector-button { font: inherit; font-weight: 500; height: 32px; padding: 0 .8rem; margin-right: .7rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check input { margin-top: .15rem; flex-shrink: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.muted { color: var(--ink-3); }
.small { font-size: .84rem; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }

.type { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.type::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--ink-3)); }
.type[data-t="Mittelspannung"] { --c: var(--t-ms); }
.type[data-t="Transformator"] { --c: var(--t-tr); }
.type[data-t="Schalthaus"] { --c: var(--t-sh); }
.type[data-t="Hauptverteilung"] { --c: var(--t-hv); }
.type[data-t="Unterverteilung"] { --c: var(--t-uv); }

.note { padding: .7rem .9rem; border-radius: var(--r); font-size: .88rem; background: var(--surface-2); color: var(--ink-2); }
.note.error { background: var(--red-soft); color: var(--err); }
.note.success { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.note.warning { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.note.info { background: var(--petrol-soft); color: var(--ink-2); }

/* ── Loading bar + toast ────────────────────────────────────────────── */
.loadbar { position: fixed; inset: 0 auto auto 0; height: 2px; z-index: 100; background: var(--red); transition: width .35s var(--ease-out), opacity .3s; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translateX(-50%);
  display: flex; align-items: center; gap: .6rem; max-width: min(560px, calc(100vw - 32px));
  padding: .75rem 1rem .75rem .85rem; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-lg);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.toast.error::before { background: var(--red); }
.toast.warning::before { background: #ffbe5b; }
.toast.info::before { background: var(--petrol); }

/* ── Energy stage (shared by login + hero) ──────────────────────────── */
.stage { position: relative; background: var(--stage); color: var(--stage-ink); overflow: hidden; isolation: isolate; }
.stage canvas.energy { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1;
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.18) 38%, #000 72%); mask-image: linear-gradient(90deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.18) 38%, #000 72%); }
.stage::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: none; }

/* ── Login ──────────────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login .stage { display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; }
.login-mark { display: flex; align-items: center; gap: .8rem; font-weight: 500; letter-spacing: .01em; }
.login-mark img { width: 30px; height: auto; }
.login-head { max-width: 560px; }
.login-head h1 { font-size: clamp(2.4rem, 4.6vw, 4.2rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 600; text-wrap: balance; }
.login-head h1 em { font-style: normal; color: var(--red); }
.login-head p { margin-top: 1.1rem; color: var(--stage-ink-2); font-size: 1.08rem; max-width: 42ch; }
.login-foot { color: var(--stage-ink-2); font-size: .82rem; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.login-card { width: 100%; max-width: 360px; display: grid; gap: 1.1rem; }
.login-card h2 { font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; }
.login-card .lede { color: var(--ink-3); margin-top: -.6rem; }
.login-card .input { height: 48px; font-size: 1rem; }
.login-card .btn.primary { height: 48px; font-size: 1rem; }
.login-install { border-top: 1px solid var(--line); padding-top: 1.1rem; display: grid; gap: .5rem; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login .stage { min-height: 300px; padding: 24px; gap: 2rem; }
  .login-head h1 { font-size: 2.3rem; }
  .login-foot { display: none; }
}

/* ── Header ─────────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  display: flex; align-items: center; gap: 1rem; padding: 0 clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--stage) 92%, transparent); color: var(--stage-ink);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: inherit; min-width: 0; }
.brand img { width: 22px; height: auto; }
.brand b { font-weight: 600; font-size: 1.02rem; letter-spacing: -.01em; }
.brand small { display: block; font-size: .72rem; color: var(--stage-ink-2); font-weight: 600; letter-spacing: .02em; margin-top: -2px; }
.crumbs { display: flex; align-items: center; gap: .4rem; min-width: 0; font-size: .9rem; color: var(--stage-ink-2); }
.crumbs svg { opacity: .5; }
.crumbs b { color: var(--stage-ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header .spacer { flex: 1; }
.hbtn { height: 36px; min-width: 36px; padding: 0 .6rem; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; color: var(--stage-ink-2); font-weight: 600; font-size: .86rem; transition: background .15s, color .15s; position: relative; }
.hbtn:hover, .hbtn[aria-expanded="true"] { background: rgba(255, 255, 255, .08); color: var(--stage-ink); }
.hsearch { width: min(300px, 32vw); justify-content: flex-start; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); }
.hsearch kbd { margin-left: auto; font: inherit; font-size: .72rem; padding: 1px 6px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .16); color: var(--stage-ink-2); }
.pill { display: inline-flex; align-items: center; gap: .35rem; height: 26px; padding: 0 .6rem; border-radius: 99px; font-size: .76rem; font-weight: 500; }
.pill.warn { background: rgba(255, 190, 91, .14); color: #ffbe5b; }
.pill.info { background: rgba(151, 214, 223, .14); color: var(--petrol); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .8rem; background: var(--red); color: #fff; }
.menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; min-width: 260px; padding: 6px; border-radius: 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-lg); text-align: left; }
.menu-head { padding: .7rem .75rem .8rem; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu-head b { display: block; font-weight: 500; }
.menu-item { width: 100%; display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--ink); text-decoration: none; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--err); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); gap: 2px; }
.seg button { height: 30px; padding: 0 .7rem; border-radius: 8px; font-size: .82rem; font-weight: 500; color: var(--ink-3); display: inline-flex; align-items: center; gap: .35rem; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
@media (max-width: 760px) {
  .brand small, .hsearch span, .hsearch kbd, .crumbs { display: none; }
  .hsearch { width: 36px; padding: 0; justify-content: center; background: transparent; border-color: transparent; }
}

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero { overflow: visible; z-index: 5; padding: clamp(48px, 9vh, 96px) clamp(16px, 4vw, 48px) clamp(40px, 7vh, 72px); }
.hero-inner { max-width: 1120px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.6rem); line-height: 1; letter-spacing: -.04em; font-weight: 600; max-width: 15ch; text-wrap: balance; }
.hero h1 span { color: var(--red); }
.hero-sub { margin-top: 1.1rem; color: var(--stage-ink-2); font-size: clamp(1rem, 1.3vw, 1.15rem); max-width: 60ch; }
.hero-sub b { color: var(--stage-ink); font-weight: 500; }
.search { position: relative; margin-top: clamp(28px, 4.5vh, 44px); max-width: 760px; }
.search-box {
  display: flex; align-items: center; gap: .8rem; height: 64px; padding: 0 .6rem 0 1.25rem; border-radius: 16px;
  background: rgba(255, 255, 255, .96); color: #181919;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .3);
  transition: box-shadow .25s var(--ease-out), transform .25s var(--ease-out);
}
.search-box:focus-within { box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7), 0 0 0 3px var(--red); }
.search-box svg.i { width: 22px; height: 22px; color: #5e6363; }
.search-box input:focus-visible { box-shadow: none; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 1.15rem; font-weight: 500; color: #181919; }
.search-box input::placeholder { color: #5e6363; }
.search-box kbd { font: inherit; font-size: .75rem; font-weight: 500; padding: 3px 8px; border-radius: 7px; background: #eef4f5; color: #5e6363; }
.results {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0; z-index: 30; max-height: min(420px, 56vh); overflow: auto;
  padding: 6px; border-radius: 16px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.result { width: 100%; display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; padding: .7rem .85rem; border-radius: 10px; text-align: left; }
.result b { font-weight: 500; font-size: 1rem; }
.result mark { background: none; color: var(--red-ink); }
.result .muted { font-size: .85rem; }
.result[aria-selected="true"] { background: var(--surface-2); }
.result[aria-selected="true"] .go { opacity: 1; transform: none; }
.result .go { opacity: 0; transform: translateX(-4px); transition: .15s var(--ease-out); color: var(--red-ink); }
.results-empty { padding: 1rem; color: var(--ink-3); }
.recent { margin-top: 1.1rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.recent > span { font-size: .8rem; color: var(--stage-ink-2); font-weight: 600; margin-right: .2rem; }
.chip-dark { height: 32px; padding: 0 .8rem; border-radius: 99px; display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 500; color: var(--stage-ink); background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); transition: background .15s, border-color .15s; }
.chip-dark:hover { background: rgba(236, 0, 72, .18); border-color: rgba(236, 0, 72, .5); }

/* ── Page sections ──────────────────────────────────────────────────── */
.page { max-width: 1200px; margin: 0 auto; padding: clamp(28px, 4vw, 48px) clamp(16px, 4vw, 48px) 96px; }
.section + .section { margin-top: clamp(48px, 6vw, 72px); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.section-head h2 { font-size: 1.55rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.15; }
.section-head p { color: var(--ink-3); margin-top: .2rem; font-size: .92rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.chip { height: 34px; padding: 0 .85rem; border-radius: 99px; font-size: .86rem; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; gap: .4rem; transition: .15s; }
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .n { font-size: .75rem; opacity: .65; }
.filters .input { height: 34px; width: 220px; border-radius: 99px; font-size: .88rem; }

/* board list */
.hall + .hall { border-top: 1px solid var(--line); }
.hall-head { display: flex; align-items: baseline; gap: .6rem; padding: 1rem 1.2rem .4rem; }
.hall-head h3 { font-size: .95rem; font-weight: 600; letter-spacing: 0; }
.hall-head span { font-size: .8rem; color: var(--ink-3); }
.board {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .9fr) auto; gap: 1rem; align-items: center;
  padding: .7rem 1.2rem; margin: 0 .4rem; border-radius: 10px; cursor: pointer; text-align: left; width: calc(100% - .8rem);
  transition: background .12s;
}
.board:last-child { margin-bottom: .5rem; }
.board:hover { background: var(--surface-2); }
.board b { font-weight: 500; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .when { font-size: .84rem; color: var(--ink-3); }
.board .act { display: flex; gap: .2rem; align-items: center; color: var(--ink-3); }
.board .chev { transition: transform .18s var(--ease-out), color .18s; }
.board:hover .chev { transform: translateX(3px); color: var(--red-ink); }
@media (max-width: 680px) {
  .board { grid-template-columns: minmax(0, 1fr) auto; }
  .board .when { display: none; }
  .board .type { grid-column: 1; grid-row: 2; margin-top: -.5rem; }
}
/* Leerzustand (überall gleich): Überschrift, ein Satz, bei Rechten eine Hauptaktion. Muster:
   <div class="empty"><b>Noch keine Verteilung</b><span>Ein Satz.</span><button class="btn primary">…</button></div> */
.empty { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 28px 18px; text-align: center; color: var(--ink-3); line-height: 1.45; }
.empty b { display: block; color: var(--ink); font-size: 1.05rem; font-weight: 600; }
.empty > span, .empty > p { max-width: 52ch; }
.empty > .btn { margin-top: .7rem; }
.empty > .btn + .btn { margin-top: .4rem; }

/* network: site map (Hallen + Gebäude) */
.net { position: relative; overflow: hidden; padding: 8px; }
.net-svg { display: block; width: 100%; height: auto; overflow: visible; user-select: none; -webkit-user-select: none; }
.net-legend { display: inline-flex; gap: 1rem; flex-wrap: wrap; margin-right: .6rem; }
.net-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); }
.net-tip { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; display: grid; gap: .15rem; min-width: 160px; max-width: 260px; padding: .6rem .75rem; border-radius: 10px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-size: .88rem; }
.net-tip b { font-weight: 600; }
.net-tip .type { color: var(--bg); opacity: .85; }
.net-tip .muted { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.zone-label { fill: var(--ink-3); font-family: var(--font); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.hall-box rect.frame { fill: var(--surface-2); stroke: var(--line-soft); stroke-width: 1; transition: fill .2s, stroke .2s; }
.hall-box.bld rect.frame { fill: var(--surface); stroke: var(--line); }
.hall-box .roof { fill: var(--surface-3); }
.hall-box .floor-line { stroke: var(--line); stroke-width: 1; }
.hall-box .floor-lbl { fill: var(--ink-3); font-size: 10.5px; font-weight: 500; }
.hall-box text { fill: var(--ink-2); font-family: var(--font); font-size: 12.5px; font-weight: 500; }
.hall-box text.cnt { fill: var(--ink-3); font-weight: 600; }
.hall-box .hit { cursor: pointer; fill: transparent; }
.hall-box:hover rect.frame { stroke: var(--ink-3); }
.hall-box.drop rect.frame { stroke: var(--red); stroke-width: 2; fill: var(--red-soft); }
.hall-box.none rect.frame { fill: none; stroke: var(--line); stroke-dasharray: 5 4; }
.dot { cursor: pointer; transform-box: fill-box; transform-origin: center; animation: pop .55s var(--ease-out) both; animation-delay: calc(var(--i) * 4ms + 120ms); }
.dot rect { fill: var(--surface); stroke: var(--c); stroke-width: 1.6; transition: fill .15s, stroke-width .15s; }
.dot.linked rect { fill: var(--c); }
.dot[data-t="Mittelspannung"] { --c: var(--t-ms); }
.dot[data-t="Transformator"] { --c: var(--t-tr); }
.dot[data-t="Schalthaus"] { --c: var(--t-sh); }
.dot[data-t="Hauptverteilung"] { --c: var(--t-hv); }
.dot[data-t="Unterverteilung"] { --c: var(--t-uv); }
.dot:hover rect, .dot.on rect { stroke-width: 2.6; }
.dot.on rect { fill: var(--c); }
.dot.dragging { opacity: .25; }
.ghost rect { fill: var(--red); stroke: #fff; stroke-width: 2; }
.ghost text { fill: var(--ink); font-family: var(--font); font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
@keyframes pop { from { opacity: 0; transform: scale(.2); } }
.wire { fill: none; stroke: var(--ink-3); stroke-width: 1.2; opacity: .35; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s var(--ease-out) forwards; animation-delay: .7s; transition: opacity .2s, stroke .2s; }
.wire-flow { fill: none; stroke: var(--red); stroke-width: 2; opacity: 0; stroke-dasharray: 4 10; stroke-linecap: round; animation: flow 1.6s linear infinite; transition: opacity .25s; pointer-events: none; }
.net:not(.focus) .wire-flow { opacity: .28; animation-duration: 3s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes flow { to { stroke-dashoffset: -28; } }
.net.focus .dot:not(.on) { opacity: .22; }
.net.focus .wire:not(.on) { opacity: .08; }
.net.focus .wire-flow:not(.on) { opacity: 0; }
.net.focus .wire.on { stroke: var(--red); opacity: 1; stroke-width: 2; }
.net.focus .wire-flow.on { opacity: 1; stroke: #fff; stroke-width: 2; animation-duration: .7s; }
:root[data-theme="dark"] .net.focus .wire-flow.on { stroke: #ffd0dd; }
.net.focus .hall-box rect.frame { fill: var(--surface); }
.net-hint { display: flex; gap: .5rem; align-items: center; margin-top: .7rem; }

/* plan page */
.plan-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.4rem; }
.plan-actions .btn { height: 44px; padding: 0 1.1rem; }
.plan-actions .btn small { font-weight: 600; opacity: 1; }
.plan-actions .btn.primary small { color: #fff; }
.plan-view { position: relative; height: min(78vh, 900px); overflow: hidden; border-radius: var(--r-lg); background: #dfe7e8; cursor: grab; touch-action: none; }
:root[data-theme="dark"] .plan-view { background: #0b0c0c; }
.plan-view.dragging { cursor: grabbing; }
.plan-view img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-drag: none; box-shadow: var(--shadow-lg); }
.plan-tools { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md); z-index: 2; }
.plan-facts { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1.2rem; color: var(--stage-ink-2); font-size: .92rem; }
.plan-facts b { display: block; color: var(--stage-ink); font-size: 1.35rem; font-weight: 600; }

/* ── Detail ─────────────────────────────────────────────────────────── */
.dhead { padding: clamp(32px, 6vh, 56px) clamp(16px, 4vw, 48px) 0; }
.dhead-inner { max-width: 1200px; margin: 0 auto; }
.back { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; font-weight: 500; color: var(--stage-ink-2); text-decoration: none; margin-bottom: 1.2rem; }
.back:hover { color: var(--stage-ink); }
.dtitle { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.dtitle h1 { font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1; letter-spacing: -.04em; font-weight: 600; overflow-wrap: anywhere; }
.dmeta { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.2rem; color: var(--stage-ink-2); font-size: .92rem; }
.dmeta > div { display: grid; gap: .1rem; }
.dmeta small { font-size: .74rem; font-weight: 500; color: var(--stage-ink-2); opacity: .8; }
.dmeta b { color: var(--stage-ink); font-weight: 500; font-size: 1rem; }
.dmeta a { color: var(--stage-ink); text-decoration: none; border-bottom: 1px solid rgba(236, 0, 72, .7); }
.dmeta a:hover { color: #fff; border-bottom-color: var(--red); }
.dmeta .type { color: var(--stage-ink); font-size: 1rem; }
.dtitle .row .btn { background: rgba(255, 255, 255, .06); color: var(--stage-ink); border-color: rgba(255, 255, 255, .14); }
.dtitle .row .btn:hover { background: rgba(255, 255, 255, .12); }
.dtitle .row .btn.primary { background: var(--red); border-color: var(--red); }

.tabs { position: sticky; top: var(--header-h); z-index: 30; margin-top: 2rem; background: var(--stage); }
.dhead + .tabs { margin-top: 0; padding-top: 1.2rem; }
.tabs-inner { max-width: 1200px; margin: 0 auto; display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; height: 52px; padding: 0 1rem; display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; font-size: .95rem; color: var(--stage-ink-2); text-decoration: none; white-space: nowrap; transition: color .15s; }
.tab:hover { color: var(--stage-ink); }
.tab .n { font-size: .76rem; padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, .09); color: var(--stage-ink); }
.tab[aria-current="true"] { color: var(--stage-ink); }
.tab[aria-current="true"]::after { content: ""; position: absolute; left: .7rem; right: .7rem; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--red); }

.dsec { scroll-margin-top: calc(var(--header-h) + 64px); }
.dsec + .dsec { margin-top: 56px; }

.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
thead th { position: sticky; top: 0; text-align: left; padding: .8rem 1rem; font-size: .76rem; font-weight: 500; color: var(--ink-3); letter-spacing: .02em; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
tbody td { padding: .7rem 1rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.strong { font-weight: 500; }
td.acts { width: 1%; white-space: nowrap; text-align: right; }
td.acts .btn { opacity: .55; }
td.acts .row { flex-wrap: nowrap; }
tr:hover td.acts .btn, td.acts .btn:focus-visible { opacity: 1; }
.cell-input { height: 34px; padding: 0 .55rem; font-size: .9rem; border-radius: 8px; min-width: 90px; }
tr.editing td { background: var(--red-soft) !important; }
tr.adding td { background: var(--surface-2); }
.tfoot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .8rem 1rem; border-top: 1px solid var(--line); }
.link { color: var(--red-ink); font-weight: 500; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 680px) {
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; }
  table.cards tr { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem .9rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line-soft); position: relative; }
  table.cards tbody td { padding: 0; border: 0; background: none !important; }
  table.cards td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 500; color: var(--ink-3); }
  table.cards td.strong { font-size: 1.05rem; }
  table.cards td[data-label="Anschlussort"] { grid-column: 1 / -1; }
  table.cards td { min-width: 0; overflow-wrap: anywhere; white-space: normal !important; }
  table.cards td.acts { grid-column: 1 / -1; width: auto; display: flex; justify-content: flex-end; gap: .4rem; margin-top: .35rem; }
  table.cards td.acts .btn { opacity: 1; }
  table.cards tr.editing td.acts, table.cards tr.adding td.acts { position: static; grid-column: 1 / -1; margin-top: .4rem; }
  table.cards tr.editing td.acts .row, table.cards tr.adding td.acts .row { justify-content: flex-start !important; }
}
.more { display: block; margin: 0 .4rem .6rem; width: calc(100% - .8rem); padding: .6rem 1.2rem; border-radius: 10px; text-align: left; font-weight: 500; font-size: .88rem; color: var(--ink-2); }
.more:hover { background: var(--surface-2); }

/* connections */
.flowbox { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0; align-items: stretch; }
.flow-col { padding: 1.1rem 1.2rem; min-width: 0; }
.flow-col h3 { font-size: .8rem; font-weight: 500; color: var(--ink-3); letter-spacing: .02em; margin-bottom: .7rem; }
.flow-mid { display: grid; place-items: center; padding: 1.1rem .2rem; position: relative; }
.flow-mid .me { padding: .7rem 1rem; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600; text-align: center; min-width: 120px; position: relative; z-index: 1; }
.flow-mid::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 2px; background: var(--line); }
@keyframes current { from { background-position: -60% 0, 0 0; } to { background-position: 160% 0, 0 0; } }
.conn { display: grid; gap: .1rem; padding: .7rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.conn + .conn { margin-top: .5rem; }
.conn .top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.conn .spec { font-size: .84rem; color: var(--ink-3); }
.conn .spec b { color: var(--ink-2); font-weight: 500; }
.conn-none { color: var(--ink-3); font-size: .9rem; padding: .7rem 0; }
@media (max-width: 820px) {
  .flowbox { grid-template-columns: 1fr; }
  .flow-mid { padding: .2rem 1.2rem; }
  .flow-mid::before { top: 0; bottom: 0; left: 50%; right: auto; width: 2px; height: auto; background: var(--red); animation: none; }
}

/* photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; padding: 12px; }
.photo { position: relative; border-radius: 12px; overflow: hidden; background: var(--surface-3); aspect-ratio: 4 / 3; cursor: zoom-in; isolation: isolate; }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out), opacity .4s; opacity: 0; }
.photo img.ld { opacity: 1; }
.photo:hover img { transform: scale(1.05); }
.photo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); pointer-events: none; }
.photo .cap { position: absolute; inset: auto 0 0 0; padding: 1.6rem .75rem .55rem; font-size: .76rem; font-weight: 500; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s var(--ease-out); }
.photo:hover .cap, .photo:focus-visible .cap { opacity: 1; transform: none; }
.photo .pick { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 8px; background: rgba(255, 255, 255, .92); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.photo.sel { outline: 3px solid var(--red); outline-offset: -3px; }
.photo.sel img { opacity: .7; }
.photo.first { grid-column: span 2; grid-row: span 2; }
@media (max-width: 520px) { .photos { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 6px; } .photo.first { grid-column: span 2; grid-row: auto; } }

.uploader { display: grid; grid-template-columns: auto auto 1fr; gap: .6rem; align-items: center; padding: 12px; border-bottom: 1px solid var(--line-soft); }
.uploader .btn { height: 44px; padding: 0 1.1rem; font-size: .95rem; }
.uploader .hint { color: var(--ink-3); font-size: .86rem; text-align: right; }
@media (max-width: 640px) { .uploader { grid-template-columns: 1fr 1fr; } .uploader > * { min-width: 0; } .uploader .btn { padding: 0 .5rem; font-size: .88rem; white-space: normal; line-height: 1.15; } .uploader .hint { grid-column: 1 / -1; text-align: left; } }
.dropzone-over { outline: 3px dashed var(--red); outline-offset: -10px; border-radius: var(--r-lg); background: var(--red-soft) !important; }
.queue { display: grid; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.q-item { display: grid; grid-template-columns: 40px 1fr auto; gap: .7rem; align-items: center; font-size: .85rem; }
.q-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; background: var(--surface-3); }
.q-item .bar { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: .3rem; }
.q-item .bar i { display: block; height: 100%; background: var(--red); transition: width .2s; }
.q-item.done .bar i { background: var(--ok); }
.q-item.err .bar i { background: var(--err); }
.q-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: #fff; background: #050606; overflow: hidden; }
.lb-bg { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(48px) saturate(1.3) brightness(.45); transform: scale(1.1); transition: background-image .4s; z-index: 0; }
.lb > *:not(.lb-bg) { position: relative; z-index: 1; }
.lb-bar { display: flex; align-items: center; gap: .4rem; padding: 12px 16px; background: linear-gradient(rgba(0, 0, 0, .55), transparent); }
.lb-bar .t { min-width: 0; }
.lb-bar .t b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar .t span { font-size: .8rem; color: #b9c2c3; }
.lb-bar .hbtn { color: #e6ecec; }
.lb-bar .hbtn:hover { background: rgba(255, 255, 255, .12); }
.lb-stage { position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.lb-stage img { max-width: calc(100vw - 140px); max-height: calc(100vh - 190px); max-height: calc(100dvh - 190px); object-fit: contain; border-radius: 6px; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9); transition: transform .35s var(--ease-out), opacity .35s; will-change: transform; cursor: zoom-in; }
.lb-stage img.zoomed { cursor: grab; transition: transform .08s linear; }
.lb-stage img.enter { opacity: 0; transform: scale(.97); }
@media (max-width: 640px) { .lb-stage img { max-width: 100vw; max-height: calc(100dvh - 170px); border-radius: 0; } }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .1); backdrop-filter: blur(8px); display: grid; place-items: center; color: #fff; transition: background .15s, transform .15s var(--ease-out); z-index: 2; }
.lb-nav:hover { background: rgba(236, 0, 72, .75); transform: translateY(-50%) scale(1.06); }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
@media (max-width: 640px) { .lb-nav { display: none; } }
.lb-strip { display: flex; gap: 6px; justify-content: center; padding: 10px 16px 16px; overflow-x: auto; scrollbar-width: none; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.lb-strip button { flex: 0 0 auto; width: 64px; height: 48px; border-radius: 8px; overflow: hidden; opacity: .5; outline: 2px solid transparent; outline-offset: 2px; transition: opacity .2s, outline-color .2s; }
.lb-strip button:hover { opacity: .85; }
.lb-strip button[aria-current="true"] { opacity: 1; outline-color: var(--red); }
.lb-strip img { width: 100%; height: 100%; object-fit: cover; }
.lb-spin { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }

/* bulk photo import */
.bulk { display: grid; gap: .5rem; }
.bulk-row { display: grid; grid-template-columns: 1fr minmax(0, 1.2fr); gap: .5rem; align-items: center; font-size: .85rem; }
.bulk-row .src { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bulk-row .src span { color: var(--ink-3); font-weight: 500; }
.bulk-row select { height: 34px; font-size: .84rem; }
.bulk-row.miss select { border-color: var(--warn); }

/* next boards */
.next { display: flex; gap: .6rem; flex-wrap: wrap; }
.next a { display: inline-flex; align-items: center; gap: .6rem; padding: .7rem .9rem .7rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 500; transition: border-color .15s, transform .15s var(--ease-out); }
.next a:hover { border-color: var(--red); transform: translateY(-1px); }
.next a svg { color: var(--red-ink); }

/* ── Drawer + dialog ────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(8, 9, 9, .45); backdrop-filter: blur(2px); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(520px, 100vw); display: flex; flex-direction: column; background: var(--bg); box-shadow: var(--shadow-lg); border-left: 1px solid var(--line); }
.drawer-head { padding: 20px 22px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; }
.drawer-head p { font-size: .86rem; color: var(--ink-3); }
.drawer-tabs { padding: 0 22px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer-tabs .seg { width: 100%; }
.drawer-tabs .seg button { flex: 1; justify-content: center; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 22px 40px; display: grid; gap: 12px; align-content: start; }
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.tool > summary { list-style: none; display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; cursor: pointer; font-weight: 500; }
.tool > summary::-webkit-details-marker { display: none; }
.tool > summary .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex-shrink: 0; }
.tool > summary small { display: block; font-weight: 500; font-size: .8rem; color: var(--ink-3); }
.tool > summary .chev { margin-left: auto; color: var(--ink-3); transition: transform .2s var(--ease-out); }
.tool[open] > summary .chev { transform: rotate(180deg); }
.tool[open] > summary .ic { background: var(--red-soft); color: var(--red-ink); }
.tool-body { padding: 0 1rem 1rem; display: grid; gap: .75rem; }
.copy { display: flex; gap: .4rem; }
.copy .input { font-size: .84rem; height: 36px; }
.list-mini { display: grid; gap: .15rem; font-size: .82rem; color: var(--ink-3); max-height: 220px; overflow: auto; }
.list-mini table { font-size: .82rem; }
.list-mini td, .list-mini th { padding: .4rem .5rem; }
.ok-ic { color: var(--ok); } .err-ic { color: var(--err); }

.dialog-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
.dialog { width: min(560px, 100%); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.dialog-head { padding: 20px 22px 0; }
.dialog-head h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.dialog-body { padding: 18px 22px; display: grid; gap: .9rem; }
.dialog-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: .5rem; }

/* ── Motion ─────────────────────────────────────────────────────────── */
.rise { animation: rise .7s var(--ease-out) both; }
.rise.d1 { animation-delay: .06s; } .rise.d2 { animation-delay: .12s; } .rise.d3 { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }
.fade-enter { transition: opacity .2s ease, transform .3s var(--ease-out); }
.fade-start { opacity: 0; transform: translateY(6px); }
.slide-enter { transition: transform .38s var(--ease-out); }
.slide-start { transform: translateX(100%); }
.slide-leave { transition: transform .22s ease-in; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ── Stromweg: streets ──────────────────────────────────────────────── */
.road { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: var(--surface-3); transition: stroke .25s; }
.road.main { stroke: var(--ink); stroke-width: 14; }
.road.side { stroke: var(--ink-2); stroke-width: 9; }
.road.lane { stroke: color-mix(in srgb, var(--ink-3) 70%, var(--surface)); stroke-width: 6; }
.road.alley { stroke: color-mix(in srgb, var(--ink-3) 50%, var(--surface)); stroke-width: 4; }
.road.drive { stroke: color-mix(in srgb, var(--ink-3) 45%, var(--surface)); stroke-width: 3; }
:root[data-theme="dark"] .road.main { stroke: #3a3f3f; }
:root[data-theme="dark"] .road.side { stroke: #333838; }
.flow { fill: none; stroke-linecap: round; pointer-events: none; stroke: var(--red); opacity: 0; transition: opacity .25s; }
.flow.main { stroke: #fff; stroke-width: 1.6; stroke-dasharray: 10 12; opacity: .7; }
:root[data-theme="dark"] .flow.main { stroke: #cfd8d9; opacity: .5; }
.flow.side, .flow.lane, .flow.alley, .flow.drive { stroke-width: 2.2; stroke-dasharray: 3 12; opacity: .5; }
@keyframes road { to { stroke-dashoffset: -44; } }
.net.focus .road:not(.on) { stroke: var(--surface-2); }
.net.focus .road.main.on { stroke: var(--ink); }
.net.focus .road.on:not(.main) { stroke: var(--red); }
.net.focus .flow { opacity: 0; }
.net.focus .flow.on { opacity: 1; stroke: #fff; animation-duration: .8s; }
.st-card { cursor: pointer; animation: rise-in .6s var(--ease-out) both; animation-delay: calc(var(--i) * 25ms + 100ms); }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }
.st-card .bg { fill: var(--surface); stroke: var(--line); stroke-width: 1; transition: stroke .2s, fill .2s; }
.st-card .mk { fill: var(--c, var(--ink-3)); }
.st-card[data-t="Mittelspannung"] { --c: var(--t-ms); }
.st-card[data-t="Transformator"] { --c: var(--t-tr); }
.st-card[data-t="Schalthaus"] { --c: var(--t-sh); }
.st-card[data-t="Hauptverteilung"] { --c: var(--t-hv); }
.st-card[data-t="Unterverteilung"] { --c: var(--t-uv); }
.st-card .nm { fill: var(--ink); font-family: var(--font); font-size: 13px; font-weight: 600; }
.st-card.root .nm { font-size: 14px; }
.st-card .sub { fill: var(--ink-3); font-family: var(--font); font-size: 11.5px; font-weight: 600; }
.st-card .cnt { fill: var(--ink-3); font-family: var(--font); font-size: 11px; font-weight: 500; }
.st-card.root .bg { fill: var(--surface); stroke: var(--ink-3); stroke-width: 1.2; }
.st-card:hover .bg, .st-card.on .bg { stroke: var(--c); stroke-width: 2; }
.net.focus .st-card:not(.on) { opacity: .3; }
.st-sign rect { fill: var(--red); }
.st-sign text { fill: #fff; font-family: var(--font); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.st-empty { fill: var(--ink-3); font-family: var(--font); font-size: 14px; }
svg .ghost { pointer-events: none; }
@media (max-width: 760px) { .hide-sm { display: none; } }
.hbtn[aria-current="true"] { background: rgba(255, 255, 255, .1); color: var(--stage-ink); }

/* ── Preload ────────────────────────────────────────────────────────── */
.preload { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 24px; background: radial-gradient(120% 90% at 30% 10%, #151717 0%, #0b0c0c 60%); color: var(--stage-ink); }
.pl-leave { transition: opacity .6s ease, filter .6s ease; }
.pl-leave-end { opacity: 0; filter: blur(6px); }
.preload-inner { width: min(980px, 100%); display: grid; gap: 22px; }
.pl-head { display: flex; align-items: center; gap: 14px; }
.pl-head img { width: 26px; }
.pl-head b { display: block; font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.pl-head span { color: var(--stage-ink-2); font-size: .9rem; }
.pl-svg { width: 100%; height: auto; overflow: visible; }
.pl-svg text { font-family: var(--font); fill: var(--stage-ink); }
.pl-svg text.b { font-size: 15px; font-weight: 600; }
.pl-svg text.s { font-size: 11.5px; fill: var(--stage-ink-2); font-weight: 600; }
.pl-svg .pl-evu rect { fill: rgba(236, 0, 72, .12); stroke: var(--red); stroke-width: 1.6; }
.pl-svg .pl-trafo circle { fill: none; stroke: rgba(151, 214, 223, .3); stroke-width: 2.2; transition: stroke .5s, filter .5s; }
.pl-svg .w { fill: none; stroke: rgba(151, 214, 223, .18); stroke-width: 2.4; stroke-linecap: round; transition: stroke .4s; }
.pl-svg .bus { stroke: rgba(151, 214, 223, .18); stroke-width: 6; stroke-linecap: round; transition: stroke .5s; }
.pl-svg .hv { fill: rgba(255, 255, 255, .03); stroke: rgba(151, 214, 223, .2); stroke-width: 1.2; transition: stroke .4s, fill .4s; }
.pl-svg .hv-mark { fill: rgba(151, 214, 223, .25); transition: fill .4s; }
.pl-svg .pl-row text { opacity: 0; transition: opacity .5s; transition-delay: calc(var(--k) * 90ms); }
.pl-svg .uv { fill: none; stroke: rgba(151, 214, 223, .25); stroke-width: 1.4; transition: fill .3s, stroke .3s; }
/* live wires: dashes flowing in the direction of the current */
.pl-svg .w1, .pl-svg.r1 .w2, .pl-svg.r2 .w3, .pl-svg.r3 .w4 { stroke: var(--red); stroke-dasharray: 5 9; animation: plflow .7s linear infinite; }
.pl-svg.r1 .bus { stroke: var(--red); }
.pl-svg.r1 .pl-trafo circle { stroke: var(--red); }
.pl-svg.r1 .pl-row text { opacity: 1; }
.pl-svg.r2 .hv { stroke: rgba(236, 0, 72, .7); fill: rgba(236, 0, 72, .06); transition-delay: calc(var(--k) * 110ms); }
.pl-svg.r2 .hv-mark { fill: var(--red); transition-delay: calc(var(--k) * 110ms); }
.pl-svg.r2 .w3, .pl-svg.r3 .w4 { animation-delay: calc(var(--k) * -110ms); }
.pl-svg.r4 .uv { fill: var(--t-uv); stroke: var(--t-uv); transition-delay: calc(var(--k) * 80ms + var(--j) * 60ms); }
.pl-svg.r5 .w, .pl-svg.r5 .bus { animation-duration: .45s; }
.pl-svg.r5 .hv { fill: rgba(236, 0, 72, .14); }
@keyframes plflow { to { stroke-dashoffset: -28; } }
.pl-lines { list-style: none; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pl-lines li { display: flex; align-items: center; gap: .55rem; font-size: .92rem; color: var(--stage-ink-2); animation: rise .5s var(--ease-out) both; }
.pl-lines li.ok { color: var(--stage-ink); }
.pl-lines li.ok svg { color: var(--ok); }
:root .preload .ok svg { color: #2fcf96; }
@media (max-width: 640px) { .pl-svg text.s { font-size: 13px; } }

/* header on tablets: keep one line */
.brand span, .crumbs span, .crumbs b { white-space: nowrap; }
@media (max-width: 1100px) { .crumbs { display: none; } }
@media (max-width: 900px) { .brand small { display: none; } }

/* ── v6: compact streets ─────────────────────────────────────────────── */
.st-card .bg { rx: 8; }
.st-card .mk { fill: var(--c, var(--ink-3)); }
.st-card .nm { font-size: 13px; }
.st-card.root .nm { font-size: 14px; }
.pill { fill: var(--red-soft); stroke: color-mix(in srgb, var(--red) 35%, transparent); stroke-width: 1; }
.pill-t { fill: var(--red-ink); font-family: var(--font); font-size: 10.5px; font-weight: 600; }
.pill-n { fill: var(--surface-2); }
.pill-nt { fill: var(--ink-3); font-family: var(--font); font-size: 10.5px; font-weight: 600; }
.road.side { stroke-width: 8; }

/* ── map colour overlay ──────────────────────────────────────────────── */
.net-legend .lg { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 500; color: var(--ink-2); }
.net-legend .lg::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.lg[data-k="ueber"], .pdot[data-k="ueber"], .dot-st[data-k="ueber"] { --c: var(--err); }
.lg[data-k="bald"], .pdot[data-k="bald"], .dot-st[data-k="bald"] { --c: #e8a317; }
.lg[data-k="ok"], .pdot[data-k="ok"], .dot-st[data-k="ok"] { --c: var(--ok); }
.lg[data-k="offen"], .pdot[data-k="offen"], .dot-st[data-k="offen"] { --c: var(--line); }
.lg[data-k="r0"] { --c: var(--line); } .lg[data-k="r1"] { --c: #9fd8d4; } .lg[data-k="r2"] { --c: #2fb3ad; } .lg[data-k="r3"] { --c: #00706e; }
.net[data-color="pruef"] .dot rect, .net[data-color="reserve"] .dot rect { stroke: var(--m); fill: var(--m); }
.net[data-color="pruef"] .dot[data-p="ueber"] { --m: var(--err); }
.net[data-color="pruef"] .dot[data-p="bald"] { --m: #e8a317; }
.net[data-color="pruef"] .dot[data-p="ok"] { --m: var(--ok); }
.net[data-color="pruef"] .dot[data-p="offen"] rect { fill: var(--surface); stroke: var(--line); }
.net[data-color="reserve"] .dot[data-r="0"] rect { fill: var(--surface); stroke: var(--line); }
.net[data-color="reserve"] .dot[data-r="1"] { --m: #9fd8d4; }
.net[data-color="reserve"] .dot[data-r="2"] { --m: #2fb3ad; }
.net[data-color="reserve"] .dot[data-r="3"] { --m: #00706e; }

/* ── status bits ─────────────────────────────────────────────────────── */
.badge-dot { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 600; display: inline-grid; place-items: center; margin-left: -2px; }
.chip-dark.warn { background: rgba(236, 0, 72, .2); border-color: rgba(236, 0, 72, .6); }
.pstat { font-weight: 500; font-size: .9rem; }
.pstat[data-k="ueber"] { color: var(--err); }
.pstat[data-k="bald"] { color: #c77d00; }
:root[data-theme="dark"] .pstat[data-k="bald"] { color: #ffbe5b; }
.pstat[data-k="ok"] { color: var(--ok); }
.pstat[data-k="offen"] { color: var(--ink-3); font-weight: 600; }
.dmeta .pstat { border-bottom: 0; font-size: 1rem; }
.dmeta .pstat[data-k="offen"] { color: var(--stage-ink-2); }
.dmeta .pstat[data-k="ok"] { color: #2fcf96; }
.dmeta .pstat[data-k="bald"] { color: #ffbe5b; }
.dmeta .pstat[data-k="ueber"] { color: #ff5c8a; }
.dot-st { width: 9px; height: 9px; padding: 0 !important; border-radius: 50%; background: var(--c, var(--line)) !important; }
.rbadge { display: inline-block; margin-left: .35rem; padding: 1px 7px; border-radius: 99px; font-size: .72rem; font-weight: 600; vertical-align: 1px; white-space: nowrap; }
.rbadge[data-k="frei"] { background: color-mix(in srgb, var(--t-uv) 14%, transparent); color: var(--t-uv); }
.rbadge[data-k="zweck"] { background: color-mix(in srgb, #e8a317 16%, transparent); color: #b06f00; }
:root[data-theme="dark"] .rbadge[data-k="zweck"] { color: #ffbe5b; }
.rbadge[data-k="ok"] { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); margin-left: 0; }
.rbadge[data-k="m"] { background: var(--red-soft); color: var(--err); margin-left: 0; }
td.acts .btn.belegen { opacity: 1; color: var(--t-uv); border-color: color-mix(in srgb, var(--t-uv) 40%, transparent); }
td.acts .btn.belegen:hover { background: color-mix(in srgb, var(--t-uv) 10%, transparent); }
.chip svg { margin-left: -2px; }

/* ── Betrieb page ────────────────────────────────────────────────────── */
.plan-facts .fact { text-decoration: none; color: var(--stage-ink-2); transition: color .15s; }
.plan-facts .fact:hover { color: var(--stage-ink); }
.plan-facts .fact[data-k="ueber"] b { color: #ff5c8a; }
.plan-facts .fact[data-k="bald"] b { color: #ffbe5b; }
.plan-facts .fact[data-k="res"] b { color: #2fc6c2; }
.chip.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip.st[data-k="ueber"] { --c: var(--err); } .chip.st[data-k="bald"] { --c: #e8a317; } .chip.st[data-k="offen"] { --c: var(--line); } .chip.st[data-k="ok"] { --c: var(--ok); } .chip.st[data-k="m"] { --c: var(--red); }
.chip .n { font-size: .75rem; opacity: .65; }
.prow, .rrow { display: grid; align-items: center; gap: 1rem; padding: .75rem 1.2rem; border-bottom: 1px solid var(--line-soft); }
.prow { grid-template-columns: 10px minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; }
.rrow { grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.6fr) auto; }
.prow:last-of-type, .rrow:last-of-type { border-bottom: 0; }
.prow:hover, .rrow:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.pdot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.pdot[data-k="offen"] { background: none; box-shadow: inset 0 0 0 2px var(--line); }
.pname { display: grid; text-decoration: none; min-width: 0; }
.pname b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname:hover b { color: var(--red-ink); }
.rcount { font-size: .9rem; white-space: nowrap; }
.rcount b { font-size: 1.1rem; font-weight: 600; color: var(--t-uv); }
.rsizes { display: flex; flex-wrap: wrap; gap: .3rem; }
.rsize { display: inline-flex; gap: .3rem; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); font-size: .78rem; font-weight: 500; color: var(--ink-2); }
.rsize b { color: var(--ink-3); font-weight: 500; }
.rgroup + .rgroup { margin-top: 14px; }
.rgroup .hall-head { border-bottom: 1px solid var(--line-soft); padding-bottom: .7rem; }
@media (max-width: 760px) {
  .prow { grid-template-columns: 10px 1fr auto; }
  .prow .plast { grid-column: 2 / -1; margin-top: -.6rem; }
  .prow .pstat { grid-column: 2; grid-row: 2; margin-top: -.5rem; }
  .prow .pact { grid-column: 3; grid-row: 1; }
  .rrow { grid-template-columns: 1fr auto; }
  .rrow .rsizes { grid-column: 1 / -1; }
}

/* inspection card on the board page */
.pcard-head { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--line-soft); }
.pcard-head > div { display: grid; gap: .1rem; }
.pcard-head b { font-size: 1.1rem; font-weight: 600; }
.pcard-head .pill { margin-left: auto; }
.pbig { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); flex-shrink: 0; }
.pbig svg { width: 22px; height: 22px; }
.pcard[data-k="ok"] .pbig { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.pcard[data-k="bald"] .pbig { background: color-mix(in srgb, #e8a317 16%, transparent); color: #c77d00; }
.pcard[data-k="ueber"] .pbig { background: var(--red-soft); color: var(--err); }
.pcard[data-k="ueber"] .pcard-head b { color: var(--err); }
.pill.warn { background: color-mix(in srgb, #e8a317 18%, transparent); color: #b06f00; }
.dialog-head p { margin-top: .2rem; }

/* ── plan viewer (PDF-like) ──────────────────────────────────────────── */
.pv-bar { position: sticky; top: var(--header-h); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.pv-bar-in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 1.2rem; padding: 8px clamp(16px, 4vw, 48px); }
.pv-page, .pv-zoom { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; }
.pv-page b { font-weight: 600; }
.pv { position: relative; height: calc(100vh - var(--header-h) - 51px); height: calc(100dvh - var(--header-h) - 51px); overflow: auto; background: #d9e0e1; cursor: grab; overscroll-behavior: contain; }
:root[data-theme="dark"] .pv { background: #0b0c0c; }
.pv.dragging { cursor: grabbing; user-select: none; }
.pv-pages { margin: 0 auto; padding: 24px 0 48px; display: grid; gap: 24px; justify-items: center; }
.pv-sheet { position: relative; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 12px 32px -12px rgba(0, 0, 0, .35); }
.pv-sheet img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.pv-no { position: absolute; left: -34px; top: 0; font-size: .8rem; font-weight: 500; color: var(--ink-3); }
@media (max-width: 640px) { .pv-pages { padding: 12px 8px 32px; gap: 12px; } .pv-no { display: none; } }

/* dialogs: the scrim sits behind the dialog inside its own stacking context */
.dialog-wrap .scrim { z-index: 0; }
.dialog-wrap .dialog { z-index: 1; max-height: calc(100dvh - 32px); overflow-y: auto; }

/* compact stage on the plan page: the sheets get the room */
.dhead.compact { padding-top: 18px; padding-bottom: 18px; }
.dhead.compact .back { margin-bottom: .5rem; }
.dhead.compact .dtitle h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.dhead.compact .hero-sub { display: none; }
.dhead.compact .dhead-inner { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: .4rem 2rem; }
.dhead.compact .back, .dhead.compact .dtitle { grid-column: 1; }
.dhead.compact .plan-actions { grid-column: 2; grid-row: 1 / span 2; justify-content: flex-end; margin-top: 0; }
.dhead.compact .plan-facts { grid-column: 1 / -1; margin-top: .6rem; gap: 1.6rem; }
.dhead.compact .plan-facts b { display: inline; font-size: 1.05rem; margin-right: .3rem; }
@media (max-width: 860px) { .dhead.compact .dhead-inner { grid-template-columns: 1fr; } .dhead.compact .plan-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; } }

/* ── offline app: sync dialog ────────────────────────────────────────── */
.sync-dlg { width: min(680px, 100%); }
.sync-list { display: grid; gap: 6px; max-height: min(52vh, 460px); overflow-y: auto; }
.sync-item { display: flex; align-items: center; gap: .8rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.sync-item.conflict { border-color: #e8a317; background: rgba(232, 163, 23, .08); flex-wrap: wrap; }
.sync-txt { display: grid; gap: .1rem; flex: 1; min-width: 220px; }
.sync-txt b { font-weight: 500; font-size: .92rem; }
.sync-ok { color: var(--ok); }
.sync-btn .badge-dot { background: #e8a317; color: #181919; }

/* header links are buttons, never underlined */
.hbtn { text-decoration: none; }

/* ── 3D loading scene ────────────────────────────────────────────────── */
.pl3d { position: absolute; inset: 0; }
.pl3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pl3d-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pl3d-label { position: absolute; left: 0; top: 0; padding: 5px 10px; border-radius: 8px; background: rgba(13, 14, 14, .78); color: #fff; font: 500 13px/1.2 var(--font); white-space: nowrap; border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .8); transition: opacity .35s; will-change: transform; }
.pl3d-label.board { border-color: rgba(236, 0, 72, .65); max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.pl3d-label.layer { background: rgba(255, 255, 255, .94); color: #181919; border-color: transparent; font-size: 12px; margin-left: 8px; }
.pl3d-label.note { background: rgba(212, 18, 63, .92); border-color: transparent; }
.preload.is-3d { padding: 0; background: radial-gradient(120% 90% at 50% 20%, #171919 0%, #0a0b0b 70%); }
.preload.is-3d .preload-inner { position: absolute; inset: 0; width: auto; padding: clamp(18px, 3vw, 32px); display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.preload.is-3d .pl-lines { align-self: center; width: min(980px, 100%); padding: 12px 18px; border-radius: 14px; background: rgba(13, 14, 14, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .08); }
.pl-skip { position: absolute; z-index: 2; top: clamp(18px, 3vw, 32px); right: clamp(18px, 3vw, 32px); height: 34px; padding: 0 .9rem; border-radius: 99px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: #e8eded; font-weight: 500; font-size: .85rem; }
.pl-skip:hover { background: rgba(255, 255, 255, .16); }
@media (max-width: 640px) { .pl3d-label { font-size: 11px; padding: 4px 8px; } .pl3d-label.layer { font-size: 10.5px; } }
@media (max-width: 640px) {
  .preload.is-3d .pl-head { padding-right: 118px; }
  .preload.is-3d .pl-head b { font-size: 1.35rem; }
  .pl3d-label.board { max-width: 120px; font-size: 10.5px; }
}
/* lightbox arrows: the generic ".next" link row rule must not turn the button into a flex row */
.lb-nav.prev, .lb-nav.next { display: grid; place-items: center; gap: 0; flex-wrap: nowrap; }
@media (max-width: 640px) { .lb-nav.prev, .lb-nav.next { display: none; } }

/* ── EPLAN-style designation, plans & documents ───────────────────────── */
.dtitle .kz { margin-top: .35rem; display: inline-flex; align-items: center; gap: .5rem; font: 600 .95rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; color: var(--stage-ink-2, #c9d2d3); }
.dtitle .kz small { font: 500 .75rem/1 var(--font); padding: 4px 6px; border-radius: 4px; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); opacity: .8; }
td.art { font: .8rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink-2, #5b6566); overflow-wrap: anywhere; }
@media (min-width: 641px) and (max-width: 1100px) { table.cards .col-art { display: none; } }
.doclist { display: grid; }
.docrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .9rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.docrow:last-child { border-bottom: 0; }
.doctxt { display: grid; gap: .15rem; min-width: 0; }
.doctxt a { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
.doctxt a:hover { color: var(--red-ink, #c4003c); text-decoration: underline; }
.docic { width: 46px; height: 34px; border-radius: 8px; display: grid; place-items: center; font: 600 .62rem/1 var(--font); letter-spacing: .04em; color: #fff; background: #5b6566; }
.docic[data-t="PDF"] { background: #c4003c; } .docic[data-t="CAD"] { background: #00666b; } .docic[data-t="EPLAN"] { background: #6b3fa0; }
.docic[data-t="XLS"] { background: #1f7a3f; } .docic[data-t="BILD"] { background: #8a6d1f; }
.docup select { height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 .5rem; }
/* search results must cover the rows below ("Zuletzt angesehen", deadlines): the rise animation
   gives every block its own stacking context, so the whole search block needs the higher layer */
.search { z-index: 20; }

/* ── Plan einlesen ───────────────────────────────────────────────────── */
.imp-dlg { position: relative; z-index: 1; width: min(880px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); overflow: auto; }
.imp-drop { display: grid; place-items: center; min-height: 150px; border: 2px dashed var(--line); border-radius: 14px; cursor: pointer; text-align: center; padding: 1rem; transition: border-color .15s, background .15s; }
.imp-drop:hover { border-color: var(--red); background: var(--surface-2); }
.imp-drop.busy { cursor: progress; }
.imp-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.imp-meta span { font-size: .78rem; font-weight: 500; padding: .25rem .6rem; border-radius: 99px; background: var(--surface-2); }
.imp-sum { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; font-size: .9rem; margin: .4rem 0 .5rem; }
.imp-list { border: 1px solid var(--line); border-radius: 12px; max-height: 46vh; overflow: auto; }
.imp-row { display: grid; grid-template-columns: auto 5.5rem 5.5rem minmax(0, 1fr) auto; gap: .6rem; align-items: center; padding: .5rem .8rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.imp-row:last-child { border-bottom: 0; }
.imp-row[data-a="gleich"] { opacity: .55; cursor: default; }
.imp-tag { font: 500 .85rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.imp-badge { justify-self: start; font-size: .7rem; font-weight: 600; padding: .2rem .5rem; border-radius: 99px; background: var(--surface-2); }
.imp-badge[data-a="neu"] { background: rgba(0, 102, 107, .14); color: #00666b; }
.imp-badge[data-a="ergaenzen"] { background: rgba(31, 122, 63, .14); color: #1f7a3f; }
.imp-badge[data-a="aendern"] { background: rgba(236, 0, 72, .12); color: var(--red-ink, #c4003c); }
[data-theme="dark"] .imp-badge[data-a="neu"] { color: #5fd0d4; } [data-theme="dark"] .imp-badge[data-a="ergaenzen"] { color: #6fd08f; }
.imp-det { font-size: .86rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-ch { margin-right: .8rem; } .imp-ch i { font-style: normal; color: var(--ink-3); font-size: .78rem; } .imp-ch s { color: var(--ink-3); }
@media (max-width: 640px) { .imp-row { grid-template-columns: auto 4.6rem minmax(0, 1fr); } .imp-row .imp-badge, .imp-row > .small { display: none; } .imp-det { white-space: normal; } }

/* ── Projektstruktur + Prüflauf ─────────────────────────────────────────── */
.str-tree { padding: .3rem 0; }
.str-anl { border-bottom: 1px solid var(--line-soft, var(--line)); }
.str-anl:last-child { border-bottom: 0; }
.str-node { width: 100%; display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; text-align: left; min-width: 0; }
.str-node.lvl1:hover { background: var(--surface-2); }
.str-node.lvl2 { padding: .45rem 1rem .45rem 2.2rem; }
.str-node.lvl2 a { font-weight: 500; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.str-node.lvl2 a:hover { color: var(--red-ink); text-decoration: underline; }
.str-tog { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; }
.str-tog:hover { background: var(--surface-2); }
.str-node .chev { transition: transform .15s; transform: rotate(-90deg); flex: none; }
.str-node .chev.open { transform: none; }
.str-kz, .str-bmk { font: 500 .86rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #00666b; white-space: nowrap; }
[data-theme="dark"] .str-kz, [data-theme="dark"] .str-bmk { color: #5fd0d4; }
.str-devs { padding: 0 0 .4rem 4.6rem; }
.str-dev { display: grid; grid-template-columns: minmax(7rem, auto) 6rem minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .35rem 1rem; color: var(--ink); text-decoration: none; border-radius: 8px; font-size: .9rem; }
.str-dev:hover { background: var(--surface-2); }
.str-dev .str-ziel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.str-dev .art { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.str-hits-head { padding: .6rem 1rem; border-bottom: 1px solid var(--line); }
.check-groups { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.check-group { display: inline-flex; gap: .45rem; align-items: baseline; padding: .45rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: .86rem; }
.check-group b { font-size: 1rem; }
.check-group[data-sev="fehler"] b { color: var(--red-ink, #c4003c); }
.check-group[data-sev="warnung"] b { color: #b26b00; }
.check-group[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.check-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 1rem; align-items: center; padding: .7rem 1.2rem; border-bottom: 1px solid var(--line-soft, var(--line)); color: var(--ink); text-decoration: none; }
.check-row:hover { background: var(--surface-2); }
.check-row .check-txt { display: grid; gap: .1rem; min-width: 0; }
.check-row .check-txt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.check-row .go { color: var(--red-ink); opacity: .6; }
tr.focus-flash > td { animation: focusflash 2.4s ease-out; }
@keyframes focusflash { 0%, 30% { background: rgba(236, 0, 72, .16); } 100% { background: transparent; } }
@media (max-width: 640px) {
  .str-devs { padding-left: 1rem; }
  .str-dev { grid-template-columns: minmax(5.5rem, auto) minmax(0, 1fr); }
  .str-dev > :nth-child(2), .str-dev > :nth-child(4) { display: none; }
  .str-node.lvl2 { padding-left: 1rem; flex-wrap: wrap; }
  .check-row { grid-template-columns: 10px minmax(0, 1fr); }
  .check-row .check-lbl, .check-row .go { display: none; }
}

/* ── Stromlaufplan: pages per board + editor host ───────────────────────── */
.sp-list { display: grid; }
.sp-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.sp-card:last-child { border-bottom: 0; }
.sp-card:hover { background: var(--surface-2); }
.sp-nr { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 600; background: var(--ink); color: var(--surface); }
.sp-txt { display: grid; gap: .1rem; min-width: 0; }
.ed-view { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg, #f4f7f7); }
.ed-bar { display: flex; align-items: center; gap: .8rem; height: 52px; padding: 0 14px; background: #0d0e0e; color: #fff; flex: none; overflow-x: auto; scrollbar-width: none; }
.ed-bar > * { flex: none; }
@media (max-width: 760px) { .ed-bar { gap: .4rem; padding: 0 8px; } .ed-bar-title { display: none; } .ed-bar .back span { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
.ed-bar .back { color: #e8eded; text-decoration: none; display: inline-flex; gap: .4rem; align-items: center; font-weight: 500; }
.ed-bar-title { color: #9aa5a6; font-size: .85rem; }
.ed-bar .btn { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .16); }
.ed-host { flex: 1; min-height: 0; position: relative; }

/* ── Buttons & controls: one size system, nothing moves (HIG pass 13.11.2026) ─────────────
   buttons.md › Best practices: same-size buttons in a set, prominence through style not size,
   a press state for every custom button, ~44 pt hit regions; an activity indicator lives inside
   the button without changing its size. */
:root { --ctl: 38px; --ctl-sm: 34px; }
.btn { height: var(--ctl); position: relative; line-height: 1; }
.btn.sm { height: var(--ctl-sm); }
.btn.icon { width: var(--ctl); }
.btn.icon.sm { width: var(--ctl-sm); }
.chip { height: var(--ctl-sm); line-height: 1; }
.seg { height: var(--ctl-sm); padding: 2px; align-items: stretch; }
.seg button { height: auto; }
.btn, .chip, .seg button, .hbtn { flex-shrink: 0; }
.btn svg, .chip svg, .hbtn svg, .seg button svg { flex: none; }

/* press state without moving the button */
.btn:active, .chip:active, .seg button:active, .hbtn:active { transform: scale(.97); }

/* busy: the spinner sits on top of the label, the button keeps its size */
.btn > .spinner { position: absolute; left: calc(50% - 8px); top: calc(50% - 8px); margin: 0; }
.btn:has(> .spinner:not([style*="display: none"])) { color: transparent !important; }
.btn:has(> .spinner:not([style*="display: none"])) svg { visibility: hidden; }
.btn:has(> .spinner:not([style*="display: none"])) > .spinner { border-color: var(--ink); border-right-color: transparent; opacity: 1; }
.btn.primary:has(> .spinner:not([style*="display: none"])) > .spinner,
.btn.dark:has(> .spinner:not([style*="display: none"])) > .spinner { border-color: #fff; border-right-color: transparent; }

/* button rows in section heads: aligned, tidy wrapping */
.section-head .row { flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .45rem; }
@media (max-width: 640px) {
  .section-head .row { justify-content: flex-start; width: 100%; }
}

/* counts in tabs and badges never change the width of their neighbours */
.tab .n, .chip .n { min-width: 1.7em; text-align: center; font-variant-numeric: tabular-nums; }

/* header: labels go earlier, badges become a dot on the icon, nothing overlaps the brand */
@media (max-width: 1000px) { .header .hide-sm { display: none; } }
@media (max-width: 1000px) {
  .hbtn .badge-dot { position: absolute; top: 1px; right: -2px; margin: 0; min-width: 16px; height: 16px; padding: 0 4px; font-size: .62rem; pointer-events: none; }
}
@media (max-width: 560px) {
  .header { gap: .15rem; padding: 0 10px; }
  .brand { margin-right: .3rem; flex: none; }
  .brand span { display: none; }
  .hbtn { min-width: 40px; padding: 0 .45rem; }
}

/* touch: larger invisible hit area, layout unchanged */
@media (pointer: coarse) {
  .btn.sm::after, .btn.icon::after, .chip::after { content: ""; position: absolute; left: 0; right: 0; top: -5px; bottom: -5px; }
  .chip { position: relative; }
}

/* phone cards: no empty "Artikel" line */
@media (max-width: 760px) { table.cards td.col-art:empty { display: none; } }
#komponenten td[data-label="Sicherung"] { white-space: nowrap; }
#komponenten td.acts { position: sticky; right: 0; background: var(--surface); }
#komponenten tr:hover td.acts { background: inherit; }

.show-sm { display: none; }
@media (max-width: 760px) { .show-sm { display: inline; } }

/* photo types */
.foto-arten { margin: 0 0 .8rem; }
.art-badge { position: absolute; top: 8px; left: 8px; z-index: 2; font-size: .7rem; font-weight: 600; letter-spacing: .02em; padding: .2rem .5rem; border-radius: 99px; background: rgba(13, 14, 14, .72); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lb-art { height: 34px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08); color: #fff; padding: 0 .5rem; font: inherit; font-size: .85rem; margin-right: .3rem; }
.lb-art option { color: #181919; }
/* narrow screens: long board names wrap instead of being cut off */
@media (max-width: 860px) { .board b, .pname b { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; } }
/* phone: tree targets wrap, larger toggle targets; lightbox arrows stay available */
@media (max-width: 760px) { .str-dev .str-ziel { white-space: normal; overflow: visible; overflow-wrap: anywhere; } .str-tog { width: 36px; height: 36px; } }
@media (max-width: 640px) { .lb-nav.prev, .lb-nav.next { display: grid; width: 40px; height: 40px; top: auto; bottom: 12px; transform: none; } .lb-nav:hover { transform: none; } .lb-nav.prev { left: 8px; } .lb-nav.next { right: 8px; } }
/* thumbnail strip: centred when it fits, scrollable from the first photo when it does not (centred overflow hid the first ones) */
.lb-strip { justify-content: flex-start; }
.lb-strip > button:first-of-type { margin-left: auto; }
.lb-strip > button:last-of-type { margin-right: auto; }

/* Unslop: Prüfstatus im Reiter als Punkt statt Zähler-Pille */
.tab .n.dot-st { min-width: 0; width: 8px; height: 8px; padding: 0; border-radius: 50%; background: var(--stage-ink-2); }

/* login: security notice */
.login-sicher { border-top: 1px solid var(--line); padding-top: .9rem; font-size: .84rem; color: var(--ink-2); }
.login-sicher summary { cursor: pointer; display: flex; align-items: center; gap: .45rem; font-weight: 600; color: var(--ink); list-style: none; }
.login-sicher summary::-webkit-details-marker { display: none; }
.login-sicher summary::after { content: "+"; margin-left: auto; color: var(--ink-3); font-weight: 500; }
.login-sicher[open] summary::after { content: "–"; }
.login-sicher ul { margin: .7rem 0 0; padding-left: 1.1rem; display: grid; gap: .45rem; line-height: 1.45; }
.login-sicher b { color: var(--ink); font-weight: 600; }

/* ── Netzebenen: Mittelspannung über der Niederspannung ─────────────── */
.st-layer { fill: var(--ink-3); font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.road.main.nsbus { stroke: var(--t-ms); stroke-width: 8; }
.st-sign.ns rect { fill: var(--t-ms); }
.st-card[data-t="Mittelspannung"] .bg, .st-card[data-t="Transformator"] .bg { fill: color-mix(in srgb, var(--t-ms) 6%, var(--surface)); }
.st-card.flash-back .bg { stroke: var(--red); stroke-width: 2; }
.board.flash-back { box-shadow: 0 0 0 2px var(--red); border-radius: 10px; transition: box-shadow .4s; }

/* ── Kopfzeile: Standort führt zur vorherigen Ansicht zurück ────────── */
.crumb-loc { display: inline-flex; align-items: center; gap: .3rem; height: 30px; padding: 0 .5rem 0 .35rem; margin: 0 -.15rem; border-radius: 8px;
  color: var(--stage-ink-2); font: inherit; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.crumb-loc svg { width: 14px; height: 14px; opacity: 0; margin-right: -14px; transition: opacity .15s, margin .2s var(--ease-out); }
.crumb-loc:hover, .crumb-loc:focus-visible { background: rgba(255, 255, 255, .08); color: var(--stage-ink); }
.crumb-loc:hover svg, .crumb-loc:focus-visible svg { opacity: .9; margin-right: 0; }
.crumb-loc:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .crumb-loc svg { transition: none; } }

/* ── Sitzung ────────────────────────────────────────────────────────── */
.sess-warn {
  position: fixed; left: 50%; bottom: 24px; z-index: 95; transform: translateX(-50%);
  display: flex; align-items: center; gap: .75rem; max-width: calc(100vw - 32px);
  padding: .55rem .6rem .55rem 1rem; border-radius: 14px;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: .92rem; box-shadow: var(--shadow-lg);
}
.sess-warn > svg { color: #ffbe5b; flex-shrink: 0; }
.sess-warn .num { font-variant-numeric: tabular-nums; }
.sess-wrap { z-index: 120; }
.sess-wrap .scrim { background: rgba(8, 9, 9, .55); backdrop-filter: blur(3px); }
.sess-dlg { width: min(440px, 100%); }
.sess-dlg .dialog-head p { margin-top: .45rem; line-height: 1.45; }
@media (max-width: 520px) { .sess-warn { flex-wrap: wrap; justify-content: center; text-align: center; bottom: 12px; } }

/* ── Passwort anzeigen (Anmeldung, Wiederanmeldung, Passwort ändern) ─── */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; padding-right: 2.8rem; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center; color: var(--ink-3); transition: color .15s, background .15s; }
.pw-eye:hover { color: var(--ink); background: var(--surface-2); }
.pw-eye:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.pw-eye[aria-pressed="true"] { color: var(--ink); }

/* ── Stromweg 2: ruhige Linien wie im Stromlaufplan, klare Ebenen, Fluss nur auf dem gewählten Weg ── */
.road.main { stroke-width: 6; }
.road.side { stroke: color-mix(in srgb, var(--ink-3) 75%, var(--surface)); stroke-width: 3; }
.road.lane { stroke: color-mix(in srgb, var(--ink-3) 55%, var(--surface)); stroke-width: 2; }
.road.alley, .road.drive { stroke: color-mix(in srgb, var(--ink-3) 40%, var(--surface)); stroke-width: 1.5; }
:root[data-theme="dark"] .road.main { stroke: #4a5050; }
:root[data-theme="dark"] .road.side { stroke: #3d4343; }
.road.main.nsbus { stroke-width: 4; }
.flow.side, .flow.lane, .flow.alley, .flow.drive { opacity: 0; }
.net.focus .road.on:not(.main) { stroke: var(--red); stroke-width: 3; }
.net.focus .flow.on { stroke-width: 1.6; }
/* Karten: Hauptebene kräftig, Abgänge leicht */
.st-card .bg { fill: var(--surface); stroke: var(--line-soft); }
.st-card.root .bg { stroke: color-mix(in srgb, var(--c, var(--ink-3)) 45%, var(--line)); stroke-width: 1.2; }
.st-card.root .mk { width: 4px; }
.st-card:not(.root) .nm { font-weight: 600; }
.st-card .sum { fill: var(--ink-2); font-family: var(--font); font-size: 11.5px; font-weight: 650; }
.st-card:hover .bg, .st-card.on .bg, .st-card:focus-visible .bg { stroke: var(--c); stroke-width: 2; }
.st-card:focus-visible { outline: none; }
/* Aufklapp-Pfeil */
.st-tog { cursor: pointer; outline: none; }
.st-tog .hit { fill: transparent; transition: fill .15s; }
.st-tog:hover .hit, .st-tog:focus-visible .hit { fill: var(--surface-2); }
.st-tog:focus-visible .hit { stroke: var(--red); stroke-width: 1.5; }
.st-tog .chev { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.st-tog:hover .chev { stroke: var(--ink); }
/* Aufklappen ohne neue Einflug-Animation aller Karten */
.net-svg.still .st-card { animation: none; }
@media (prefers-reduced-motion: reduce) { .st-card { animation: none; } .flow { animation: none !important; } }

/* Einflug kurz und gedeckelt (max. ~0,6 s für alle), weiche Abblendung beim Zeigen */
.st-card { animation-duration: .45s; animation-delay: calc(min(var(--i), 24) * 18ms + 60ms); transition: opacity .18s ease-out; }
.dot { animation-delay: calc(min(var(--i), 120) * 4ms + 80ms); }
.net-svg.still .dot { animation: none; }
.net.focus .st-card:not(.on) { opacity: .42; }
.road, .flow { transition: stroke .18s, opacity .18s; }

/* ── Personen: Rechte-Kennzeichen ───────────────────────────────────── */
.dialog .pill { display: inline-flex; align-items: center; height: 20px; padding: 0 .5rem; margin-left: .35rem; border-radius: 99px; font-size: .74rem; font-weight: 600;
  background: var(--surface-2); color: var(--ink-2); vertical-align: 1px; }
.dialog .pill.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }

/* v42: Änderungsverlauf – Hinweis oben und Liste */
.aend-pops {
  position: fixed; top: calc(var(--header-h) + 8px); right: clamp(12px, 3vw, 32px); z-index: 60;
  display: flex; flex-direction: column; width: min(360px, calc(100vw - 24px)); pointer-events: none;
}
.aend-pop {
  pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: .6rem;
  width: 100%; max-height: 180px; margin-bottom: .45rem; text-align: left; cursor: pointer;
  padding: .65rem .85rem .8rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: .88rem; line-height: 1.35; box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.14));
  animation: aend-rein .3s ease-out;
  transition: opacity .3s ease, transform .3s ease, max-height .4s ease, margin .4s ease, padding .4s ease, border-width .4s ease;
}
.aend-pop.aus { opacity: 0; transform: translateX(10px); }
.aend-pop.weg { max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; border-width: 0; }
.aend-pop:hover { border-color: var(--petrol); }
.aend-pop:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.aend-pop-text small { display: block; margin-top: .1rem; }
.aend-dot { width: 8px; height: 8px; margin-top: .4rem; border-radius: 50%; background: var(--red); flex-shrink: 0; }
.aend-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--red); opacity: .75;
  transform-origin: left center; animation: aend-lauf 10s linear forwards;
}
.aend-pop:hover .aend-bar, .aend-pop:focus-visible .aend-bar { animation-play-state: paused; }  /* Maus darauf = Zeit hält an */
@keyframes aend-lauf { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes aend-rein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .aend-pop { animation: none; transition: opacity .2s linear; }
  .aend-pop.aus { transform: none; }
}
.aend-dialog { width: min(680px, calc(100vw - 24px)); }
.aend-dialog .dialog-body { max-height: min(64vh, 640px); overflow: auto; }
.aend-liste { list-style: none; margin: 0; padding: 0; }
.aend-item { padding: .75rem 0; border-bottom: 1px solid var(--line-soft); }
.aend-item:last-child { border-bottom: 0; }
.aend-kopf { display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: baseline; font-size: .9rem; }
.aend-kopf a { color: var(--red-ink); font-weight: 600; }
.aend-was { display: flex; gap: .5rem; align-items: baseline; margin-top: .2rem; }
.aend-tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .05rem .4rem; border-radius: 5px; background: var(--petrol-soft); color: var(--ink); white-space: nowrap; }
.aend-tag[data-k="neu"] { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.aend-tag[data-k="gelöscht"] { background: var(--red-soft, #fde8ee); color: var(--red-ink); }
.aend-felder { margin: .35rem 0 0; border-collapse: collapse; font-size: .86rem; }
.aend-felder th { text-align: left; font-weight: 600; padding: .1rem .8rem .1rem 0; vertical-align: top; white-space: nowrap; opacity: .75; }
.aend-felder td { padding: .1rem 0; overflow-wrap: anywhere; }

/* ── v44 Mängel ──────────────────────────────────────────────────────── */
.mlist { display: grid; gap: .8rem; }
.mcard { padding: 1rem 1.2rem; display: grid; gap: .55rem; border-left: 4px solid var(--c, var(--line)); }
.mcard[data-d="sofort"] { --c: var(--err); }
.mcard[data-d="kurzfristig"] { --c: #e8a317; }
.mcard[data-d="geplant"] { --c: var(--t-uv); }
.mcard[data-k="erledigt"] { --c: var(--ok); }
.mcard[data-k="erledigt"] .mhead b { color: var(--ink-3); }
.mhead { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.mhead b { font-weight: 600; font-size: 1.02rem; }
.mdr { font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.mdr[data-d="sofort"] { --c: var(--err); }
.mdr[data-d="kurzfristig"] { --c: #a86400; }
.mdr[data-d="geplant"] { --c: var(--t-uv); }
:root[data-theme="dark"] .mdr[data-d="kurzfristig"] { --c: #ffbe5b; }
.mstat { margin-left: auto; font-size: .82rem; font-weight: 500; color: var(--ink-3); }
.mstat[data-k="in_arbeit"] { color: #a86400; }
:root[data-theme="dark"] .mstat[data-k="in_arbeit"] { color: #ffbe5b; }
.mstat[data-k="erledigt"] { color: var(--ok); }
.mtext { margin: 0; color: var(--ink-2); white-space: pre-line; }
.mmeta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.mmeta .err, .mrow .err { color: var(--err); font-weight: 500; }
.mfotos { display: flex; gap: .5rem; flex-wrap: wrap; }
.mfoto { position: relative; display: block; width: 104px; height: 78px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.mfoto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mfoto span { position: absolute; left: 4px; bottom: 4px; font-size: .66rem; font-weight: 600; padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .62); color: #fff; }
.mfoto[data-n="nachher"] { border: 2px solid var(--ok); }
.macts { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.mrow { display: grid; grid-template-columns: 10px 64px minmax(0, 1.6fr) auto minmax(0, .9fr) minmax(0, 1fr); align-items: center; gap: 1rem; padding: .75rem 1.2rem; border-bottom: 1px solid var(--line-soft); }
.mrow:last-of-type { border-bottom: 0; }
.mrow:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.mrow .mstat { margin-left: 0; }
.plan-facts .fact[data-k="m"] b, .dmeta .moffen { color: #ff5c8a; }
@media (max-width: 700px) {
  .mrow { grid-template-columns: 10px 56px minmax(0, 1fr) auto; }
  .mrow > :nth-child(5), .mrow > :nth-child(6) { grid-column: 3 / -1; }
}

/* ── v46 Lageplan ────────────────────────────────────────────────────── */
.lp-sel { width: auto; min-width: 240px; max-width: 100%; }
.lp-hint { color: var(--stage-ink-2); margin: .8rem 0 0; }
.lp-body { display: flex; gap: 1rem; align-items: flex-start; }
.lp-side { width: 250px; flex-shrink: 0; padding: 1rem; display: grid; gap: .4rem; max-height: 72vh; overflow: auto; position: sticky; top: calc(var(--header-h) + 12px); }
.lp-side p { margin: 0 0 .3rem; }
.lp-item { text-align: left; padding: .45rem .6rem; border-radius: 8px; font-size: .88rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.lp-item:hover { border-color: var(--ink-3); }
.lp-item[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.lp-scroll { flex: 1; min-width: 0; overflow: auto; max-height: 78vh; padding: 0; background: var(--surface-2); }
.lp-canvas { position: relative; min-width: 100%; }
.lp-canvas img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.lp-canvas.setzt, .lp-canvas.setzt .lp-pin { cursor: crosshair; }
.lp-pin { position: absolute; transform: translate(-9px, -50%); display: flex; align-items: center; gap: 4px; z-index: 1; touch-action: none; }
.lp-link { display: flex; align-items: center; gap: 4px; text-decoration: none; }
.lp-pin:hover, .lp-pin.hl { z-index: 2; }
.lp-dot { box-sizing: border-box; width: 18px; height: 18px; border-radius: 50%; background: var(--c, #8a9596); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); flex-shrink: 0; }
.lp-dot[data-k="ueber"] { --c: #d10040; }
.lp-dot[data-k="bald"] { --c: #e8a317; }
.lp-dot[data-k="ok"] { --c: #066b50; }
.lp-pin.m .lp-dot { border-color: #ff3d76; }
.lp-lbl { font-size: .74rem; font-weight: 600; color: #181919; background: rgba(255, 255, 255, .94); padding: 1px 6px; border-radius: 5px; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.lp-pin:hover .lp-lbl { background: #fff; color: #d10040; }
.lp-pin.hl .lp-dot { outline: 3px solid #ec0048; outline-offset: 2px; }
.lp-pin.edit { cursor: grab; }
.lp-x { width: 20px; height: 20px; border-radius: 50%; background: #d10040; color: #fff; font-size: .85rem; line-height: 1; display: grid; place-items: center; }
@media (max-width: 700px) {
  .lp-body { flex-direction: column; }
  .lp-side { width: 100%; position: static; max-height: none; }
}
.erinn-text { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; background: var(--surface-2); padding: .8rem 1rem; border-radius: 8px; max-height: 52vh; overflow: auto; margin: 0; }

/* ── v47 Prüfprotokoll ───────────────────────────────────────────────── */
.pp-sub { margin: .3rem 0 0; color: var(--stage-ink-2); }
.pp-stand { color: var(--stage-ink-2); font-size: .84rem; margin-right: .4rem; }
.pp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.pp-card { padding: 1.1rem 1.3rem 1.3rem; display: grid; gap: .8rem; align-content: start; }
.pp-card h2 { font-size: 1.05rem; font-weight: 600; margin: 0; }
.pp-voll { grid-column: 1 / -1; }
.pp-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.pp-checks { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.pp-wrap { flex-wrap: wrap; width: auto; }
.pp-punkte { display: grid; gap: .3rem; }
.pp-punkt { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .25rem 0; border-bottom: 1px solid var(--line-soft); font-size: .9rem; }
.pp-punkt:last-child { border-bottom: 0; }
.seg.sm button { height: 26px; padding: 0 .55rem; font-size: .78rem; }
.seg button.nio[aria-pressed="true"] { color: var(--err); }
.pp-pa { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem 1rem; font-size: .88rem; }
.pp-bem { width: 100%; font: inherit; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); resize: vertical; }
.pp-erg { display: flex; flex-wrap: wrap; gap: .6rem; }
.pp-tbl-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--r); }
.pp-tbl { border-collapse: separate; border-spacing: 0; font-size: .82rem; min-width: 1500px; width: 100%; }
.pp-tbl th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-weight: 600; font-size: .74rem; color: var(--ink-2); padding: .45rem .3rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pp-tbl td { padding: 2px; border-bottom: 1px solid var(--line-soft); }
.pp-tbl tr.folge td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.pp-tbl input { width: 100%; height: 30px; padding: 0 .35rem; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; }
.pp-tbl input:hover:not(:disabled) { border-color: var(--line); }
.pp-tbl input:focus { outline: none; border-color: var(--ink-3); background: var(--surface); box-shadow: var(--focus); }
.pp-tbl input.err { background: var(--red-soft); color: var(--err); font-weight: 600; border-color: color-mix(in srgb, var(--err) 45%, transparent); }
.pp-tbl input.warn { background: color-mix(in srgb, #e8a317 15%, transparent); border-color: color-mix(in srgb, #e8a317 50%, transparent); }
.pp-tbl .pp-l { width: 38px; text-align: center; color: var(--ink-3); }
.pp-tbl .pp-t { width: 64px; } .pp-tbl .pp-w { width: 210px; } .pp-tbl .pp-s { width: 62px; } .pp-tbl .pp-n { width: 58px; } .pp-tbl .pp-a { width: 84px; }
.pp-tbl .pp-a .row { flex-wrap: nowrap; gap: 2px; }
@media (max-width: 900px) { .pp-grid { grid-template-columns: minmax(0, 1fr); } .pp-pa { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── v48 Aushang-Link ───────────────────────────────────────────────── */
.dmeta .ah { display: inline-flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; font-weight: 500; }
.dmeta .ah a { color: #2fcf96; }
.dmeta .ah b { color: #ff5c8a; }
.ah-b { color: var(--stage-ink-2); text-decoration: underline; font-size: .85rem; }
.ah-b:hover { color: var(--stage-ink); }

/* v51: Ablageort der Prüfprotokolle */
.ablage { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin-top: .7rem; padding-top: .6rem; border-top: 1px solid var(--line-soft); }
.ablage code { font-family: var(--mono, ui-monospace, monospace); font-size: .82rem; padding: .1rem .4rem; border-radius: 6px; background: var(--petrol-soft); overflow-wrap: anywhere; }
.ablage-alle { margin: 0 0 .9rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }

/* v51: Standorte verwalten */
.standort-dialog { width: min(560px, calc(100vw - 24px)); }
.standort-dialog .dialog-body { max-height: min(70vh, 680px); overflow: auto; }
.standort-dialog textarea { width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); resize: vertical; }
.standort-liste { border: 1px solid var(--line-soft); border-radius: 10px; }
.standort-zeile { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: center; padding: .35rem .7rem; border-bottom: 1px solid var(--line-soft); }
.standort-zeile:last-child { border-bottom: 0; }
.error-text { color: var(--red-ink); }

/* v51: Instandhaltung – Status-Auswahl und Verlauf je Mangel */
.mstatus-wahl select { font: inherit; font-size: .85rem; min-height: 34px; padding: 0 .5rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.mstat[data-k="beauftragt"], .mstat[data-k="wartet"] { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.mverlauf { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line-soft); display: grid; gap: .5rem; }
.mkomm .input { flex: 1; min-width: 0; }
.mverlauf-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.mverlauf-liste li { display: grid; gap: .05rem; padding: .35rem .6rem; border-left: 3px solid var(--line); }
.mverlauf-liste li[data-art="kommentar"] { border-left-color: var(--petrol); background: var(--petrol-soft); border-radius: 0 8px 8px 0; }
.mverlauf-liste li[data-art="status"] { border-left-color: var(--red); }

/* v53: Wunsch / Fehler melden */
.fb-knopf { position: fixed; right: clamp(12px, 2.5vw, 28px); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 55;
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: 0 1rem; border-radius: 999px;
  border: 0; background: var(--red); color: #fff; font: inherit; font-weight: 650; font-size: .9rem; cursor: pointer; box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.18)); }
.fb-knopf:hover { background: var(--red-hover); }
.fb-knopf:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
@media (max-width: 560px) { .fb-knopf span { display: none; } .fb-knopf { width: 48px; height: 48px; padding: 0; justify-content: center; } }
.fb-eintrag { padding: .8rem 0; border-bottom: 1px solid var(--line-soft); }
.fb-eintrag.erledigt { opacity: .55; }
.fb-kopf { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.fb-text { white-space: pre-wrap; margin: .4rem 0; }
#fb-text { width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); resize: vertical; }
/* Was hängt dran? (nachgelagerte Verteilungen je Abgang) */
.dran-sum { display: flex; flex-wrap: wrap; gap: .6rem 2rem; margin: 0 0 1rem; }
.dran-sum > div { display: grid; }
.dran-sum b { font-size: 1.5rem; font-weight: 600; line-height: 1.15; }
.dran-sum span { font-size: .8rem; color: var(--ink-3); }
.dran-grp { overflow: hidden; }
.dran-grp + .dran-grp { margin-top: 10px; }
.dran-grp.fokus { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.dran-grp.dran-flash { animation: dranflash 2.4s ease-out; }
@keyframes dranflash { 0%, 30% { background: var(--red-soft); } 100% { background: var(--surface); } }
.dran-head { width: 100%; display: flex; align-items: center; gap: .7rem; padding: .75rem 1.2rem; text-align: left; min-width: 0; }
.dran-head:hover { background: var(--surface-2); }
.dran-head b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dran-head .muted { margin-left: auto; white-space: nowrap; }
.dran-head .chev, .dran-grp .chev { transition: transform .18s var(--ease-out); transform: rotate(-90deg); flex: none; }
.dran-head .chev.open { transform: none; }
.dran-sic, .dsic { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.dran-sic { padding: 1px 8px; border-radius: 6px; background: var(--surface-2); font-size: .82rem; }
.drow { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 9rem) 10.5rem; align-items: center; gap: 1rem; padding: .5rem 1.2rem; border-top: 1px solid var(--line-soft); }
.drow:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.dname { display: flex; align-items: center; gap: .6rem; min-width: 0; padding-left: calc(var(--d, 0) * 1.3rem); }
.dname .type { flex: none; }
.dsic { overflow: hidden; text-overflow: ellipsis; }
.dname a { font-weight: 500; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dname a:hover { color: var(--red-ink); text-decoration: underline; }
.dname .type { font-size: .76rem; }
.dtree { color: var(--ink-3); margin-right: -.3rem; }
.dloc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk { white-space: nowrap; color: var(--ink-2); }
.dran-act { display: inline-flex; align-items: center; gap: .35rem; margin-top: .35rem; padding: 2px 0; font-size: .82rem; font-weight: 500; color: var(--red-ink); justify-self: start; }
.dran-act:hover span { text-decoration: underline; }
a.rbadge.dran-badge { background: color-mix(in srgb, var(--t-hv) 14%, transparent); color: var(--t-hv); text-decoration: none; }
a.rbadge.dran-badge:hover { text-decoration: underline; }
@media (max-width: 760px) {
  .drow { grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .8rem; }
  .drow .dloc { grid-column: 1; grid-row: 2; }
  .drow .dsic { grid-column: 2; grid-row: 1; }
  .drow .dk { grid-column: 2; grid-row: 2; }
  .drow .dname { padding-left: calc(var(--d, 0) * .8rem); }
  .drow .dname .type { display: none; }
  .dran-head { flex-wrap: wrap; }
  .dran-head .muted { margin-left: 0; flex-basis: 100%; padding-left: 1.7rem; }
}

/* Datenqualität (Betrieb) */
.dqrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 2rem; align-items: center; gap: 1rem; padding: .75rem 1.2rem; border-bottom: 1px solid var(--line-soft); }
.dqrow:last-of-type { border-bottom: 0; }
.dqrow:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.dqtags { display: flex; flex-wrap: wrap; gap: .3rem; }
.dqtag { display: inline-flex; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); font-size: .78rem; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.dqtag:hover { color: var(--red-ink); text-decoration: underline; }
.dqtag[data-k="zuleitung"], .dqtag[data-k="pruefung"] { background: var(--red-soft); color: var(--err); }
.dqtag[data-k="standort"], .dqtag[data-k="plan"] { background: color-mix(in srgb, #e8a317 16%, transparent); color: #b06f00; }
:root[data-theme="dark"] .dqtag[data-k="standort"], :root[data-theme="dark"] .dqtag[data-k="plan"] { color: #ffbe5b; }
.dqn { text-align: right; font-weight: 600; color: var(--ink-3); }
@media (max-width: 760px) {
  .dqrow { grid-template-columns: minmax(0, 1fr) 2rem; gap: .4rem .8rem; }
  .dqrow .dqtags { grid-column: 1 / -1; grid-row: 2; }
}

/* v54: Mangel-Fotos – Auswahl mit Vorschau, Vorher/Nachher, Vorschaubild in der Liste */
.fotowahl { display: grid; gap: .5rem; padding: .7rem; margin-bottom: .6rem; border: 1px dashed var(--line); border-radius: 12px; background: var(--bg); }
.fotoknopf { min-height: 48px; cursor: pointer; }
.fotovorschau { display: flex; flex-wrap: wrap; gap: .4rem; }
.fv { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--line-soft); display: block; }
.fv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fv-weg { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.62); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }
.vn-raster { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: .5rem 0; }
.vn-raster > div { padding: .5rem; border-radius: 10px; background: var(--bg); }
.vn-raster small { display: block; font-weight: 650; margin-bottom: .35rem; }
.pflicht { font-size: .7rem; padding: .05rem .35rem; border-radius: 5px; background: var(--red-soft, #fde8ee); color: var(--red-ink); margin-left: .3rem; }
.mthumb { position: relative; width: 64px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--line-soft); display: block; }
.mthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mthumb img.nach { position: absolute; right: 0; top: 0; width: 50%; border-left: 2px solid var(--surface); }
.mthumb-leer { display: grid; place-items: center; height: 100%; color: var(--ink-2); opacity: .5; }
@media (max-width: 760px) { .vn-raster { grid-template-columns: 1fr; } }

/* v52: Werk wechseln (Kopfzeile) */
.werk-wahl { display: inline-flex; align-items: center; margin-left: .2rem; }
.werk-wahl select { height: 32px; max-width: 12rem; padding: 0 1.6rem 0 .6rem; border-radius: 9px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23aab4b6' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right .6rem center;
  color: var(--stage-ink, #f4f8f8); font: inherit; font-size: .84rem; font-weight: 650; cursor: pointer; -webkit-appearance: none; appearance: none; }
.werk-wahl select option { color: #181919; background: #fff; }
@media (max-width: 640px) { .werk-wahl select { max-width: 7.5rem; } }

/* v54: Lager (Ersatzteile) */
.lager-menu { display: none; text-decoration: none; }
@media (max-width: 600px) { .hbtn.lager-nav { display: none; } .lager-menu { display: flex; } }
.lager-tbl td { vertical-align: middle; }
.lager-kat { display: block; }
.lager-n { font-weight: 600; font-size: 1.02rem; }
.lager-n[data-k="unter"] { color: var(--err); }
.lager-badge { text-decoration: none; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.lager-badge[data-k="leer"] { background: var(--red-soft); color: var(--err); }
.lager-badge:hover { text-decoration: underline; }
.lager-h3 { font-size: 1rem; font-weight: 600; margin: 1.6rem 0 .6rem; }
.lager-daten { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem 1.4rem; padding: 1rem 1.2rem; }
.lager-daten small { display: block; font-size: .74rem; color: var(--ink-3); }
.lager-zeile { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: center; gap: .4rem 1rem; padding: .7rem 1.2rem; border-bottom: 1px solid var(--line-soft); }
.lager-zeile:last-of-type { border-bottom: 0; }
.lager-buchung { grid-template-columns: 6.5rem minmax(0, 1.5fr) minmax(0, 1.2fr) auto; }
.lager-art { font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); justify-self: start; }
.lager-art[data-k="entnahme"] { background: var(--red-soft); color: var(--err); }
.lager-art[data-k="zugang"] { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
@media (max-width: 760px) {
  table.cards td.col-art.lager-leer { display: none; }
  .lager-zeile, .lager-buchung { grid-template-columns: 1fr; padding: .7rem 1rem; }
}
/* Stornieren statt Löschen: stornierte Einträge grau, durchgestrichen, mit Grund */
.storniert { opacity: .62; }
.storniert .mhead b, .storniert .pname b, tr.storniert td.strong { text-decoration: line-through; text-decoration-thickness: 1px; }
.rbadge[data-k="storno"] { background: var(--line-soft); color: var(--ink-3); border: 1px dashed var(--line); }
.pdot[data-k="storno"] { background: none; box-shadow: inset 0 0 0 2px var(--line); opacity: .6; }
/* Sicherheitsrelevanter Mangel */
.sbadge { display: inline-block; margin-right: .4rem; padding: 1px 7px; border-radius: 99px; font-size: .72rem; font-weight: 700;
  background: var(--err); color: #fff; vertical-align: 1px; white-space: nowrap; text-decoration: none; }
.sicher-wahl { padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--r-sm); }
/* Sicherheitskennzeichnung der Verteilung: Warnfarbe Gelb/Schwarz, im Hell- und Dunkelmodus gleich */
.kbadge { display: inline-block; margin-left: .4rem; padding: 0 6px; border-radius: 99px; font-size: .68rem; font-weight: 700; line-height: 1.55;
  background: #ffbe00; color: #181919; vertical-align: 2px; white-space: nowrap; }
.kbadge[data-k="lichtbogen"], .kbadge[data-k="abdeckung_fehlt"] { background: var(--err); color: #fff; }
.kz-banner { display: flex; gap: .8rem; align-items: flex-start; margin: .7rem 0 .9rem; padding: .75rem 1rem; border-radius: var(--r);
  background: #ffbe00; color: #181919; border: 2px solid #181919; box-shadow: 0 0 0 2px #ffbe00; }
.kz-banner > .i { width: 26px; height: 26px; flex-shrink: 0; margin-top: .1rem; }
.kz-banner > div { flex: 1; min-width: 0; }
.kz-banner b { font-size: 1.05rem; }
.kz-banner ul { margin: .15rem 0 0; padding-left: 1.1rem; font-weight: 600; }
.kz-banner li { overflow-wrap: anywhere; }
.kz-banner .btn { background: #181919; color: #fff; border-color: #181919; flex-shrink: 0; }
/* ── Freischalten nach den 5 Sicherheitsregeln ──────────────────────── */
.fs-banner { display: flex; gap: .75rem; align-items: flex-start; margin: .2rem 0 1rem; padding: .8rem 1rem; border-radius: var(--r); text-decoration: none;
  color: #fff; background: #c4003c; border: 1px solid rgba(255, 255, 255, .18); box-shadow: 0 6px 20px -8px rgba(236, 0, 72, .6); }
.fs-banner .i { flex-shrink: 0; width: 22px; height: 22px; margin-top: 2px; }
.fs-banner > span { display: grid; gap: .1rem; min-width: 0; }
.fs-banner b { font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
.fs-banner small { opacity: .85; }
.fs-banner[data-k="laeuft"] { background: #9a4a00; box-shadow: none; }
.fs-banner[data-k="plan"] { background: rgba(255, 255, 255, .06); color: var(--stage-ink); box-shadow: none; }
.fs-banner[data-k="vor"] { background: rgba(232, 163, 23, .16); color: #ffd28a; border-color: rgba(232, 163, 23, .5); box-shadow: none; }
.fs-banner:hover { filter: brightness(1.08); }
.fs-marke { display: inline-block; margin-left: .45rem; padding: 0 .45rem; border-radius: 99px; font-size: .7rem; font-weight: 700; line-height: 1.6;
  vertical-align: middle; white-space: nowrap; background: var(--err); color: #fff; }
.fs-marke[data-k="vor"] { background: color-mix(in srgb, #e8a317 22%, transparent); color: #8a5200; }
:root[data-theme="dark"] .fs-marke[data-k="vor"] { color: #ffbe5b; }
.fs-card { padding: 1rem 1.2rem; display: grid; gap: .7rem; border-left: 4px solid var(--c, var(--line)); }
.fs-card[data-k="aktiv"] { --c: var(--err); }
.fs-card[data-k="vorbereitet"] { --c: #e8a317; }
.fs-st { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap;
  background: color-mix(in srgb, var(--c, var(--ink-3)) 14%, transparent); color: var(--c, var(--ink-3)); }
.fs-st[data-k="aktiv"] { --c: var(--err); }
.fs-st[data-k="vorbereitet"] { --c: #a86400; }
.fs-st[data-k="beendet"] { --c: var(--ok); }
:root[data-theme="dark"] .fs-st[data-k="vorbereitet"] { --c: #ffbe5b; }
.fs-regeln { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.fs-regeln li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: .7rem; align-items: start; padding: .55rem .7rem; border-radius: var(--r-sm); background: var(--surface-2); }
.fs-regeln li[data-k="offen"] { opacity: .6; }
.fs-regeln li[data-k="jetzt"] { background: var(--surface); outline: 2px solid #e8a317; }
.fs-nr { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: var(--surface-3); color: var(--ink-2); }
.fs-regeln li[data-k="ok"] .fs-nr { background: var(--ok); color: #fff; }
.fs-regeln li[data-k="jetzt"] .fs-nr { background: #e8a317; color: #1a1200; }
.fs-body { display: grid; gap: .2rem; min-width: 0; padding-top: .2rem; }
.fs-body b { font-weight: 600; }
.fs-eingabe { display: grid; gap: .6rem; margin-top: .3rem; }
.fs-eingabe p { margin: 0; }
.fs-link { margin-left: .5rem; font-size: .82rem; color: var(--red-ink); text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }
.fs-frei { display: flex; gap: .45rem; align-items: center; font-weight: 600; color: var(--err); }
.fs-betroffen { display: grid; gap: .35rem; }
.fs-betroffen small { font-weight: 600; color: var(--ink-2); }
.fs-chip { display: inline-flex; align-items: center; height: 28px; padding: 0 .7rem; border-radius: 99px; font-size: .82rem; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.fs-chip:hover { border-color: var(--red); color: var(--ink); }
.fs-h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .5rem; }
.fs-hist { padding: .7rem 1.2rem; border-bottom: 1px solid var(--line-soft); }
.fs-hist:last-child { border-bottom: 0; }
.fs-hist summary { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; cursor: pointer; }
.fs-hist[open] summary { margin-bottom: .5rem; }
.fs-hist .mmeta { margin-bottom: .5rem; }
.fs-zeile { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.2fr) auto minmax(0, .8fr); gap: 1rem; align-items: center;
  padding: .7rem 1.2rem; border-bottom: 1px solid var(--line-soft); color: inherit; text-decoration: none; }
.fs-zeile:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.fs-zeile b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .fs-zeile { grid-template-columns: auto 1fr; gap: .3rem .8rem; } .fs-zeile > :nth-child(n+3) { grid-column: 2; } }
/* ── Handy-Modus (bis 640 px oder Touch): html.handy wird in handyInit gesetzt; Desktop bleibt unverändert ── */
html.handy { --ctl: 44px; --ctl-sm: 44px; }
html.handy .hbtn { min-width: 44px; height: 44px; }
html.handy .tab { min-height: 48px; }
html.handy .input, html.handy .field input, html.handy .field select, html.handy .field textarea, html.handy .cell-input { min-height: 44px; font-size: 16px; }
html.handy .seg { height: auto; min-height: 44px; }
html.handy .hero { display: none; }
@media (max-width: 640px) {
  html.handy .header { gap: .3rem; padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); }
  html.handy .header a.hbtn[href="#/struktur"], html.handy .header a.hbtn[href="#/plan"], html.handy .header .pill { display: none; }
  html.handy .brand span { display: none; }
  html.handy .werk-wahl { min-width: 0; flex-shrink: 1; }
  html.handy .werk-wahl select { max-width: 38vw; text-overflow: ellipsis; }
}
.hstatus { position: sticky; top: var(--header-h); z-index: 39; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 6px 16px;
  background: color-mix(in srgb, var(--warn) 22%, var(--surface)); color: var(--ink); font-size: .88rem; font-weight: 600; }
.hstatus button { min-height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }

.hstart { padding: 20px 16px 8px; display: grid; gap: 14px; max-width: 720px; margin: 0 auto; }
.hstart-titel { font-size: 1.5rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.hsuche { position: relative; }
.hsuche .i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.hsuche input { width: 100%; height: 60px; padding: 0 16px 0 50px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 18px; }
.hsuche input:focus { outline: none; border-color: var(--red); }
.htreffer { display: grid; gap: 8px; }
.htreffer > button, .htreffer > a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.htreffer > button > span, .htreffer > a > span { display: grid; gap: 2px; min-width: 0; }
.htreffer b { font-weight: 650; overflow-wrap: anywhere; }
.htreffer small { color: var(--ink-3); font-size: .85rem; }
.htreffer .i { flex-shrink: 0; color: var(--ink-3); }
.hrow { display: flex; gap: 8px; flex-wrap: wrap; }
.hnr { display: flex; gap: 8px; flex: 1 1 220px; min-width: 0; }
.hnr input { flex: 1; min-width: 0; height: 52px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.hnr .btn, .hscan-knopf { height: 52px; }
.hscan-knopf { flex: 1 1 140px; }
.hchips { display: flex; flex-wrap: wrap; gap: 8px; }
.hzuletzt-titel { font-size: 1rem; font-weight: 650; margin-top: 6px; }

/* Aktionsleiste unten in der Verteilung */
.hbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; gap: 8px;
  padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .08);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.hbar button { flex: 1 1 0; min-width: 0; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; font-size: .84rem; font-weight: 650; line-height: 1.1; text-align: center; cursor: pointer; padding: 6px 4px; }
.hbar button.hb-mangel { background: var(--red); border-color: var(--red); color: #fff; }
.hbar button:active { transform: scale(.97); }
.hbar button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
body:has(nav.hbar:not([style*="display: none"])) .page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body:has(nav.hbar:not([style*="display: none"])) .fb-knopf { bottom: calc(92px + env(safe-area-inset-bottom)); }
body:has(nav.hbar:not([style*="display: none"])) .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
#komponenten tr.hk-mark, #komponenten tr.hk-mark td { background: color-mix(in srgb, var(--warn) 22%, var(--surface)); }
#komponenten tr.hk-mark { outline: 3px solid var(--warn); outline-offset: -3px; }

/* Stromkreis-Suche */
.hk { display: flex; flex-direction: column; max-height: min(86dvh, 760px); }
.hk-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-bottom: 8px; }
.hk-suche { padding: 4px 22px 10px; }
.hk-input { width: 100%; height: 52px; font-size: 18px; }
.hk-liste { overflow-y: auto; padding: 0 12px 16px; display: grid; gap: 6px; align-content: start; flex: 1; }
.hk-liste button { display: grid; grid-template-columns: minmax(3.5rem, auto) 1fr; column-gap: 12px; row-gap: 2px; align-items: baseline; min-height: 56px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.hk-liste button b { font-weight: 700; }
.hk-liste button span { overflow-wrap: anywhere; }
.hk-liste button small { grid-column: 2; }
.hk-liste p { padding: 8px 10px; }

.hnetz { padding: .6rem .8rem; border-radius: 10px; background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--ink); font-size: .9rem; font-weight: 600; }

.hscan video { width: 100%; aspect-ratio: 3 / 4; max-height: 70dvh; object-fit: cover; background: #000; display: block; border-radius: 18px 18px 0 0; }
.hscan-text { padding: 12px 22px 0; font-weight: 600; }

/* Formulare auf dem Handy: bildschirmfüllend, Knöpfe unten mit dem Daumen erreichbar */
@media (max-width: 640px) {
  .dialog-wrap { padding: 0; place-items: stretch; }
  .dialog-wrap .dialog { width: 100%; min-height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; display: flex; flex-direction: column;
    padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .dialog-wrap .dialog > .dialog-body { flex: 1 0 auto; }
  .dialog-wrap .dialog-foot { position: sticky; bottom: 0; z-index: 2; margin-top: auto; background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .dialog-wrap .dialog-foot .btn { flex: 1; height: 52px; font-size: 1rem; }
  .hk { max-height: 100dvh; }
  .hscan video { border-radius: 0; max-height: none; flex: 1; }
}

/* Werkwechsel: kurzer Ladehinweis statt Startanimation */
.werk-laedt { position: fixed; top: 4.2rem; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; gap: .55rem; align-items: center;
  padding: .55rem 1rem; border-radius: 999px; background: var(--surface, #fff); color: var(--ink, #181919); font-weight: 600; font-size: .9rem;
  box-shadow: 0 8px 28px -10px rgba(0, 0, 0, .35); border: 1px solid var(--line, rgba(0, 0, 0, .1)); }

/* v59: Werk wählen nach der Anmeldung */
.werkwahl-dlg { width: min(480px, 100%); }
.werkwahl-liste { display: grid; gap: .7rem; align-content: start; }
.werkwahl-knopf { display: flex; align-items: center; gap: .9rem; width: 100%; min-height: 64px; padding: .9rem 1.1rem; text-align: left;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s; }
.werkwahl-knopf:hover { border-color: var(--red); background: var(--red-soft); }
.werkwahl-knopf:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.werkwahl-knopf.vor { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.werkwahl-knopf .i { width: 26px; height: 26px; flex-shrink: 0; color: var(--red); }
.werkwahl-knopf .werkwahl-text { display: grid; gap: .15rem; flex: 1; min-width: 0; }
.werkwahl-knopf b { font-size: 1.1rem; font-weight: 600; }
.werkwahl-knopf small { color: var(--ink-3); font-size: .82rem; }
.werkwahl-knopf small:empty { display: none; }
.werkwahl-knopf:disabled { opacity: .6; cursor: wait; }

/* ── Lagebild (Startseite je Werk) ─────────────────────────────────── */
.lb-kopfzeile { padding-bottom: clamp(20px, 3vh, 32px); }
.lb-stand { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin-top: .5rem; color: var(--stage-ink-2); font-size: .92rem; }
.lb-neu { display: inline-flex; align-items: center; gap: .35rem; color: var(--stage-ink-2); font-size: .85rem; padding: .2rem .5rem; border-radius: var(--r-sm); }
.lb-neu:hover { color: var(--stage-ink); background: rgba(255, 255, 255, .06); }
.lb-neu:disabled { opacity: .6; cursor: default; }
.plan-facts .fact[data-ton="err"] b { color: #ff5c8a; }
.plan-facts .fact[data-ton="warn"] b { color: #ffbe5b; }
.plan-facts .fact[data-ton="ok"] b { color: #2fcf96; }
.lb-handy { margin-bottom: 16px; }
.lb-leer-werk { margin-bottom: 18px; }
.lb-laedt { display: flex; justify-content: center; padding: 48px 0; }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 18px; align-items: start; }
.lb-karte { display: flex; flex-direction: column; min-width: 0; scroll-margin-top: calc(var(--header-h) + 16px); }
.lb-karte[data-ton="err"] { box-shadow: inset 3px 0 0 var(--err), var(--shadow-sm); }
.lb-karte[data-ton="warn"] { box-shadow: inset 3px 0 0 var(--warn), var(--shadow-sm); }
.lb-khead { display: flex; align-items: center; gap: .6rem; padding: 14px 18px 10px; }
.lb-khead h2 { font-size: 1.05rem; font-weight: 650; flex: 1; min-width: 0; }
.lb-zahl { min-width: 2rem; height: 1.75rem; padding: 0 .55rem; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: .95rem; background: var(--surface-2); color: var(--ink-2); }
.lb-zahl[data-ton="err"] { background: var(--red-soft); color: var(--err); }
.lb-zahl[data-ton="warn"] { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.lb-zahl[data-ton="ok"] { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.lb-liste { list-style: none; border-top: 1px solid var(--line-soft); }
.lb-liste li + li { border-top: 1px solid var(--line-soft); }
.lb-eintrag { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .3rem .7rem;
  padding: 10px 18px; text-align: left; color: var(--ink); transition: background .12s; }
.lb-eintrag:not(:disabled):hover { background: var(--surface-2); }
.lb-eintrag:disabled { cursor: default; }
.lb-text { min-width: 0; display: flex; flex-direction: column; }
.lb-text b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-text small { color: var(--ink-3); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-marke { font-size: .76rem; font-weight: 600; padding: .15rem .5rem; border-radius: 99px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.lb-marke[data-ton="err"] { background: var(--red-soft); color: var(--err); }
.lb-marke[data-ton="warn"] { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.lb-marke[data-ton="ok"] { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.lb-pfeil { color: var(--ink-3); }
.lb-eintrag:hover .lb-pfeil { color: var(--red-ink); }
.lb-karte > .empty { padding: 18px 18px 22px; border-top: 1px solid var(--line-soft); }
.lb-kfuss { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding: 8px 10px 10px 18px; border-top: 1px solid var(--line-soft); margin-top: auto; }
@media (max-width: 560px) {
  .lb-eintrag { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 14px; }
  .lb-eintrag .lb-marke { grid-column: 1; grid-row: 2; justify-self: start; }
  .lb-eintrag .lb-pfeil { grid-row: 1 / span 2; grid-column: 2; }
  .lb-text b, .lb-text small { white-space: normal; }
  .lb-khead { padding: 12px 14px 8px; }
  .lb-kfuss { padding-left: 14px; }
}

/* Kopfleiste mit dem zusätzlichen Eintrag „Lagebild“: Marke nie überdecken, Suche früher nur als Symbol, Beschriftungen früher ausblenden */
.header .brand { flex-shrink: 0; }
@media (max-width: 1480px) {
  .header .hsearch span, .header .hsearch kbd { display: none; }
  .header .hsearch { width: 36px; padding: 0; justify-content: center; }
}
@media (max-width: 1200px) { .header .hide-sm { display: none; } }
@media (max-width: 1640px) { :root[data-schrift="gross"] .header .hsearch span, :root[data-schrift="gross"] .header .hsearch kbd { display: none; }
  :root[data-schrift="gross"] .header .hsearch { width: 40px; padding: 0; justify-content: center; } }
@media (max-width: 1440px) { :root[data-schrift="gross"] .header .hide-sm { display: none; } }

/* Handy: mit „Lagebild“ ein Knopf mehr in der Kopfleiste. Die Werkauswahl gibt Platz ab statt die Knöpfe zu überdecken. */
@media (max-width: 640px) {
  html.handy .header .werk-wahl { flex: 0 1 auto; overflow: hidden; margin-left: 0; }
  html.handy .header .werk-wahl select { width: 100%; min-width: 3.2rem; max-width: 34vw; }
  html.handy .header .hbtn { min-width: 40px; padding: 0 .3rem; }
}

/* ── Darstellung: größere Schrift (Menü „Schriftgröße“). Fast alles ist in rem, das folgt der Wurzelgröße. ── */
:root[data-schrift="gross"] { font-size: 112.5%; }
:root[data-schrift="gross"] body { font-size: 17px; }

/* Drucken bleibt hell, auch im dunklen Modus */
@media print {
  :root[data-theme="dark"] {
    --red-ink: #d10040; --red-soft: rgba(236, 0, 72, .09); --petrol-soft: #e3f3f5;
    --t-ms: #4f2f9e; --t-tr: #7d55c7; --t-sh: #00509b; --t-uv: #0b8f8d;
    --ok: #066b50; --warn: #965900; --err: #d10040;
    --bg: #ffffff; --surface: #ffffff; --surface-2: #eef4f5; --surface-3: #e3eced;
    --ink: #181919; --ink-2: #3c4040; --ink-3: #5e6363; --line: #d6e1e2; --line-soft: #e6eeef;
    --shadow-sm: none; --shadow-md: none; --shadow-lg: none;
    color-scheme: light;
  }
  :root[data-theme="dark"] body { background: #fff; color: #181919; }
}
/* v60: Import je Werk (Excel, CSV, EPLAN) */
.wimp-vorlage { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: .9rem; }
.wimp-vorlage .muted { flex: 1; min-width: 220px; }
.wimp-summe { display: flex; flex-wrap: wrap; gap: .5rem; margin: .2rem 0 .8rem; }
.wimp-summe > div { display: grid; gap: .1rem; padding: .55rem .85rem; border-radius: 12px; background: var(--surface-2); min-width: 120px; }
.wimp-summe b { font-size: 1.35rem; font-weight: 650; line-height: 1.1; }
.wimp-summe span { font-size: .8rem; color: var(--ink-3); }
.wimp-box { border: 1px solid var(--line); border-radius: 12px; padding: .55rem .8rem; margin-bottom: .7rem; }
.wimp-box > summary { cursor: pointer; }
.wimp-hinweise { margin: .5rem 0 .1rem; padding-left: 1.1rem; max-height: 22vh; overflow: auto; font-size: .86rem; display: grid; gap: .25rem; }
.wimp-hinweise li[data-art="warnung"]::marker { color: var(--warn); }
.wimp-blatt { padding: .7rem 0 .2rem; border-top: 1px solid var(--line); margin-top: .6rem; }
.wimp-spalten { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; margin-top: .55rem; }
.wimp-spalte { display: grid; gap: .25rem; padding: .45rem .55rem; border-radius: 10px; background: var(--surface-2); min-width: 0; }
.wimp-spalte > span { display: grid; min-width: 0; }
.wimp-spalte > span > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wimp-spalte.leer { opacity: .7; }
.wimp-sel { height: 32px; font-size: .84rem; padding: 0 .5rem; width: auto; }
.wimp-spalte .wimp-sel { width: 100%; }
.wimp-liste { display: grid; gap: .5rem; }
.wimp-vt { border: 1px solid var(--line); border-radius: 12px; padding: .55rem .7rem; }
.wimp-vt[data-modus="ueberspringen"] { opacity: .65; }
.wimp-vt-kopf { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.wimp-name { height: 34px; font-weight: 600; width: min(260px, 100%); }
.wimp-seg { margin-left: auto; }
.wimp-zahlen { display: flex; flex-wrap: wrap; gap: .3rem .9rem; width: 100%; text-align: left; font-size: .86rem; padding: .45rem .1rem .1rem; background: none; border: 0; cursor: pointer; color: var(--ink-2); }
.wimp-auf { margin-left: auto; color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }
.wimp-det { margin-top: .4rem; border-top: 1px solid var(--line); max-height: 36vh; overflow: auto; }
.wimp-zeile { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: .6rem; align-items: baseline; padding: .35rem .3rem; border-bottom: 1px solid var(--line); font-size: .85rem; }
.wimp-zeile:last-child { border-bottom: 0; }
.wimp-zeile[data-st="vorhanden"], .wimp-zeile[data-st="doppelt"], .wimp-zeile[data-st="uebersprungen"] { opacity: .55; }
.wimp-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .wimp-seg { margin-left: 0; } .wimp-zeile { grid-template-columns: 4.5rem minmax(0, 1fr); } .wimp-zeile > .small { display: none; } .wimp-txt { white-space: normal; } }
/* v60 Lager: Produktbild (lädt der Browser direkt beim Hersteller) */
.lager-bild { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.lager-bild img { width: 120px; height: 120px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: block; }
