:root {
  /* Akzentfarben aus dem DMD2-CD (basic_CD_DMD2_1a): Gold = Verlauf #FFF2BA → #847063 (Stopp #C2B28F),
     ok = health #507B84/#BFDCDF, Warnung = media #E2DE00, Fehler = hospitality #761233 (aufgehellt für dunkel).
     Grundflächen: Charcoal #1F232B, Slate #313844, Warm Light #F5F3EE, Soft Stone #DDD6C8 */
  --bg: #181B21; --panel: #1F232B; --panel2: #272C35; --line: #313844;
  --text: #F0EEE9; --muted: #9EA3AC; --gold: #C2B28F; --gold2: #E5D7A8; --gold-bg: #C2B28F;
  --ok: #A5C9CD; --bad: #E07A93; --warn: #E2DE00;
  --head: #15181D; --bar: #1A1D23; --tint: rgba(255,255,255,.04); --tint2: rgba(255,255,255,.015);
  --r: 10px; color-scheme: dark;
}
/* Heller Modus: Gold als Schrift dunkler (lesbar auf Weiss), als Fläche wie gehabt */
:root[data-theme="light"] {
  --bg: #F5F3EE; --panel: #ffffff; --panel2: #F1EEE7; --line: #DDD6C8;
  --text: #1F232B; --muted: #5E6470; --gold: #74625A; --gold2: #5E4E45; --gold-bg: #C2B28F;
  --ok: #507B84; --bad: #761233; --warn: #7D7800;
  --head: #ffffff; --bar: #ffffff; --tint: rgba(0,0,0,.035); --tint2: rgba(0,0,0,.02);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Schrift wächst mit dem Bildschirm: Handy 15 px, Laptop ~16 px, grosser Monitor bis 18 px */
  font-size: clamp(15px, calc(11px + .35vw), 18px); }
a { color: var(--gold); }
h1, h2, h3 { margin: 0 0 .6em; font-weight: 600; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; color: var(--gold); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: .5em .7em; width: 100%;
}
input[type=checkbox] { width: auto; }
input[type=range] { padding: 0; accent-color: var(--gold); }
label { display: block; color: var(--muted); font-size: .85rem; margin: .6em 0 .25em; }
.btn {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: .45em .9em; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--gold); }
.btn.primary { background: var(--gold-bg); color: #111; border-color: var(--gold-bg); font-weight: 600; }
.btn.primary:hover { background: var(--gold2); }
.btn.danger { color: var(--bad); }
.btn.small { padding: .25em .6em; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: .5em; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, Menlo, monospace; }

/* Kopfzeile */
header {
  display: flex; align-items: center; gap: 1em; padding: .7em clamp(1.2em, 2vw, 2.4em);
  border-bottom: 1px solid var(--line); background: var(--head); position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.brand > span.logo-one { color: inherit; }
header select { width: auto; max-width: 14em; }
nav { display: flex; gap: .3em; padding: .6em clamp(1.2em, 2vw, 2.4em); border-bottom: 1px solid var(--line); overflow-x: auto; }
nav .btn { border-color: transparent; background: none; }
nav .btn.active { color: var(--gold); border-color: var(--gold); }
main { padding: 1.4em clamp(1.2em, 2vw, 2.4em); }

/* Login */
.login { max-width: 340px; margin: 12vh auto; background: var(--panel);
  padding: 2em; border-radius: var(--r); border: 1px solid var(--line); }
.login .brand { font-size: 1.4rem; margin-bottom: 1em; text-align: center; }

/* Karten */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1em; margin-bottom: 1em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19em, 100%), 1fr)); gap: 1em; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1em;
  display: flex; flex-direction: column; gap: .5em; }
