/* Funk-Standards: Wege (WLAN, Bluetooth, Zigbee, Thread) und Sprachen (Matter, Zigbee, Hersteller).
   Übernommen aus entwurf/standards*.css, Fassung D2 (2026-12-02). Logik in funk.js. */

/* Eine Farbe je Standard, als Fläche und in Symbolen, nie als Strich am Rand. */
:root { --c-wlan:#4F46C8; --c-bluetooth:#0071DC; --c-zigbee:#D6043D; --c-thread:#1F7A4D; --l-hersteller:#6B778C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-wlan:#A29DFF; --c-bluetooth:#4DA8FF; --c-zigbee:#FF6B8E; --c-thread:#5CC08C; --l-hersteller:#95A3B8; } }
:root[data-theme="dark"] { --c-wlan:#A29DFF; --c-bluetooth:#4DA8FF; --c-zigbee:#FF6B8E; --c-thread:#5CC08C; --l-hersteller:#95A3B8; }
#funk { --l-zigbee: var(--c-zigbee); --l-matter: var(--ink); }
#funk .r-wlan { --r: var(--c-wlan); } #funk .r-bluetooth { --r: var(--c-bluetooth); } #funk .r-zigbee { --r: var(--c-zigbee); }
#funk .r-thread { --r: var(--c-thread); } #funk .r-net { --r: var(--muted); }
#funk .l-hersteller { --l: var(--l-hersteller); } #funk .l-zigbee { --l: var(--l-zigbee); } #funk .l-matter { --l: var(--l-matter); }

.fk-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
#funk svg.ic, .wb-scene use { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fk-sprite .fill { fill: currentColor; stroke: none; }
#funk .ic { width: 22px; height: 22px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Echte Zeichen der Standards: einfarbig als Maske in Markenfarbe; das Wi-Fi-Zeichen ist zweifarbig und bleibt ein Bild. */
#funk .lg { display: inline-block; flex: none; vertical-align: middle; background: var(--lg-c, currentColor);
  -webkit-mask: var(--lg) center / contain no-repeat; mask: var(--lg) center / contain no-repeat; }
#funk .lg.bluetooth { --lg: url("logos/funk/bluetooth.svg"); --lg-c: var(--c-bluetooth); width: 1em; height: 1em; }
#funk .lg.zigbee { --lg: url("logos/funk/zigbee.svg"); --lg-c: var(--c-zigbee); width: 1em; height: 1em; }
#funk .lg.matter { --lg: url("logos/funk/matter.svg"); --lg-c: var(--ink); width: 4.66em; height: 1em; }
#funk .lg.thread { --lg: url("logos/funk/thread.svg"); --lg-c: var(--ink); width: 5.4em; height: 1em; }
#funk img.lg.wlan { background: none; -webkit-mask: none; mask: none; max-width: none; }
/* Im Dunkeln bekommt das schwarz-weiße Wi-Fi-Zeichen eine helle Unterlage, sonst verschwindet es. */
:root[data-theme="dark"] #funk img.lg.wlan { background: #fff; border-radius: .35em; padding: .12em .2em; box-sizing: content-box; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #funk img.lg.wlan { background: #fff; border-radius: .35em; padding: .12em .2em; box-sizing: content-box; } }

/* Rahmen: Haus links, Auswahl rechts */
.wb { margin: 0 auto; border-radius: calc(var(--radius) + 6px); background: var(--card); border: 1px solid var(--border); }
.wb.side { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: center; padding: 28px 34px 28px 24px; }
.side .wb-scroll { min-width: 0; }
.panel { display: grid; gap: 22px; align-content: center; }

/* Szene */
.wb-scene { width: 100%; height: auto; display: block; }
.wb-scene .node { opacity: .3; transition: opacity .3s ease; }
.wb-scene .node.on { opacity: 1; }
.wb-scene .node .disc { fill: var(--card); stroke: transparent; stroke-width: 1.5; }
.wb-scene .node.on .disc { stroke: var(--border); }
.wb-scene .node .ic { color: var(--muted); }
.wb-scene .node.src .disc { fill: color-mix(in srgb, var(--r, var(--accent)) 14%, var(--card)); stroke: var(--r, var(--accent)); stroke-width: 2; }
.wb-scene .node.src .ic { color: var(--r, var(--accent)); }
.wb-scene .node[data-road="wlan"] { --r: var(--c-wlan); } .wb-scene .node[data-road="bluetooth"] { --r: var(--c-bluetooth); }
.wb-scene .node[data-road="zigbee"] { --r: var(--c-zigbee); } .wb-scene .node[data-road="thread"] { --r: var(--c-thread); }
.wb-scene .node.hub .disc { fill: var(--accent); stroke: none; } .wb-scene .node.hub .ic { color: var(--on-accent); }
.wb-scene .node.infra.on .disc { stroke: var(--muted); } .wb-scene .node.infra.on .ic { color: var(--ink); }
/* Sprache gewählt: Ring in der Farbe der Sprache, innen die Farbe des Wegs */
.wb-scene .node[data-lang="hersteller"] { --l: var(--l-hersteller); } .wb-scene .node[data-lang="zigbee"] { --l: var(--l-zigbee); } .wb-scene .node[data-lang="matter"] { --l: var(--l-matter); }
.wb-scene .halo { fill: none; stroke: var(--l); stroke-width: 2.5; opacity: 0; transition: opacity .25s ease; }
.wb-scene .node.speak .halo { opacity: 1; }
.wb-scene .link { stroke: var(--r); stroke-width: 3; stroke-linecap: round; opacity: .7; }
.wb-scene .link.r-net { stroke-dasharray: 2 6; opacity: .6; }
.wb-scene .tag { opacity: 0; transition: opacity .25s ease; }
.wb-scene .tag.on { opacity: 1; }
.wb-scene .tag-bg { fill: var(--card); stroke-width: 1.5; }
.wb-scene .tag-t { font: 700 11px/1 var(--sans); text-anchor: middle; }
.wb-scene .tag[class*=" r-"] .tag-bg { fill: var(--card); stroke: var(--r); }
.wb-scene .tag[class*=" r-"] .tag-t { fill: var(--r); }
.wb-scene .dot { fill: var(--l); stroke: var(--card); stroke-width: 2; }
.wb-scene .range { fill: color-mix(in srgb, var(--c-bluetooth) 9%, transparent); stroke: var(--c-bluetooth); stroke-dasharray: 4 6; opacity: .8; }
/* Haus als ruhige Fläche, Räume nur durch Aussparungen */
.wb-scene .house { fill: color-mix(in srgb, var(--chip) 85%, transparent); stroke: color-mix(in srgb, var(--chip) 85%, transparent); stroke-width: 20; stroke-linejoin: round; }
.wb-scene .wall { stroke: var(--card); stroke-width: 6; fill: none; }
/* Namen nur an Geräten, die gerade mitspielen; Saum in Hausfarbe, damit Funklinien sauber dahinter verschwinden */
.wb-scene .lbl { font: 600 12px/1 var(--sans); fill: var(--ink); text-anchor: middle; opacity: 0; transition: opacity .25s ease;
  paint-order: stroke; stroke: color-mix(in srgb, var(--chip) 85%, var(--card)); stroke-width: 5px; stroke-linejoin: round; }
.wb-scene .node.on .lbl, .wb-scene .node.hub .lbl { opacity: 1; }

/* Umschalter Wege / Sprachen */
.dswitch { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--chip); }
.dswitch button { border: 0; background: none; padding: 10px 0; border-radius: 999px; font: 600 .92rem/1 var(--sans); color: var(--muted); cursor: pointer;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; -webkit-tap-highlight-color: transparent; }
.dswitch button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }

