/* ═══════════════════════════════════════════════════════════════════
   Railpedia – Oberfläche
   Farben aus dem Titelbild: Nachtblau → Königsblau → Leuchtblau → Cyan
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --night:   #010216;
  --deep:    #010d4f;
  --navy:    #01196b;
  --royal:   #012583;
  --blue:    #034cc5;
  --bright:  #0a6fe7;
  --cyan:    #39b5f8;
  --ice:     #bfe8ff;
  --white:   #ffffff;

  --bg:      #f4f7fd;
  --surface: #ffffff;
  --text:    #0b1433;
  --muted:   #5b6788;
  --line:    #dbe3f3;
  --ok:      #198754;
  --err:     #c62828;

  --radius:  12px;
  --shadow:  0 1px 2px rgba(1,13,79,.06), 0 6px 24px rgba(1,13,79,.08);
  --font:    'RP Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--bright); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
code, pre { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }

/* ── Marke ─────────────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--white); font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }
.brand b { color: var(--cyan); font-weight: 800; }

/* ── Kopfzeile ─────────────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 24px; background: linear-gradient(90deg, var(--night), var(--deep) 60%, var(--navy)); color: var(--ice); }
.topbar__nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar__nav a { color: var(--ice); font-weight: 600; }
.topbar__nav a.is-active { color: var(--white); border-bottom: 2px solid var(--cyan); }
.topbar__nav form { margin: 0; }
.topbar .muted { color: #9fb3e6; }
.topbar--landing { position: absolute; inset: 0 0 auto 0; z-index: 2; background: transparent; }
/* Burger-Menü im angemeldeten Bereich (unter 1100 px) */
.topbar__mobile { display: none; align-items: center; gap: 12px; }
.burger { position: relative; }
.burger__btn { list-style: none; cursor: pointer; width: 42px; height: 42px; border: 1px solid rgba(191,232,255,.45); border-radius: 12px; display: grid; place-content: center; gap: 5px; }
.burger__btn::-webkit-details-marker { display: none; }
.burger__btn span { display: block; width: 20px; height: 2px; background: var(--ice); border-radius: 2px; transition: transform .2s, opacity .2s; }
.burger[open] .burger__btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[open] .burger__btn span:nth-child(2) { opacity: 0; }
.burger[open] .burger__btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.burger__menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 50; width: min(86vw, 300px); display: grid; gap: 2px; padding: 10px;
  background: var(--deep); border: 1px solid rgba(191,232,255,.2); border-radius: 14px; box-shadow: 0 20px 50px rgba(1,2,22,.55); }
.burger__menu a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ice); font-weight: 600; }
.burger__menu a:hover, .burger__menu a.is-active { background: rgba(57,181,248,.15); color: var(--white); text-decoration: none; }
.burger__user { display: block; padding: 10px 12px 0; margin-top: 6px; border-top: 1px solid rgba(191,232,255,.2); color: #9fb3e6; font-size: .85rem; }
.burger__menu form { padding: 8px 12px; }
@media (max-width: 1100px) {
  .topbar--app { flex-wrap: nowrap; padding-top: 10px; padding-bottom: 10px; }
  .topbar--app > .topbar__nav { display: none; }
  .topbar--app .topbar__mobile { display: flex; }
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px;
  border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer;
  text-decoration: none; line-height: 1.2; transition: transform .08s, box-shadow .15s, background .15s; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(135deg, var(--bright), var(--blue)); color: var(--white); box-shadow: 0 4px 16px rgba(10,111,231,.35); }
.btn--primary:hover { box-shadow: 0 6px 22px rgba(57,181,248,.45); }
.btn--ghost { background: transparent; color: var(--bright); border-color: currentColor; }
.topbar .btn--ghost, .hero .btn--ghost { color: var(--ice); }
.btn--link { background: none; border: 0; padding: 4px 0; color: var(--bright); font-weight: 600; }
.btn--sm { padding: 6px 12px; font-size: .85rem; }

/* ── Titelbereich ──────────────────────────────────────────────────── */
.landing { background: var(--night); }
.hero { position: relative; min-height: 88vh; display: flex; align-items: center; padding: 120px 24px 80px;
  color: var(--white); background: var(--night) url(/assets/img/hero.webp) center / cover no-repeat; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(1,2,22,.15) 0%, rgba(1,2,22,.55) 45%, rgba(1,2,22,.85) 100%); }