.card .name { font-weight: 600; font-size: 1.05rem; }
.dot { display: inline-block; width: .65em; height: .65em; border-radius: 50%; background: var(--bad); margin-right: .4em; }
.dot.on { background: var(--ok); }
.badge { font-size: .75rem; padding: .1em .5em; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.badge.play { color: var(--ok); border-color: var(--ok); }
.badge.err { color: var(--bad); border-color: var(--bad); }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.now { min-height: 2.6em; }
.now .ch { color: var(--gold); }
.allbar { display: flex; gap: .5em; flex-wrap: wrap; align-items: center; margin-bottom: 1em; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5em .4em; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: .85rem; }

/* Dialog */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex;
  align-items: flex-start; justify-content: center; padding: 5vh 1em; z-index: 20; overflow-y: auto; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  width: 100%; max-width: 37em; padding: 1.2em; }
.modal .head { display: flex; align-items: center; margin-bottom: .8em; }
.modal .head h2 { margin: 0; flex: 1; }
.list { display: flex; flex-direction: column; gap: .3em; max-height: 55vh; overflow-y: auto; }
.item { display: flex; align-items: center; gap: .7em; padding: .5em .6em; border-radius: 8px;
  background: var(--panel2); cursor: pointer; border: 1px solid transparent; }
.item:hover { border-color: var(--gold); }
.item img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; background: var(--panel2); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .2em 1em; font-size: .9rem; }
.kv div:nth-child(odd) { color: var(--muted); }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 1.4rem; color: var(--gold); letter-spacing: .08em; }
.days label { display: inline-flex; gap: .25em; align-items: center; margin-right: .6em; color: var(--text); }

.listenbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; gap: .8em; align-items: center;
  padding: .7em 1.2em; background: var(--bar); border-top: 1px solid var(--gold); }
.listenbar audio { height: 36px; max-width: 45vw; }
body:has(.listenbar) main { padding-bottom: 6em; }
.toast { position: fixed; bottom: 1.2em; left: 50%; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--gold); padding: .6em 1.1em; border-radius: 8px; z-index: 30; }
.toast.err { border-color: var(--bad); }

@media (max-width: 640px) {
  header { flex-wrap: wrap; padding: .6em .8em; }
  main { padding: .8em; }
  .grid { grid-template-columns: 1fr; }
  .hide-mobile { display: none; }
}

/* Ladeanzeige */
body.busy { cursor: progress; }
body.busy::before { content: ""; position: fixed; top: 0; left: 0; height: 3px; width: 40%; z-index: 1000;
  background: var(--gold-bg); animation: busybar 1s ease-in-out infinite; }
@keyframes busybar { 0% { left: -40%; } 100% { left: 100%; } }
body.blocking .modal button, body.blocking main button, body.blocking nav button { pointer-events: none; }
body.blocking.busy .modal button, body.blocking.busy main button { opacity: .7; }

/* Uhr in der Kopfzeile */
.clockbox { text-align: center; }
.clock { font-variant-numeric: tabular-nums; font-size: 1.05rem; letter-spacing: .04em; color: var(--text); }

/* Ein/Aus-Schalter */
.switch { display: inline-flex; align-items: center; gap: .6em; cursor: pointer; user-select: none; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: relative; width: 2.6em; height: 1.45em; flex: none; border-radius: 99px;
  background: var(--panel2); border: 1px solid var(--line); transition: background .15s, border-color .15s; }
