/* Shared appearance for the diagnostic workspace. Router/remote UIs keep their own theme. */
:root{color-scheme:dark;--theme-bg:#111820;--theme-panel:#1a2530;--theme-raised:#23313f;--theme-text:#d9e3ed;--theme-muted:#9aafc0;--theme-line:#354756}
:root[data-theme=light]{color-scheme:light}
.theme-toggle{white-space:nowrap;flex-shrink:0;font:600 11px/1.3 system-ui;padding:7px 10px;border:1px solid #617486;border-radius:5px;background:#273746;color:#edf5fb;cursor:pointer;width:auto;margin:0}
.theme-toggle:hover{background:#354b5e}.theme-toggle:focus-visible{outline:2px solid #7bc8ff;outline-offset:3px}
body>main>.theme-toggle{display:block;margin:0 0 18px auto}
:root:not([data-theme=light]){background:var(--theme-bg);color:var(--theme-text);--line:var(--theme-line);--muted:var(--theme-muted);--accent:#77c2ed}
:root:not([data-theme=light]) body{background:var(--theme-bg);color:var(--theme-text)}
:root:not([data-theme=light]) :is(main,aside,article,.panel,.detail-panel,.metrics>div,.hierarchy-selector,.scope-selector,.org-selector,.overview-wan-expanded,dialog,.raw-layout,.payload,.record-list,.packet-inspection,.packet-workspace,.packet-tree-pane,.packet-value-pane,.packet-bytes){background:var(--theme-panel);color:var(--theme-text);border-color:var(--theme-line)}
:root:not([data-theme=light]) :is(header,.main-nav){background:#17232d}
:root:not([data-theme=light]) :is(p,label,dd,dt,.info-list dd,.info-list dt,.metric-label,.subtle,.muted,.section-note,.breadcrumbs,.breadcrumbs a,.empty,.unreported,.scope-note small,.move-details){color:var(--theme-muted)}
:root:not([data-theme=light]) :is(h1,h2,h3,.toolbar-heading,.device-title,.org-row strong){color:var(--theme-text)}
:root:not([data-theme=light]) :is(a,.device-title>a){color:#77c2ed}
:root:not([data-theme=light]) :is(input,select,textarea){background:#111d27;color:var(--theme-text);border-color:#455d71}
:root:not([data-theme=light]) :is(button,.secondary,button.secondary,button.small-button){background:#283c4b;color:#dbeaf5;border-color:#496275}
:root:not([data-theme=light]) button:hover{background:#365267}
:root:not([data-theme=light]) :is(.primary,#sign-out){background:#245d49;color:#d1f7e6;border-color:#38785f}
:root:not([data-theme=light]) :is(th,.inventory-table th:first-child,.inventory-table th:nth-child(2),.detail-panel>h2,.dialog-head,.packet-frame,.packet-help,.message-group>summary,.pane-drag-handle,.receiver-settings){background:var(--theme-raised);color:#b4c8d9;border-color:var(--theme-line)}
:root:not([data-theme=light]) :is(td,th,.wan-detail,.cellular-section,.cellular-engineering,.org-row,fieldset,.device-tabs,.detail-panel,.message-group,.packet-list,.packet-inspection,.packet-bytes,.peer){border-color:var(--theme-line)}
:root:not([data-theme=light]) :is(.inventory-table td:first-child,.inventory-table td:nth-child(2)){background:var(--theme-panel)}
:root:not([data-theme=light]) :is(.inventory-table tbody tr:nth-child(even),.inventory-table tbody tr:nth-child(even) td:nth-child(-n+2),.wan-detail[open]){background:#1e2c38}
:root:not([data-theme=light]) :is(pre,code,.protocol-content code,.packet-value-pane pre,.move-details pre){background:#101c26;color:#d6e5f1;border-color:var(--theme-line)}
:root:not([data-theme=light]) :is(.packet-field,.packet-tree){color:#d6e5f1}
:root:not([data-theme=light]) :is(.packet-field:hover,.packet-field:focus,.selected,.tabs .active,.device-tabs .active){background:#29495d;color:#b4e1ff}
:root:not([data-theme=light]) .packet-list tbody tr.packet-rx{background:#1b352e;color:#c8e4d6}
:root:not([data-theme=light]) .packet-list tbody tr.packet-tx{background:#23354d;color:#cfdef3}
:root:not([data-theme=light]) .packet-list tbody tr.selected{background:#245d86;color:white}
:root:not([data-theme=light]) :is(.online,.coverage.decoded){background:#204a39;color:#92e2b5}
:root:not([data-theme=light]) :is(.offline,.coverage.unmapped){background:#4d2936;color:#ffadbf}
:root:not([data-theme=light]) :is(.neutral,.tag,.coverage){background:#2a3b4b;color:#b1ccdf}
:root:not([data-theme=light]) :is(.warning,.coverage.partial){background:#433923;color:#ecd79a;border-color:#71613b}
:root:not([data-theme=light]) .sim-indicator{background:#293c49;color:#c1d2df;border-color:#7892a5}
:root:not([data-theme=light]) .sim-indicator.is-active{background:#14734f;color:white;border-color:#3eb889}
:root:not([data-theme=light]) :is(#notice:not(:empty),.receiver-settings){background:#213c34;color:#b7e6d0;border-color:#3f6c58}
:root:not([data-theme=light]) :is(#notice.error,#message.error){background:#44262d;color:#ffc1c9;border-color:#84505a}
:root:not([data-theme=light]) .usage-chart text{fill:#abc2d4}
:root:not([data-theme=light]) dialog::backdrop{background:#02080dc9}
:root:not([data-theme=light]) .theme-toggle{background:#273746;color:#edf5fb}
@media(max-width:700px){.theme-toggle{padding:6px 8px;font-size:10px}header{flex-wrap:wrap;height:auto;min-height:44px}.receiver-head{flex-wrap:wrap;gap:8px}}
:root:not([data-theme=light]) :is(.device-overview,.status-section>h3,#hierarchy-browser.group-context){background:var(--theme-panel);color:var(--theme-text)}
:root:not([data-theme=light]) :is(.overview-wan-name,.icva-columns .info-list dt){color:var(--theme-muted)}
:root:not([data-theme=light]) .device-map-host:empty{background:linear-gradient(135deg,#1b2b35,#233744)}
:root:not([data-theme=light]) :is(.metrics>div:first-child strong){color:#83dba8}
:root:not([data-theme=light]) :is(.metrics>div:nth-child(2) strong){color:#ff99b2}

.theme-toggle{display:inline-flex;align-items:center;justify-content:center;width:32px;height:30px;padding:5px;line-height:1}.theme-toggle svg{display:block;flex-shrink:0}
