:root{color-scheme:light}
.theme-toggle{flex:0 0 40px;width:40px;height:40px;padding:7px;border-radius:10px;line-height:1}
.theme-toggle svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .theme-sun{display:none}
[data-theme=dark] .theme-toggle .theme-sun{display:inline}
[data-theme=dark] .theme-toggle .theme-moon{display:none}
.login-view .topbar>.theme-toggle{display:inline-flex}
@media(max-width:760px){.topbar .theme-toggle{width:38px;flex-basis:38px;min-height:40px;padding:6px;font-size:23px}.save-tools{min-width:0}}
/* Screen-only palette: reports still print on a light background. */
@media screen{
  :root[data-theme=dark]{color-scheme:dark;--ink:#e3edf0;--muted:#a6bcc3;--line:#344b54;--accent:#76d6c8;--dark:#10282e;--bg:#0f1b20;--surface:#17282e;--surface-soft:#1e333a;--field:#102127;scrollbar-color:#536e76 var(--bg)}
  [data-theme=dark] body{background:var(--bg);color:var(--ink)}
  [data-theme=dark] :is(.panel,.stat,.floor-card,.table-wrap,dialog,.topbar,.mobile-nav,.port-tools .form-actions,.form-actions){background:var(--surface);color:var(--ink);border-color:var(--line)}
  [data-theme=dark] :is(.button,input,select,textarea,.service-choice span){background:var(--field);color:var(--ink);border-color:var(--line)}
  [data-theme=dark] :is(input,select,textarea){accent-color:var(--accent)}
  [data-theme=dark] input::placeholder,[data-theme=dark] textarea::placeholder{color:#99afb5;opacity:1}
  [data-theme=dark] .button:hover{background:var(--surface-soft)}
  [data-theme=dark] .button.primary{background:#16796f;border-color:#33958b;color:#fff}
  [data-theme=dark] .button.primary:hover{background:#126b62}
  [data-theme=dark] .button.danger{background:#3b242b;color:#ffb7b4;border-color:#775058}
  [data-theme=dark] :is(.text-button,.eyebrow,.floor-add,.network-address){color:var(--accent)}
  [data-theme=dark] :is(.link-config,.storage-mode,.connection-path,.personal-pin,.rack-icon,.floor-add,th){background:var(--surface-soft);border-color:var(--line)}
  [data-theme=dark] .welcome-team{background:#183630;border-color:#39675b}
  [data-theme=dark] .welcome-team .welcome-icon{background:#254a40;color:var(--accent)}
  [data-theme=dark] .welcome-tag{background:#254a40;color:#b1e6d4}
  [data-theme=dark] .welcome .welcome-link{background:transparent;color:var(--accent);border-color:transparent}
  [data-theme=dark] .welcome .welcome-link:hover{background:var(--surface-soft)}
  [data-theme=dark] .settings-tabs{background:var(--surface-soft);border-color:var(--line)}
  [data-theme=dark] .settings-tab:hover{background:var(--field)}
  [data-theme=dark] .settings-tab.active{background:linear-gradient(135deg,#1aa395,#146e65);color:#fff;box-shadow:0 4px 16px rgba(26,163,149,.35)}
  [data-theme=dark] .settings-card-icon{background:#1e3c42;color:#b1e6d4}
  [data-theme=dark] .category-tabs{background:var(--surface-soft);border-color:var(--line)}
  [data-theme=dark] .category-tab:hover{background:var(--field)}
  [data-theme=dark] .category-tab.active{background:#16796f;color:#fff}
  [data-theme=dark] .empty-section-notice{background:var(--surface-soft);border-color:var(--line)}
  [data-theme=dark] .storage-mode{border-color:#4eb1a3}
  [data-theme=dark] .release-card{background:var(--surface);border-color:var(--line)}
  [data-theme=dark] .release-card:hover{background:var(--surface-soft);border-color:var(--accent)}
  [data-theme=dark] .release-card.is-current{background:linear-gradient(90deg,var(--surface-soft) 0%,var(--surface) 35%);border-left-color:var(--accent)}
  [data-theme=dark] .release-vtag{background:var(--field);color:var(--ink)}
  [data-theme=dark] .release-badge-current{background:#16423a;color:#78dfd1}
  [data-theme=dark] .release-count-pill{background:var(--field);color:var(--muted)}
  [data-theme=dark] .release-search-wrap input{background:var(--field);border-color:var(--line);color:var(--ink)}
  [data-theme=dark] .release-modal-hero{background:var(--surface-soft);border-color:var(--line)}
  [data-theme=dark] .release-modal-item{background:var(--surface);border-color:var(--line)}
  [data-theme=dark] .release-item-bullet{background:var(--field);color:var(--accent)}
  [data-theme=dark] :is(.field,.link-config legend,.link-heading,.credits,.credits a,th,.close){color:var(--ink)}
  [data-theme=dark] :is(.close,.photo,.mobile-sheet-head){background:var(--surface-soft)}
  [data-theme=dark] :is(.rack-link,.device-item,td,.history-row,.mobile-sheet-head){border-color:var(--line)}
  [data-theme=dark] :is(.rack-link:hover,tbody tr:hover,.mobile-nav a.active,.sidebar nav a.active){background:#24473f;color:#c6f4e8}
  [data-theme=dark] .mobile-nav a{color:var(--muted)}
  [data-theme=dark] :is(.sidebar nav a.active,.mobile-nav a.active){color:#c6f4e8}
  [data-theme=dark] .rack-device{background:linear-gradient(90deg,color-mix(in srgb,var(--device) 14%,#1e3037) 0%,#1f323a 28%);border-color:#3f5862;border-left:6px solid var(--device);box-shadow:0 3px 8px #00000033}
  [data-theme=dark] .rack-device:hover{border-color:#587a88;box-shadow:0 4px 14px #0000004d}
  [data-theme=dark] .device-head button{color:var(--ink)}
  [data-theme=dark] .device-head small{color:var(--muted)}
  [data-theme=dark] :is(.rack-side,.rack-view .rack-side,.mobile-sheet-head,.topbar #saveStatus){background:var(--bg)}
  [data-theme=dark] :is(.form-error,.login-card #loginError){color:#ffb7b4}
  [data-theme=dark] .form-error{background:#3b242b}
  [data-theme=dark] #saveStatus[data-error=true]{color:#ffb7b4}
  [data-theme=dark] #connectionBanner{background:#3b301d;color:#f5d59e}
  [data-theme=dark] #toast{background:#264c4c;border:1px solid #4d7777;color:#fff}
  [data-theme=dark] .status.free{background:#1c4333;color:#b4e6cd}
  [data-theme=dark] .status.used{background:#243e59;color:#b9d9fc}
  [data-theme=dark] .status.fault{background:#502e34;color:#ffb7b4}
  [data-theme=dark] .scene-link{background:var(--surface-soft);color:var(--ink)}
  [data-theme=dark] .scene-link:hover{background:var(--field)}
  [data-theme=dark] .scene-count{background:var(--surface-soft)}
  [data-theme=dark] .scene-link>button:first-child{color:var(--ink)}
  [data-theme=dark] .scene-link.selected{background:#4d4321}
  [data-theme=dark] dialog::backdrop{background:#000a}
  [data-theme=dark] .welcome-options .button:focus-visible{outline-color:#f5d879}
}
/* Navigation keeps the same geometry in both themes and in the collapsed rail. */
.sidebar{width:260px;padding:24px 16px 16px;background:#122b31;border-right:1px solid #29434a;gap:0;overflow-y:auto}
.workspace{margin-left:260px}
.sidebar .brand{gap:12px;padding:0 8px 20px;font-size:24px;letter-spacing:-.4px;flex:none}
.sidebar .brand-mark{width:42px;height:42px;border-radius:12px;background:linear-gradient(135deg, #18444c 0%, #0c2b30 100%);border:1px solid #2b5d66;color:#5eead4;box-shadow:0 4px 12px rgba(10,34,38,0.4), inset 0 1px 0 rgba(255,255,255,0.08);display:grid;place-items:center;flex:none;transition:all .2s ease}
.sidebar .brand:hover .brand-mark{border-color:#38808d;box-shadow:0 6px 16px rgba(14,54,61,0.5), inset 0 1px 0 rgba(255,255,255,0.15);transform:translateY(-1px)}
.sidebar .brand-mark svg{width:26px;height:26px}.sidebar .brand small{font-size:8px;letter-spacing:1.5px;color:#93b8bc}
.sidebar .company-switcher{margin:0 0 22px;padding:14px 12px;border:1px solid #355159;border-radius:14px;background:#1b363d}
.sidebar .company-label{display:block;margin:0 0 9px;color:#a5c2c6;font-size:9px;letter-spacing:1px}
.sidebar .company-switcher select{width:100%;height:40px;min-height:40px;padding:8px 9px;color:#f0f8f7;background:#122b31;border:1px solid #49676d;font-size:12px;text-overflow:ellipsis}
.sidebar .company-add{width:100%;margin-top:9px;padding:8px;border:0;background:transparent;color:#a9dbd1;font-size:11px;min-height:34px}.sidebar .company-add:hover{background:#284c52}
.sidebar .company-name{display:none}
.sidebar nav{display:flex;flex-direction:column;gap:5px;margin:0;overflow:visible}
.sidebar .nav-group-label{padding:0 12px 8px;font-size:9px;color:#8bafb5;letter-spacing:1px;font-weight:600}
.sidebar .nav-management{margin-top:22px}
#leftPanel nav a{gap:12px;min-height:46px;padding:11px 12px;border:1px solid transparent;border-radius:10px;color:#bfd1d5;font-weight:500;transition:background .15s,color .15s}
#leftPanel nav a .nav-label{font-size:12px;line-height:1.45;overflow-wrap:break-word}
#leftPanel nav a .nav-icon{width:20px;height:20px;flex:0 0 20px;color:inherit}
#leftPanel nav a .nav-icon svg{width:20px;height:20px;stroke-width:1.65}
#leftPanel nav a:hover{color:#fff;background:#203e46}
#leftPanel nav a.active{color:#e1fff5;background:#245349;border-color:#3d796b;font-weight:650;box-shadow:inset 3px 0 #8fe0c9}
.sidebar .sidebar-bottom{margin-top:auto;padding:24px 4px 0;font-size:11px;color:#a7c6cb}
.sidebar-release,.sidebar-bottom [data-action=install-app]{display:flex;align-items:center;gap:10px;width:100%;padding:11px 8px;font-size:11px;border:0;background:transparent;color:#a7c6cb;text-align:left;white-space:normal}
.sidebar-release:hover,.sidebar-bottom [data-action=install-app]:hover{color:#fff;background:#203e46;border-radius:8px}
.sidebar-bottom svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.settings-tabs{gap:8px;padding:8px}
.settings-tab{min-height:42px;font-size:12.5px}
.release-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}
.release-summary>div{padding:22px;border:1px solid var(--line);border-radius:14px;background:var(--surface,#fff)}
.release-summary span{display:block;color:var(--muted);font-size:12px;line-height:1.5}.release-summary strong{display:block;font-size:28px;letter-spacing:-.5px;margin-top:8px}
.release-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:18px 0 14px}
.release-search-wrap{position:relative;flex:1;max-width:480px}
.release-search-wrap input{width:100%;padding:10px 14px 10px 36px;border-radius:10px;border:1px solid var(--line);background:var(--surface,#fff);color:var(--ink);font-size:12.5px}
.release-search-wrap:before{content:'🔍';position:absolute;left:11px;top:50%;transform:translateY(-50%);font-size:12px;opacity:.7;pointer-events:none}
.release-search-count{font-size:12px;color:var(--muted);white-space:nowrap;font-weight:600}
.release-list{display:flex;flex-direction:column;gap:8px}
.release-card{display:flex;align-items:center;gap:14px;padding:12px 18px;border:1px solid var(--line);border-radius:12px;background:var(--surface,#fff);cursor:pointer;transition:all .18s ease;position:relative}
.release-card:hover{border-color:var(--accent,#16796f);transform:translateY(-1px);box-shadow:0 4px 14px rgba(22,121,111,.08)}
.release-card:focus-visible{outline:3px solid #eab54b;outline-offset:2px}
.release-card.is-current{border-left:4px solid var(--accent,#16796f);background:linear-gradient(90deg,var(--surface-soft,#edf4f2) 0%,var(--surface,#fff) 25%)}
.release-card-left{display:flex;align-items:center;gap:10px;flex-shrink:0}
.release-vtag{display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:13.5px;padding:5px 11px;border-radius:8px;background:var(--surface-soft,#eef4f3);color:var(--ink);letter-spacing:-.2px}
.release-vtag.active{background:linear-gradient(135deg,#1aa395,#146e65);color:#fff;box-shadow:0 2px 8px rgba(26,163,149,.3)}
.release-vtag.large{font-size:16px;padding:6px 14px}
.release-badge-current{display:inline-flex;align-items:center;padding:3px 8px;border-radius:6px;background:#e2f6f1;color:#0d695e;font-size:10.5px;font-weight:700;letter-spacing:.3px}
.release-card-body{display:flex;flex-direction:column;gap:3px;flex:1;min-width:0}
.release-card-meta{display:flex;align-items:center;gap:10px;font-size:11.5px;color:var(--muted)}
.release-card-date{display:inline-flex;align-items:center;gap:4px}
.release-card-snippet{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.4}
.release-card-right{display:flex;align-items:center;gap:10px;flex-shrink:0;margin-left:auto}
.release-count-pill{display:inline-flex;align-items:center;padding:4px 9px;border-radius:8px;background:var(--surface-soft,#edf3f3);color:var(--muted);font-size:11px;font-weight:600}
.release-open-btn{white-space:nowrap;display:inline-flex;align-items:center;gap:6px;padding:6px 12px;font-size:11.5px}
.release-modal-view{display:flex;flex-direction:column;gap:16px;padding-top:4px}
.release-modal-hero{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;padding:12px 14px;background:var(--surface-soft,#f2f7f6);border:1px solid var(--line);border-radius:10px}
.release-modal-meta{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.release-modal-notes-title{font-size:13px;font-weight:700;color:var(--ink);margin-top:2px}
.release-modal-items{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.release-modal-item{display:flex;align-items:flex-start;gap:12px;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface,#fff);line-height:1.65;font-size:13px}
.release-modal-item:hover{border-color:var(--accent,#16796f)}
.release-item-bullet{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:var(--surface-soft,#edf3f3);color:var(--accent,#16796f);font-size:11px;font-weight:700;flex-shrink:0;margin-top:2px}
.release-item-desc{flex:1;min-width:0;overflow-wrap:anywhere}
@media(min-width:761px){body.left-collapsed .nav-group-label{display:none}body.left-collapsed .sidebar .brand{padding:0}body.left-collapsed #leftPanel nav a{width:44px;height:44px;min-height:44px;padding:10px;gap:0}body.left-collapsed #leftPanel nav{overflow:visible}body.left-collapsed .topbar .menu-toggle svg{transform:scaleX(-1)}}
@media(max-width:760px){.workspace{margin-left:0}.sidebar{width:min(300px,86vw);padding:20px 14px 16px}.sidebar .company-switcher{margin:0 0 20px}.sidebar .sidebar-bottom{padding-top:20px}.settings-tab{font-size:11.5px;padding:8px 12px}.release-summary{gap:8px}.release-summary>div{padding:13px 10px}.release-summary span{font-size:10px}.release-summary strong{font-size:21px}.release-toolbar{flex-direction:column;align-items:stretch}.release-search-wrap{max-width:none}.release-card{padding:10px 12px;gap:10px;flex-wrap:wrap}.release-card-body{order:3;flex-basis:100%;margin-top:4px}.release-card-snippet{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.release-card-right{margin-left:auto}.release-open-btn span:last-child{display:none}}

/* Topbar Save Status SVG & Live Presence */
#saveStatus{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;margin:0;cursor:default}
.save-status-wrap{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px}
.save-status-svg{width:22px;height:22px;display:block;transition:transform .2s ease}
.status-spin{animation:saveStatusSpin .85s linear infinite;transform-origin:center}
@keyframes saveStatusSpin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
.status-saved .status-check{stroke-dasharray:16;stroke-dashoffset:16;animation:saveCheckDraw .35s ease forwards}
@keyframes saveCheckDraw{to{stroke-dashoffset:0}}
.status-pending .status-pulse{animation:statusPendingPulse 1.4s ease-in-out infinite;transform-origin:center}
@keyframes statusPendingPulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.7)}}

.topbar-install-btn,
.live-profile-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;min-height:38px;padding:0;border-radius:10px;background:var(--surface,#fff);border:1px solid var(--line,#cedbd8);color:var(--accent,#16796f);cursor:pointer;transition:all .18s ease;box-shadow:0 1px 3px rgba(0,0,0,0.06);overflow:visible!important;flex:0 0 38px}
.topbar-install-btn:hover,
.live-profile-btn:hover{background:var(--surface-soft,#edf3f3);color:var(--ink,#153e42);border-color:var(--accent,#16796f);transform:translateY(-1px);box-shadow:0 3px 8px rgba(0,0,0,0.1)}
[data-theme=dark] .topbar-install-btn,
[data-theme=dark] .live-profile-btn{background:#16363d;border-color:#2a555f;color:#7ee7d5}
[data-theme=dark] .topbar-install-btn:hover,
[data-theme=dark] .live-profile-btn:hover{background:#1e4852;border-color:#488796;color:#fff}
.install-svg-anim{width:20px;height:20px;display:block}
.install-svg-anim .install-arrow{animation:installArrowBounce 2s ease-in-out infinite;transform-origin:center}
@keyframes installArrowBounce{0%,100%{transform:translateY(0)}50%{transform:translateY(2.5px)}}

.live-profile-svg{width:20px;height:20px;display:block}
.live-badge{position:absolute;top:-5px;right:-5px;min-width:18px;height:18px;padding:0 4px;border-radius:9px;background:#10b981;color:#fff;font-size:10px;font-weight:700;line-height:18px;text-align:center;box-shadow:0 2px 5px rgba(0,0,0,0.25);border:2px solid var(--surface,#fff);display:inline-block}
[data-theme=dark] .live-badge{border-color:#16363d}
.live-badge[data-connected="false"]{background:#f59e0b}

.live-modal-content{padding:4px 0}
.live-modal-summary{display:flex;align-items:center;gap:8px;font-size:13px;margin-bottom:14px;padding:10px 14px;border-radius:8px;background:var(--surface-soft,#edf3f3);color:var(--ink)}
[data-theme=dark] .live-modal-summary{background:#17343b}
.live-pulse-dot{width:8px;height:8px;border-radius:50%;background:#10b981;box-shadow:0 0 0 3px rgba(16,185,129,0.25);animation:livePulseDot 2s infinite;display:inline-block;flex:none}
@keyframes livePulseDot{0%,100%{box-shadow:0 0 0 2px rgba(16,185,129,0.35)}50%{box-shadow:0 0 0 6px rgba(16,185,129,0)}}
.live-modal-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px;max-height:300px;overflow-y:auto}
.live-dialog-user{display:flex;align-items:center;gap:12px;padding:10px 14px;border-radius:10px;border:1px solid var(--line);background:var(--surface,#fff)}
[data-theme=dark] .live-dialog-user{background:#132d33;border-color:#244952}
.live-user-avatar{width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,#16796f,#0d4e48);color:#fff;display:grid;place-items:center;font-weight:700;font-size:12px;flex:none}
.live-user-details{display:flex;flex-direction:column;gap:2px;min-width:0}
.live-user-details strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.live-user-tag{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--muted)}

[data-theme=dark] .cable-filters{background:var(--surface);border-color:var(--line)}
[data-theme=dark] .cable-query input{background:var(--field);border-color:var(--line);color:var(--ink)}
[data-theme=dark] .cable-query-icon{color:var(--muted)}
[data-theme=dark] .cable-filter-grid select{background:var(--field);border-color:var(--line);color:var(--ink)}
[data-theme=dark] .cable-stat{background:var(--surface);border-color:var(--line);color:var(--ink)}
[data-theme=dark] .cable-stat:hover{background:var(--surface-soft);border-color:var(--accent)}
[data-theme=dark] .cable-chip{background:var(--surface-soft);border-color:var(--line);color:var(--ink)}
[data-theme=dark] .cable-result-tools select{background:var(--field);border-color:var(--line);color:var(--ink)}
[data-theme=dark] .cable-table{background:var(--surface);border-color:var(--line)}
[data-theme=dark] .cable-symbol{background:var(--surface-soft);color:var(--accent)}
[data-theme=dark] .cable-port{background:var(--surface-soft);color:var(--ink)}
[data-theme=dark] .cable-connected{background:#18364e;color:#8cc4f7}
[data-theme=dark] .cable-rack-link{background:var(--surface-soft);color:var(--accent)}
[data-theme=dark] .link-badge{background:#11384a;color:#7dd3fc;border:1px solid #1e526d}
[data-theme=dark] .rack-unlink-btn:hover{color:#fca5a5;background:#451a1a}