.switch .slider::after { content: ""; position: absolute; top: .14em; left: .16em; width: 1.05em; height: 1.05em;
  border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + .slider { background: var(--gold-bg); border-color: var(--gold-bg); }
.switch input:checked + .slider::after { transform: translateX(1.12em); background: #111; }
.switch input:focus-visible + .slider { outline: 2px solid var(--gold2); outline-offset: 2px; }
.switch-label { color: var(--text); }
tr.inactive td:not(:first-child) { opacity: .45; }

/* Logo */
.brand .logo { width: 28px; height: 28px; margin-right: .5em; vertical-align: middle; position: relative; top: -2px; }
.login-logo { display: block; width: 84px; height: 84px; margin: 0 auto .6em; }

/* Play/Stop-Knopf zeigt den aktuellen Zustand */
.btn.on { color: var(--gold); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.card:has(.dot:not(.on)) .now { opacity: .55; }

/* Player-Details: Reiter */
.tabs { display: flex; gap: .35em; overflow-x: auto; padding-bottom: .5em; margin-bottom: .8em;
  border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs .btn { white-space: nowrap; flex: none; }
.tabs .btn.active { color: var(--gold); border-color: var(--gold); }
.tabbody { min-height: 12em; }
.notice { border: 1px solid var(--warn); color: var(--warn); border-radius: 8px; padding: .6em .8em;
  margin-bottom: 1em; font-size: .9rem; display: flex; flex-direction: column; gap: .3em; }
.field { margin-bottom: .9em; }
.field label { margin-top: 0; }
.field .muted.small { margin-top: .3em; }
.kv div:nth-child(even) { overflow-wrap: anywhere; }
table.compact td, table.compact th { padding: .4em .3em; font-size: .88rem; }
.modal .head h2 .dot { margin-right: .45em; vertical-align: middle; }
.panel { overflow-x: auto; }

/* Handy hochkant */
@media (max-width: 640px) {
  .backdrop { padding: .6em .4em; }
  .modal { padding: .9em; }
  .modal .head h2 { font-size: 1.1rem; }
  .kv { grid-template-columns: minmax(7em, max-content) 1fr; font-size: .88rem; }
  .card .row .btn { padding-left: .8em; padding-right: .8em; }
  header select { max-width: 9em; }
  .clockbox { order: 3; flex-basis: 100%; text-align: left; font-size: .95rem; }
  .listenbar { flex-wrap: wrap; padding: .6em .8em; }
  .listenbar audio { max-width: 100%; flex: 1 1 100%; order: 3; }
  th, td { padding: .45em .3em; }
  .allbar select { max-width: 100%; }
}

/* Handy hochkant: Tabellen als gestapelte Karten, Navigation umbrechen */
@media (max-width: 640px) {
  header { row-gap: .5em; }
  header .brand { order: 1; }
  .clockbox { order: 2; flex: 1 1 auto; flex-basis: auto; text-align: right; font-size: .95rem; }
  header > .row { order: 3; flex-basis: 100%; }
  nav { flex-wrap: wrap; overflow-x: visible; padding: .5em .8em; }
  nav .btn { padding: .35em .7em; font-size: .92rem; }
  .tabs { flex-wrap: wrap; overflow-x: visible; }
  table.stack, table.stack tbody { display: block; }
  table.stack tr { display: flex; flex-wrap: wrap; align-items: center; gap: .3em .8em;
    padding: .6em 0; border-bottom: 1px solid var(--line); }
  table.stack tr:has(th) { display: none; }
  table.stack td { display: block; border: 0; padding: 0; }
  table.stack td:last-child { flex-basis: 100%; }
  table.stack td:last-child .row { justify-content: flex-start !important; }
  table.stack td[style*="text-align:right"] { text-align: left !important; }
  .modal select, main select { max-width: 100%; }
}

/* Synchrone Gruppe als Block */
.syncgroup { border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--gold) 5%, transparent);
  border-radius: calc(var(--r) + 4px); padding: .9em; margin-bottom: 1.2em; }
.sghead { display: flex; gap: .8em; align-items: center; flex-wrap: wrap; margin-bottom: .8em; }
.sgname { font-weight: 600; color: var(--gold); font-size: 1.05rem; }
.syncgroup .card { background: var(--panel); }
.chip { display: inline-block; padding: 0 .5em; border: 1px solid var(--gold); border-radius: 99px;
  font-size: .78rem; line-height: 1.5; }
@media (max-width: 640px) { .syncgroup { padding: .6em; } }

/* Wochenpläne (Etappe 1: Liste pro Tag) */
.planweek { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5em; }
.planday { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: .5em; min-height: 6em; }
.planday .btn.small { padding: .1em .45em; }
.planitem { border-radius: 6px; padding: .3em .4em; margin-top: .35em; font-size: .85em; cursor: pointer; border-left: 3px solid var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.planitem.event { border-left-color: var(--muted); background: var(--tint); }
.planitem.series { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.planitem:hover { filter: brightness(1.25); }
.planline { margin-top: .2em; }
@media (max-width: 900px) { .planweek { grid-template-columns: 1fr; } .planday { min-height: 0; } }

/* Wochenraster (Etappe 2) */
.wg { user-select: none; -webkit-user-select: none; }
.wg-palette { display: flex; flex-wrap: wrap; gap: .4em; align-items: center; margin-bottom: .8em; }
.chipbtn { display: inline-flex; align-items: center; gap: .4em; padding: .3em .7em; border-radius: 999px; cursor: pointer;
  background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); color: var(--text); }
.chipbtn.sel { border: 2px solid var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent); font-weight: 600; }
.chipbtn img { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; }
.chipbtn .sw { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.wg-head, .wg-body { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); gap: 0 5px; }
.wg-dayname { display: flex; align-items: center; gap: .3em; padding: 0 .2em .4em; font-weight: 600; min-height: 2em; }
.wg-dayname .btn.small { padding: .05em .45em; font-weight: 400; }
.wg-scroll { border-top: 1px solid var(--line); }
.wg-head { position: sticky; top: var(--wg-top, 0); z-index: 3; background: var(--panel); padding-top: .4em; }
.panel:has(.wg) { overflow: visible; }
.wg-axis { position: relative; }
.wg-hour { position: absolute; right: 6px; transform: translateY(-50%); font-size: .75em; color: var(--muted); }
.wg-hour:first-child { transform: none; }
.wg-day { position: relative; background: var(--panel2);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 48px); }
.wg-day.today { outline: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
.wg-lane { position: absolute; top: 0; bottom: 0; }
.wg-lane.music { left: 0; right: 24%; }
.wg-lane.extra { right: 0; width: 22%; border-left: 1px dashed var(--line); background: var(--tint2); }
.wg-lane.music.editable { cursor: crosshair; }
.wg-lane.extra.editable { cursor: copy; }
.wg-block, .wg-series, .wg-ghost { position: absolute; left: 3px; right: 3px; border-radius: 7px; overflow: hidden; line-height: 1.25; }
.wg-block { --c: var(--gold); background: color-mix(in srgb, var(--c) 28%, var(--panel2)); border: 1px solid var(--c);
  border-left-width: 4px; color: var(--text); padding: 4px 6px; cursor: grab; font-size: .85em; touch-action: none; }
.wg-block.drag { cursor: grabbing; z-index: 4; box-shadow: 0 4px 14px rgba(0,0,0,.5); opacity: .92; }
.wg-block .wg-t { font-weight: 600; display: flex; align-items: center; gap: .35em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-block .wg-t img { width: 22px; height: 22px; border-radius: 4px; object-fit: cover; flex: none; }
.wg-block .wg-s { color: var(--muted); font-size: .9em; margin-top: 1px; }
.wg-grip { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; cursor: ns-resize; }
.wg-grip.top { top: 0; bottom: auto; }
.wg-grip:not(.top)::after { content: ""; position: absolute; left: 38%; right: 38%; bottom: 3px; height: 3px; border-radius: 2px; background: var(--c); opacity: .8; }
.wg-series { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--warn) 28%, transparent) 0 6px, color-mix(in srgb, var(--warn) 10%, transparent) 6px 12px); border: 1px solid var(--warn); cursor: pointer; padding: 3px; font-size: .78em; }
.wg-series .wg-t { white-space: nowrap; }
.wg-pin { position: absolute; right: 2px; padding: 0 6px; height: 20px; border-radius: 0 10px 10px 10px; border-top: 2px solid var(--gold); background: var(--panel); border: 1px solid var(--muted); font-size: .74em; line-height: 18px; white-space: nowrap; cursor: pointer; z-index: 2; }
.wg-hint { position: absolute; right: 2px; padding: 0 6px; height: 20px; border-radius: 0 10px 10px 10px; border: 1px dashed var(--gold); color: var(--gold); font-size: .74em; line-height: 18px; white-space: nowrap; pointer-events: none; z-index: 1; }
.wg-ghost { --c: var(--gold); background: color-mix(in srgb, var(--c) 35%, transparent); border: 1px dashed var(--c); padding: 4px 6px; pointer-events: none; font-size: .85em; }
.wg-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--bad); z-index: 3; pointer-events: none; }
.wg.ro { opacity: .55; }
.wg.ro .wg-block, .wg.ro .wg-series, .wg.ro .wg-pin { cursor: default; }
.wg-block:hover, .wg-series:hover, .wg-pin:hover { filter: brightness(1.15); }
.chipbtn .x { margin-left: .2em; padding: 0 .3em; border-radius: 50%; color: var(--muted); }
.chipbtn .x:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, transparent); }
.langsw { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.langsw button { border: 0; background: transparent; color: var(--muted); padding: .25em .6em; font-size: .8rem; cursor: pointer; }
.langsw button.on { background: var(--gold-bg); color: #111; font-weight: 600; }
.themebtn { padding: .25em .55em; line-height: 1; }
.planpaused { border-color: var(--warn); }
.planbox-paused .wg { opacity: .45; }
nav .setupbtn { margin-left: auto; white-space: nowrap; }
nav .adminbtn { white-space: nowrap; color: var(--muted); }
nav .adminbtn.active { color: var(--gold); }
.fleet td { vertical-align: middle; }
.fleet select { padding: .25em .4em; font-size: .9em; }
nav .helpbtn { color: var(--gold); white-space: nowrap; }
.subnav { display: flex; gap: .4em; flex-wrap: wrap; margin-bottom: 1.1em; padding-bottom: .8em; border-bottom: 1px solid var(--line); }
.subnav .btn { background: none; }
.subnav .btn.active { color: var(--gold); border-color: var(--gold); }
.allbar .addplayer { margin-left: auto; }
ol.steps { padding-left: 1.3em; line-height: 1.55; }
ol.steps li { margin: .35em 0; }
.modal.wide { max-width: 58em; }
.help > p { color: var(--muted); font-size: 1.05rem; margin: 0 0 1.1em; }
.help-card { display: flex; gap: 1.2em; align-items: flex-start; background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1em 1.1em; margin-bottom: .9em; }
.help-ill { flex: none; width: 200px; height: 120px; border-radius: 8px; background: #151515; display: flex; align-items: center; justify-content: center; }
.help-body { flex: 1; min-width: 0; }
.help-body h3 { margin: .1em 0 .45em; color: var(--gold2); font-size: 1.08rem; }
.help-body p, .help-body li { color: var(--text); line-height: 1.55; }
.help-body p { margin: 0 0 .5em; }
.help-body ol, .help-body ul { margin: .2em 0 .5em; padding-left: 1.3em; }
.help-body li { margin: .3em 0; }
.help-tip { margin-top: .5em; padding: .5em .7em; border-radius: 8px; background: color-mix(in srgb, var(--gold) 8%, transparent); border-left: 3px solid var(--gold);
  color: var(--text); font-size: .93rem; line-height: 1.5; }
@media (max-width: 640px) {
  .help-card { flex-direction: column; }
  .help-ill { width: 100%; }
}
details.mgroup { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 1em; background: var(--panel); }
details.mgroup > summary { cursor: pointer; padding: .7em 1em; list-style: none; display: flex; align-items: baseline; gap: .3em; }
details.mgroup > summary::before { content: "▸"; color: var(--gold); margin-right: .4em; transition: transform .15s; }
details.mgroup[open] > summary::before { transform: rotate(90deg); }
details.mgroup > summary::-webkit-details-marker { display: none; }
details.mgroup .mgname { font-weight: 600; }
details.mgroup > .grid, details.mgroup > .syncgroup { margin: 0 1em 1em; }
.cardhead { flex-wrap: nowrap; }
.cardhead { align-items: flex-start; }
.cardhead .name { min-width: 0; overflow: hidden; white-space: nowrap; overflow-wrap: anywhere; line-height: 1.3; }  /* Name auf einer Zeile, Schrift passt sich an (fitName) */
.badge.icon { font-size: .85rem; min-width: 1.9em; text-align: center; padding: .05em .45em; }
.cardhead .badge, .cardhead .btn { flex: none; white-space: nowrap; }

/* Netzwerkkarte */
svg.netmap { width: 100%; max-width: 680px; height: auto; display: block; margin: .4em auto 1em; }

/* Uhr wie auf einem Kontrollmonitor: gross und genau in der Mitte des Fensters (breite Bildschirme) */
@media (min-width: 1200px) {
  .clockbox { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; }
  .clockbox + * { margin-left: auto; }
  .clock { font-size: clamp(1.6rem, 2.2vw, 2.4rem); font-weight: 600; letter-spacing: .06em; line-height: 1; }
}

/* Netzwerk-Markierung: gleiche Farbe/Buchstabe = selbes lokales Netz */
.netbadge { display: inline-block; padding: 0 .45em; border-radius: 999px; font-size: .78rem; line-height: 1.5;
  border: 1px solid var(--net, var(--line)); color: var(--net, var(--muted)); white-space: nowrap; }
/* Netzwerk-Symbol (drei verbundene Knoten) statt Punkt */
.netbadge::before { content: ""; display: inline-block; width: .95em; height: .95em; margin-right: .3em; vertical-align: -.12em;
  background: var(--net); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='3' r='2.2'/%3E%3Ccircle cx='2.8' cy='13' r='2.2'/%3E%3Ccircle cx='13.2' cy='13' r='2.2'/%3E%3Cpath d='M8 5.2V8.5M8 8.5H2.8V10.8M8 8.5h5.2v2.3' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='3' r='2.2'/%3E%3Ccircle cx='2.8' cy='13' r='2.2'/%3E%3Ccircle cx='13.2' cy='13' r='2.2'/%3E%3Cpath d='M8 5.2V8.5M8 8.5H2.8V10.8M8 8.5h5.2v2.3' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat; }
.netbadge.unknown::before { display: none; }

/* Netzwerkansicht eines Standorts */
.nt-ico { display: inline-block; width: 1.05em; height: 1.05em; background: var(--net, var(--gold)); flex: none; }
.nt-ico.net { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='3' r='2.2'/%3E%3Ccircle cx='2.8' cy='13' r='2.2'/%3E%3Ccircle cx='13.2' cy='13' r='2.2'/%3E%3Cpath d='M8 5.2V8.5M8 8.5H2.8V10.8M8 8.5h5.2v2.3' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='3' r='2.2'/%3E%3Ccircle cx='2.8' cy='13' r='2.2'/%3E%3Ccircle cx='13.2' cy='13' r='2.2'/%3E%3Cpath d='M8 5.2V8.5M8 8.5H2.8V10.8M8 8.5h5.2v2.3' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat; }
.nt-ico.wifi { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M1.5 6a9.5 9.5 0 0 1 13 0M4 8.8a6 6 0 0 1 8 0M6.4 11.4a2.6 2.6 0 0 1 3.2 0'/%3E%3Ccircle cx='8' cy='13.6' r='.9' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M1.5 6a9.5 9.5 0 0 1 13 0M4 8.8a6 6 0 0 1 8 0M6.4 11.4a2.6 2.6 0 0 1 3.2 0'/%3E%3Ccircle cx='8' cy='13.6' r='.9' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat; }
.nt-ico.cable { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M1 8h4c2 0 2-4 4-4h2M5 8c2 0 2 4 4 4h2M11 4h4M11 12h4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M1 8h4c2 0 2-4 4-4h2M5 8c2 0 2 4 4 4h2M11 4h4M11 12h4'/%3E%3C/svg%3E") center / contain no-repeat; }
.nettree { margin: .4em 0 1.6em; }
.nettree + .nettree { border-top: 1px solid var(--line); padding-top: 1.2em; }
.nt-head { display: flex; align-items: center; gap: .45em; font-weight: 600; }
.nt-router { display: inline-block; border: 2px solid var(--net); border-radius: 12px; padding: .55em 1em; }
/* Baum: senkrechte Linie links, waagrechter Abzweig zu jedem Ast – eindeutig, auch bei vielen Ästen */
.nt-trunk { width: 0; height: .9em; margin-left: 1.4em; border-left: 2px solid var(--net); }
.nt-branches { display: flex; flex-direction: column; gap: .9em; margin-left: 1.4em; padding-left: 1.8em; }
.nt-branch { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: .55em .8em .7em; background: var(--panel2); }
.nt-branch::before { content: ""; position: absolute; left: -1.8em; top: 1.35em; width: 1.8em; border-top: 2px solid var(--net); }
.nt-branch::after { content: ""; position: absolute; left: -1.8em; top: -.9em; height: 2.25em; border-left: 2px solid var(--net); }
.nt-branch:not(:last-child)::after { height: calc(100% + .9em); }
.nt-branch .nt-head { flex-wrap: wrap; margin-bottom: .45em; }
.nt-sub { font-weight: 400; overflow-wrap: anywhere; }
.nt-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); gap: .5em; }
.nt-player { border: 1px solid var(--line); border-radius: 8px; padding: .45em .6em; background: var(--panel); }
.nt-player.off { opacity: .6; }
.sig { white-space: nowrap; }
.sig.ok { color: var(--ok); } .sig.warn { color: var(--warn); } .sig.bad { color: var(--bad); }
.sig .bars { display: inline-flex; align-items: flex-end; gap: 1px; height: .8em; vertical-align: -.05em; }
.sig .bars i { width: 3px; background: currentColor; opacity: .25; border-radius: 1px; }
.sig .bars i:nth-child(1) { height: 30%; } .sig .bars i:nth-child(2) { height: 55%; } .sig .bars i:nth-child(3) { height: 80%; } .sig .bars i:nth-child(4) { height: 100%; }
.sig .bars i.on { opacity: 1; }

/* Drag & Drop für synchrone Gruppen */
.card[draggable="true"] { cursor: grab; }
body.dragging .card, body.dragging .syncgroup { transition: box-shadow .12s, outline-color .12s; }
.drop-ok { outline: 2px dashed var(--ok); outline-offset: 3px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.card.drop-no, .syncgroup.drop-no { outline: 2px dashed var(--bad); outline-offset: 3px; position: relative; }
.card.drop-no::after, .syncgroup.drop-no::after { content: attr(data-reason); position: absolute; left: .6em; right: .6em; bottom: .6em;
  background: var(--panel); color: var(--bad); border: 1px solid var(--bad); border-radius: 8px; padding: .4em .6em; font-size: .85rem; z-index: 3; }
.unsynczone { position: fixed; left: 50%; bottom: 1.2em; transform: translateX(-50%); z-index: 20; padding: 1em 2em;
  background: var(--panel); border: 2px dashed var(--gold); border-radius: 14px; color: var(--text); box-shadow: 0 6px 30px rgba(0,0,0,.4); }
.unsynczone.drop-ok { border-color: var(--ok); }

/* Wochenplan: kompakte Kopfzeile, damit der Kalender weiter oben beginnt */
.plantoolbar { display: flex; align-items: center; gap: .6em; flex-wrap: wrap; margin-bottom: .7em; }
.plantoolbar #plan-tools { gap: .6em; min-width: 12em; }
.planhelp { display: grid; gap: .4em; margin-bottom: .7em; }
.planhelp[hidden] { display: none; }
.planpanel { padding-top: .7em; }
.btn.on:disabled { opacity: 1; }  /* Zustand „erledigt“ gut sichtbar */

/* Logo DMD2 cast (brand.js) */
.brand { display: flex; align-items: center; color: var(--text); }
.logo-one svg { height: 30px; width: auto; display: block; }
.logo-two svg { width: 100%; height: auto; display: block; }
.brand .beta, .login-brand .beta { font-size: .62rem; font-weight: 600; letter-spacing: .08em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: .05em .4em; margin-left: .7em; text-transform: uppercase; }
.login-brand { color: var(--text); display: flex; flex-direction: column; align-items: center; margin-bottom: 1.4em; }
.login-brand .logo-two { width: 230px; }
.login-brand .beta { margin: .6em 0 0; }
@media (max-width: 520px) { .logo-one svg { height: 24px; } }

/* Protokoll holen */
.logbox { max-height: 65vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: .8em; font: 12px/1.45 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; margin: 0; }