.hero__text { position: relative; z-index: 1; max-width: 620px; margin-left: auto; margin-right: 6vw; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; }
.hero h1 em { font-style: normal; color: var(--cyan); text-shadow: 0 0 24px rgba(57,181,248,.6); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 700; color: var(--cyan); margin: 0 0 12px; }
.lead { font-size: 1.12rem; color: #d8e6ff; }
.hero .muted { color: #9fb3e6; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 18px 0; }
@media (max-width: 820px) {
  .hero { background-image: url(/assets/img/hero-960.webp); }
  .hero__text { margin: 0; }
  .hero::after { background: linear-gradient(180deg, rgba(1,2,22,.35), rgba(1,2,22,.85)); }
}

/* ── Abschnitte Startseite ─────────────────────────────────────────── */
.section { padding: 72px 24px; background: var(--bg); }
.section > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.section--alt { background: linear-gradient(180deg, var(--deep), var(--night)); color: var(--ice); }
.section--alt .section__title { color: var(--white); }
.section__title { font-size: 1.8rem; font-weight: 800; }
.section__lead { font-size: 1.08rem; color: var(--muted); }
.section--alt .section__lead { color: #b8c8ee; }
.section > .section__lead { max-width: 1180px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 28px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature__icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; margin-bottom: 10px;
  background: linear-gradient(135deg, var(--royal), var(--bright)); color: var(--white); font-size: 1.3rem; }
.feature p { margin: 0; color: var(--muted); }
.api-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; margin-top: 24px; }
.api-grid .card { background: rgba(255,255,255,.06); border-color: rgba(191,232,255,.18); color: var(--ice); box-shadow: none; }
.api-grid h3 { color: var(--white); }
.code-block { margin: 0; padding: 20px; border-radius: var(--radius); background: #000818; color: #bfe8ff;
  border: 1px solid rgba(57,181,248,.25); overflow: auto; }
ul.plain { list-style: none; padding: 0; margin: 0 0 16px; }
ul.plain li { padding: 4px 0; }
ul.plain code { color: var(--cyan); }
@media (max-width: 820px) { .api-grid { grid-template-columns: 1fr; } }

/* ── Fußzeile ──────────────────────────────────────────────────────── */
.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px 24px;
  background: var(--night); color: #8fa3d6; font-size: .9rem; }
.footer nav { display: flex; gap: 18px; }
.footer a { color: var(--ice); }

/* ── Karten, Formulare ─────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
.form { display: grid; gap: 14px; margin: 0 0 8px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcff; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: 1px; border-color: var(--bright); }
input.code { font-size: 1.4rem; letter-spacing: .3em; text-align: center; font-family: ui-monospace, Consolas, monospace; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
label.check input { width: auto; margin-top: 4px; }
label.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-weight: 500; cursor: pointer; }
label.choice:has(input:checked) { border-color: var(--bright); background: #eef5ff; }
label.choice input { width: auto; margin-top: 5px; }
.alert { padding: 10px 14px; border-radius: 8px; margin: 0 0 12px; }
.alert--info { background: #e7f2ff; color: #063a86; border: 1px solid #c4defe; }
.alert--error { background: #fdecea; color: var(--err); border: 1px solid #f5c2c0; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #e7eefc; color: var(--royal); font-size: .78rem; font-weight: 700; }
.badge--ok { background: #e3f4ea; color: var(--ok); }

/* ── Anmeldung ─────────────────────────────────────────────────────── */
.page-auth { min-height: 100vh; background: var(--night) url(/assets/img/hero-960.webp) center / cover fixed; }
.auth { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 32px 16px; }
.auth__card { width: min(460px, 92vw); margin: 0; }
.auth__back a { color: var(--ice); }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; font-size: .85rem; color: var(--muted); }
.steps li { display: flex; align-items: center; gap: 6px; }
.steps li + li::before { content: ''; width: 18px; height: 1px; background: var(--line); }
.steps span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); font-weight: 700; }
.steps .is-active { color: var(--text); font-weight: 700; }
.steps .is-active span { background: var(--bright); border-color: var(--bright); color: var(--white); }
.steps .is-done span { background: var(--ok); border-color: var(--ok); color: var(--white); }
.totp-setup { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 10px 0 16px; }
.totp-setup__qr { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
code.secret { display: inline-block; padding: 6px 10px; background: #eef3ff; border-radius: 6px; word-break: break-all; }
ul.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; list-style: none; padding: 12px; background: #f3f6fd; border-radius: 10px; }
.alt-methods { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.alt-methods form { margin: 0; }

/* ── Angemeldeter Bereich ──────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 18px; border-radius: var(--radius); color: var(--white); background: linear-gradient(135deg, var(--royal), var(--bright)); box-shadow: var(--shadow); }
.stat b { display: block; font-size: 2rem; line-height: 1; }
.stat span { color: var(--ice); }
.stat small { display: block; margin-top: 6px; font-size: .85rem; font-weight: 600; color: var(--ice); opacity: .9; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.actions-cell form { margin: 0; }
.setup-box { margin-top: 16px; padding: 16px; border: 1px dashed var(--bright); border-radius: 10px; background: #f6faff; }
.dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.tree, .tree ul { list-style: none; margin: 0; padding-left: 18px; }
.tree { padding-left: 0; }
.tree li { padding: 3px 0; }
.tree ul { border-left: 1px dashed var(--line); margin-left: 6px; }
.tree__name { font-weight: 600; }
.indent { display: inline-block; }
.indent--1 { width: 18px; } .indent--2 { width: 36px; } .indent--3 { width: 54px; } .indent--4 { width: 72px; }
.indent--5 { width: 90px; } .indent--6 { width: 108px; } .indent--7 { width: 126px; } .indent--8 { width: 144px; }

/* ── Rechtstexte ───────────────────────────────────────────────────── */
.wrap.legal { max-width: 820px; }
.wrap.legal h2 { margin-top: 1.6em; }
.legal-note { padding: 10px 14px; border-left: 3px solid var(--bright); background: #eef5ff; border-radius: 6px; }

/* ── Sprachwahl ────────────────────────────────────────────────────── */
.lang-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; border: 1px solid rgba(191,232,255,.35); }
.lang-switch a { padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: var(--ice); letter-spacing: .04em; }
.lang-switch a:hover { text-decoration: none; background: rgba(191,232,255,.12); }
.lang-switch a.is-active { background: var(--cyan); color: var(--night); }
.auth .lang-switch { margin-top: 4px; }

/* ── Hersteller ────────────────────────────────────────────────────── */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; flex: 1 1 420px; }
.toolbar input[type=search] { flex: 1 1 220px; width: auto; }
.toolbar select { width: auto; }
.table-scroll { overflow-x: auto; }
.table td.num, .table th.num { text-align: right; }
.logo-thumb { width: 72px; height: 36px; object-fit: contain; display: block; }
.logo-ph { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, var(--royal), var(--bright)); color: var(--white); font-weight: 800; font-size: .9rem; }
.mf-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.mf-head__logo { width: 160px; height: 80px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.mf-head h1 { margin: 0; }
.mf-head .muted { margin: 4px 0 0; }
.address { margin: 0; font-style: normal; }
.addr-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.addr { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.addr--old { opacity: .65; border-style: dashed; }
.addr h3 { font-size: .95rem; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.media { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 6px; align-content: start; }
.media img { width: 100%; height: 90px; object-fit: contain; background: #fff; }
.media .actions-cell { justify-content: flex-start; }
.badge--warn { background: #fff4d6; color: #8a5a00; }
.badge--err { background: #fdecea; color: var(--err); }
.restricted { border-color: #f0c36d; }
.restricted h2::after { content: ' 🔒'; font-size: .9em; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
textarea { min-height: 90px; resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; }

/* ── Sortierbare Tabellenköpfe ─────────────────────────────────────── */
.table th a.sort { color: inherit; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.table th a.sort:hover { color: var(--bright); text-decoration: none; }
.table th a.sort.is-active { color: var(--royal); }
.sort__arrow { font-size: .75em; opacity: .45; }
.sort.is-active .sort__arrow { opacity: 1; }

/* ── Geräte ────────────────────────────────────────────────────────── */
.wrap--wide { max-width: 1440px; }
a.stat:hover { text-decoration: none; box-shadow: 0 6px 22px rgba(57,181,248,.45); }
.prod-thumb { width: 64px; height: 48px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; display: block; }
.prod-hero { width: 220px; height: 150px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin: 0 0 18px; }
.tabs__tab { padding: 10px 16px; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 700; margin-bottom: -2px; border-bottom: 2px solid transparent; }
.tabs__tab:hover { text-decoration: none; color: var(--text); background: #eef3fd; }
.tabs__tab.is-active { color: var(--royal); border-bottom-color: var(--bright); background: var(--surface); }
.tabs__count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #e7eefc; color: var(--royal); font-size: .75rem; text-align: center; }
.media-grid--large { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.media-grid--large img { height: 200px; }
.drawing-large { display: block; max-width: 100%; max-height: 70vh; margin: 16px auto 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.inline-form { display: flex; gap: 6px; align-items: center; margin: 4px 0 0; }
.inline-form select { width: auto; padding: 4px 8px; font-size: .85rem; }
.dl--wide { grid-template-columns: 170px 1fr; }
.toolbar label.check { display: inline-flex; gap: 6px; align-items: center; }

/* ── Anschluss-Editor ──────────────────────────────────────────────── */
.ce-toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.ce-toolbar label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.ce-toolbar select { width: auto; max-width: 340px; }
.ce-main { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .ce-main { grid-template-columns: 1fr; } }
.ce-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.ce-pal { border-color: var(--c, var(--bright)); color: var(--text); }
.ce-pal::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c, var(--bright)); }
.ce-pal--knx::before { background: linear-gradient(90deg, #d62828 50%, #1b1b1b 50%); }
.ce-pal--pe::before { background: repeating-linear-gradient(45deg, #2e9b3e 0 3px, #f1c40f 3px 6px); }
.ce-stage { overflow: auto; background: repeating-conic-gradient(#f3f5fa 0% 25%, #fff 0% 50%) 50% / 16px 16px; min-height: 560px; display: flex; justify-content: center; align-items: flex-start; }
.ce-svg { touch-action: none; user-select: none; outline: none; box-shadow: 0 2px 14px rgba(1,13,79,.15); background: transparent; }
.ce-el { cursor: grab; }
.ce-el:active { cursor: grabbing; }
.ce-msg { margin-bottom: 12px; }
/* Anzeige auf der Geräteseite: Frontbild exakt unter dem SVG */

.ce-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ce-btns .btn, .ce-inline .btn { padding: 5px 10px; }
.ce-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.ce-inline label { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: .9rem; }
.ce-inline select { width: auto; }
.ce-num { width: 70px !important; }
.ce-props h3 { font-size: .9rem; margin: 12px 0 6px; color: var(--muted); }
.ce-table input, .ce-table select { padding: 4px 6px; font-size: .9rem; }
.ce-table tr.is-sel td { background: #eef5ff; }
.ce-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.ce-dot--knx { background: linear-gradient(90deg, #1b1b1b 50%, #d62828 50%); }
.ce-dot--l { background: #7a4a1e; } .ce-dot--n { background: #1e6fd0; } .ce-dot--out { background: #6b7280; } .ce-dot--rj45 { background: #e67e22; }
.ce-dot--pe { background: repeating-linear-gradient(45deg, #2e9b3e 0 3px, #f1c40f 3px 6px); }
.ce-pal--knx::before { background: linear-gradient(90deg, #1b1b1b 50%, #d62828 50%); }

/* Werkzeugleiste direkt über der Zeichnung */
.ce-tools { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px 14px; margin-bottom: 10px; position: sticky; top: 0; z-index: 3; }
.ce-group { display: inline-flex; gap: 4px; align-items: center; padding-right: 14px; border-right: 1px solid var(--line); }
.ce-group:last-of-type { border-right: 0; }
.ce-tool { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--royal); cursor: pointer; padding: 0; }
.ce-tool:hover:not(:disabled) { border-color: var(--bright); background: #eef5ff; }
.ce-tool:disabled { opacity: .35; cursor: default; }
.ce-tools select { width: auto; padding: 5px 6px; font-size: .85rem; }
.ce-tools .ce-num { width: 58px !important; padding: 5px 6px; }

/* Einzelansicht SVG/Bild: mittig, auf Fensterhöhe */
.svg-page { background: var(--bg); }
.svg-view { padding: 12px 16px 24px; }
.svg-view__bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; max-width: 1440px; margin: 0 auto 12px; }
.svg-view__stage { display: grid; place-items: center; min-height: calc(100vh - 170px); border-radius: var(--radius);
  background: repeating-conic-gradient(#eef1f7 0% 25%, #fff 0% 50%) 50% / 20px 20px; border: 1px solid var(--line); padding: 20px; }
.svg-view__stage img { max-height: calc(100vh - 220px); max-width: 100%; height: calc(100vh - 220px); width: auto; filter: drop-shadow(0 6px 18px rgba(1,13,79,.18)); }

.ce-dot--aux, .ce-pal--aux::before { background: linear-gradient(90deg, #f4f4f4 50%, #f1c40f 50%); outline: 1px solid #c3c9d5; }
.ce-dot--dcp { background: #c0392b; } .ce-dot--dcm { background: #222; } .ce-dot--dali { background: #8e44ad; } .ce-dot--rf { background: #3498db; border-radius: 50%; }

[hidden] { display: none !important; }

/* KNX: Kommunikationsobjekte */
.table-wrap { overflow-x: auto; }
.table--compact th, .table--compact td { padding: .3rem .5rem; font-size: .9rem; }
.table tr.is-current td { background: var(--accent-soft, #eef4ff); }

/* Logos prüfen */
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin: 1rem 0; }
.review-card { position: relative; margin: 0; border: 1px solid var(--line, #ddd); border-radius: 8px; padding: .75rem; background: var(--card, #fff); }
.review-card__pick { position: absolute; top: .5rem; left: .5rem; }
.review-card__pick input { width: 1.2rem; height: 1.2rem; }
.review-card__img { height: 110px; display: flex; align-items: center; justify-content: center; background:
  repeating-conic-gradient(#f2f2f2 0 25%, #fff 0 50%) 0 0 / 16px 16px; border-radius: 4px; margin-bottom: .5rem; }
.review-card__img img { max-width: 90%; max-height: 95px; object-fit: contain; }
.review-actions { position: sticky; bottom: 0; background: var(--bg, #fff); padding: .75rem 0; display: flex; gap: .5rem; }

/* Anschluss-Editor: neue Elemente */
.ce-dot--dc { background: radial-gradient(circle, #d4af37 20%, #0d0f12 22% 60%, #3b3f46 62%); border-radius: 50%; }
.ce-dot--c14, .ce-dot--c6 { background: #2b2f36; }
.ce-dot--euro { background: #e5e7eb; border: 1px solid #6b7280; border-radius: 5px; }
.ce-dot--psu { background: linear-gradient(135deg, #fff 45%, #111827 45% 55%, #fff 55%); border: 1px solid #111827; }
.ce-pal--dc::before { border-radius: 50%; }
.ce-toolbar .ce-num { width: 5.5em; }
.ce-pal--blind { --c: #0a6fe7; }
.ce-pal--blind::before { background: linear-gradient(90deg, #7a4a1e 33%, #6b7280 33% 66%, #9aa3b5 66%); }
.ce-table select[data-f=role] { min-width: 7em; }
.ce-dot--in { background: #0f766e; } .ce-dot--wire { background: linear-gradient(90deg, #f1c40f 75%, #c87533 75%); border-radius: 5px; }
.ce-pal--wire::before { background: linear-gradient(90deg, #f1c40f 70%, #c87533 70%); border-radius: 5px; }

/* Anschluss-Editor: Palette in Gruppen */
.ce-palette { display: block; }
.ce-group-box { border-top: 1px solid var(--line); padding: 6px 0; }
.ce-group-box:first-child { border-top: 0; }
.ce-group-box > summary { cursor: pointer; font-weight: 700; padding: 4px 0; list-style: revert; }
.ce-pal-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 4px; }
.ce-dot--term { background: #6b7280; border-radius: 1px; }
.ce-pal--term::before, .ce-pal--rf::before { background: var(--c); }
.ce-table select[data-f=fn] { max-width: 14em; }
/* Beschriftungen im Editor: weiße Kontur (wie in der SVG) */
.ce-svg .ce-label { paint-order: stroke; stroke: #fff; stroke-width: 0.45px; stroke-linejoin: round; }
/* Anschlusstabelle: eigene Reihenfolge */
.ce-sortbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ce-table td.ce-order { white-space: nowrap; }
.ce-grip { cursor: grab; color: var(--muted, #6b7280); padding-right: 4px; user-select: none; }
.ce-mv { border: 1px solid var(--line); background: #fff; border-radius: 4px; font-size: .7rem; line-height: 1; padding: 3px 4px; margin-left: 2px; cursor: pointer; }
.ce-mv:disabled { opacity: .3; cursor: default; }
.ce-table tr.is-drag td { opacity: .5; }

/* Anschlusszeichnung maßstäblich (4 px/mm), mittig – REG und freie Maße vergleichbar */
.conn-view { margin: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.conn-view svg { display: block; max-width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; }

/* Verteiler-Generator */
.alert--warn { background: #fff6e0; color: #7a4b00; border: 1px solid #f3d38b; }
.gen__preview { margin: 12px 0; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
.gen__preview svg { display: block; width: 100%; height: auto; max-height: 75vh; }
.table tr.is-match td { background: #eefaf2; }

/* Startseite auf dem Handy: Kopfzeile mit 7 Sprachen braucht Platz über dem Hero */
@media (max-width: 700px) {
  .topbar--landing .topbar__nav { gap: 10px 14px; }
  .lang-switch--site { order: 10; flex-basis: 100%; justify-content: space-between; max-width: 340px; }
  .hero { padding-top: 220px; align-items: flex-start; }
}

/* Hersteller: Geräte nach Kategorie */
#geraete { margin-top: 1.25rem; }
.mf-cat { margin: 1.1rem 0 .35rem; font-size: 1rem; }
.mf-prod { list-style: none; margin: 0; padding: 0; columns: 2 26rem; column-gap: 2rem; }
.mf-prod li { break-inside: avoid; padding: .3rem 0; border-bottom: 1px solid var(--line, #e6e9f0); }

.ce-elec { white-space: nowrap; }
.ce-elec .ce-num { width: 4.5em; }
.ce-range { white-space: nowrap; font-size: .85em; }
.ce-range select { padding: 1px 2px; }
/* Anschlusstabelle: technische Daten in eigener Zeile */
.ce-table tr.ce-sub td { border-top: 0; padding-top: 0; padding-bottom: 10px; }
.ce-tech { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; font-size: .82rem; color: var(--muted, #5b6474); }
.ce-tech label { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
.ce-tech label > span { display: inline-flex; align-items: center; gap: 4px; color: var(--ink, #111); }
.ce-tech select, .ce-tech input { padding: 2px 4px; font-size: .85rem; }
.ce-tech .ce-num { width: 5.5em; }
/* Anschlusstabelle: kompakte Hauptzeile + aufklappbare Details */
.ce-table td { vertical-align: middle; }
.ce-table .ce-art { white-space: nowrap; }
.ce-table input[data-f=label] { width: 100%; min-width: 8em; }
.ce-table .ce-sum { min-width: 12em; line-height: 1.35; }
.ce-table tr.is-open td { background: #eef5ff; }
.ce-open { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; color: var(--muted, #5b6474); }
.ce-table tr.is-open .ce-open { transform: rotate(180deg); color: #0a6fe7; border-color: #0a6fe7; }
.ce-table tr.ce-det td { background: #f6f9ff; border-top: 0; padding: 10px 12px 16px; }
.ce-det-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 20px; }
.ce-fld { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.ce-fld > span:first-child { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted, #5b6474); }
.ce-fld .ce-in { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .9rem; }
.ce-fld .ce-num { width: 6em; }
.ce-fld--ro .ce-in { color: var(--muted, #5b6474); }
.ce-dot--coil { background: #111; }
.wrap--full { max-width: none; padding-left: 24px; padding-right: 24px; }
.ce-dot--usba, .ce-dot--usbap, .ce-dot--usbb, .ce-dot--usbc, .ce-dot--usbmicro { background: #2563eb; }
.ce-dot--dsub9 { background: #475569; } .ce-dot--vga { background: #2563eb; } .ce-dot--hdmi { background: #7c3aed; }
/* Geräteliste: Tabellenkopf bleibt beim Scrollen stehen (auf breiten Bildschirmen ohne eigenen Scrollbereich) */
.prod-list thead th { position: sticky; top: 0; z-index: 2; background: var(--surface, #fff); box-shadow: 0 1px 0 var(--line, #dbe3f3); }
@media (min-width: 1000px) { .prod-list { overflow: visible; } }
.pl-count { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pl-per a { display: inline-block; padding: 2px 8px; margin-left: 4px; border-radius: 999px; border: 1px solid var(--line, #dbe3f3); text-decoration: none; }
.pl-per a.is-active { background: #0a6fe7; border-color: #0a6fe7; color: #fff; }
.ce-dot--rj11, .ce-dot--tae { background: #334155; }
.ce-dot--wifi { background: #0ea5e9; }
/* Verteiler: Ebenen-Ansicht (offen / Abdeckung / Tür) – Umschalten ohne JS */
.encl-stage { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.encl-stage .lay-r { position: absolute; opacity: 0; pointer-events: none; }
.encl-stage .lay-r:checked + label { background: #0a6fe7; color: #fff; border-color: #0a6fe7; }
.encl-imgs { flex-basis: 100%; margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.encl-imgs .lay { display: none; max-width: 100%; max-height: 70vh; margin: 0 auto; }
.encl-stage .lay-r0:checked ~ .encl-imgs .lay0, .encl-stage .lay-r1:checked ~ .encl-imgs .lay1, .encl-stage .lay-r2:checked ~ .encl-imgs .lay2 { display: block; }
.encl-layers .lay { display: inline-block; font-size: .72rem; padding: 1px 6px; margin: 1px; border-radius: 999px; border: 1px dashed var(--line); color: #9aa3b5; }
.encl-layers .lay.is-on { border-style: solid; border-color: #2e9b3e; color: #1f7a2e; background: #ecf8ee; }
/* Verteiler-Generator */
.fgen { display: grid; grid-template-columns: minmax(380px, 520px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .fgen { grid-template-columns: 1fr; } }
.fgen-zones td, .fgen-zones th { padding: 4px 6px; }
.fgen-zones select, .fgen-zones input { width: 100%; }
.fgen-zones .ce-num { width: 6em; }
.fgen .gen__preview svg { max-height: 75vh; }
.ce-dot--pb { background: #0f766e; border-radius: 50%; } .ce-dot--sw { background: #7c2d12; }
.fgen-arts { display: flex; flex-wrap: wrap; gap: 14px 40px; }
.fgen-arts .btn { margin: 6px 6px 0 0; }
.fgen-field { margin: 8px 0; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.fgen-field summary { cursor: pointer; }
.fgen-step { margin-bottom: 16px; }
.fgen-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.fgen-big { text-align: right; line-height: 1.1; color: #0b1433; }
.fgen-big strong { font-size: 2.6rem; font-weight: 800; color: #0a6fe7; margin-right: 4px; }
.fgen-big span { display: block; font-size: .8rem; }
.fgen-field label.small { display: inline-flex; gap: 8px; align-items: center; margin: 6px 0; }

/* 2026-10-29: Hilfe, Willkommen, Symbole, Kleinkram (statt Inline-Styles – CSP style-src 'self') */
.inline { display: inline; }
.mb-12 { margin-bottom: 12px; }
.welcome-box { border-left: 4px solid #3a6df0; }
.help-video { margin: 0 auto 1.75rem; max-width: 720px; text-align: center; }
.help-video video { display: block; box-sizing: border-box; width: 100%; max-width: 100%; height: auto; margin: .5rem auto 0; border-radius: 8px; background: #000; }
.sym { vertical-align: middle; margin-right: .4em; width: auto; }
.sym--sm { height: 1.6em; }
.sym--md { height: 2.2em; }
.sym--lg { height: 2.6em; margin-right: 0; }
.prod-thumb--symbol { opacity: .75; }
.ref-q { min-width: 320px; max-width: 100%; }

/* 2026-10-29: Profilbilder / Fotos Ansprechpartner */
.avatar { display: inline-block; border-radius: 50%; object-fit: cover; vertical-align: middle; background: #dfe6f3; color: #2a3a5c; font-weight: 600; text-align: center; }
.avatar--xs { width: 1.6em; height: 1.6em; line-height: 1.6em; font-size: .8em; }
.avatar--sm { width: 2em; height: 2em; line-height: 2em; font-size: .85em; }
.avatar--md { width: 3em; height: 3em; line-height: 3em; }
.avatar--lg { width: 6em; height: 6em; line-height: 6em; font-size: 1.4em; }
.avatar-edit { margin-bottom: 1rem; }
.avatar-edit .avatar { margin-right: .75rem; }
.topbar__me { display: inline-flex; align-items: center; gap: .4em; color: inherit; text-decoration: none; }

/* 2026-10-29: Kategorien-Übersicht zum Drucken / als PDF */
.cat-types a { display: inline-block; margin-right: .2em; }
.kd-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.kd-title h1 { margin-bottom: .25rem; }
.kd-top { margin: 1.5rem 0; }
.kd-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .6rem 0 .3rem; }
.kd-icon { height: 2em; width: auto; }
.kd-cat--d1 { margin-left: 1.25rem; }
.kd-cat--d2, .kd-cat--d3 { margin-left: 1.25rem; }
.kd-code { font-size: .75em; color: #667; }
.kd-bmk, .kd-n { font-size: .8em; color: #667; font-weight: 400; }
.kd-types { display: flex; flex-wrap: wrap; gap: .6rem; margin: .3rem 0 .6rem 2.5rem; }
.kd-type { margin: 0; width: 110px; text-align: center; border: 1px solid #e3e7ef; border-radius: 6px; padding: .4rem; break-inside: avoid; }
.kd-type img { height: 48px; width: auto; max-width: 100%; }
.kd-type figcaption { font-size: .75rem; line-height: 1.2; margin-top: .25rem; }
.kd-nosym { display: inline-block; height: 48px; line-height: 48px; color: #aab; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  .topbar, .no-print, .lang-switch { display: none !important; }
  body { background: #fff !important; }
  .wrap { max-width: none !important; padding: 0 !important; }
  .kd-top { break-before: page; margin: 0; }
  .kd-top:first-of-type { break-before: auto; }
  .kd-head { break-after: avoid; }
  a { color: inherit; text-decoration: none; }
}
.media--generated img { background: #f4f5f7; padding: 8px; }

/* Personen: Kopfzeile mit Aktion rechts, kleine Kennzahlen, Online-Zeiten (2026-10-29) */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin-right: auto; }
.stats--small .stat { padding: 12px 14px; }
.stats--small .stat b { font-size: 1.35rem; }
.timeline-wrap { overflow-x: auto; margin: 6px 0 4px; }
.timeline { display: block; width: 100%; min-width: 640px; height: auto; font-family: inherit; }