/* Eine Auswahl: ohne Rahmen, gewählt mit Fläche */
.grp { display: grid; gap: 4px; align-content: start; }
.opt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; padding: 11px 14px; border: 0; background: none;
  color: var(--ink); font: 600 .98rem/1.2 var(--sans); text-align: left; cursor: pointer; border-radius: 12px;
  transition: background-color .2s ease, color .2s ease, transform .16s ease-out; -webkit-tap-highlight-color: transparent; }
.opt:active { transform: scale(.98); }
.opt-n { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; min-height: 22px; }
.opt .lg { font-size: 18px; } .opt .lg.matter { font-size: 16px; } .opt .lg.thread { font-size: 14px; }
.opt img.lg.wlan { height: 18px; width: 30px; }
#funk .opt .ic { width: 18px; height: 18px; color: var(--l); }
.opt small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.opt.road[aria-pressed="true"] { background: color-mix(in srgb, var(--r) 11%, var(--card)); }
.opt.road[aria-pressed="true"] small { color: var(--r); }
/* Sprache gewählt: Sprechblase in ihrer Farbe */
.opt.lang { border-radius: 16px 16px 16px 4px; }
.opt.lang[aria-pressed="true"] { background: var(--l); color: var(--paper); }
.opt.lang[aria-pressed="true"] small { color: color-mix(in srgb, var(--paper) 78%, transparent); }
#funk .opt.lang[aria-pressed="true"] .lg, #funk .opt.lang[aria-pressed="true"] .ic { --lg-c: var(--paper); color: var(--paper); }
@media (hover: hover) and (pointer: fine) { .opt[aria-pressed="false"]:hover { background: color-mix(in srgb, var(--chip) 70%, transparent); } }

/* Ohne Springen: Listen und Texte liegen übereinander, sichtbar ist nur die aktuelle; die Karte bleibt gleich hoch */
#fk-ctl .panes, #fk-ctl .caps { display: grid; }
#fk-ctl .panes > .grp, #fk-ctl .caps > .cap { grid-area: 1 / 1; }
#fk-ctl .grp[hidden] { display: grid; visibility: hidden; }
.cap { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.6; text-wrap: pretty; visibility: hidden; opacity: 0; transition: opacity .2s ease, visibility 0s linear .2s; }
.cap.on { visibility: visible; opacity: 1; transition: opacity .2s ease; }
.cap b { color: var(--ink); }

/* Schmale Fenster: Haus oben, Auswahl darunter; auf dem Handy das Haus zum Wischen statt winzig */
@media (max-width: 980px) {
  .wb.side { grid-template-columns: 1fr; gap: 22px; padding: 20px; }
  .panel { max-width: 440px; width: 100%; margin: 0 auto; }
}
@media (max-width: 640px) {
  .wb.side { padding: 12px; }
  .wb-scroll { overflow-x: auto; margin: 0 -12px; padding: 0 12px; scrollbar-width: none; }
  .wb-scroll::-webkit-scrollbar { display: none; }
  .wb-scene { width: 720px; max-width: none; }
}
