/* ============================================================
   Command Center — dense tactical dashboard theme
   ============================================================ */
:root {
  --bg: #070b12;
  --bg-2: #0b1120;
  --panel: rgba(15, 22, 36, 0.72);
  --panel-solid: #0d1524;
  --panel-head: rgba(255, 255, 255, 0.03);
  --border: rgba(120, 165, 210, 0.14);
  --border-strong: rgba(120, 165, 210, 0.28);
  --text: #dbe4ef;
  --muted: #8b9bb3;
  --faint: #5d6b82;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.15);
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 10px;
  --tb-h: 62px;
}

/* Light theme — applied when <html data-theme="light"> (resolved by applyTheme in app.js).
   'auto' resolves to light/dark in JS from the viewer's OS, so only these two states hit CSS. */
:root[data-theme="light"] {
  --bg: #eef2f7;
  --bg-2: #e3e9f2;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --panel-head: rgba(10, 30, 60, 0.035);
  --border: rgba(30, 60, 100, 0.16);
  --border-strong: rgba(30, 60, 100, 0.30);
  --text: #16202e;
  --muted: #55627a;
  --faint: #8592a6;
  --accent-dim: rgba(20, 120, 150, 0.12);
  --good: #0f9d6b;
  --warn: #b45309;
  --bad: #dc2626;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

/* ---- Background layers ---- */
#bg {
  position: fixed; inset: 0; z-index: -2;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  background-color: var(--bg);
  transition: opacity .4s ease;
}
#scrim {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(34,211,238,.07), transparent 60%),
    linear-gradient(180deg, rgba(4,7,12,.82) 0%, rgba(4,7,12,.66) 40%, rgba(4,7,12,.86) 100%);
}

#app { min-height: 100%; display: flex; flex-direction: column; }

/* ============================================================
   Top bar
   ============================================================ */
#topbar {
  height: var(--tb-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: rgba(7, 11, 18, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.tb-clock { display: flex; align-items: baseline; gap: 12px; }
.tb-time { font-family: var(--mono); font-size: 26px; font-weight: 600; letter-spacing: 1px; color: #fff; }
.tb-time .sec { color: var(--accent); font-size: 16px; }
.tb-date { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; }

.tb-center { display: flex; align-items: center; gap: 14px; min-width: 0; overflow: hidden; }
.tb-wx { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); }
.tb-wx .wx-ico { width: 26px; height: 26px; color: var(--accent); }
.tb-wx .wx-temp { font-family: var(--mono); font-size: 18px; font-weight: 600; }
.tb-wx .wx-meta { font-size: 11px; color: var(--muted); line-height: 1.25; }
.tb-wx .wx-loc { color: var(--text); font-weight: 600; }

.tb-status { display: flex; gap: 6px; flex-wrap: wrap; overflow: hidden; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: .5px; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); background: rgba(255,255,255,.02); white-space: nowrap; }
.pill .led { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.pill.up .led { background: var(--good); box-shadow: 0 0 8px var(--good); }
.pill.down { color: var(--bad); border-color: rgba(248,113,113,.35); }
.pill.down .led { background: var(--bad); box-shadow: 0 0 8px var(--bad); }

.tb-right { display: flex; align-items: center; gap: 10px; }

.btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
  padding: 8px 14px; border-radius: 8px; font-size: 13px; transition: .15s; }
.btn:hover { border-color: var(--accent); color: #fff; }
.btn.primary { background: var(--accent); color: #04222a; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.icon { padding: 8px; }
.btn svg { width: 16px; height: 16px; }

.user-chip { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.user-chip .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-dim); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.user-chip .u-name { font-size: 13px; } .user-chip .u-role { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 1px; }

/* ============================================================
   Main area
   ============================================================ */
#main { flex: 1; padding: 16px; }
#statusline { font-family: var(--mono); font-size: 11px; color: var(--faint);
  padding: 8px 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; }

/* ---- Widget grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  grid-auto-flow: dense;
}
.span-2 { grid-column: span 2; }
.tall .panel-body { max-height: 460px; }
@media (max-width: 760px) { .span-2 { grid-column: span 1; } }

/* ---- Panel ---- */
.panel {
  background: var(--panel);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,.28);
}
.panel-head {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: var(--panel-head);
}
.panel-head .p-ico { width: 16px; height: 16px; color: var(--accent); flex: none; }
.panel-head .p-title { font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text); }
.panel-head .p-meta { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.panel-head .p-led { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.p-led.ok { background: var(--good); box-shadow: 0 0 7px var(--good); }
.p-led.err { background: var(--bad); box-shadow: 0 0 7px var(--bad); }
.p-led.load { background: var(--warn); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.panel-body { padding: 12px; overflow: auto; flex: 1; max-height: 340px; }

/* thin scrollbars */
.panel-body::-webkit-scrollbar, .modal-body::-webkit-scrollbar { width: 8px; height: 8px; }
.panel-body::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }

/* ---- Common widget bits ---- */
.empty { color: var(--faint); font-size: 13px; text-align: center; padding: 22px 8px; }
.state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 12px; }
.state-loading { flex-direction: row; justify-content: center; gap: 10px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.state-ico { width: 28px; height: 28px; color: var(--faint); }
.state-error .state-ico { color: var(--bad); }
.state-title { font-size: 14px; color: var(--text); }
.state-hint { font-size: 12px; color: var(--muted); max-width: 420px; line-height: 1.5; }
.notconf { text-align: center; padding: 18px 10px; color: var(--muted); }
.notconf .nc-ico { width: 30px; height: 30px; color: var(--faint); margin-bottom: 8px; }
.notconf .nc-title { font-size: 13px; color: var(--text); margin-bottom: 4px; }
.notconf .nc-sub { font-size: 12px; color: var(--faint); margin-bottom: 10px; }

.row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid rgba(255,255,255,.04); }
.row:last-child { border-bottom: 0; }
.row .r-main { min-width: 0; flex: 1; }
.row .r-title { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r-right { font-family: var(--mono); font-size: 11px; color: var(--faint); text-align: right; white-space: nowrap; }
.thumb { width: 34px; height: 50px; border-radius: 4px; object-fit: cover; background: var(--bg-2); flex: none; }
.chip { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .5px;
  padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); color: var(--muted); }
.chip.good { color: var(--good); border-color: rgba(52,211,153,.4); }
.chip.warn { color: var(--warn); border-color: rgba(251,191,36,.4); }
.chip.bad { color: var(--bad); border-color: rgba(248,113,113,.4); }
.chip.accent { color: var(--accent); border-color: rgba(34,211,238,.4); }

.bar { height: 4px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 5px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: rgba(255,255,255,.02); }
.stat .s-num { font-family: var(--mono); font-size: 22px; font-weight: 600; color: #fff; }
.stat .s-num.accent { color: var(--accent); }
.stat .s-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); margin-top: 2px; }

/* ---- Uptime widget ---- */
.up-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.up-row .up-name { flex: 0 0 90px; font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-bar { flex: 1; height: 8px; background: rgba(255,255,255,.06); border-radius: 999px; overflow: hidden; }
.up-bar-fill { height: 100%; border-radius: 999px; transition: width .3s ease; }
.up-pct { flex: 0 0 46px; font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }

/* ---- Backup list ---- */
.bk-list { display: flex; flex-direction: column; }
.bk-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); }
.bk-name { font-family: var(--mono); font-size: 12px; color: var(--text); }

/* ---- Now playing ---- */
.np { display: flex; gap: 10px; padding: 8px 4px; align-items: center; }
.np .np-info { min-width: 0; flex: 1; }
.np .np-state { font-family: var(--mono); font-size: 10px; text-transform: uppercase; color: var(--accent); }

/* ---- Weather widget ---- */
.wx-now { display: flex; align-items: center; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.wx-now .big { font-family: var(--mono); font-size: 40px; font-weight: 600; color: #fff; line-height: 1; }
.wx-now .wx-ico-lg { width: 52px; height: 52px; color: var(--accent); }
.wx-now .wx-desc { font-size: 13px; color: var(--text); }
.wx-now .wx-sub { font-size: 11px; color: var(--muted); }
.wx-hours { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; }
.wx-hr { text-align: center; min-width: 52px; }
.wx-hr .h { font-size: 10px; color: var(--faint); font-family: var(--mono); }
.wx-hr .i { width: 22px; height: 22px; color: var(--accent); margin: 3px auto; }
.wx-hr .t { font-family: var(--mono); font-size: 13px; }
.wx-hr .p { font-size: 9px; color: var(--accent); }
.wx-days { display: flex; flex-direction: column; gap: 2px; }
.wx-day { display: grid; grid-template-columns: 44px 24px 1fr auto; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; }
.wx-day .d { color: var(--muted); font-family: var(--mono); }
.wx-day .i { width: 18px; height: 18px; color: var(--accent); }
.wx-day .hi { font-family: var(--mono); color: #fff; } .wx-day .lo { font-family: var(--mono); color: var(--faint); }

/* ---- Map ---- */
.map { width: 100%; height: 320px; border-radius: 8px; overflow: hidden; }
.leaflet-container { background: #0a1018; font-family: var(--sans); }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

/* ---- News ---- */
.news-item { padding: 7px 2px; border-bottom: 1px solid rgba(255,255,255,.04); }
.news-item a { color: var(--text); font-size: 13px; }
.news-item a:hover { color: var(--accent); }
.news-item .meta { font-size: 10px; color: var(--faint); font-family: var(--mono); margin-top: 2px; }

/* ---- Links / launcher ---- */
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.link-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 6px; border: 1px solid var(--border);
  border-radius: 9px; background: rgba(255,255,255,.02); text-align: center; transition: .15s; }
.link-tile:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.link-tile .lt-ico { width: 26px; height: 26px; color: var(--accent); }
.link-tile .lt-name { font-size: 11px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---- Flights ---- */
.flt { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 6px 2px; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 12px; align-items: center; }
.flt .call { font-family: var(--mono); color: #fff; }
.flt .rte { font-size: 10px; color: var(--muted); }
.flt .alt { font-family: var(--mono); color: var(--faint); text-align: right; }
.flt .dist { font-family: var(--mono); color: var(--accent); text-align: right; }

/* ============================================================
   Public landing (pre-login)
   ============================================================ */
.landing { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .landing { grid-template-columns: 1fr; } }
.hero-cam { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #000; position: relative; }
.hero-cam .cam-frame { width: 100%; aspect-ratio: 16/9; display: block; border: 0; background: #000; object-fit: cover; }
.hero-cam .cam-label { position: absolute; top: 10px; left: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; color: #fff; background: rgba(0,0,0,.5); padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(4px); }
.hero-cam .cam-live { color: var(--bad); } .hero-cam .cam-live::before { content: "● "; }
.landing-side { display: flex; flex-direction: column; gap: 16px; }
.welcome { padding: 6px 2px; }
.welcome h1 { margin: 0; font-size: 22px; letter-spacing: .5px; }
.welcome p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

/* ============================================================
   Login popover
   ============================================================ */
.login-pop { position: absolute; top: calc(var(--tb-h) - 6px); right: 14px; width: 320px; z-index: 60;
  background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5); padding: 18px; }
.login-pop h3 { margin: 0 0 4px; font-size: 15px; }
.login-pop .sub { color: var(--faint); font-size: 12px; margin-bottom: 14px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border-radius: 7px; border: 1px solid var(--border-strong);
  background: rgba(0,0,0,.35); color: var(--text); font-size: 13px; font-family: var(--sans); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.form-err { color: var(--bad); font-size: 12px; margin-bottom: 10px; min-height: 16px; }

/* ============================================================
   Settings modal
   ============================================================ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(3,6,11,.7); backdrop-filter: blur(4px); z-index: 100050;
  display: grid; place-items: center; padding: 20px; }
.modal { width: min(920px, 96vw); max-height: 90vh; background: var(--panel-solid); border: 1px solid var(--border-strong);
  border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 16px; letter-spacing: .5px; }
.modal-head .btn { margin-left: auto; }
.modal-body { display: grid; grid-template-columns: 190px 1fr; min-height: 0; flex: 1; }
.set-nav { border-right: 1px solid var(--border); padding: 10px; overflow: auto; }
.set-nav button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: transparent; border: 0;
  color: var(--muted); padding: 9px 11px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.set-nav button svg { width: 15px; height: 15px; }
.set-nav button:hover { background: rgba(255,255,255,.03); color: var(--text); }
.set-nav button.active { background: var(--accent-dim); color: var(--accent); }
.set-pane { padding: 18px 20px; overflow: auto; }
.set-pane h3 { margin: 0 0 4px; font-size: 15px; }
.set-pane .pane-sub { color: var(--faint); font-size: 12px; margin-bottom: 16px; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.set-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .set-grid { grid-template-columns: 1fr; } .modal-body { grid-template-columns: 1fr; } .set-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); } }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.switch input { width: 40px; height: 22px; appearance: none; background: rgba(255,255,255,.12); border-radius: 999px; position: relative; cursor: pointer; transition: .2s; }
.switch input:checked { background: var(--accent); }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked::after { left: 20px; }
.test-result { font-size: 12px; font-family: var(--mono); margin-top: 8px; min-height: 16px; }
.test-result.ok { color: var(--good); } .test-result.err { color: var(--bad); }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.hint { font-size: 11px; color: var(--faint); margin-top: 4px; }
.row-inline { display: flex; gap: 10px; align-items: flex-end; }
.win-toolbar .row-inline { flex-wrap: wrap; row-gap: 6px; }
.row-inline .btn { flex: none; }

/* ---- Toast ---- */
/* 5.71: z above the classic taskbar / dock (100000) and the drawers, still under the modals (100050) */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100040;
  background: var(--panel-solid); border: 1px solid var(--border-strong); color: var(--text);
  padding: 11px 18px; border-radius: 10px; font-size: 13px; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.toast.ok { border-color: rgba(52,211,153,.5); } .toast.err { border-color: rgba(248,113,113,.5); }

.spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* Fix: constrain Settings header icons so the gear/X don't balloon to fill the modal */
.modal-head > svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.modal-head .btn svg { width: 16px; height: 16px; }
/* Safety net: any inline icon that slips through without a size class */
.panel-head > svg:not([class]), .set-nav svg { width: 15px; height: 15px; flex: none; }

/* Changelog viewer + statusline link */
#statusline a { color: var(--accent); text-decoration: none; }
#statusline a:hover { text-decoration: underline; }
.changelog-wrap { overflow: auto; max-height: 72vh; }
.changelog { margin: 0; padding: 18px 20px; font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--text); white-space: pre-wrap; word-break: break-word; }

/* 1.2 — access / profile / status */
.status-line { display: flex; align-items: center; gap: 8px; }
.status-led { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.status-led.up { background: var(--good); box-shadow: 0 0 8px var(--good); }
.status-led.down { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.status-led.warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.status-text { font-size: 13px; color: var(--text); }
.prof-grid { display: grid; gap: 6px; }
.prof-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: 13px; }
.prof-k { color: var(--faint); text-transform: uppercase; font-size: 11px; letter-spacing: .5px; }
.prof-v { color: var(--text); }
.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; }
.perm-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.role-block { border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.role-name { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.set-pane textarea { width: 100%; padding: 8px 10px; border-radius: 7px; border: 1px solid var(--border-strong); background: rgba(0,0,0,.35); color: var(--text); font-family: var(--mono); font-size: 12px; }

/* ---- Access & Permissions ---- */
.access-note { border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; color: var(--muted); background: rgba(255,255,255,.02); }
.access-note.warn { border-color: rgba(251,191,36,.5); color: var(--text); }
.access-section { margin: 18px 0 8px; }
.access-section h4 { margin: 0; font-size: 14px; }
.access-grid { display: flex; flex-direction: column; gap: 8px; }
.access-role-row { display: flex; gap: 10px; align-items: flex-start; }
.access-role-row textarea { flex: 1; }
.role-badge { flex: 0 0 74px; text-align: center; font-size: 10px; font-weight: 700; letter-spacing: 1px; padding: 5px 0; border-radius: 6px; text-transform: uppercase; height: fit-content; }
.role-badge.role-owner { background: rgba(34,211,238,.18); color: var(--accent); }
.role-badge.role-admin { background: rgba(248,113,113,.18); color: #f87171; }
.role-badge.role-power { background: rgba(251,191,36,.18); color: #fbbf24; }
.role-badge.role-user  { background: rgba(255,255,255,.08); color: var(--muted); }
.people-wrap { display: flex; flex-direction: column; gap: 8px; }
.person-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.person-head { display: flex; align-items: center; gap: 10px; }
.person-name { font-family: var(--mono); font-size: 13px; color: var(--text); }
.person-card select { padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border-strong); background: rgba(0,0,0,.35); color: var(--text); font-size: 12px; }
.perm-tri-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; margin-top: 10px; }
.perm-tri-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.perm-tri { flex: 0 0 auto; }

/* ---- UniFi detail ---- */
.unifi-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.unifi-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: rgba(255,255,255,.02); }
.uc-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); }
.uc-value { font-family: var(--mono); font-size: 20px; font-weight: 600; color: #fff; margin-top: 2px; }
.uc-value.accent { color: var(--accent); } .uc-value.good { color: var(--good); } .uc-value.bad { color: var(--bad); }
.uc-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.udev-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.udev-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.udev-name { font-weight: 600; color: var(--text); }
.udev-meta { color: var(--muted); font-size: 12px; }
.udev-stats { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 6px; }
.uports { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.uport { width: 26px; height: 26px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-family: var(--mono); border: 1px solid var(--border-strong); color: var(--faint); background: rgba(255,255,255,.03); }
.uport.up { border-color: rgba(52,211,153,.5); color: var(--good); background: rgba(52,211,153,.12); }
.uport.poe { box-shadow: inset 0 -3px 0 var(--warn); }
.uport.uplink { border-color: var(--accent); color: var(--accent); }
.uradios { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; }
.uradio { display: flex; flex-direction: column; }
.udev-actions { display: flex; gap: 8px; margin-top: 12px; }
.uport.poe:hover { outline: 2px solid var(--warn); outline-offset: 1px; }
.uclients { display: flex; flex-direction: column; }
.uclient { display: grid; grid-template-columns: 14px 1.4fr 1fr 1.6fr auto; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--border); font-size: 12px; }
.uclient .uc-name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-ip, .uc-conn { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.uc-data { color: var(--faint); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
/* UniFi round 2: vouchers, bandwidth groups, Wi-Fi QR, threats */
.uvouchers { display: flex; flex-direction: column; }
.uvoucher-row { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--border); }
.uvoucher-row .dir-main { flex: 1; min-width: 0; }
.uvoucher-row .dir-name { color: var(--text); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uvoucher-row .dir-sub { color: var(--muted); font-size: 11px; }
.uqr-holder svg { display: block; }
.uevent.uthreat { align-items: center; }
.uevent.uthreat .ue-msg { color: var(--text); }
.unifi-chart { border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: rgba(0,0,0,.2); }
.chart-legend { display: flex; gap: 14px; align-items: center; font-size: 11px; margin-bottom: 4px; }
.uclient:hover { background: rgba(255,255,255,.03); }
.client-detail { display: flex; flex-direction: column; }
.cd-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.cd-k { color: var(--muted); } .cd-v { color: var(--text); font-family: var(--mono); text-align: right; word-break: break-all; }

/* ---- Home Assistant control ---- */
.ha-area { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); }
.ha-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ha-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ha-card-head { min-height: 20px; }
.ha-name { font-size: 13px; color: var(--text); font-weight: 500; }
.ha-card-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ha-toggle { border: 1px solid var(--border-strong); background: rgba(255,255,255,.05); color: var(--muted); border-radius: 999px; padding: 4px 14px; cursor: pointer; font-size: 12px; font-weight: 600; }
.ha-toggle.on { background: var(--accent); color: #04121a; border-color: var(--accent); }
.ha-slider { flex: 1; min-width: 90px; accent-color: var(--accent); }
.ha-temp { font-family: var(--mono); font-size: 16px; color: var(--text); min-width: 48px; text-align: center; }
.ha-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.ha-tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 8px 12px; cursor: pointer; font-size: 13px; }
.ha-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.ha-cams { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ha-cam-tile { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #000; }
.ha-cam { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.ha-cam-name { padding: 6px 10px; font-size: 12px; color: var(--muted); }

/* 1.3 — NAS file browser */
.fb-crumbs { padding: 9px 16px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.fb-crumbs a { color: var(--accent); cursor: pointer; } .fb-crumbs a:hover { text-decoration: underline; }
.fb-crumbs .sep { color: var(--faint); }
.fb-body { flex: 1; overflow: auto; min-height: 0; }
.fb-list { padding: 4px 8px; }
.fb-row { display: grid; grid-template-columns: 20px 1fr auto auto; align-items: center; gap: 10px; padding: 7px 8px; border-bottom: 1px solid rgba(255,255,255,.04); }
.fb-row:hover { background: rgba(255,255,255,.03); }
.fb-ico { width: 18px; height: 18px; color: var(--accent); flex: none; }
.fb-name { cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.fb-name.dir { color: var(--text); font-weight: 600; } .fb-name.file { color: var(--muted); }
.fb-name:hover { color: var(--accent); }
.fb-size { font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; }
.fb-ops { display: flex; gap: 2px; }
.fb-actions { display: inline-flex; gap: 8px; }

/* 1.4 — command palette */
.palette { width: min(560px, 94vw); margin-top: 12vh; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.palette-input { width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font-size: 15px; outline: none; }
.palette-list { max-height: 320px; overflow: auto; }
.palette-item { padding: 10px 16px; font-size: 13px; color: var(--muted); cursor: pointer; }
.palette-item:hover, .palette-item.sel { background: var(--accent-dim); color: var(--accent); }

/* 1.5 — chat */
/* 5.71: the Ask / Notifications drawers sit above the classic taskbar / dock (z 100000), which covered their compose
   row and last rows; still under the modals (100050). Their snooze menu (.nc-menu) goes above them. One ladder:
   windows 10 < taskbar 100000 < .chat-drawer 100010 < .nc-menu 100020 < viewers and popup menus 100030 (camera big
   view, lightbox, emoji / file / fleet / shell / snippet menus) < .toast 100040 < .si 100045 (the sign-in screen and
   its Settings preview cover everything below) < .modal-backdrop 100050 */
.chat-drawer { position: fixed; top: 0; right: 0; width: min(380px, 92vw); height: 100vh; background: var(--panel-solid); border-left: 1px solid var(--border-strong); z-index: 100010; display: flex; flex-direction: column; box-shadow: -12px 0 44px rgba(0,0,0,.45); }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 600; }
.chat-head svg { width: 18px; height: 18px; color: var(--accent); }
.chat-msgs { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 85%; align-self: flex-start; background: rgba(255,255,255,.04); border: 1px solid var(--border); padding: 7px 10px; border-radius: 10px; }
.chat-msg.me { align-self: flex-end; background: var(--accent-dim); border-color: rgba(34,211,238,.3); }
.chat-meta { font-size: 10px; color: var(--faint); margin-bottom: 2px; }
.chat-text { font-size: 13px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.chat-foot { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-input { flex: 1; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border-strong); background: rgba(0,0,0,.35); color: var(--text); outline: none; }
.chat-badge { display: none; position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; place-items: center; }

/* 1.6 — drag/resize layout edit mode */
.span-3 { grid-column: span 3; }
@media (max-width: 1100px) { .span-3 { grid-column: span 2; } }
@media (max-width: 760px) { .span-3 { grid-column: span 1; } }
.grid.editing .panel { outline: 1px dashed var(--border-strong); }
.edit-panel { position: relative; cursor: grab; }
.edit-panel.dragging { opacity: .45; }
.edit-panel.hidden-widget { opacity: .5; }
.edit-strip { display: flex; gap: 5px; align-items: center; padding: 5px 7px; background: rgba(0,0,0,.4); border-bottom: 1px solid var(--border); }
.es-btn { font-size: 11px; font-family: var(--mono); padding: 2px 8px; border: 1px solid var(--border-strong); background: var(--panel); color: var(--text); border-radius: 6px; cursor: pointer; }
.es-btn:hover { border-color: var(--accent); }
.es-btn.on { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.es-w { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.layoutbar { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 99990; display: flex; gap: 8px; align-items: center; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 999px; padding: 8px 12px; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.layoutbar .hint { margin-right: 4px; }

/* 2.0 — Gridstack live layout */
.grid-stack { background: transparent; }
.grid-stack-item-content { inset: 0; overflow: visible; display: flex; }
.grid-stack-item-content > .panel { width: 100%; height: 100%; }
.grid-stack > .grid-stack-item > .grid-stack-item-content { color: inherit; }
.grid-stack.editing .grid-stack-item { cursor: move; }
.grid-stack.editing .panel { outline: 1px dashed var(--border-strong); }
.grid-stack .ui-resizable-handle { z-index: 6; }
/* make edge/corner handles visible while editing */
.grid-stack.editing .ui-resizable-handle::after { content: ''; }
.grid-stack.editing .ui-resizable-se, .grid-stack.editing .ui-resizable-sw,
.grid-stack.editing .ui-resizable-ne, .grid-stack.editing .ui-resizable-nw {
  width: 16px; height: 16px; border: 2px solid var(--accent); background: var(--panel-solid); border-radius: 3px; opacity: .9;
}
.grid-stack.editing .ui-resizable-nw { top: -2px; left: -2px; }
.grid-stack.editing .ui-resizable-ne { top: -2px; right: -2px; }
.grid-stack.editing .ui-resizable-sw { bottom: -2px; left: -2px; }
.grid-stack.editing .ui-resizable-se { bottom: -2px; right: -2px; }
.grid-stack-item.grid-stack-placeholder > .placeholder-content { border: 1px dashed var(--accent); border-radius: var(--radius); background: var(--accent-dim); }
.addwidget-sel { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: rgba(0,0,0,.35); color: var(--text); font-size: 13px; }

/* 2.1 — splash grid widgets + editor */
.splash-clock { display: flex; flex-direction: column; justify-content: center; height: 100%; gap: 4px; }
.splash-clock .t { font-family: var(--mono); font-size: 38px; font-weight: 600; color: #fff; line-height: 1; }
.splash-clock .d { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; }
.splash-welcome { display: flex; flex-direction: column; justify-content: center; height: 100%; gap: 10px; }
.splash-welcome h1 { margin: 0; font-size: 22px; }
/* Webcam fills its panel edge-to-edge; container clips so iframe/zoom crops don't spill. */
.panel-body.splash-cam { padding: 0; overflow: hidden; position: relative; background: #000; max-height: none; }
.panel-body.splash-cam .cam-frame { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border: 0; display: block; }
.splash-editor { display: flex; flex-direction: column; width: 100%; height: 100%; background: var(--bg); }
.splash-edit-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--panel-solid); }
.splash-edit-top svg { width: 18px; height: 18px; color: var(--accent); }
.splash-edit-host { flex: 1; overflow: auto; padding: 14px; }

/* 2.3 — notifications + topbar badges */
.note { padding: 9px 12px; border-bottom: 1px solid rgba(255,255,255,.05); }
.note-title { font-size: 13px; color: var(--text); }
.note-body { font-size: 12px; color: var(--muted); margin-top: 2px; }
.note-meta { font-size: 10px; color: var(--faint); font-family: var(--mono); margin-top: 3px; text-transform: uppercase; letter-spacing: .5px; }
.note-error .note-title { color: var(--bad); }
.note-warn .note-title { color: var(--warn, #d19a00); }
.note-good .note-title { color: var(--good); }
.tb-badge { display: none; position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; place-items: center; }

/* Cameras app (UniFi Protect live wall) */
.cam-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; padding: 12px; }
@media (max-width: 560px) { .cam-wall { grid-template-columns: 1fr; padding: 8px; gap: 8px; } }
.cam-tile { position: relative; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid var(--border); cursor: pointer; aspect-ratio: 16 / 9; }
.cam-tile:hover { border-color: var(--accent); }
.cam-tile.offline { cursor: default; }
.cam-img { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
.cam-img.broken { opacity: .25; }
.cam-tile.offline .cam-img { opacity: .35; filter: grayscale(1); }
.cam-cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; font-size: 13px; }
.cam-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.cam-badge { font-family: var(--mono); font-size: 10px; letter-spacing: .6px; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,.55); color: #ccc; }
.cam-badge.on { background: rgba(220,40,40,.85); color: #fff; }
.cam-badge.off { background: rgba(90,90,90,.85); color: #ddd; }
.cam-ptz { position: absolute; top: 8px; right: 8px; font-family: var(--mono); font-size: 10px; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,.55); color: #fff; }
.cam-err { position: absolute; left: 10px; right: 10px; top: 38%; font-size: 12px; color: var(--bad); background: rgba(0,0,0,.7); padding: 6px 8px; border-radius: 6px; text-align: center; }
.cam-big { z-index: 100030; }
.cam-big-box { width: min(1400px, 96vw); max-height: 94vh; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.cam-big-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.cam-big-head svg { width: 18px; height: 18px; color: var(--accent); }
.cam-big-img { display: block; width: 100%; max-height: calc(94vh - 52px); object-fit: contain; background: #000; }

/* Notification Center */
.nc-drawer { width: min(420px, 94vw); }
.nc-head-actions { margin-left: auto; display: flex; gap: 2px; }
.nc-filters { padding: 8px 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.nc-tabs { display: flex; gap: 6px; }
.nc-tab { padding: 4px 12px; border-radius: 6px; font-size: 12px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.nc-tab:hover { color: var(--text); }
.nc-tab.active { background: rgba(255,255,255,.06); color: var(--text); border-color: var(--border); }
.nc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nc-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; text-transform: capitalize; }
.nc-chip:hover { color: var(--text); border-color: var(--border-strong); }
.nc-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.nc-chip-n { font-family: var(--mono); font-size: 10px; opacity: .75; }
.nc-chip.active .nc-chip-n { opacity: .95; }
.nc-unacked { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); cursor: pointer; user-select: none; }
.nc-list { padding: 0; }
.nc-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.05); border-left: 3px solid transparent; }
.nc-note.unread { border-left-color: var(--accent); background: rgba(255,255,255,.025); }
.nc-note.acked { opacity: .55; }
.nc-note-main { flex: 1; min-width: 0; }
.nc-note-main .note-title { word-break: break-word; }
.nc-note-actions { display: flex; gap: 2px; flex-shrink: 0; opacity: .4; transition: opacity .12s; }
.nc-note:hover .nc-note-actions { opacity: 1; }
.nc-note-actions .btn.icon { width: 26px; height: 26px; }
.nc-menu { position: fixed; z-index: 100020; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.5); padding: 4px; min-width: 148px; }
.nc-menu-item { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: transparent; color: var(--text); font-size: 12px; border-radius: 6px; cursor: pointer; }
.nc-menu-item:hover { background: var(--accent); color: #fff; }
.edit-interval { font-size: 11px; font-family: var(--mono); padding: 2px 4px; border-radius: 6px; border: 1px solid var(--border-strong); background: rgba(0,0,0,.35); color: var(--text); margin-top: 6px; }

/* ============================================================
   3.0 — Desktop shell: window manager, dock, snap tiling
   ============================================================ */
#main.desktop-mode { padding: 0; position: relative; overflow: hidden; }
.desktop { position: absolute; inset: 0; overflow: hidden; }
.desk-wallpaper { position: absolute; inset: 0; overflow: auto; padding: 14px 14px 96px; }
/* 5.70: z-index = its own stacking context, so the climbing per-window z-indexes only order the windows among
   themselves and never end up over the drawers, toasts and menus (still above .desk-files 7 / .desk-shortcuts 5) */
.desk-windows { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.snap-preview { position: absolute; z-index: 99998; pointer-events: none; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 20%, transparent); border: 2px solid var(--accent);
  transition: left .12s ease, top .12s ease, width .12s ease, height .12s ease; }

/* window */
.win { position: absolute; pointer-events: auto; display: flex; flex-direction: column;
  min-width: 340px; min-height: 220px; border-radius: 12px; overflow: hidden;
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  box-shadow: 0 24px 70px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.4); }
:root[data-theme="light"] .win { box-shadow: 0 24px 60px rgba(20,40,80,.22), 0 2px 8px rgba(20,40,80,.12); }
.win.active { border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong));
  box-shadow: 0 30px 90px rgba(0,0,0,.62), 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.win.maximized { border-radius: 0; }
.win.opening { animation: winIn .18s cubic-bezier(.2,.8,.3,1); }
.win.closing { animation: winOut .13s ease forwards; }
.win.minimized { animation: winMin .16s ease forwards; }
@keyframes winIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes winOut { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes winMin { to { opacity: 0; transform: translateY(46px) scale(.88); } }

.win-titlebar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 12px; flex: 0 0 auto;
  background: var(--panel-head); border-bottom: 1px solid var(--border); cursor: grab; user-select: none; touch-action: none; }
.win-titlebar:active { cursor: grabbing; }
.win-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; }
.win-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-ico { width: 16px; height: 16px; color: var(--accent); flex: 0 0 auto; }
.win-controls { display: flex; gap: 4px; flex: 0 0 auto; }
.win-btn { width: 28px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; transition: background .12s, color .12s; }
.win-btn svg { width: 15px; height: 15px; }
.win-btn:hover { background: var(--border); color: var(--text); }
.win-btn.close:hover { background: var(--bad); color: #fff; }
.win-body { flex: 1; overflow: auto; position: relative; background: var(--panel-solid); }

/* resize handles */
.win-resize { position: absolute; z-index: 2; touch-action: none; }
.win-resize.r-n { top: -3px; left: 10px; right: 10px; height: 8px; cursor: ns-resize; }
.win-resize.r-s { bottom: -3px; left: 10px; right: 10px; height: 8px; cursor: ns-resize; }
.win-resize.r-e { right: -3px; top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.win-resize.r-w { left: -3px; top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.win-resize.r-ne { top: -3px; right: -3px; width: 15px; height: 15px; cursor: nesw-resize; }
.win-resize.r-nw { top: -3px; left: -3px; width: 15px; height: 15px; cursor: nwse-resize; }
.win-resize.r-se { bottom: -3px; right: -3px; width: 15px; height: 15px; cursor: nwse-resize; }
.win-resize.r-sw { bottom: -3px; left: -3px; width: 15px; height: 15px; cursor: nesw-resize; }

/* dock */
.desk-dock { position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px; z-index: 100000;
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 18px;
  background: color-mix(in srgb, var(--panel-solid) 76%, transparent); border: 1px solid var(--border-strong);
  box-shadow: 0 12px 40px rgba(0,0,0,.45); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  max-width: calc(100% - 24px); overflow-x: auto; }
.dock-apps { display: flex; align-items: flex-end; gap: 8px; }
.dock-item { position: relative; width: 52px; height: 52px; border: 0; border-radius: 14px; cursor: pointer; flex: 0 0 auto;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); display: grid; place-items: center;
  transition: transform .14s cubic-bezier(.2,.8,.3,1), background .14s; }
.dock-item svg { width: 26px; height: 26px; color: var(--accent); }
.dock-item:hover { transform: translateY(-8px) scale(1.08); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.dock-item.active { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.dock-dot { position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: transparent; transition: background .14s; }
.dock-item.running .dock-dot { background: var(--accent); }
.dock-item.dock-running-only:not(.running) { display: none; } /* 5.70: hidden apps (a PC's terminal...) only while open */
@media (max-width: 640px) { .dock-item { width: 46px; height: 46px; } .desk-dock { bottom: 8px; } }

/* app-in-window chrome (shared by HA / UniFi / Files mounted into windows) */
.win-toolbar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; row-gap: 6px; align-items: center; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); background: var(--panel-solid); flex-wrap: wrap; }
.win-tt { font-size: 13px; font-weight: 600; color: var(--text); }
.win-scroll { padding: 14px; }
.win-body .fb-body { position: static; height: auto; }
.chat-win { display: flex; flex-direction: column; height: 100%; }
.chat-win .chat-msgs { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-win .chat-foot { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--panel-head); }
.chat-win .chat-input { flex: 1; }

/* ============================================================
   3.1 — Windows Aero glass refresh
   Frosted translucent surfaces, glossy top sheen, glowing edges;
   blur reveals the wallpaper (and windows behind) — the Aero effect.
   ============================================================ */
:root { --glass-hi: rgba(255,255,255,.40); }
:root[data-theme="light"] { --glass-hi: rgba(255,255,255,.85); }
.aero-sheen { }

/* widget cards */
.panel {
  background: linear-gradient(to bottom, rgba(255,255,255,.12) 0%, rgba(255,255,255,.04) 44%, rgba(255,255,255,0) 45%, rgba(0,0,0,.05) 100%), color-mix(in srgb, var(--panel-solid) 56%, transparent);
  backdrop-filter: blur(18px) saturate(165%); -webkit-backdrop-filter: blur(18px) saturate(165%);
  border: 1px solid color-mix(in srgb, #fff 20%, var(--border));
  border-radius: 14px;
  box-shadow: 0 8px 26px rgba(0,0,0,.26), inset 0 1px 0 var(--glass-hi);
}
.panel-head { background: linear-gradient(to bottom, rgba(255,255,255,.10), rgba(255,255,255,0)); border-bottom: 1px solid rgba(255,255,255,.10); }

/* top bar → glass menu bar */
#topbar {
  background: linear-gradient(to bottom, rgba(255,255,255,.12), rgba(255,255,255,.03)), color-mix(in srgb, var(--panel-solid) 52%, transparent);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 2px 14px rgba(0,0,0,.22);
}

/* buttons → glass */
.btn { background: linear-gradient(to bottom, rgba(255,255,255,.13), rgba(255,255,255,.03)); box-shadow: inset 0 1px 0 rgba(255,255,255,.26); }
.btn:hover { background: linear-gradient(to bottom, rgba(255,255,255,.20), rgba(255,255,255,.06)); }
.btn.primary { background: linear-gradient(to bottom, color-mix(in srgb, var(--accent) 76%, #fff 24%), var(--accent)); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 2px 10px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.icon.ghost:hover { background: linear-gradient(to bottom, rgba(255,255,255,.16), rgba(255,255,255,.04)); }

/* windows → Aero glass, active window glows with the accent */
.win {
  background: linear-gradient(to bottom, rgba(255,255,255,.09), rgba(255,255,255,0) 64px), color-mix(in srgb, var(--panel-solid) 72%, transparent);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid color-mix(in srgb, #fff 26%, var(--border-strong));
  box-shadow: 0 30px 80px rgba(0,0,0,.5), inset 0 1px 0 var(--glass-hi);
}
.win.active {
  border-color: color-mix(in srgb, var(--accent) 55%, #fff 22%);
  box-shadow: 0 36px 100px rgba(0,0,0,.6), 0 0 26px color-mix(in srgb, var(--accent) 42%, transparent), inset 0 1px 0 var(--glass-hi);
}
.win-titlebar { background: linear-gradient(to bottom, rgba(255,255,255,.17), rgba(255,255,255,.04)); border-bottom: 1px solid rgba(255,255,255,.12); }
.win-body { background: color-mix(in srgb, var(--panel-solid) 90%, transparent); }

/* dock → chunkier Aero glass */
.desk-dock {
  background: linear-gradient(to bottom, rgba(255,255,255,.17), rgba(255,255,255,.05)), color-mix(in srgb, var(--panel-solid) 52%, transparent);
  backdrop-filter: blur(28px) saturate(170%); -webkit-backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid color-mix(in srgb, #fff 26%, var(--border-strong));
  box-shadow: 0 16px 46px rgba(0,0,0,.45), inset 0 1px 0 var(--glass-hi);
}
.dock-item { background: linear-gradient(to bottom, rgba(255,255,255,.16), rgba(255,255,255,.04)); box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.dock-item.running { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 0 16px color-mix(in srgb, var(--accent) 48%, transparent); }

/* modals still in use (client panels etc.) → match the glass */
.modal {
  background: linear-gradient(to bottom, rgba(255,255,255,.08), rgba(255,255,255,0) 64px), color-mix(in srgb, var(--panel-solid) 84%, transparent);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid color-mix(in srgb, #fff 22%, var(--border-strong));
  box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 var(--glass-hi);
}

/* Settings, now a window */
.set-win { display: flex; flex-direction: column; height: 100%; }
.set-body { display: flex; flex: 1; min-height: 0; }
.set-body .set-nav { width: 190px; flex: 0 0 auto; }
.set-body .set-pane { flex: 1; }
.set-foot { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border); background: linear-gradient(to bottom, rgba(255,255,255,.06), rgba(255,255,255,0)); }
@media (max-width: 640px) { .set-body { flex-direction: column; } .set-body .set-nav { width: auto; display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); } }

/* ============================================================
   3.2 — Feature-rich chat
   ============================================================ */
.chat-win { display: flex; flex-direction: column; height: 100%; position: relative; }
.chat-win.drag::after { content: 'Drop files to share'; position: absolute; inset: 8px; z-index: 5; display: grid; place-items: center;
  border: 2px dashed var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 600; pointer-events: none; }
.chat-msgs { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.chat-day { text-align: center; margin: 12px 0 6px; }
.chat-day span { font-size: 11px; color: var(--faint); background: color-mix(in srgb, var(--panel-solid) 70%, transparent); padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); }
.cmsg { position: relative; padding: 2px 40px 2px 0; }
.cmsg:not(.grouped) { margin-top: 10px; }
.cmsg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.cmsg-avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #04222a;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent)); flex: none; }
.cmsg-name { font-size: 13px; font-weight: 700; color: var(--text); }
.cmsg-time { font-size: 10.5px; color: var(--faint); }
.cmsg-bwrap { padding-left: 34px; }
.cmsg-body { display: inline-flex; flex-direction: column; gap: 4px; max-width: 100%; }
.cmsg-text { background: color-mix(in srgb, var(--accent) 8%, var(--panel-head)); border: 1px solid var(--border); padding: 7px 11px; border-radius: 4px 12px 12px 12px; font-size: 13.5px; line-height: 1.45; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.cmsg.mine .cmsg-text { background: color-mix(in srgb, var(--accent) 20%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.cmsg-edited { color: var(--faint); font-size: 10.5px; }
.cmsg-replyq { font-size: 11.5px; color: var(--muted); border-left: 2px solid var(--accent); padding: 1px 8px; margin-bottom: 2px; opacity: .85; }
.cmsg-replyq b { color: var(--text); }
.cmsg-atts { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.cmsg-imgs { display: grid; gap: 4px; max-width: 340px; }
.cmsg-imgs.n1 { grid-template-columns: 1fr; }
.cmsg-imgs.n2, .cmsg-imgs.n4 { grid-template-columns: 1fr 1fr; }
.cmsg-imgs.n3 { grid-template-columns: 1fr 1fr 1fr; }
.cmsg-imgs img { width: 100%; height: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; cursor: zoom-in; border: 1px solid var(--border); display: block; }
.cmsg-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-head); color: var(--text); max-width: 300px; }
.cmsg-file:hover { border-color: var(--accent); text-decoration: none; }
.cmsg-file svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.cmsg-file .cf-main { flex: 1; min-width: 0; }
.cf-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-size { font-size: 10.5px; color: var(--faint); }
.cmsg-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.creact { font-size: 12px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-head); color: var(--text); cursor: pointer; }
.creact.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, transparent); }
.cmsg-actions { position: absolute; top: -10px; right: 8px; display: none; gap: 2px; padding: 2px; border-radius: 8px;
  background: var(--panel-solid); border: 1px solid var(--border-strong); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.cmsg:hover .cmsg-actions { display: flex; }
.ca-btn { width: 26px; height: 24px; border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.ca-btn svg { width: 15px; height: 15px; }
.ca-btn:hover { background: var(--border); color: var(--text); }
.emoji-pop { position: fixed; z-index: 100030; display: flex; gap: 2px; padding: 6px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--border-strong); box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.emoji-pop button { font-size: 20px; width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; }
.emoji-pop button:hover { background: var(--border); transform: scale(1.15); }
.chat-typing { height: 16px; padding: 0 16px; font-size: 11.5px; color: var(--muted); font-style: italic; }
.chat-composer { border-top: 1px solid var(--border); padding: 8px 10px; background: var(--panel-head); }
.chat-reply { display: flex; align-items: center; gap: 8px; padding: 5px 8px; margin-bottom: 6px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid var(--border); font-size: 12px; }
.chat-reply svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.chat-reply .reply-info { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-reply .reply-info b { margin-right: 6px; }
.chat-tray { display: none; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chat-chip { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-solid); max-width: 180px; }
.chat-chip img { width: 30px; height: 30px; border-radius: 5px; object-fit: cover; }
.chat-chip svg { width: 18px; height: 18px; color: var(--accent); }
.chat-chip .chip-name { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 2px; }
.chip-x svg { width: 13px; height: 13px; }
.chat-inputrow { display: flex; align-items: flex-end; gap: 6px; }
.chat-ta { flex: 1; resize: none; min-height: 38px; max-height: 140px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--panel-solid); color: var(--text); font-family: var(--sans); font-size: 13.5px; line-height: 1.4; }
.chat-ta:focus { outline: none; border-color: var(--accent); }
.chat-send { align-self: stretch; }
.lightbox { position: fixed; inset: 0; z-index: 100030; background: rgba(0,0,0,.82); display: grid; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }

/* 3.7 — chat threads / mentions / search / pins */
.chat-win { position: relative; }
.chat-topbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--panel-head); flex: 0 0 auto; }
.chat-search-ico { width: 15px; height: 15px; color: var(--faint); flex: none; }
.chat-search { flex: 1; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--panel-solid); color: var(--text); font-size: 13px; }
.chat-search:focus { outline: none; border-color: var(--accent); }
.chat-topbar .btn.icon.ghost.has { color: var(--accent); }
.chat-pins { max-height: 38%; overflow: auto; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--accent) 6%, transparent); padding: 6px 10px; flex: 0 0 auto; }
.chat-pins-h { display: flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); margin-bottom: 4px; }
.chat-pins-h svg { width: 13px; height: 13px; }
.chat-pin { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px solid var(--border); }
.chat-pin-main { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pin-main b { color: var(--text); }
.cmention { color: var(--accent); font-weight: 600; }
.cmention.me { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 4px; padding: 0 3px; }
.cmsg.pinged .cmsg-text { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: color-mix(in srgb, var(--warn) 9%, var(--panel-head)); }
.cmsg-pinned { color: var(--warn); display: inline-flex; margin-left: 4px; }
.cmsg-pinned svg { width: 12px; height: 12px; }
.cmsg-thread { margin-top: 4px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; cursor: pointer; width: fit-content; }
.cmsg-thread svg { width: 13px; height: 13px; }
.cmsg-thread.has-unread { color: var(--good, #34d399); background: color-mix(in srgb, var(--good, #34d399) 14%, transparent); border-color: color-mix(in srgb, var(--good, #34d399) 40%, var(--border)); font-weight: 600; }
.cmsg-thread-badge { min-width: 16px; height: 16px; padding: 0 4px; display: inline-grid; place-items: center; border-radius: 8px; background: var(--good, #34d399); color: #04170f; font-size: 10.5px; font-weight: 700; }

/* 3.16 — link preview card */
.cmsg-preview { display: flex; margin-top: 6px; max-width: 420px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit; background: color-mix(in srgb, var(--text) 4%, transparent); }
.cmsg-preview:hover { border-color: var(--border-strong); }
.cpv-img { flex: 0 0 96px; width: 96px; background: var(--panel-head); }
.cpv-img img { width: 96px; height: 100%; object-fit: cover; display: block; }
.cpv-meta { padding: 8px 10px; min-width: 0; }
.cpv-site { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.cpv-title { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cpv-desc { font-size: 12px; color: var(--muted); margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* 3.16 — read receipts */
.chat-receipts { display: flex; align-items: center; gap: 4px; justify-content: flex-end; padding: 2px 16px 6px; font-size: 11px; color: var(--muted); }
.chat-receipts svg { width: 12px; height: 12px; color: var(--good, #34d399); }

.chat-thread { position: absolute; inset: 0; z-index: 6; flex-direction: column; background: var(--panel-solid); }
.chat-thread-h { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--panel-head); flex: 0 0 auto; }
.chat-thread .chat-msgs { flex: 1; }
.mention-pop { display: flex; flex-direction: column; min-width: 200px; max-width: 280px; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.4); overflow: hidden; }
.mention-pop button { display: flex; align-items: baseline; gap: 4px; text-align: left; border: 0; background: transparent; color: var(--text); padding: 7px 11px; cursor: pointer; font-size: 13px; }
.mention-pop button:hover { background: var(--accent-dim); }

/* ============================================================
   3.2.1 — Aero scrollbars + dock polish
   ============================================================ */
/* Kill the default white scrollbars in every app window / scroll area. */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 38%, var(--border-strong)) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 34%, var(--border-strong)); border-radius: 9px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--accent) 55%, var(--border-strong)); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* Dock: magnify icons in place (no lift) so they stay inside the bar instead of overlapping it. */
.desk-dock { padding: 10px 13px; }
.dock-item:hover { transform: scale(1.16); }
.dock-badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; display: none; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.4); }

/* ============================================================
   3.3 — FlightRadar app (live radar map + full aircraft table)
   ============================================================ */
.win-body:has(.fr-body) { display: flex; flex-direction: column; overflow: hidden; }
.fr-toolbar { flex: 0 0 auto; }
.fr-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.fr-stat { font-size: 12.5px; color: var(--muted); }
.fr-stat b { color: var(--text); font-size: 14px; font-family: var(--mono); }
.fr-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.fr-map { flex: 0 0 auto; height: 300px; width: 100%; background: #0a1120; }
.fr-plane-ic { color: var(--accent); }
.fr-plane { width: 18px; height: 18px; display: grid; place-items: center; filter: drop-shadow(0 0 2px rgba(0,0,0,.7)); }
.fr-table { flex: 1; overflow: auto; min-height: 0; padding: 2px 0; }
.fr-row { display: grid; grid-template-columns: 1.4fr .9fr 1fr .8fr .7fr 1.4fr; gap: 8px; align-items: center; padding: 6px 14px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.fr-row.fr-head { position: sticky; top: 0; background: var(--panel-solid); color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; z-index: 1; }
.fr-row:not(.fr-head):hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.fr-call b { color: var(--text); }
.fr-call small { color: var(--faint); }
.fr-row .up { color: var(--good); }
.fr-row .down { color: var(--warn); }
.fr-rte { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.splash-flt-list { margin-top: 8px; display: flex; flex-direction: column; }
@media (max-width: 720px) { .fr-row { grid-template-columns: 1.4fr .9fr .8fr 1.2fr; } .fr-row span:nth-child(2), .fr-row span:nth-child(4) { display: none; } }

/* ============================================================
   3.4 — Docker · System Monitor · Notes & Tasks
   ============================================================ */
.dk-sum { color: var(--muted); font-size: 12px; margin-left: 10px; }
.dk-group { display: flex; align-items: center; gap: 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); margin: 14px 2px 6px; }
.dk-group svg { width: 13px; height: 13px; }
.dk-group-sum { margin-left: auto; text-transform: none; letter-spacing: 0; color: var(--muted); font-family: var(--mono); }
.dk-card { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; background: var(--panel-head); }
.dk-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--faint); }
.dk-dot.up { background: var(--good); box-shadow: 0 0 7px var(--good); }
.dk-dot.down { background: var(--bad); }
.dk-dot.warn { background: var(--warn); }
.dk-main { flex: 1; min-width: 0; }
.dk-name { font-size: 13px; font-weight: 600; color: var(--text); }
.dk-img { font-size: 11px; color: var(--muted); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-status { font-size: 11px; color: var(--faint); }
.dk-acts { display: flex; gap: 3px; flex: none; }
.dk-logs { margin: 0; padding: 14px; font-family: var(--mono); font-size: 11.5px; line-height: 1.5; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.dk-sum { font-size: 11.5px; color: var(--muted); margin-left: 10px; }
/* 3.17 — docker: per-container stats + images */
.dk-stat { flex: 0 0 148px; }
.dk-stat-load { color: var(--faint); font-size: 12px; }
.dk-stat-in { display: flex; flex-direction: column; gap: 4px; }
.dk-metric { display: flex; align-items: center; gap: 6px; }
.dk-mlabel { font-size: 9.5px; letter-spacing: .5px; color: var(--faint); width: 26px; }
.dk-mval { font-size: 10.5px; font-family: var(--mono); color: var(--muted); width: 52px; text-align: right; }
.dk-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.dk-bar-fill { height: 100%; border-radius: 3px; }
.dk-imgbar { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.dk-imgbar .btn { margin-left: auto; }
.dk-imglist { display: flex; flex-direction: column; }
.dk-imgrow { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.dk-imgrow.dangling { opacity: .6; }
.dk-imgmain { flex: 1; min-width: 0; }
.dk-imgname { font-size: 12.5px; color: var(--text); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-imgtags { font-size: 10.5px; color: var(--faint); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-imgsize { font-size: 11.5px; font-family: var(--mono); color: var(--muted); flex: none; }
@media (max-width: 560px) {
  /* Phone: name + status on one line, CPU/MEM bars under it, buttons wrap underneath - nothing clipped. */
  .dk-card { flex-wrap: wrap; row-gap: 8px; }
  .dk-main { flex: 1 1 calc(100% - 24px); }
  .dk-status { overflow-wrap: anywhere; }
  .dk-stat { flex: 1 1 100%; }
  .dk-acts { flex: 1 1 100%; flex-wrap: wrap; }
  .dk-imgrow { flex-wrap: wrap; }
  .dk-imgsize { margin-left: auto; }
}

.sm-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.sm-gauge { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--panel-head); }
.sm-g-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.sm-g-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); }
.sm-g-pct { font-size: 20px; font-weight: 700; font-family: var(--mono); color: var(--text); }
.sm-g-sub { font-size: 11px; color: var(--muted); margin-top: 6px; }
.sm-sect { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); margin: 14px 2px 2px; }
.sm-spark { border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px; background: var(--panel-head); }
.sm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.sm-stat { border: 1px solid var(--border); border-radius: 10px; padding: 10px; text-align: center; background: var(--panel-head); }
.sm-stat b { display: block; font-family: var(--mono); font-size: 15px; color: var(--text); }
.sm-stat span { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .6px; }
@media (max-width: 560px) { .sm-grid { grid-template-columns: 1fr; } }

.nt-body { padding: 2px 0; }
.nt-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.nt-note { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--panel-head); cursor: pointer; transition: border-color .12s; }
.nt-note:hover { border-color: var(--accent); }
.nt-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.nt-prev { font-size: 12px; color: var(--muted); white-space: pre-wrap; max-height: 60px; overflow: hidden; }
.nt-meta { font-size: 10.5px; color: var(--faint); margin-top: 8px; }
.nt-editor { display: flex; flex-direction: column; gap: 10px; }
.nt-input { padding: 9px 12px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--panel-solid); color: var(--text); font-size: 14px; }
.nt-input:focus { outline: none; border-color: var(--accent); }
.nt-ta { min-height: 260px; resize: vertical; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--panel-solid); color: var(--text); font-family: var(--sans); font-size: 13.5px; line-height: 1.5; }
.nt-ta:focus { outline: none; border-color: var(--accent); }
.nt-edit-foot { display: flex; gap: 8px; align-items: center; }
.nt-addrow { display: flex; gap: 8px; margin-bottom: 12px; }
.nt-addrow .nt-input { flex: 1; }
.nt-tasks { display: flex; flex-direction: column; }
.nt-task { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.nt-task.done .nt-tx { text-decoration: line-through; color: var(--faint); }
.nt-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border-strong); background: transparent; cursor: pointer; display: grid; place-items: center; flex: none; color: #04222a; }
.nt-check.on { background: var(--accent); border-color: var(--accent); }
.nt-check svg { width: 14px; height: 14px; }
.nt-tx { flex: 1; font-size: 13.5px; color: var(--text); }
.nt-done-sep { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); margin: 14px 2px 4px; }
/* 3.17 — notes: tags, pin, markdown */
.nt-tagbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 2px; }
.nt-tag { font-size: 11.5px; padding: 3px 10px; border-radius: 20px; border: 1px solid var(--border); background: var(--panel-head); color: var(--muted); cursor: pointer; }
.nt-tag.on { background: var(--accent); border-color: var(--accent); color: #04222a; font-weight: 600; }
.nt-note { position: relative; }
.nt-note.pinned { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.nt-pin { position: absolute; top: 10px; right: 10px; color: var(--accent); }
.nt-pin svg { width: 14px; height: 14px; }
.nt-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.nt-chip { font-size: 10.5px; padding: 2px 8px; border-radius: 12px; background: var(--accent-dim); color: var(--accent); }
.nt-pincheck { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.nt-view-head { display: flex; align-items: center; margin-bottom: 8px; }
.nt-view-title { font-size: 22px; font-weight: 700; color: var(--text); margin: 6px 0; }
.nt-preview { min-height: 260px; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--panel-solid); }
/* markdown output */
.md { font-size: 14px; line-height: 1.6; color: var(--text); }
.md-h { font-weight: 700; color: var(--text); margin: 14px 0 6px; line-height: 1.3; }
h1.md-h { font-size: 20px; } h2.md-h { font-size: 17px; } h3.md-h { font-size: 15px; } h4.md-h { font-size: 13.5px; }
.md-p { margin: 8px 0; }
.md-list { margin: 8px 0 8px 20px; display: flex; flex-direction: column; gap: 3px; }
.md-q { border-left: 3px solid var(--accent); padding: 2px 12px; margin: 8px 0; color: var(--muted); }
.md-pre { background: var(--panel-head); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow: auto; margin: 8px 0; }
.md-pre code { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.md-code { font-family: var(--mono); font-size: 12.5px; background: var(--panel-head); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.md a { color: var(--accent); }
.md-hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
/* 3.20 — notes folders */
.nt-folderbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 2px; }
.nt-folder { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 3px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-head); color: var(--muted); cursor: pointer; }
.nt-folder svg { width: 12px; height: 12px; }
.nt-folder.on { background: var(--accent); border-color: var(--accent); color: #04222a; font-weight: 600; }
@media (max-width: 560px) { .nt-notes { grid-template-columns: 1fr; } }

/* 3.20 — Workspaces popover */
.ws-pop { width: 320px; max-width: 92vw; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 18px 44px rgba(0,0,0,.45); z-index: 100060; overflow: hidden; }
.ws-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; color: var(--text); }
.ws-head svg { width: 16px; height: 16px; color: var(--accent); }
.ws-list { max-height: 300px; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.ws-empty { font-size: 12px; color: var(--muted); padding: 12px; line-height: 1.5; }
.ws-row { display: flex; align-items: center; gap: 4px; }
.ws-open { flex: 1; display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--border); background: var(--panel-head); border-radius: 8px; padding: 7px 10px; cursor: pointer; color: var(--text); min-width: 0; }
.ws-open:hover { border-color: var(--accent); }
.ws-open svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.ws-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-count { margin-left: auto; font-size: 10.5px; color: var(--faint); flex: none; }
.ws-mini { width: 30px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--panel-head); border-radius: 8px; cursor: pointer; color: var(--muted); flex: none; }
.ws-mini:hover { border-color: var(--accent); color: var(--text); }
.ws-mini.danger:hover { border-color: var(--bad); color: var(--bad); }
.ws-mini svg { width: 14px; height: 14px; }
.ws-save { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--border); }
.ws-input { flex: 1; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--panel-head); color: var(--text); font-size: 13px; }
.ws-input:focus { outline: none; border-color: var(--accent); }

/* 3.20 — Calendar / agenda */
.cal-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-left: 14px; }
.cal-leg { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.cal-leg.err { color: var(--bad); }
.cal-dot, .cal-ev-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.cal-body { padding: 4px 4px 16px; }
.cal-day { display: flex; align-items: baseline; gap: 10px; margin: 16px 6px 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.cal-day.today .cal-daylabel { color: var(--accent); }
.cal-daynum { font-size: 20px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.cal-daylabel { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--faint); }
.cal-ev { display: flex; align-items: flex-start; gap: 10px; padding: 8px 8px; border-radius: 9px; }
.cal-ev:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.cal-ev-dot { margin-top: 5px; }
.cal-ev-time { font-size: 12px; font-family: var(--mono); color: var(--muted); width: 62px; flex: none; text-align: right; }
.cal-ev-main { flex: 1; min-width: 0; }
.cal-ev-title { font-size: 13.5px; color: var(--text); }
.cal-ev-loc { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.cal-ev-loc svg { width: 12px; height: 12px; }
.cal-ev-feed { font-size: 10.5px; color: var(--faint); background: var(--panel-head); border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px; flex: none; align-self: center; }

/* ============================================================
   3.5 — Changelog viewer · Weather radar · AD Directory
   ============================================================ */
.cl-body { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.cl-list { width: 180px; flex: 0 0 auto; border-right: 1px solid var(--border); overflow: auto; padding: 8px; }
.cl-ver { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; background: transparent; color: var(--muted); padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.cl-ver:hover { background: rgba(255,255,255,.04); color: var(--text); }
.cl-ver.active { background: var(--accent-dim); color: var(--accent); }
.cl-vn { font-size: 13px; font-weight: 600; }
.cl-vd { font-size: 10.5px; color: var(--faint); }
.cl-pane { flex: 1; overflow: auto; padding: 18px 22px; }
.cl-vh { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 12px; }
.cl-vh h3 { margin: 0; font-size: 20px; }
.cl-date { color: var(--faint); font-size: 12px; }
.cl-h { font-weight: 700; color: var(--accent); margin: 14px 0 6px; font-size: 13.5px; }
.cl-li { position: relative; padding-left: 16px; margin: 4px 0; font-size: 13px; color: var(--text); line-height: 1.5; }
.cl-li::before { content: '•'; position: absolute; left: 2px; color: var(--accent); }
.cl-p { font-size: 13px; color: var(--muted); margin: 4px 0; line-height: 1.5; }
.cl-sp { height: 6px; }
@media (max-width: 560px) { .cl-list { width: 130px; } }

.win-body:has(.rd-body) { display: flex; flex-direction: column; overflow: hidden; }
.rd-bar { display: flex; align-items: center; gap: 10px; width: 100%; flex-wrap: wrap; }
.rd-ts { font-size: 12.5px; color: var(--text); font-family: var(--mono); min-width: 130px; }
.rd-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rd-map { flex: 1; width: 100%; min-height: 0; background: #0a1120; }
/* 3.18 — radar controls */
.rd-ctls { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }
.rd-ctl { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .5px; }
.rd-sel { background: var(--panel-solid); color: var(--text); border: 1px solid var(--border-strong); border-radius: 7px; padding: 3px 6px; font-size: 12px; }
.rd-op { width: 80px; }
.rd-scrub { flex: 0 0 auto; padding: 8px 12px; background: var(--panel-head); border-top: 1px solid var(--border); }
.rd-range { width: 100%; accent-color: var(--accent); cursor: pointer; }

.dir-count { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 1px; margin: 4px 2px 8px; }
.dir-row { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.dir-row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.dir-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #04222a; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent)); flex: none; }
.dir-avatar.off { background: var(--faint); }
.dir-gi { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-dim); color: var(--accent); flex: none; }
.dir-gi svg { width: 17px; height: 17px; }
.dir-main { flex: 1; min-width: 0; }
.dir-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.dir-sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-uname { font-size: 11.5px; color: var(--faint); font-family: var(--mono); flex: none; }
.dir-kv { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.dir-k { width: 110px; flex: none; color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-v { color: var(--text); font-size: 13px; word-break: break-word; }
/* Disk rows carry mount paths that can be long (Synology: /volume1/...) - let the label grow but
   ellipsize instead of overlapping the value, and keep the value pinned right on one line. */
.fleet-disk .dir-k { width: auto; flex: 0 1 auto; max-width: 55%; }
.fleet-disk .dir-v { margin-left: auto; flex: 0 0 auto; white-space: nowrap; }
.dir-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.dir-tags .chip-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; }
.dir-tags .chip-x:hover { color: var(--bad); }
.dir-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.dir-pw { display: flex; gap: 8px; margin-top: 6px; }

/* 3.8 — AD-more (create/unlock/bulk/report), DNS + Group Policy apps */
.dir-check { width: 15px; height: 15px; flex: none; accent-color: var(--accent); cursor: pointer; }
.dir-bulkbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 8px; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid var(--accent-dim); position: sticky; top: 0; z-index: 2; }
.dir-bulkbar > span:first-child { font-size: 12px; font-weight: 600; color: var(--text); margin-right: auto; }
.dir-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dir-field { display: flex; flex-direction: column; gap: 4px; }
.dir-field > span { font-size: 11.5px; color: var(--faint); }
.dir-field.full, .dir-form > .full { grid-column: 1 / -1; }

.dir-table { display: flex; flex-direction: column; margin-top: 6px; }
.dir-tr { display: grid; grid-template-columns: 2fr 1.4fr 1.2fr 1fr; gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 12.5px; }
.dir-tr:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.dir-th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--faint); cursor: default; position: sticky; top: 0; background: var(--panel); }
.dir-tr.stale { opacity: .72; }

/* DNS app */
/* The split apps own their own scrolling: stop the window body from scrolling the whole thing as
   one, and let each pane scroll independently (fixes both sides scrolling together). */
.win-body:has(.dns-split), .win-body:has(.gpo-split) { display: flex; flex-direction: column; overflow: hidden; }
.dns-left, .dns-right, .gpo-left, .gpo-right { overflow-y: auto; min-height: 0; }
.dns-split, .gpo-split { display: flex; flex: 1; min-height: 0; }
.dns-left { width: 240px; flex: none; border-right: 1px solid var(--border); }
.dns-right { flex: 1; min-width: 0; }
.dns-zgroup { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--faint); padding: 10px 10px 4px; }
.dns-zone { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.dns-zone:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.dns-zone.active { background: var(--accent-dim); }
.dns-zn { font-size: 13px; font-weight: 600; color: var(--text); word-break: break-all; }
.dns-zt { font-size: 11px; color: var(--muted); }
.dns-rhead, .gpo-dhead { display: flex; align-items: center; gap: 8px; padding: 4px 2px 10px; }
.dns-table .dir-tr { grid-template-columns: 1.4fr .7fr 2fr .7fr .9fr; }
.dns-data { font-family: var(--mono); font-size: 11.5px; word-break: break-all; }

/* Group Policy app */
.gpo-left { width: 260px; flex: none; border-right: 1px solid var(--border); }
.gpo-right { flex: 1; min-width: 0; padding: 4px 12px 16px; }
.gpo-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.gpo-item:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.gpo-item.active { background: var(--accent-dim); }
.gpo-link, .gpo-regrow { display: flex; align-items: center; gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.gpo-reg { margin-top: 8px; }
/* 3.18 — GPO report + WMI filters */
.gpo-report { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 0 0 12px 12px; }
.gpo-wmi { display: flex; flex-direction: column; gap: 8px; }
.gpo-wmirow { display: flex; flex-direction: column; gap: 3px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel-head); }
.gpo-wmiq { font-family: var(--mono); font-size: 11.5px; color: var(--muted); background: var(--panel-solid); border: 1px solid var(--border); border-radius: 5px; padding: 3px 7px; overflow-x: auto; white-space: pre; }

/* 3.21 — Infrastructure app (DHCP, sites, event log, tasks) */
.infra-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-bottom: 1px solid var(--border); cursor: default; }
.infra-row[onclick], .infra-row:hover { }
.infra-row .dir-main { flex: 1; min-width: 0; }
.infra-row > svg { width: 15px; height: 15px; color: var(--faint); flex: none; }
.dhcp-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--faint); }
.dhcp-dot.on { background: var(--good, #34d399); box-shadow: 0 0 6px var(--good, #34d399); }
.infra-events { display: flex; flex-direction: column; gap: 6px; }
.evt { border: 1px solid var(--border); border-left-width: 3px; border-radius: 8px; padding: 7px 10px; background: var(--panel-head); }
.evt-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 11px; }
.evt-lvl { font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.evt-id { font-family: var(--mono); color: var(--muted); }
.evt-prov { color: var(--muted); }
.evt-time { margin-left: auto; color: var(--faint); font-family: var(--mono); }
.evt-msg { font-size: 12px; color: var(--text); margin-top: 4px; white-space: pre-wrap; word-break: break-word; max-height: 120px; overflow: auto; }
.evt-error { border-left-color: var(--bad); } .evt-error .evt-lvl { color: var(--bad); }
.evt-warning { border-left-color: var(--warn, #f59e0b); } .evt-warning .evt-lvl { color: var(--warn, #f59e0b); }
.evt-critical { border-left-color: var(--bad); } .evt-critical .evt-lvl { color: var(--bad); }
.evt-information { border-left-color: var(--border-strong); } .evt-information .evt-lvl { color: var(--muted); }

/* 3.10 — Computer fleet monitor */
.fleet-count { font-size: 12px; color: var(--muted); font-weight: 600; }
.win-body:has(.fleet-split) { display: flex; flex-direction: column; overflow: hidden; }
.fleet-split { display: flex; flex: 1; min-height: 0; }
.fleet-left { width: 280px; flex: none; border-right: 1px solid var(--border); overflow-y: auto; min-height: 0; }
.fleet-right { flex: 1; min-width: 0; overflow-y: auto; min-height: 0; padding: 4px 14px 16px; }
.fleet-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.fleet-item:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.fleet-item.active { background: var(--accent-dim); }
.fleet-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--faint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--faint) 25%, transparent); }
.fleet-dot.on { background: var(--good, #34d399); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good, #34d399) 30%, transparent); }
.fleet-dhead { display: flex; align-items: center; padding: 4px 2px 10px; }
.fleet-token { display: block; word-break: break-all; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-family: var(--mono); font-size: 12px; color: var(--accent); }
.fleet-cfg { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 10px; font-family: var(--mono); font-size: 11.5px; white-space: pre-wrap; overflow-x: auto; }

/* 3.13 — Global spotlight search (Ctrl-K) */
.spot-backdrop { position: fixed; inset: 0; z-index: 100060; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; background: rgba(0,0,0,.42); backdrop-filter: blur(2px); }
.spot-box { width: min(640px, 94vw); background: var(--panel-solid, var(--panel)); border: 1px solid var(--glass-hi, var(--border)); border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,.5); overflow: hidden; }
.spot-inputrow { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.spot-ico { color: var(--muted); flex: none; display: grid; place-items: center; }
.spot-ico svg { width: 20px; height: 20px; }
.spot-input { flex: 1; background: transparent; border: 0; outline: none; color: var(--text); font-size: 16px; }
.spot-esc { font-size: 10px; color: var(--faint); border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; flex: none; }
.spot-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.spot-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.spot-row.active { background: var(--accent-dim); }
.spot-ric { width: 24px; height: 24px; display: grid; place-items: center; color: var(--accent); flex: none; }
.spot-ric svg { width: 18px; height: 18px; }
.spot-main { min-width: 0; flex: 1; }
.spot-label { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-sub { font-size: 11.5px; color: var(--muted); }
.spot-empty { padding: 22px; text-align: center; color: var(--faint); font-size: 13px; }
/* ADUC drag-and-drop: drag an object from the list onto an OU in the tree to move it. */
.aduc-item[draggable="true"] { cursor: grab; }
.aduc-item.aduc-dragging { opacity: .45; cursor: grabbing; }
.aduc-ou.aduc-drop { background: var(--accent-dim); outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }

.spot-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 10px 12px 4px; }
.spot-group:first-child { padding-top: 4px; }

/* 3.14 — searchable emoji picker (chat) */
.emoji-picker { position: fixed; z-index: 100070; width: 300px; background: var(--panel-solid, var(--panel)); border: 1px solid var(--glass-hi, var(--border)); border-radius: 12px; box-shadow: 0 18px 44px rgba(0,0,0,.5); padding: 8px; }
.emoji-search { width: 100%; margin-bottom: 6px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 260px; overflow-y: auto; }
.emoji-cell { border: 0; background: transparent; cursor: pointer; font-size: 20px; line-height: 1; padding: 5px 0; border-radius: 6px; }
.emoji-cell:hover { background: var(--accent-dim); }
.emoji-none { grid-column: 1 / -1; text-align: center; color: var(--faint); font-size: 12px; padding: 16px; }
.emoji-more { font-size: 13px; opacity: .8; }
.emoji-more svg { width: 15px; height: 15px; }

/* 3.15 — fleet detail: actions, graphs, software */
.fleet-actions { display: flex; gap: 8px; padding: 4px 0 10px; flex-wrap: wrap; }
/* 3.19 — fleet remote PowerShell console */
.fleet-ps-warn { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--warn, #f59e0b) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn, #f59e0b) 40%, var(--border)); font-size: 12px; color: var(--text); }
.fleet-ps-warn svg { width: 16px; height: 16px; flex: none; color: var(--warn, #f59e0b); }
.fleet-ps-ta { min-height: 90px; resize: vertical; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border-strong); background: #0b1120; color: #e5edff; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
.fleet-ps-ta:focus { outline: none; border-color: var(--accent); }
.fleet-ps-out { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.fleet-ps-item { border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; background: var(--panel-head); }
.fleet-ps-item.hot { border-color: var(--accent); }
.fleet-ps-cmd code { font-family: var(--mono); font-size: 12px; color: var(--accent); word-break: break-word; }
.fleet-ps-status { font-size: 11px; color: var(--muted); margin: 3px 0; }
.fleet-ps-status.error { color: var(--bad); }
.fleet-ps-status.done { color: var(--good, #34d399); }
.fleet-ps-output { margin: 4px 0 0; padding: 8px 10px; background: #0b1120; border-radius: 7px; color: #d7e3ff; font-family: var(--mono); font-size: 11.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; max-height: 280px; overflow: auto; }
.fleet-graphs { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 0; }
.fleet-spark { width: 220px; height: 34px; display: block; }
.fleet-sw { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.fleet-swrow { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.fleet-swrow:last-child { border-bottom: 0; }
.fleet-swrow .dir-sub { flex: none; font-family: var(--mono); }
.fleet-meta { margin: 8px 0 4px; }
.fleet-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.fleet-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--accent-weak, rgba(34,211,238,.14)); border: 1px solid var(--border); font-size: 12px; }
.fleet-tag-x { cursor: pointer; opacity: .6; font-weight: 700; }
.fleet-tag-x:hover { opacity: 1; color: var(--bad, #f87171); }
.fleet-rowtags { display: inline-flex; gap: 4px; margin-left: 6px; }
.fleet-rowtag { padding: 0 6px; border-radius: 999px; background: var(--accent-weak, rgba(34,211,238,.14)); border: 1px solid var(--border); font-size: 10px; opacity: .85; }
.fleet-verbar { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 8px; cursor: pointer; }
.fleet-verbar:hover { background: var(--hover, rgba(127,127,127,.10)); }
.fleet-verbar-label { min-width: 96px; font-family: var(--mono); font-size: 12px; }
.fleet-verbar.old .fleet-verbar-label { color: var(--bad, #f87171); }
.fleet-verbar.cur .fleet-verbar-label { color: var(--good, #34d399); }
.fleet-verbar-track { flex: 1; height: 10px; border-radius: 999px; background: var(--panel-solid, rgba(127,127,127,.15)); overflow: hidden; }
.fleet-verbar-fill { display: block; height: 100%; border-radius: 999px; background: var(--bad, #f87171); }
.fleet-verbar.cur .fleet-verbar-fill { background: var(--good, #34d399); }
.fleet-verbar-n { min-width: 24px; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
/* XP Search Companion */
.sc-wrap { display: flex; gap: 14px; padding: 14px; height: 100%; box-sizing: border-box; }
.sc-side { width: 200px; flex: none; background: linear-gradient(180deg, #6f96df22, #6f96df08); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.sc-dog { width: 54px; height: 54px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; margin: 0 auto 8px; }
.sc-dog svg { width: 30px; height: 30px; }
.sc-side-t { text-align: center; font-weight: 700; margin-bottom: 6px; }
.sc-side-h { font-size: 12px; color: var(--muted); line-height: 1.5; }
.sc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.sc-results { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sc-hit { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.sc-hit:hover { background: var(--accent); color: #fff; }
.sc-hit:hover svg { color: #fff; }
.sc-ico svg { width: 20px; height: 20px; color: var(--accent); }
/* Remote file browser */
.fleet-fb { display: flex; flex-direction: column; }
.fleet-fb-row { display: grid; grid-template-columns: 20px 1fr auto auto; align-items: center; gap: 10px; padding: 5px 6px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.fleet-fb-row.dir { cursor: pointer; }
.fleet-fb-row.dir:hover, .fleet-fb-row:hover { background: var(--hover, #ffffff0d); }
.fleet-fb-row .fb-ico { width: 16px; height: 16px; color: var(--accent); }
.fleet-fb-row.dir .fb-ico { color: #e6a71e; }
.fleet-fb-row .fb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fleet-fb-row .fb-size { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.fleet-fb-warn { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 7px; background: #7a5c0022; color: var(--warn, #f59e0b); font-size: 11.5px; }
.fleet-fb-warn svg { width: 15px; height: 15px; flex: none; }
.fleet-hist { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.fleet-hist-row { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 12.5px; }
.fleet-hist-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted, #94a3b8); }
.fleet-hist-row.online .fleet-hist-dot { background: var(--good, #34d399); }
.fleet-hist-row.offline .fleet-hist-dot { background: var(--bad, #f87171); }
.fleet-hist-row.version .fleet-hist-dot { background: var(--accent, #22d3ee); }
.fleet-hist-label { flex: 1; }
.fleet-hist-time { color: var(--muted, #94a3b8); font-variant-numeric: tabular-nums; }

/* ---- Seerr (media discovery + requests) ---- */
.seerr-tab.on { background: var(--accent, #22d3ee); color: #04121e; border-color: transparent; }
.seerr-subtabs { display: flex; gap: 8px; margin-bottom: 12px; }
.seerr-subtabs .btn.on { background: var(--accent-weak, rgba(34,211,238,.16)); border-color: var(--accent, #22d3ee); }
.seerr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.seerr-card { position: relative; cursor: pointer; border-radius: 10px; overflow: hidden; background: var(--panel-solid, #10182a); border: 1px solid var(--border); transition: transform .12s ease, box-shadow .12s ease; }
.seerr-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.seerr-poster { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; background: #1b2436; }
.seerr-cap { padding: 7px 8px 9px; }
.seerr-cap-t { font-size: 12.5px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.seerr-cap-s { font-size: 11px; color: var(--muted, #94a3b8); margin-top: 2px; }
.seerr-badge { position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; text-transform: capitalize; background: rgba(0,0,0,.65); color: #fff; }
.seerr-badge.available { background: #16a34a; }
.seerr-badge.processing, .seerr-badge.partial { background: #d97706; }
.seerr-badge.pending { background: #6366f1; }
.seerr-badge.approved { background: #0ea5e9; }
.seerr-badge.declined { background: #dc2626; }
.seerr-reqs { display: flex; flex-direction: column; gap: 8px; }
.seerr-req { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-solid, #10182a); }
.seerr-req-poster { width: 46px; height: 69px; object-fit: cover; border-radius: 6px; flex: none; background: #1b2436; }
.seerr-req-main { min-width: 0; flex: 1; }
.seerr-detail-body { display: flex; gap: 16px; padding: 16px; }
.seerr-detail-poster { width: 160px; aspect-ratio: 2/3; object-fit: cover; border-radius: 10px; flex: none; background: #1b2436; }
.seerr-detail-info { min-width: 0; flex: 1; }
.seerr-backdrop { height: 150px; background-size: cover; background-position: center; opacity: .5; }
.seerr-tagline { font-style: italic; color: var(--muted, #94a3b8); margin-bottom: 4px; }
.seerr-overview { font-size: 13.5px; line-height: 1.5; margin: 10px 0; max-height: 200px; overflow-y: auto; }
.seerr-reqzone { margin-top: 8px; }
.seerr-seasons { display: flex; flex-wrap: wrap; gap: 6px 16px; max-height: 160px; overflow-y: auto; margin-bottom: 6px; }
.seerr-season { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
@media (max-width: 640px) {
  .seerr-detail-body { flex-direction: column; }
  .seerr-detail-poster { width: 120px; }
  .seerr-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
}

/* ---- Audiobookshelf app ---- */
.abs-prog { display: flex; flex-direction: column; gap: 8px; }
.abs-prow { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-solid, #10182a); }
.abs-prow-cover { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; flex: none; background: #1b2436; }
.abs-prow-main { flex: 1; min-width: 0; }
.abs-bar { height: 6px; border-radius: 999px; background: var(--panel-solid, rgba(127,127,127,.18)); margin-top: 6px; overflow: hidden; }
.abs-bar > span { display: block; height: 100%; background: var(--accent, #22d3ee); border-radius: 999px; }
.abs-pct { font-variant-numeric: tabular-nums; color: var(--muted, #94a3b8); font-size: 12px; }
.abs-libs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.abs-libs .btn.on { background: var(--accent-weak, rgba(34,211,238,.16)); border-color: var(--accent, #22d3ee); }
.abs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.abs-card { border-radius: 10px; overflow: hidden; background: var(--panel-solid, #10182a); border: 1px solid var(--border); }
.abs-cover { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: #1b2436; }
.abs-cap { padding: 7px 8px 9px; }
.abs-cap-t { font-size: 12.5px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.abs-cap-s { font-size: 11px; color: var(--muted, #94a3b8); margin-top: 2px; }
@media (max-width: 640px) { .abs-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; } }

/* ---- News reader app ---- */
.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-card { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-solid, #10182a); text-decoration: none; color: inherit; transition: background .12s ease, transform .12s ease; }
.news-card:hover { background: var(--hover, rgba(127,127,127,.08)); transform: translateY(-1px); }
.news-thumb { width: 120px; height: 78px; object-fit: cover; border-radius: 7px; flex: none; background: #1b2436; }
.news-body { min-width: 0; flex: 1; }
.news-title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.news-snip { font-size: 12.5px; color: var(--muted, #94a3b8); margin: 4px 0; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.news-meta { font-size: 11.5px; color: var(--muted, #94a3b8); }
@media (max-width: 640px) { .news-thumb { width: 84px; height: 60px; } }

/* ---- Tautulli (Plex activity) app ---- */
.taut-stream { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-solid, #10182a); margin-bottom: 8px; }
.taut-stream-main { flex: 1; min-width: 0; }
.taut-stream-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.taut-hist { display: flex; flex-direction: column; }
.taut-hrow { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--border); }
.taut-hrow:last-child { border-bottom: 0; }
.taut-htype { width: 22px; height: 22px; border-radius: 5px; background: var(--accent-weak, rgba(34,211,238,.16)); color: var(--accent, #22d3ee); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.taut-hmain { flex: 1; min-width: 0; }
.taut-htime { color: var(--muted, #94a3b8); font-size: 12px; white-space: nowrap; }
.taut-stat { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 2px; border-bottom: 1px dashed var(--border); }
.taut-stat:last-child { border-bottom: 0; }

/* ---- Infrastructure: DHCP ---- */
.infra-scopewrap { border-bottom: 1px solid var(--border); }
.infra-leases { padding: 4px 8px 10px 26px; }
.infra-lease { display: flex; align-items: center; gap: 10px; padding: 4px 2px; font-size: 12.5px; border-top: 1px dashed var(--border); }
.infra-lease:first-child { border-top: 0; }

/* ============================================================
   Accessibility & interaction polish
   ============================================================ */
/* Themed keyboard-focus ring — only for keyboard users (:focus-visible), so mouse clicks
   stay clean. The app had no visible focus state before; this restores keyboard navigability. */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [role="button"]:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

/* Disabled controls now actually look disabled (many buttons toggle .disabled during async work). */
button:disabled, .btn:disabled, .btn[disabled],
input:disabled, select:disabled, textarea:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.btn:disabled:hover, .btn[disabled]:hover { border-color: var(--border-strong); color: var(--text); filter: none; }
/* Tactile press feedback on buttons. */
.btn:active:not(:disabled) { transform: translateY(1px); }

/* Themed text selection. */
::selection { background: var(--accent); color: #04222a; }

/* Respect "reduce motion": neutralise transitions/animations for users who ask for it. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== 5.0 hybrid shell (opt-in: html[data-shell="new"]) ===== */
[data-shell="new"] #topbar, [data-shell="new"] #statusline, [data-shell="new"] .desk-dock, [data-shell="new"] .desk-icons, [data-shell="new"] .desk-sc, [data-shell="new"] .xp-start, [data-shell="new"] .xp-tray { display: none !important; }
[data-shell="new"] #main { top: 0 !important; bottom: 0 !important; }
[data-shell="new"] .desk-wallpaper { display: block !important; padding: 0; overflow: hidden; } /* classic mobile mode hides this layer; the new shell lives in it */
[data-shell="new"] .mobile-wg-back { display: none !important; }
.sh { position: absolute; inset: 0; display: flex; background: var(--panel-solid); color: var(--text); }
.sh-side { width: 208px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; border-right: 1px solid var(--border); background: rgba(0,0,0,.18); }
.sh-brand { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; margin: 0 0 10px 4px; }
.sh-brand svg { width: 20px; height: 20px; }
.sh-nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; text-align: left; }
.sh-nav svg { width: 18px; height: 18px; flex: none; }
.sh-nav:hover { background: rgba(255,255,255,.06); color: var(--text); }
.sh-nav.on { background: rgba(255,255,255,.1); color: var(--text); }
.sh-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* 5.72 sidebar in three parts: Home on top and Ask / All apps / Settings at the bottom always stay in view; only the
   pinned apps between them scroll (one long column used to run off the bottom of the screen) */
.sh-side { overflow: hidden; min-height: 0; }
.sh-side-top, .sh-side-bot { flex: none; display: flex; flex-direction: column; gap: 2px; }
.sh-side-mid { flex: 1 1 auto; min-height: 40px; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; margin: 2px -6px; padding: 2px 6px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; overscroll-behavior: contain; }
.sh-side-mid::-webkit-scrollbar { width: 6px; }
.sh-side-mid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }
@media (min-width: 721px) { .sh-side-mid .sh-nav, .sh-side-bot .sh-nav { flex: none; } }
.sh-side-bot { border-top: 1px solid var(--border); padding-top: 6px; margin-top: 2px; }
/* short screens: the bottom group becomes one row of icons (names on hover), so the pins keep their room */
@media (min-width: 721px) and (max-height: 600px) {
  .sh-side-bot { flex-direction: row; flex-wrap: wrap; }
  .sh-side-bot .sh-nav { padding: 8px; }
  .sh-side-bot .sh-nav > span { display: none; }
  .sh-brand { width: 30px; height: 30px; margin-bottom: 4px; }
}
/* 5.72 hide / show the sidebar (the button left of the title, remembered per device): tiles and windows take the room */
.sh-sidebtn.on { color: var(--text); }
@media (min-width: 721px) { .sh.side-hidden .sh-side { display: none; } }
/* 5.72 View menu (top bar): display size for this device + the sidebar switch */
.sh-view { position: fixed; z-index: 100030; min-width: 230px; padding: 6px; border-radius: 12px; background: var(--panel-solid, #0d1524); border: 1px solid var(--border); box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.sh-view-h { padding: 6px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.sh-view-sep { height: 1px; margin: 6px 4px; background: var(--border); }
.sh-view-dot { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid var(--muted); box-sizing: border-box; }
.sh-ctx-item.on .sh-view-dot { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 3px, transparent 3.5px); }
/* 5.72 display size (per device) scales the sidebar, the top bar and the tiles; windows keep their own size */
html[data-ui-size="compact"] { --ui-zoom: .85; }
html[data-ui-size="large"] { --ui-zoom: 1.2; }
html[data-ui-size="xlarge"] { --ui-zoom: 1.45; }
@media (min-width: 721px) { .sh-side, .sh-top, .sh-scroll > * { zoom: var(--ui-zoom, 1); } }
.sh-top { height: 52px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.sh-title { font-weight: 600; font-size: 15px; }
.sh-search { display: flex; align-items: center; gap: 8px; width: min(380px, 40vw); height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: rgba(0,0,0,.2); color: var(--muted); font-size: 13px; cursor: text; margin-left: 12px; }
.sh-search svg { width: 16px; height: 16px; }
.sh-search kbd { margin-left: auto; font-family: var(--mono); font-size: 10px; padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px; }
.sh-clock { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.sh-user { font-size: 13px; }
.sh-scroll { flex: 1; overflow: auto; padding: 16px; }
.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; min-height: 118px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; transition: border-color .12s, transform .12s; user-select: none; }
.tile:hover { border-color: var(--accent); }
.tile.dragging { opacity: .4; }
.tile.over { border-color: var(--accent); transform: scale(1.02); }
.tile.err { opacity: .6; }
.tile.stale .tile-body { opacity: .7; }
.tile-head { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.tile-head svg { width: 16px; height: 16px; }
.tile-body { flex: 1; display: flex; flex-direction: column; gap: 5px; min-height: 0; }
.tile-big { font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: -.5px; }
.tile-big.good { color: var(--good); }
.tile-small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.tile-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tile-chip { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--text); }
.tile-chip.bad { background: rgba(224,36,94,.2); color: var(--bad); }
.tile-chip.warn { background: rgba(209,154,0,.2); color: var(--warn, #d19a00); }
.tile-list { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--text); }
.tile-list div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11px; }
.tile-cam { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: #000; display: block; }
.sh-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.sh-app { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--text); font-size: 12px; cursor: pointer; }
.sh-app svg { width: 26px; height: 26px; color: var(--accent); }
.sh-app:hover { border-color: var(--accent); }
/* phone: sidebar becomes a bottom bar with icons only */
@media (max-width: 720px) {
  .sh { flex-direction: column-reverse; }
  .sh-side { width: auto; flex-direction: row; justify-content: space-around; padding: 6px 4px; border-right: 0; border-top: 1px solid var(--border); gap: 0; overflow-x: auto; }
  .sh-brand, .sh-side > div { display: none; }
  .sh-nav { flex-direction: column; gap: 3px; padding: 6px 8px; font-size: 10px; }
  .sh-nav svg { width: 20px; height: 20px; }
  .sh-top { height: 46px; padding: 0 10px; }
  .sh-title, .sh-user, .sh-search kbd { display: none; }
  .sh-search { width: auto; flex: 1; margin-left: 0; white-space: nowrap; overflow: hidden; }
  .sh-search span { overflow: hidden; text-overflow: ellipsis; }
  /* five items fit a phone bar; the rest live under All apps */
  .sh-nav[data-nav="timeline"], .sh-nav[data-nav="unifi"], .sh-nav[data-nav="locations"], .sh-nav[data-nav="settings"], .sh-nav[data-nav="classic"] { display: none; }
  .sh-scroll { padding: 10px; }
  .sh-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { min-height: 100px; padding: 10px 12px; }
  .tile-big { font-size: 24px; }
}
/* TV / very wide: bigger tiles */
@media (min-width: 1800px) { .sh-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } .tile-big { font-size: 36px; } }

/* Timeline app */
.tl-list { padding: 4px 0 20px; }
.tl-day { position: sticky; top: 0; font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); padding: 12px 14px 6px; background: var(--panel-solid); z-index: 1; }
.tl-row { display: grid; grid-template-columns: 60px 24px 1fr auto; gap: 10px; align-items: start; padding: 8px 14px; border-left: 3px solid transparent; }
.tl-row:hover { background: rgba(255,255,255,.03); }
.tl-row.lvl-error { border-left-color: var(--bad); }
.tl-row.lvl-good { border-left-color: var(--good); }
.tl-row.lvl-warn { border-left-color: var(--warn, #d19a00); }
.tl-time { font-family: var(--mono); font-size: 11px; color: var(--faint); padding-top: 3px; }
.tl-ico svg { width: 16px; height: 16px; color: var(--muted); }
.tl-title { font-size: 13px; }
.tl-body { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tl-kind { font-family: var(--mono); font-size: 10px; color: var(--faint); text-transform: uppercase; padding-top: 3px; }
.nc-chip svg { width: 13px; height: 13px; }
@media (max-width: 560px) { .tl-row { grid-template-columns: 52px 1fr; } .tl-ico, .tl-kind { display: none; } }

/* Map app */
.mp-wrap { display: flex; height: 100%; min-height: 0; }
.mp-map { flex: 1; min-width: 0; background: #0b1220; }
.mp-panel { width: 300px; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--border); min-height: 0; }
.mp-panel .ha-tabs { padding: 6px 10px 0; }
.mp-list { flex: 1; overflow: auto; padding: 4px 0 12px; }
.mp-sect { font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); padding: 12px 12px 4px; }
.mp-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; }
.mp-row:hover { background: rgba(255,255,255,.04); }
.mp-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.mp-initial { display: grid; place-items: center; background: rgba(255,255,255,.08); color: var(--text); font-weight: 600; font-size: 13px; }
.mp-initial svg { width: 16px; height: 16px; color: var(--muted); }
.mp-main { flex: 1; min-width: 0; }
.mp-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.mp-dot.on { background: var(--good); box-shadow: 0 0 0 3px rgba(61,220,132,.2); }
@media (max-width: 720px) { .mp-wrap { flex-direction: column; } .mp-map { min-height: 42vh; } .mp-panel { width: auto; border-left: 0; border-top: 1px solid var(--border); } }

/* OpenStreetMap tiles rendered dark to match the UI (Carto's free dark basemap now needs an API key) */
.osm-tiles { filter: invert(1) hue-rotate(180deg) brightness(.8) contrast(.95) saturate(.5); }
.leaflet-control-attribution { font-size: 9px !important; background: rgba(0,0,0,.4) !important; color: #aaa !important; }
.leaflet-control-attribution a { color: #ccc !important; }

/* Ask (AI assistant) */
.sh-search-in { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 13px; }
.sh-search-in::placeholder { color: var(--muted); }
.ask-drawer { width: min(460px, 96vw); }
.ask-msgs { padding: 14px; gap: 10px; }
.ask-hello { padding: 8px 4px; }
.ask-hello-t { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.ask-hello-s { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.ask-sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-msg { display: flex; gap: 8px; align-items: flex-start; }
.ask-msg.me { justify-content: flex-end; }
.ask-ico { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; margin-top: 2px; }
.ask-ico svg { width: 14px; height: 14px; }
.ask-msg.err .ask-ico { background: var(--bad); }
.ask-bubble { max-width: 86%; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; background: rgba(255,255,255,.06); }
.ask-msg.me .ask-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.ask-msg.ai .ask-bubble { border-bottom-left-radius: 4px; }
.ask-bubble p { margin: 0 0 6px; } .ask-bubble p:last-child { margin: 0; }
.ask-ul { margin: 4px 0 6px; padding-left: 18px; } .ask-ul li { margin: 2px 0; }
.ask-think { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.ask-compose { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.ask-input { flex: 1; resize: none; min-height: 36px; max-height: 120px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: rgba(0,0,0,.25); color: var(--text); font: inherit; font-size: 13px; outline: 0; }
.ask-input:focus { border-color: var(--accent); }
.sh-nav[data-nav="ask"] svg { color: var(--accent); }
@media (max-width: 720px) { .sh-nav[data-nav="chat"] { display: none; } }

/* PWA install entry: only shown when the browser says the app is installable and it isn't already installed */
.sh-install { display: none; }
[data-installable="1"] .sh-install { display: flex; }
@media (display-mode: standalone) { .sh-install { display: none !important; } }

/* 5.0 first-run welcome */
.sh-welcome { border: 1px solid var(--accent); background: rgba(34,211,238,.06); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.sh-welcome-t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.sh-welcome-t svg { width: 18px; height: 18px; color: var(--accent); }
.sh-welcome-s { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* Ask: action confirmation cards */
.ask-card { margin-left: 32px; border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: rgba(34,211,238,.06); }
.ask-card-t { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.ask-card-t > span { white-space: pre-wrap; overflow-wrap: anywhere; } /* 5.12: run_command shows the whole command on its own lines */
.ask-card-t svg { width: 16px; height: 16px; color: var(--accent); }
.ask-card-status { font-size: 12px; color: var(--muted); }
.ask-card.done { border-color: var(--good); background: rgba(61,220,132,.07); }
.ask-card.done .ask-card-t svg { color: var(--good); }
.ask-card.failed { border-color: var(--bad); background: rgba(224,36,94,.07); }
.ask-card.cancelled { opacity: .55; border-color: var(--border); background: transparent; }

/* 5.1: window frame polish inside the new shell */
[data-shell="new"] .win { border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06); overflow: hidden; }
[data-shell="new"] .win-titlebar { height: 42px; background: rgba(255,255,255,.04); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; }
[data-shell="new"] .win-btn { width: 30px; height: 28px; border-radius: 8px; }
[data-shell="new"] .win-btn:hover { background: rgba(255,255,255,.08); }
[data-shell="new"] .win-btn.close:hover { background: var(--bad); color: #fff; }
[data-shell="new"] .win-body { background: var(--panel-solid); }
/* Sticky toolbar must be OPAQUE so scrolled content can't bleed through it (was rgba white .025 = transparent). Keep the faint tint by mixing over the solid panel, not with the page behind it. */
[data-shell="new"] .win-toolbar { background: color-mix(in srgb, var(--panel-solid) 97%, #fff); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
[data-theme="light"][data-shell="new"] .win-titlebar { background: rgba(0,0,0,.03); }

/* Security Center */
.sc-body { padding: 14px; }
.sc-hero { display: flex; align-items: center; gap: 18px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,.04); }
.sc-score { text-align: center; min-width: 96px; }
.sc-num { font-size: 44px; font-weight: 700; line-height: 1.15; }
.sc-grade { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sc-hero.good .sc-num { color: var(--good); } .sc-hero.warn .sc-num { color: var(--warn, #d19a00); } .sc-hero.bad .sc-num { color: var(--bad); }
.sc-h { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.sc-issue { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer; border-left: 3px solid transparent; }
.sc-issue:hover { background: rgba(255,255,255,.04); }
.sc-issue.sev-high { border-left-color: var(--bad); } .sc-issue.sev-med { border-left-color: var(--warn, #d19a00); } .sc-issue.sev-low { border-left-color: var(--faint); }
.sc-sev { font-family: var(--mono); font-size: 10px; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,.08); flex: none; margin-top: 2px; }
.sev-high .sc-sev { background: rgba(224,36,94,.2); color: var(--bad); } .sev-med .sc-sev { background: rgba(209,154,0,.2); color: var(--warn, #d19a00); }
/* 5.73 info notes (e.g. developer options on an Android device) */
.sc-issue.sev-info { border-left-color: var(--accent); } .sev-info .sc-sev { background: var(--accent-dim); color: var(--accent); }
.sc-issue-main { flex: 1; min-width: 0; } .sc-issue-t { font-size: 13px; } .sc-issue-d { font-size: 12px; color: var(--muted); }
.sc-area { font-size: 11px; color: var(--faint); flex: none; }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.sc-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: rgba(255,255,255,.03); cursor: pointer; }
.sc-card:hover { border-color: var(--accent); }
.sc-card-t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; margin-bottom: 8px; } .sc-card-t svg { width: 16px; height: 16px; color: var(--accent); }
.sc-kv { display: flex; gap: 10px; justify-content: space-between; font-size: 12px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.sc-k { color: var(--muted); flex: none; max-width: 48%; min-width: 0; overflow-wrap: anywhere; } .sc-v { text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; }

.ask-mic.on { color: var(--bad); animation: pulse 1s ease-in-out infinite; }
.ask-speak.on { color: var(--accent); }
@keyframes pulse { 50% { opacity: .4; } }
.cmsg[data-user="ask"] .cmsg-name, .chat-msg-ask { color: var(--accent); }

.fl-day { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; }

/* Backup: disaster-recovery report (5.2) */
.dr-report { border: 1px solid var(--border, rgba(255,255,255,.12)); border-radius: 10px; padding: 10px 12px; }
.dr-head { font-weight: 600; margin-bottom: 8px; }
.dr-head.ok { color: var(--good, #34d399); } .dr-head.warn { color: var(--warn, #fbbf24); } .dr-head.bad { color: var(--bad, #f87171); }
.dr-item { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-top: 1px solid rgba(128,128,128,.15); }
.dr-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; background: #9ca3af; }
.dr-item.ok .dr-dot { background: #34d399; } .dr-item.warn .dr-dot { background: #fbbf24; } .dr-item.bad .dr-dot { background: #f87171; }
.dr-title { font-weight: 500; font-size: 13px; }

/* Automations (5.2) */
.au-body { display: grid; grid-template-columns: 300px 1fr; gap: 14px; padding: 12px; height: calc(100% - 44px); overflow: auto; }
.au-list { display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.au-rule { border: 1px solid rgba(128,128,128,.25); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.au-rule:hover { background: rgba(128,128,128,.08); }
.au-rule.off { opacity: .6; }
.au-rule-t { font-weight: 600; margin-bottom: 3px; }
.au-edit { overflow: auto; min-width: 0; }
.au-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.au-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.au-step { border: 1px solid rgba(128,128,128,.25); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.au-step-h { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.au-step-h .hint { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint.err { color: #f87171; }
@media (max-width: 720px) { .au-body { grid-template-columns: 1fr; height: auto; } .au-grid2, .au-grid3 { grid-template-columns: 1fr; } }

/* Phones: the 12-column GridStack layouts (public splash + classic dashboard) become one stacked
   column. Saved coordinates are untouched (edit mode keeps the real grid); this is display-only. */
@media (max-width: 720px) {
  .grid-stack:not(.editing) { height: auto !important; display: flex; flex-direction: column; gap: 10px; }
  .grid-stack:not(.editing) > .grid-stack-item { position: static !important; width: 100% !important; height: var(--ph, auto) !important; min-height: 0 !important; left: auto !important; top: auto !important; transform: none !important; margin: 0 !important; transition: none !important; }
  .grid-stack:not(.editing) > .grid-stack-item > .grid-stack-item-content { position: static !important; height: 100%; }
  .grid-stack:not(.editing) .ui-resizable-handle { display: none !important; }
  /* The webcam embed is 16:9 and leaves blank space in a tall card - keep it short on phones. */
  .grid-stack:not(.editing) > .grid-stack-item[gs-id="webcam"] { --ph: 300px !important; }
  .wx-hr { overflow-x: auto; }
}

/* Settings on phones: the category nav becomes one horizontal chip row instead of a 300px-tall stack. */
@media (max-width: 720px) {
  .set-body .set-nav { display: block; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--border); max-height: none; }
  .set-body .set-nav .set-search { width: 100%; margin-bottom: 6px; }
  .set-body .set-nav-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .set-body .set-nav-group { display: none; }
  .set-body .set-nav button { width: auto; flex: none; white-space: nowrap; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); }
  .set-body .set-pane { padding: 12px 14px; }
  .set-foot { flex-wrap: wrap; gap: 6px; }
  /* drawers (chat / Ask) take the full width */
  .chat-drawer, .ask-drawer { width: 100vw; left: 0; right: 0; }
}

/* Energy (5.4) */
.en-bars { display: flex; gap: 4px; align-items: flex-end; height: 110px; padding: 4px 0; overflow: hidden; }
.en-bar { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 3px; }
.en-fill { width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.en-bar span { font-size: 9px; color: var(--faint); max-width: 100%; overflow: hidden; white-space: nowrap; }
@media (max-width: 560px) { .en-bars { gap: 2px; } .en-bar span { font-size: 8px; } }

/* Inventory (5.5) */
.inv-body { display: grid; grid-template-columns: 340px 1fr; gap: 14px; padding: 12px; height: calc(100% - 44px); overflow: hidden; }
.inv-list { overflow: auto; min-width: 0; }
.inv-item { overflow: auto; min-width: 0; }
.inv-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; cursor: pointer; }
.inv-row:hover { background: rgba(128,128,128,.1); }
.inv-row svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.inv-row-t { flex: 1; min-width: 0; } .inv-row-t > div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-code { font-family: var(--mono); font-size: 11px; opacity: .7; letter-spacing: .5px; }
.inv-code.big { font-size: 15px; opacity: 1; padding: 3px 8px; border: 1px dashed var(--border-strong); border-radius: 6px; }
.inv-head { display: flex; gap: 16px; align-items: flex-start; }
.inv-qr { flex: none; background: #fff; padding: 6px; border-radius: 8px; line-height: 0; }
.inv-qr svg { width: 120px; height: 120px; }
.inv-name { margin: 0 0 2px; font-size: 20px; }
.inv-notes { white-space: pre-wrap; padding: 8px 10px; border-radius: 8px; background: rgba(128,128,128,.08); margin-top: 6px; font-size: 13px; }
.inv-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-photo { position: relative; width: 120px; height: 120px; border-radius: 8px; overflow: hidden; background: #000; }
.inv-photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.inv-photo-x { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.5) !important; }
.inv-photo-add { height: 120px; width: 120px; flex-direction: column; }
.cd-row.link { cursor: pointer; } .cd-row.link:hover .cd-v { color: var(--accent); }
@media (max-width: 720px) { .inv-body { grid-template-columns: 1fr; height: auto; overflow: auto; } .inv-list { max-height: 40vh; } .inv-head { flex-direction: column; } }

/* Wall panel (5.5): touch-first, big targets */
.wall { position: absolute; inset: 0; display: flex; flex-direction: column; background: #0b1016; color: #e6edf3; user-select: none; -webkit-user-select: none; font-size: 18px; }
.wall.night:not(.awake) { filter: brightness(.35); }
.wall-top { display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.wall-clock { font-size: 28px; font-weight: 600; letter-spacing: .5px; }
.wall-status { flex: 1; font-size: 15px; opacity: .8; }
.wall-status.good { color: #34d399; } .wall-status.warn { color: #fbbf24; } .wall-status.bad { color: #f87171; }
.wall-stage { flex: 1; overflow: auto; padding: 14px 18px; -webkit-overflow-scrolling: touch; }
.wall-nav { display: flex; border-top: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.25); }
.wall-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; background: transparent; border: 0; color: #9aa4b2; font-size: 13px; }
.wall-tab svg { width: 26px; height: 26px; } .wall-tab.on { color: var(--accent, #22d3ee); }
.wall-room { margin-bottom: 20px; } .wall-room h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 1px; opacity: .6; margin: 0 0 10px; }
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.wall-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 104px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); color: inherit; font: inherit; text-align: left; transition: background .15s, transform .05s; }
.wall-card:active { transform: scale(.97); }
.wall-card svg { width: 26px; height: 26px; opacity: .8; } .wall-card > span { font-weight: 600; font-size: 16px; line-height: 1.15; } .wall-card small { font-size: 13px; opacity: .65; }
.wall-card.on { background: rgba(251,191,36,.18); border-color: rgba(251,191,36,.5); } .wall-card.on svg { color: #fbbf24; opacity: 1; }
.wall-card.on.warn { background: rgba(248,113,113,.18); border-color: rgba(248,113,113,.5); } .wall-card.on.warn svg { color: #f87171; }
.wall-card.scene { flex-direction: row; align-items: center; min-height: 64px; }
.wall-card.climate { grid-column: span 2; } .wall-card-h { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.wall-climate { display: flex; align-items: center; gap: 16px; width: 100%; justify-content: center; } .wall-temp { font-size: 40px; font-weight: 700; }
.wall-btn { min-width: 56px; height: 56px; border-radius: 12px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08); color: inherit; font-size: 28px; }
.wall-btn.ghost { min-width: 44px; height: 44px; font-size: 18px; background: transparent; border-color: transparent; }
.wall-dim { width: 100%; margin-top: 4px; accent-color: #fbbf24; height: 28px; }
.wall-card.stat { min-height: 90px; } .wall-card.stat b { font-size: 30px; }
.wall-cams { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.wall-cam { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #000; } .wall-cam-img { width: 100%; height: 100%; object-fit: cover; }
.wall-cam-name { position: absolute; left: 10px; bottom: 8px; background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 6px; font-size: 13px; }
.wall-pop { position: absolute; inset: 0; background: #000; display: flex; align-items: center; justify-content: center; z-index: 5; } .wall-pop-img { max-width: 100%; max-height: 100%; }
.wall-pop-name { position: absolute; left: 18px; top: 14px; font-size: 22px; font-weight: 600; text-shadow: 0 1px 4px #000; }
.wall-people { display: flex; gap: 14px; flex-wrap: wrap; }
.wall-person { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 110px; padding: 12px 6px; border-radius: 14px; background: rgba(255,255,255,.05); opacity: .55; }
.wall-person.home { opacity: 1; background: rgba(52,211,153,.14); border: 1px solid rgba(52,211,153,.4); }
.wall-person img, .wall-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; }
.wall-list { display: flex; flex-direction: column; gap: 8px; }
.wall-task, .wall-alert { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); color: inherit; font: inherit; text-align: left; }
.wall-task svg { width: 22px; height: 22px; opacity: .6; } .wall-task:active { background: rgba(52,211,153,.2); }
.wall-alert.error { border-color: rgba(248,113,113,.5); } .wall-alert.warn { border-color: rgba(251,191,36,.5); } .wall-alert > span { flex: 1; display: flex; flex-direction: column; } .wall-alert b { font-size: 16px; }
.wall-event { display: flex; gap: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(255,255,255,.04); } .wall-event b { min-width: 80px; opacity: .7; }
.wall-empty { padding: 40px 20px; text-align: center; opacity: .6; font-size: 16px; } .wall-empty.small { padding: 16px; }
@media (max-width: 720px) { .wall-card.climate { grid-column: 1 / -1; } .wall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wall-card { min-width: 0; } .wall-card > span, .wall-card small { max-width: 100%; overflow-wrap: anywhere; } .wall-climate { gap: 10px; } .wall-cams { grid-template-columns: 1fr; } .wall-stage { padding: 10px; overflow-x: hidden; } .wall-person { width: calc(33.33% - 10px); min-width: 0; } .wall-people { gap: 10px; } }

/* Screen time (5.5) */
.us-body { padding: 12px 14px; overflow: auto; height: calc(100% - 44px); }
.us-person { border: 1px solid rgba(128,128,128,.25); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.us-person-h { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; } .us-person-h > div:first-child { flex: 1; min-width: 120px; }
.us-big b { font-size: 24px; } .us-big small { display: block; opacity: .7; }
.us-hours { display: flex; gap: 2px; height: 46px; align-items: flex-end; } .us-hour { flex: 1; height: 100%; display: flex; align-items: flex-end; } .us-hour-fill { width: 100%; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 1px; opacity: .8; }
.us-days { display: flex; gap: 6px; height: 60px; align-items: flex-end; } .us-day { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; } .us-day-fill { width: 100%; background: rgba(128,128,128,.5); border-radius: 3px 3px 0 0; min-height: 1px; } .us-day span { font-size: 9px; opacity: .6; }
.us-devs { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.us-dev { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: rgba(128,128,128,.07); font-size: 13px; } .us-dev small { flex: 1; opacity: .65; }
.us-dev .dot { width: 8px; height: 8px; border-radius: 50%; background: #6b7280; } .us-dev.on .dot { background: #34d399; }

.en-fill.bad { background: #f87171; }

/* NAS app (5.6) */
.nas-body { padding: 12px 14px; overflow: auto; height: calc(100% - 44px); }
.nas-hero { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; } .nas-hero h2 { margin: 0; font-size: 18px; }
.nas-stats { display: flex; gap: 8px; margin-left: auto; } .nas-stat { min-width: 70px; padding: 6px 10px; border-radius: 8px; background: rgba(128,128,128,.1); text-align: center; } .nas-stat small { display: block; opacity: .6; font-size: 10px; text-transform: uppercase; } .nas-stat b { font-size: 16px; } .nas-stat.bad b { color: #f87171; }
.nas-issue { padding: 6px 10px; border-radius: 8px; margin: 3px 0; border-left: 3px solid #fbbf24; background: rgba(251,191,36,.08); font-size: 13px; } .nas-issue.sev-high { border-color: #f87171; background: rgba(248,113,113,.1); } .nas-issue.sev-low { border-color: #6b7280; background: rgba(128,128,128,.08); }
.nas-ok { color: #34d399; font-size: 13px; margin: 6px 0; }
.nas-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; background: rgba(128,128,128,.06); margin: 3px 0; font-size: 13px; } .nas-row-t { flex: 0 0 240px; display: flex; flex-direction: column; min-width: 0; } .nas-row-t .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nas-table { width: 100%; border-collapse: collapse; font-size: 12px; } .nas-table th, .nas-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid rgba(128,128,128,.15); white-space: nowrap; } .nas-table tr.bad td { color: #f87171; }
.nas-pkgs { display: flex; flex-wrap: wrap; gap: 6px; } .nas-pkg { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; background: rgba(128,128,128,.08); font-size: 12px; } .nas-pkg small { opacity: .6; } .nas-pkg .dot, .nas-row .dot { width: 8px; height: 8px; border-radius: 50%; background: #6b7280; flex: none; } .nas-pkg.on .dot, .nas-row .dot.on { background: #34d399; }
@media (max-width: 720px) { .nas-row-t { flex: 1 1 100%; } .nas-row { flex-wrap: wrap; } .nas-stats { margin-left: 0; } }

/* 5.6 inventory key/value grid */
.cd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 16px; }

/* ---------------------------------------------------------------- Sign-in screen (5.7) */
.si { position: fixed; inset: 0; z-index: 100045; color: #eef2f7; display: flex; overflow: auto; background: #070b12;
  font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif; animation: si-in .35s ease-out; }
.si::before { content: ''; position: absolute; inset: -40px; background: var(--si-img) center/cover no-repeat; filter: blur(18px) brightness(.55) saturate(1.1); transform: scale(1.04); }
.si.si-aurora::before { background:
    radial-gradient(60% 50% at 18% 25%, rgba(34,211,238,.30), transparent 70%),
    radial-gradient(50% 45% at 82% 70%, rgba(129,140,248,.28), transparent 70%),
    radial-gradient(45% 40% at 60% 10%, rgba(52,211,153,.18), transparent 70%),
    linear-gradient(160deg, #0b1220 0%, #070b12 60%, #0a0f1a 100%);
  filter: none; animation: si-drift 24s ease-in-out infinite alternate; }
.si::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 50%, transparent 40%, rgba(0,0,0,.55)); pointer-events: none; }
.si.si-done { animation: si-out .26s ease-in forwards; }
@keyframes si-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes si-out { to { opacity: 0; transform: scale(1.02); } }
@keyframes si-drift { from { transform: translate3d(-2%, -1%, 0) scale(1.05); } to { transform: translate3d(2%, 1%, 0) scale(1.08); } }

.si-inner { position: relative; z-index: 1; margin: auto; width: min(1080px, 100%); padding: 40px 32px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.si-left { display: flex; flex-direction: column; gap: 6px; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.si-greet { font-size: 20px; font-weight: 500; opacity: .85; letter-spacing: .2px; }
.si-time { font-size: clamp(64px, 9vw, 112px); font-weight: 300; line-height: .95; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.si-date { font-size: 20px; opacity: .8; margin-bottom: 14px; }
.si-wx, .si-status { display: flex; align-items: center; gap: 10px; font-size: 15px; opacity: .85; min-height: 24px; }
.si-wx-t { font-size: 26px; font-weight: 600; opacity: 1; }
.si-led { width: 9px; height: 9px; border-radius: 50%; background: #6b7280; box-shadow: 0 0 10px currentColor; }
.si-led.up { background: #34d399; color: #34d399; } .si-led.warn { background: #fbbf24; color: #fbbf24; } .si-led.down { background: #f87171; color: #f87171; }

.si-right { display: flex; justify-content: center; }
.si-card { width: 100%; max-width: 400px; padding: 30px 28px 22px; border-radius: 22px;
  background: rgba(15,20,30,.62); border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 30px 80px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); }
.si-card.shake { animation: si-shake .38s; }
@keyframes si-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.si-form { display: flex; flex-direction: column; gap: 12px; }
.si-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.si-logo { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--accent, #22d3ee), #818cf8); box-shadow: 0 8px 24px rgba(34,211,238,.35); }
.si-logo svg { width: 24px; height: 24px; color: #06121a; stroke: #06121a; }
.si-title { font-size: 20px; font-weight: 650; letter-spacing: .2px; }
.si-sub { font-size: 13px; opacity: .65; margin-top: 2px; }
.si-field { position: relative; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border-radius: 13px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); transition: border-color .15s, background .15s, box-shadow .15s; cursor: text; }
.si-field:focus-within { border-color: var(--accent, #22d3ee); background: rgba(255,255,255,.09); box-shadow: 0 0 0 4px rgba(34,211,238,.15); }
.si-field > svg { width: 18px; height: 18px; opacity: .55; flex: none; }
.si-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; font-size: 16px; }
.si-field input::placeholder { color: rgba(238,242,247,.45); }
.si-field input:-webkit-autofill { -webkit-text-fill-color: #eef2f7; transition: background-color 9999s; }
.si-eye { border: 0; background: transparent; color: inherit; opacity: .5; padding: 6px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.si-eye svg { width: 18px; height: 18px; } .si-eye:hover, .si-eye.on { opacity: 1; }
.si-caps { display: none; font-size: 12px; color: #fbbf24; margin-top: -4px; padding-left: 4px; } .si-caps.on { display: block; }
.si-btn { position: relative; height: 50px; border: 0; border-radius: 13px; font: inherit; font-size: 16px; font-weight: 650; cursor: pointer; color: #06121a;
  background: linear-gradient(135deg, var(--accent, #22d3ee), #67e8f9); box-shadow: 0 10px 26px rgba(34,211,238,.30); transition: transform .08s, filter .15s; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 4px; }
.si-btn:hover { filter: brightness(1.07); } .si-btn:active { transform: translateY(1px); } .si-btn:disabled { cursor: progress; filter: saturate(.7) brightness(.9); }
.si-spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(6,18,26,.3); border-top-color: #06121a; animation: si-rot .7s linear infinite; }
.loading > .si-spin { display: inline-block; }
@keyframes si-rot { to { transform: rotate(360deg); } }
.si-or { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; font-size: 12px; opacity: .5; text-transform: uppercase; letter-spacing: 1px; }
.si-or::before, .si-or::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.18); }
.si-alt { width: 100%; height: 46px; border-radius: 13px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.04); color: inherit; font: inherit; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: background .15s; }
.si-alt:hover { background: rgba(255,255,255,.09); } .si-alt svg { width: 18px; height: 18px; }
.si-alt.loading { opacity: .6; cursor: progress; }
.si-err { min-height: 0; font-size: 13.5px; color: #fecaca; background: rgba(248,113,113,.14); border: 1px solid rgba(248,113,113,.35); border-radius: 10px; padding: 9px 12px; }
.si-err:empty { display: none; }
.si-note { font-size: 14px; opacity: .8; line-height: 1.45; }
.si-digits { display: flex; gap: 8px; justify-content: space-between; }
.si-digit { width: 100%; max-width: 50px; height: 58px; text-align: center; font-size: 24px; font-weight: 600; border-radius: 12px; color: inherit;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); outline: 0; font-variant-numeric: tabular-nums; }
.si-digit:focus { border-color: var(--accent, #22d3ee); box-shadow: 0 0 0 4px rgba(34,211,238,.15); }
.si-backup { height: 50px; padding: 0 14px; border-radius: 13px; font: inherit; font-size: 16px; letter-spacing: 1px; color: inherit; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); outline: 0; }
.si-foot { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 16px; text-align: center; }
.si-link { border: 0; background: transparent; color: var(--accent, #22d3ee); font: inherit; font-size: 13.5px; cursor: pointer; padding: 4px; }
.si-link:hover { text-decoration: underline; }
.si-hint { font-size: 12px; opacity: .5; }
html.si-open body { overflow: hidden; }

@media (max-width: 820px) {
  .si-inner { grid-template-columns: 1fr; gap: 22px; padding: 28px 18px 32px; }
  .si-left { align-items: center; text-align: center; }
  .si-time { font-size: 64px; } .si-date { font-size: 16px; margin-bottom: 6px; } .si-greet { font-size: 16px; }
  .si-wx, .si-status { justify-content: center; font-size: 14px; }
  .si-card { padding: 24px 20px 18px; border-radius: 20px; }
}
@media (max-height: 560px) and (max-width: 820px) { .si-left { display: none; } }
@media (prefers-reduced-motion: reduce) { .si, .si::before, .si-card.shake { animation: none !important; } }

/* Sign-in widgets (5.7) */
.si-left { gap: 18px; }
.si-clock { display: flex; flex-direction: column; gap: 4px; }
.si-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 520px; }
.si-cards:empty { display: none; }
.si-w { position: relative; overflow: hidden; border-radius: 18px; padding: 14px 16px; min-height: 92px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 10px 30px rgba(0,0,0,.25); text-shadow: none; animation: si-card-in .5s ease-out both; }
.si-w:nth-child(2) { animation-delay: .06s; } .si-w:nth-child(3) { animation-delay: .12s; } .si-w:nth-child(4) { animation-delay: .18s; } .si-w:nth-child(5) { animation-delay: .24s; }
@keyframes si-card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.si-w-wide { grid-column: 1 / -1; }
.si-w-k { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.2px; opacity: .6; margin-bottom: 6px; }
.si-w-big { font-size: 34px; font-weight: 300; line-height: 1; letter-spacing: -1px; }
.si-w-sub { font-size: 13px; opacity: .7; margin-top: 4px; }
.si-w-v { font-size: 15px; font-weight: 500; }
.si-w-row { display: flex; align-items: center; gap: 10px; }
.si-w-title { font-weight: 650; font-size: 15px; margin-bottom: 4px; }
.si-w-text { font-size: 14px; line-height: 1.5; opacity: .9; white-space: pre-wrap; }
.si-w-msg { border-left: 3px solid #38bdf8; } .si-w-msg.tone-good { border-left-color: #34d399; } .si-w-msg.tone-warn { border-left-color: #fbbf24; }
.si-w-photo, .si-w-cam { padding: 0; min-height: 0; }
.si-w-photo img, .si-w-cam img, .si-w-cam iframe { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; border: 0; background: #000; }
.si-w-cam img.err { opacity: .15; }
.si-w-cap { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.5); backdrop-filter: blur(6px); }
.si-live { width: 7px; height: 7px; border-radius: 50%; background: #f87171; box-shadow: 0 0 8px #f87171; animation: si-pulse 1.6s ease-in-out infinite; }
@keyframes si-pulse { 50% { opacity: .35; } }
.si-close { position: absolute; top: 16px; right: 16px; z-index: 3; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.45); color: #fff; font: inherit; font-size: 13px; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.si-preview .si-card { outline: 2px dashed rgba(255,255,255,.18); outline-offset: 6px; }
@media (max-width: 820px) { .si-cards { max-width: none; width: 100%; } .si-w { text-align: left; } }
@media (max-width: 420px) { .si-cards { grid-template-columns: 1fr; } }

/* Settings > Sign-in page editor */
.sie-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.sie-item { border: 1px solid var(--border, rgba(128,128,128,.25)); border-radius: 12px; padding: 10px 12px; background: rgba(128,128,128,.04); }
.sie-head { display: flex; align-items: center; gap: 10px; } .sie-head svg { width: 16px; height: 16px; opacity: .75; }
.sie-btns { margin-left: auto; display: flex; gap: 2px; }
.sie-fields { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.sie-thumb { width: 96px; height: 60px; object-fit: cover; border-radius: 8px; }
.sie-warn { font-size: 12.5px; color: #fbbf24; background: rgba(251,191,36,.10); border: 1px solid rgba(251,191,36,.35); border-radius: 8px; padding: 7px 10px; }
.sie-add { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.sie-add-btn { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--border-strong, rgba(128,128,128,.4)); background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.sie-add-btn:hover { background: rgba(128,128,128,.1); border-style: solid; } .sie-add-btn svg { width: 16px; height: 16px; }
.sie-add-btn.warn svg { color: #fbbf24; }

/* ---- 5.8 Computers: health / changes / updates / network / reports ---- */
.f58-scroll { overflow-x: auto; max-width: 100%; }
.f58-lost { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0 0 10px; border-radius: 10px; border: 1px solid rgba(248,113,113,.5); background: rgba(248,113,113,.12); }
.f58-lost b { color: #f87171; letter-spacing: .5px; } .f58-lost .btn { margin-left: auto; flex: none; }
.f58-day { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; opacity: .6; margin: 12px 0 4px; }
.f58-chg { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; margin: 2px 0; background: rgba(128,128,128,.05); font-size: 13px; }
.f58-chg-t { display: flex; flex-direction: column; min-width: 0; flex: 1; } .f58-chg-t .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f58-sym { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; background: rgba(128,128,128,.15); }
.f58-chg.k-added .f58-sym { background: rgba(52,211,153,.18); color: #34d399; } .f58-chg.k-removed .f58-sym { background: rgba(248,113,113,.18); color: #f87171; } .f58-chg.k-updated .f58-sym, .f58-chg.k-changed .f58-sym { color: #fbbf24; }
.f58-chg.hot { border-left: 3px solid #f87171; }
.f58-lat td.lat-good { color: #34d399; } .f58-lat td.lat-warn { color: #fbbf24; } .f58-lat td.lat-bad { color: #f87171; font-weight: 600; }
.us-app { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 2px 0; } .us-app > span { flex: 0 0 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .us-app small { flex: 0 0 56px; text-align: right; opacity: .7; }
.nas-ok { padding: 6px 10px; border-radius: 8px; background: rgba(52,211,153,.1); border-left: 3px solid #34d399; font-size: 13px; margin: 4px 0; }

/* ---- 5.9 Computers: cleaner layout ---- */
.fleet-left { width: 344px; }
.fleet-item { gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--border); transition: background .12s; }
.fleet-item.off { opacity: .62; }
.fleet-item.active { box-shadow: inset 3px 0 0 var(--accent); }
.fleet-item .dir-main { min-width: 0; flex: 1; }
.fleet-item .dir-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; min-width: 0; }
.fleet-item .dir-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.fleet-item .dir-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 2px; min-width: 0; }
.fleet-item .dir-sub .fl-subtxt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.fleet-item .dir-sub .fleet-ver { margin-left: 0; }
.fleet-ver { font-size: 10px; font-family: var(--mono); padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); white-space: nowrap; flex: none; }
.fleet-ver.stale { background: color-mix(in srgb, var(--warn, #fbbf24) 18%, transparent); color: var(--warn, #fbbf24); }
.fleet-att { flex: none; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--warn, #fbbf24) 16%, transparent); color: var(--warn, #fbbf24); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.fleet-att.lost { background: color-mix(in srgb, var(--bad, #f87171) 22%, transparent); color: var(--bad, #f87171); letter-spacing: .5px; }
.fl-minis { display: flex; flex-direction: column; gap: 4px; flex: none; width: 54px; }
.fl-mini { display: flex; align-items: center; gap: 5px; font-size: 9px; font-family: var(--mono); color: var(--muted); line-height: 1; }
.fl-mini span { display: inline-block; width: 22px; flex: none; letter-spacing: .2px; }
.fl-mini i { flex: 1; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 20%, transparent); overflow: hidden; display: block; }
.fl-mini b { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.fl-mini b.warn, .fl-meter-fill.warn { background: var(--warn, #fbbf24); } .fl-mini b.bad, .fl-meter-fill.bad { background: var(--bad, #f87171); }
.fl-rowend { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.fl-hdot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn, #fbbf24); } .fl-hdot.bad { background: var(--bad, #f87171); }
.fleet-dot.big { width: 12px; height: 12px; margin-top: 8px; align-self: flex-start; }

.fl-head { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0 12px; flex-wrap: wrap; }
.fl-head-id { flex: 1; min-width: 200px; }
.fl-head-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fl-host { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: .2px; }
.fl-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.fl-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--good, #34d399) 16%, transparent); color: var(--good, #34d399); }
.fl-pill.warn { background: color-mix(in srgb, var(--warn, #fbbf24) 16%, transparent); color: var(--warn, #fbbf24); } .fl-pill.bad { background: color-mix(in srgb, var(--bad, #f87171) 16%, transparent); color: var(--bad, #f87171); }
.fl-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fl-actions .btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.fl-actions svg, .fl-card-h svg { width: 15px; height: 15px; }
.fl-tabs { flex-wrap: wrap; margin-bottom: 0; }
.fl-subtabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 0 2px; }
.fl-subtab { border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.fl-subtab:hover { color: var(--text); }
.fl-subtab.active { background: var(--accent-dim, color-mix(in srgb, var(--accent) 16%, transparent)); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.fl-pane { padding-top: 12px; }

.fl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.fl-stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fl-stat.clickable { cursor: pointer; } .fl-stat.clickable:hover { border-color: var(--accent); }
.fl-stat.good .fl-stat-v { color: var(--good, #34d399); } .fl-stat.warn .fl-stat-v { color: var(--warn, #fbbf24); } .fl-stat.bad .fl-stat-v { color: var(--bad, #f87171); }
.fl-stat-l { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.fl-stat-v { font-size: 22px; font-weight: 700; line-height: 1.1; }
.fl-stat-s { font-size: 11.5px; color: var(--muted); }
.fl-meter { height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 18%, transparent); overflow: hidden; }
.fl-meter-fill { height: 100%; border-radius: 99px; background: var(--accent); }
.fl-bars { display: flex; align-items: flex-end; gap: 1px; height: 24px; margin-top: 2px; }
.fl-bars span { flex: 1; min-width: 1px; background: color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 1px; }
.fl-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.fl-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fl-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px 12px; min-width: 0; margin-bottom: 12px; }
.fl-cols .fl-card, .fl-col .fl-card { margin-bottom: 0; }
.fl-card-h { display: flex; align-items: center; gap: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.fl-card-h .btn { margin-left: auto; text-transform: none; letter-spacing: 0; display: inline-flex; align-items: center; gap: 4px; }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.fl-fact { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed color-mix(in srgb, var(--border) 80%, transparent); font-size: 13px; }
.fl-fact:last-child { border-bottom: 0; }
.fl-fact span { color: var(--muted); flex: 0 0 110px; }
.fl-fact b { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.fl-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.fl-note { margin-top: 8px; font-size: 12.5px; white-space: pre-wrap; color: var(--text); opacity: .85; }
.fl-disk { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 12.5px; }
.fl-disk-n { flex: 0 0 60px; font-family: var(--mono); } .fl-disk .fl-meter { flex: 1; } .fl-disk-v { flex: 0 0 150px; text-align: right; color: var(--muted); }

.fl-menu { position: fixed; z-index: 100030; min-width: 230px; max-height: 70vh; overflow-y: auto; padding: 5px; border-radius: 12px; background: var(--panel-solid, #0d1524); border: 1px solid var(--border); box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.fl-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; text-align: left; cursor: pointer; }
.fl-menu-item:hover, .fl-menu-item:focus-visible { background: color-mix(in srgb, var(--accent) 14%, transparent); outline: none; }
.fl-menu-item svg, .fl-menu-noicon { width: 15px; height: 15px; flex: none; opacity: .8; }
.fl-menu-item.danger { color: var(--bad, #f87171); }
.fl-menu-sep { height: 1px; margin: 4px 6px; background: var(--border); }
.modal.fl-drawer { width: min(560px, 96vw); max-height: 90vh; display: flex; flex-direction: column; }
.fl-drawer-body { display: block !important; padding: 6px 18px 12px; overflow-y: auto; }
.fl-drawer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.fl-form2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.fl-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.fl-field .nt-input { width: 100%; }

@media (max-width: 900px) { .fl-cols { grid-template-columns: 1fr; } .fl-minis { display: none; } }
@media (max-width: 720px) {
  .fleet-left { width: 100%; }
  .fl-head { padding-top: 4px; } .fl-host { font-size: 18px; } .fl-actions { width: 100%; }
  .fl-form2 { grid-template-columns: 1fr; } .fl-fact span { flex-basis: 90px; } .fl-disk-v { flex-basis: auto; }
  .fl-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}

/* ---- 5.9.3: xp.css (loaded after this file) paints some Computers parts light; in the new shell they
   were white-on-white. These win in the new shell only, so the Classic XP look is unchanged. ---- */
html[data-shell="new"] .fleet-bulk { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; background: color-mix(in srgb, var(--accent) 12%, var(--panel-solid, #0d1524)); border: 0; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2; }
html[data-shell="new"] .fleet-bulk .btn { color: var(--text); background: var(--panel); border: 1px solid var(--border); padding: 4px 10px; font-size: 12px; opacity: 1; }
html[data-shell="new"] .fleet-bulk .btn:hover { border-color: var(--accent); color: var(--accent); }
html[data-shell="new"] .fleet-bulk-n { color: var(--accent); font-weight: 700; font-size: 12px; margin-right: 4px; }
/* Group header: sticky + OPAQUE so the current group stays pinned and legible while the list scrolls
   (was a see-through 10% tint that vanished behind the rows). */
html[data-shell="new"] .fleet-group { position: sticky; top: 0; z-index: 1; color: var(--text); background: var(--panel-solid); padding: 7px 12px; margin: 0 0 2px; border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
html[data-shell="new"] .fleet-ov-row { border-bottom: 1px solid var(--border); }
html[data-shell="new"] .fleet-ov-row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
html[data-shell="new"] .fleet-ver { font-size: 10px; font-family: var(--mono); padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); font-weight: 500; }
html[data-shell="new"] .fleet-ver.stale { background: color-mix(in srgb, var(--warn, #fbbf24) 18%, transparent); color: var(--warn, #fbbf24); font-weight: 600; }
html[data-shell="new"] .fleet-att { color: var(--warn, #fbbf24); background: color-mix(in srgb, var(--warn, #fbbf24) 16%, transparent); margin-left: 0; font-size: 10px; padding: 1px 6px; border-radius: 999px; }
html[data-shell="new"] .fleet-att.lost { color: var(--bad, #f87171); background: color-mix(in srgb, var(--bad, #f87171) 22%, transparent); }
html[data-shell="new"] .dir-kv.fleet-warn .dir-v { color: var(--bad, #f87171); }
/* list rows: the hostname always keeps room; a long badge shrinks with "…" instead of pushing it out */
.fleet-item .dir-name > span:first-child { flex: 0 1 auto; min-width: 56px; }
/* Badge keeps its full (short) text and never collapses to "Po…"; the hostname truncates first instead. */
.fleet-item .dir-name .fleet-att { flex: none !important; min-width: 0; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* UniFi: the client you jumped to from Computers */
.uclient.focus { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ---- 5.10 UniFi: all locations side by side ---- */
.u-sites { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.u-site { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.u-site-h { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 10px; }

/* ---- 5.11 new shell: windows, open-windows strip, sidebar pins, All apps groups, What's new ---- */
/* window chrome: one soft pill with three controls; glide on maximize / restore / snap */
[data-shell="new"] .win { border-radius: 14px; }
[data-shell="new"] .win.maximized { border-radius: 10px; }
[data-shell="new"] .win-titlebar { height: 44px; padding: 0 8px 0 14px; gap: 10px; }
[data-shell="new"] .win-title { font-weight: 600; letter-spacing: .2px; }
[data-shell="new"] .win-title .win-ico { width: 16px; height: 16px; color: var(--accent); }
[data-shell="new"] .win-controls { gap: 2px; padding: 3px; border-radius: 11px; background: rgba(255,255,255,.035); border: 1px solid var(--border); }
[data-shell="new"] .win-btn { width: 32px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); background: transparent; border: 0; transition: background .16s ease, color .16s ease, transform .1s ease; }
[data-shell="new"] .win-btn svg { width: 15px; height: 15px; stroke-width: 2; }
[data-shell="new"] .win-btn:hover { background: rgba(255,255,255,.09); color: var(--text); }
[data-shell="new"] .win-btn:active { transform: scale(.9); }
[data-shell="new"] .win-btn.close:hover { background: #e5484d; color: #fff; }
[data-shell="new"] .win-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
[data-theme="light"][data-shell="new"] .win-controls { background: rgba(0,0,0,.035); }
[data-theme="light"][data-shell="new"] .win-btn:hover { background: rgba(0,0,0,.07); }
[data-shell="new"] .win.anim { transition: left .24s cubic-bezier(.2,.8,.2,1), top .24s cubic-bezier(.2,.8,.2,1), width .24s cubic-bezier(.2,.8,.2,1), height .24s cubic-bezier(.2,.8,.2,1), border-radius .24s; }
[data-shell="new"] .win.opening { animation: shWinIn .22s cubic-bezier(.2,.8,.2,1); }
[data-shell="new"] .win.closing { animation: shWinOut .16s ease forwards; }
[data-shell="new"] .win.minimized { animation: shWinMin .2s cubic-bezier(.4,0,.8,.4) forwards; }
[data-shell="new"] .win.restoring { animation: shWinRestore .22s cubic-bezier(.2,.8,.2,1); }
@keyframes shWinIn { from { opacity: 0; transform: translateY(12px) scale(.965); } to { opacity: 1; transform: none; } }
@keyframes shWinOut { to { opacity: 0; transform: scale(.96); } }
@keyframes shWinMin { to { opacity: 0; transform: translateY(-24px) scale(.9); } }
@keyframes shWinRestore { from { opacity: 0; transform: translateY(-24px) scale(.9); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { [data-shell="new"] .win.anim { transition: none; } [data-shell="new"] .win.opening, [data-shell="new"] .win.minimized, [data-shell="new"] .win.restoring { animation-duration: .01s; } }

/* open-windows strip in the top bar */
.sh-strip { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 4px; }
.sh-strip::-webkit-scrollbar { display: none; }
.sh-chip { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; max-width: 190px; height: 32px; padding: 0 6px 0 10px; border-radius: 9px; border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--muted); font-size: 12.5px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.sh-chip > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-chip svg { width: 15px; height: 15px; flex: none; }
.sh-chip:hover { color: var(--text); background: rgba(255,255,255,.07); }
.sh-chip.active { color: var(--text); border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.sh-chip.active > svg:first-child { color: var(--accent); }
.sh-chip.min { opacity: .6; border-style: dashed; }
.sh-chip-x { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; opacity: 0; transition: opacity .15s, background .15s; }
.sh-chip-x svg { width: 12px; height: 12px; }
.sh-chip:hover .sh-chip-x, .sh-chip.active .sh-chip-x { opacity: .75; }
.sh-chip-x:hover { opacity: 1 !important; background: #e5484d; color: #fff; }

/* sidebar: pinned apps, running dots, drag to reorder */
.sh-pins { display: flex; flex-direction: column; gap: 2px; }
.sh-nav { position: relative; }
.sh-nav.running::after { content: ''; position: absolute; left: 2px; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: var(--muted); }
.sh-nav.front::after { height: 16px; margin-top: -8px; border-radius: 3px; background: var(--accent); }
.sh-nav.dragging { opacity: .4; }
.sh-nav.over { box-shadow: inset 0 2px 0 var(--accent); }
.sh-nav .sh-run { display: none; }
.sh-ctx { position: fixed; z-index: 100030; min-width: 190px; padding: 5px; border-radius: 12px; background: var(--panel-solid, #0d1524); border: 1px solid var(--border); box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.sh-ctx-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; cursor: pointer; text-align: left; }
.sh-ctx-item svg { width: 15px; height: 15px; opacity: .8; }
.sh-ctx-item:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.sh-ctx-item:disabled { opacity: .4; cursor: default; }

/* All apps: grouped, filterable, with a pin toggle on each */
.sh-apps-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 6px; }
.sh-apps-head h2 { margin: 0; font-size: 18px; }
.sh-apps-filter { max-width: 260px; }
.sh-apps-cat { margin: 18px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); }
.sh-app { position: relative; cursor: pointer; text-align: center; transition: border-color .15s, transform .12s, background .15s; }
.sh-app:hover { transform: translateY(-1px); background: rgba(255,255,255,.06); }
.sh-app > span { font-size: 12.5px; }
.sh-app-pin { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted); opacity: 0; cursor: pointer; transition: opacity .15s, background .15s; }
.sh-app-pin svg { width: 14px !important; height: 14px !important; color: inherit !important; }
.sh-app:hover .sh-app-pin, .sh-app.pinned .sh-app-pin { opacity: 1; }
.sh-app.pinned .sh-app-pin { color: var(--accent); }
.sh-app-pin:hover { background: rgba(255,255,255,.1); color: var(--text); }

/* What's new banner */
.sh-news { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.sh-news > svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.sh-news > div { flex: 1; }

@media (max-width: 720px) {
  /* 5.72 the sidebar's three parts dissolve into the phone's bottom bar (same items, same order as before) */
  .sh-side > .sh-side-top, .sh-side > .sh-side-mid, .sh-side > .sh-side-bot { display: contents !important; }
  .sh-sidebtn, .sh-viewbtn { display: none !important; }
  .sh-strip, .sh-nav[data-nav="whatsnew"] { display: none; }
  .sh-pins { flex-direction: row; gap: 0; }
  .sh-pins .sh-nav { display: flex !important; }
  .sh-pins .sh-nav:nth-child(n+4) { display: none !important; }
  .sh-nav.running::after { left: 50%; top: 2px; margin: 0 0 0 -2px; }
  .sh-nav.front::after { width: 16px; height: 3px; margin-left: -8px; }
}
.cl-li.sub { margin-left: 18px; font-size: 12.5px; color: var(--muted); }
.cl-li.sub::before { content: '–'; }
.cl-detail .cl-ver { font-size: 18px; font-weight: 700; color: var(--text); padding: 0 0 6px; cursor: default; flex-direction: row; align-items: baseline; }
.cl-detail .cl-ver:hover { background: transparent; }
@media (max-width: 560px) { .cl-left { width: 110px !important; flex-basis: 110px !important; } }

/* ---------------------------------------------------------------- 5.11.1 phone pass: never scroll sideways */
.set-nav-select { display: none; }
.fl-back { display: inline-flex !important; align-items: center; gap: 6px; margin: 2px 0 8px -2px; }
/* The sign-in background bleeds 40px past the edges for its blur/drift; pin it to the screen so it can
   never make the page wider than the phone. */
.si { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.si::before { position: fixed; }
.si::after { position: fixed; }
@media (max-width: 720px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  /* The content column is exactly the space between the top bar and the bottom bar; it scrolls down,
     never across. (Without this the page grew to ~1150px and windows opened off-screen.) */
  .sh { overflow: hidden; }
  .sh-main { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  .sh-scroll { overflow-x: hidden; overflow-y: auto; min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .sh-top { gap: 8px; }
  .sh-top > * { min-width: 0; }
  /* Home tiles: two even columns that can't be pushed wider by long lines. */
  .sh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .tile, .tile * { min-width: 0; }
  .tile-list > div, .tile-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tile-list div { font-family: inherit; font-size: 11.5px; }
  .tile-head { font-size: 11.5px; }
  .tile-head > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tile-cam { aspect-ratio: 16 / 10; }
  /* Bottom bar: Home + your first pins + Ask + All apps, evenly spaced, no sideways scroll. */
  .sh-side { overflow: hidden; justify-content: space-between; padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); }
  .sh-side > .sh-pins { display: flex; }
  .sh-nav { flex: 1 1 0; min-width: 0; padding: 6px 2px; }
  .sh-nav > span:not(.sh-run) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sh-pins { flex: 3 1 0; min-width: 0; }
  /* All apps: small icon grid (4 across on a normal phone) you scroll down. */
  .sh-apps-head { gap: 8px; }
  .sh-apps-head h2 { font-size: 16px; }
  .sh-apps-filter { max-width: none; flex: 1 1 100%; }
  .sh-apps { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
  .sh-app { padding: 12px 4px 10px; gap: 6px; border-radius: 12px; min-width: 0; }
  .sh-app svg { width: 24px; height: 24px; }
  .sh-app > span { font-size: 11px; line-height: 1.2; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
  .sh-app:hover { transform: none; }
  .sh-apps-cat { margin: 14px 0 6px; }
  /* Touch has no hover: show the pin toggle faintly so it can be tapped. */
  .sh-app-pin { opacity: .45; top: 2px; right: 2px; width: 26px; height: 26px; }
  .sh-news { flex-wrap: wrap; }
  /* Tab bars wrap onto a second line instead of scrolling sideways. */
  .ha-tabs, .arr-tabs, .dk-tabs { flex-wrap: wrap !important; overflow-x: visible !important; row-gap: 0; }
  .ha-tab, .arr-tab, .dk-tab { flex: none; padding: 7px 10px; }
  /* Weather hours: a grid you scroll down, not a strip. */
  .wx-hours { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); overflow: visible !important; }
  .wx-hour { width: auto !important; }
  /* Settings: one dropdown for the section; the chip list only appears while searching (and wraps). */
  .set-body .set-nav-select { display: block; width: 100%; height: 36px; margin: 0 0 4px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-solid); color: var(--text); font-size: 14px; }
  .set-body .set-nav:not(.searching) .set-nav-list { display: none !important; }
  .set-body .set-nav.searching .set-nav-list { flex-wrap: wrap; overflow-x: visible; }
  /* Windows: content wraps to the width; wide tables scroll inside themselves only. */
  .win, .win-body { max-width: 100vw; }
  /* Windows are solid on phones - the frosted glass let the app grid show through behind the text. */
  html[data-shell="new"] .win { background: var(--panel-solid, #0d1524) !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
  html[data-shell="new"] .win-body { background: var(--panel-solid, #0d1524); }
  .win-body img, .win-body video, .win-body canvas, .win-body iframe { max-width: 100%; }
  /* Computers: one scroll for the whole list (no box-in-a-box). Tapping a PC shows just that PC with a
     "< All computers" button; the search/filter bar hides while you look at one PC. */
  /* Toolbars and headers never get squeezed: they keep their full (wrapped) height and the content below
     takes what is left. (Computers' filter bar was squashed to 35px and its second row sat on the list.) */
  .win-body > .win-toolbar, .win-body > .win-tt, .win-body > .arr-head, .win-body > .ha-tabs { flex-shrink: 0 !important; }
  .win-toolbar { background: var(--panel-solid, #0d1524) !important; }
  /* DNS and Group Policy: list on top (its own short scroll box), details underneath; the whole pane
     scrolls down so the details are always reachable. */
  .dns-split, .gpo-split { flex: 1 1 0 !important; min-height: 0 !important; height: auto; flex-direction: column !important; overflow-y: auto; overflow-x: hidden; }
  .dns-split > .dns-left, .gpo-split > .gpo-left { flex: none !important; width: 100% !important; max-height: 38vh !important; overflow-y: auto !important; border-right: 0 !important; border-bottom: 1px solid var(--border) !important; }
  .dns-split > .dns-right, .gpo-split > .gpo-right { flex: none !important; width: 100% !important; max-height: none !important; overflow: visible !important; }
  /* Button rows wrap onto a second line instead of running off the right edge (Group Policy details etc.). */
  .win-body .row-inline { flex-wrap: wrap; row-gap: 6px; max-width: 100%; }
  .win-body .row-inline > * { min-width: 0; }
  /* Bottom bar highlights the app whose window is in front, not Home underneath it. */
  .sh-side.win-front .sh-nav.on:not(.front) { background: transparent; color: var(--muted); }
  .sh-side.win-front .sh-nav.front { background: rgba(255,255,255,.1); color: var(--text); }
  .fleet-split { flex: 1 1 0 !important; min-height: 0 !important; height: auto; flex-direction: column; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
  .fleet-split > .fleet-left, .fleet-split > .fleet-right { flex: none !important; max-height: none !important; min-height: auto; overflow: visible !important; width: 100% !important; }
  .fleet-split > .fleet-left { border-bottom: 1px solid var(--border) !important; }
  .fleet-split.has-sel > .fleet-left { display: none; }
  .win-body:has(.fleet-split.has-sel) > .win-toolbar { display: none; }
  .fleet-split > .fleet-right { padding: 4px 10px 16px; }
  .fl-back { display: inline-flex !important; margin: 6px 0 2px -4px; }
  /* Tables fit the screen: cells wrap instead of pushing the table off the right edge. */
  .win-body table { width: 100% !important; max-width: 100%; table-layout: auto; }
  .win-body th, .win-body td { white-space: normal !important; overflow-wrap: anywhere; word-break: normal; }
  .win-body th { overflow-wrap: normal; }
  .win-body pre { max-width: 100%; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
}

/* ---------------------------------------------------------------- 5.12 live tools (pclive.js) */
.fl-live { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--good, #34d399) 35%, var(--border)); background: color-mix(in srgb, var(--good, #34d399) 7%, transparent); }
.fl-live.off { border-color: var(--border); background: rgba(255,255,255,.02); }
.fl-live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good, #34d399); box-shadow: 0 0 8px var(--good, #34d399); flex: none; }
.fl-live.off .fl-live-dot { background: var(--faint, #64748b); box-shadow: none; }
.fl-live-label { font-weight: 700; font-size: 12px; letter-spacing: .5px; text-transform: uppercase; color: var(--good, #34d399); margin-right: 4px; }
.fl-live .btn { height: 32px; }
.pl-bar { gap: 8px; flex-wrap: wrap; }
.pl-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--muted); white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.pl-chip.good { background: color-mix(in srgb, var(--good, #34d399) 18%, transparent); color: var(--good, #34d399); }
.pl-chip.warn { background: color-mix(in srgb, var(--warn, #d19a00) 18%, transparent); color: var(--warn, #d19a00); }
.pl-chip.bad { background: color-mix(in srgb, var(--bad, #e0245e) 18%, transparent); color: var(--bad, #e0245e); }
.pl-who { font-size: 12px; color: var(--muted); }
.pl-mini { height: 26px; padding: 0 8px; font-size: 12px; }
.win-body:has(.pl-term), .win-body:has(.pl-live), .win-body:has(.pl-files), .win-body:has(.pl-screen), .win-body:has(.pl-disco) { display: flex; flex-direction: column; overflow: hidden; }
.pl-term { flex: 1 1 0; min-height: 0; background: #0a0f1a; padding: 6px 4px 4px 8px; }
.pl-term .xterm { height: 100%; }
.pl-term .xterm-viewport { scrollbar-width: thin; }
.pl-term.pl-plain { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.pl-plain-out { flex: 1 1 0; min-height: 0; margin: 0; overflow: auto; font: 13px/1.4 "Cascadia Mono", Consolas, monospace; color: #e6edf3; white-space: pre-wrap; word-break: break-word; }
.pl-live { flex: 1 1 0; min-height: 0; overflow: auto; padding: 12px; }
.pl-live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.pl-live-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: rgba(255,255,255,.03); min-width: 0; }
.pl-live-label { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.pl-live-val { font-size: 24px; font-weight: 600; margin-top: 2px; }
.pl-live-sub { font-size: 11.5px; color: var(--muted); min-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-spark { width: 100%; height: 42px; display: block; margin-top: 4px; }
.pl-proc-table td:first-child { font-weight: 500; }
.pl-files { flex: 1 1 0; min-height: 0; overflow: auto; padding: 0 8px 8px; }
.pl-files.drop { outline: 2px dashed var(--accent); outline-offset: -6px; }
.pl-file { cursor: default; user-select: none; }
.pl-file:hover td { background: rgba(255,255,255,.04); }
.pl-file.sel td { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.pl-file.hidden { opacity: .6; }
.pl-file td svg { width: 15px; height: 15px; vertical-align: -3px; color: var(--accent); }
.pl-path { flex: 1 1 240px; min-width: 0; font-family: var(--mono); font-size: 12.5px; }
.pl-tail { flex: 0 0 38%; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.pl-tail-head { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 12.5px; }
.pl-tail-head svg { width: 15px; height: 15px; }
.pl-tail-out { flex: 1 1 0; min-height: 0; margin: 0; overflow: auto; padding: 6px 10px; background: #0a0f1a; color: #e6edf3; font: 12px/1.45 var(--mono); white-space: pre-wrap; word-break: break-word; }
.pl-screen { position: relative; flex: 1 1 0; min-height: 0; display: grid; place-items: center; background: #05080f; overflow: hidden; }
.pl-screen-img { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: auto; }
.pl-screen-note { position: absolute; top: 8px; right: 10px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.55); color: #cbd5e1; }
.pl-disco { flex: 1 1 0; min-height: 0; overflow: auto; padding: 0 10px 10px; }
.pl-disco-table tr.known td { opacity: .75; }
.pl-port { display: inline-block; font-size: 11px; padding: 1px 6px; margin: 1px 3px 1px 0; border-radius: 6px; background: rgba(255,255,255,.07); white-space: nowrap; }
.pl-new { margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--warn, #d19a00) 22%, transparent); color: var(--warn, #d19a00); }
.pl-check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.pl-modal-body { display: block !important; padding: 16px 18px; max-height: 70vh; overflow: auto; }
.pl-modal-body > * + * { margin-top: 10px; }
.pl-modal-body textarea { width: 100%; resize: vertical; font: 12.5px/1.4 var(--mono); }
.pl-p { margin: 0; font-size: 14px; line-height: 1.5; }
.pl-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.pl-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; cursor: pointer; }
.pl-check input { margin-top: 3px; }
.pl-heal-hist { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; max-height: 240px; overflow: auto; }
.pl-heal-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-recs { display: flex; flex-direction: column; gap: 4px; }
.pl-rec { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; border: 1px solid var(--border); }
.pl-rec:hover { border-color: var(--accent); }
.pl-rec svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.pl-rec-view { margin: 0; max-height: 60vh; overflow: auto; padding: 10px; background: #0a0f1a; color: #e6edf3; font: 12px/1.45 var(--mono); white-space: pre-wrap; word-break: break-word; border-radius: 8px; }
.pl-rec-meta { color: #22d3ee; margin: 4px 0; }
.pl-rec-err { color: #f87171; }
.pl-rec-keys summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.pl-rec-keys pre { margin: 6px 0 0; max-height: 200px; overflow: auto; font: 12px/1.4 var(--mono); white-space: pre-wrap; }
@media (max-width: 720px) {
  .fl-live { gap: 6px; }
  .fl-live .btn { flex: 1 1 40%; justify-content: center; }
  .pl-live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-bar .nt-input { max-width: 100%; }
  .pl-disco-table th:nth-child(3), .pl-disco-table td:nth-child(3), .pl-disco-table th:nth-child(6), .pl-disco-table td:nth-child(6) { display: none; }
}

/* ===== 5.13 Home Assistant: control, floor plan, history, automations, health ===== */
.ha-control { display: flex; flex-direction: column; min-height: 0; }
.hx-sect { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.hx-sect::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.hx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.hx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: inherit; font-size: 12px; cursor: pointer; }
.hx-chip:hover { border-color: var(--accent); }
.hx-chip.on { background: rgba(34,211,238,.14); border-color: rgba(34,211,238,.5); color: var(--accent); }
.hx-x { background: none; border: 0; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 0 0 2px; opacity: .7; }
.hx-x:hover { opacity: 1; }
.hx-events { display: flex; flex-direction: column; }
.hx-day { position: sticky; top: 0; z-index: 1; padding: 8px 2px 4px; font-weight: 600; font-size: 12px; color: var(--muted); background: var(--panel-solid); }
.hx-event { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.hx-event .icon { width: 16px; height: 16px; flex: none; color: var(--muted); }
.hx-event.cat-doors .icon { color: var(--warn); } .hx-event.cat-people .icon { color: var(--accent); } .hx-event.cat-security .icon { color: var(--bad); } .hx-event.cat-lights .icon { color: #facc15; } .hx-event.cat-climate .icon { color: #fb923c; } .hx-event.cat-automations .icon { color: #a78bfa; }
.hx-time { font-family: var(--mono); font-size: 11px; color: var(--muted); width: 62px; flex: none; }
.hx-what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hx-by { flex: none; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: rgba(34,211,238,.12); color: var(--accent); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-by.auto { background: rgba(167,139,250,.14); color: #a78bfa; }
.hx-picker { position: relative; max-width: 420px; }
.hx-drop { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; display: flex; flex-direction: column; max-height: 300px; overflow: auto; background: var(--panel-solid); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.hx-drop:empty { display: none; }
.hx-opt { text-align: left; padding: 7px 10px; background: none; border: 0; border-bottom: 1px solid var(--border); color: inherit; cursor: pointer; font-size: 13px; }
.hx-opt:hover { background: rgba(34,211,238,.1); }
.hx-charts { display: grid; gap: 12px; margin-top: 10px; }
.hx-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--panel); min-width: 0; }
.hx-card-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.hx-chart { position: relative; }
.hx-svg { width: 100%; height: 150px; display: block; overflow: visible; }
.hx-grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hx-axis { fill: var(--muted); font-size: 10px; font-family: var(--mono); }
.hx-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.hx-area { fill: rgba(34,211,238,.12); stroke: none; }
.hx-dot { fill: var(--accent); stroke: var(--panel-solid); stroke-width: 2; }
.hx-tip { position: absolute; top: 0; pointer-events: none; padding: 3px 8px; border-radius: 6px; background: var(--panel-solid); border: 1px solid var(--border); font-size: 11px; white-space: nowrap; display: none; z-index: 2; }
.hx-tl { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.04); }
.hx-seg { height: 100%; min-width: 1px; }
.hx-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.hx-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.hx-alert { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 8px 0; border-radius: 8px; border: 1px solid rgba(251,191,36,.4); background: rgba(251,191,36,.08); font-size: 13px; }
.hx-alert.bad { border-color: rgba(248,113,113,.45); background: rgba(248,113,113,.08); }
.hx-alert .icon { flex: none; width: 18px; height: 18px; }
/* floor plan */
.fp-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fp-plans { display: flex; gap: 4px; flex-wrap: wrap; }
.fp-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.fp-stage { position: relative; width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: rgba(255,255,255,.03); user-select: none; touch-action: manipulation; }
.fp-stage.editing { outline: 2px dashed rgba(34,211,238,.5); outline-offset: -2px; touch-action: none; }
.fp-img { display: block; width: 100%; height: auto; pointer-events: none; }
.fp-noimg { aspect-ratio: 16 / 10; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.fp-empty { padding: 40px 16px; }
.fp-marker { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 42px; padding: 5px 7px; border-radius: 12px; cursor: pointer; background: rgba(13,21,36,.82); border: 1px solid var(--border); color: #cbd5e1; backdrop-filter: blur(4px); box-shadow: 0 2px 10px rgba(0,0,0,.35); transition: background .15s, color .15s; }
.fp-marker .icon { width: 18px; height: 18px; }
.fp-marker.on { background: rgba(250,204,21,.9); color: #1f2937; border-color: #facc15; box-shadow: 0 0 18px rgba(250,204,21,.55); }
.fp-marker.open, .fp-marker.unlocked, .fp-marker.alert { background: rgba(248,113,113,.9); color: #fff; border-color: var(--bad); }
.fp-marker.value { color: var(--accent); }
.fp-marker.dead { opacity: .5; }
.fp-marker.editing { cursor: grab; outline: 1px dashed var(--accent); }
.fp-marker.editing:active { cursor: grabbing; }
.fp-val { font-family: var(--mono); font-size: 10px; line-height: 1.1; }
.fp-lbl { font-size: 9px; opacity: .8; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-del { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.fp-del .icon { width: 12px; height: 12px; }
.fp-tray { margin-top: 8px; }
.fp-picklist { display: flex; flex-direction: column; max-height: 50vh; overflow: auto; margin-top: 8px; }
.fp-pick { text-align: left; padding: 8px 10px; background: none; border: 0; border-bottom: 1px solid var(--border); color: inherit; cursor: pointer; }
.fp-pick:hover { background: rgba(34,211,238,.1); }
/* automations */
.ax-list { display: flex; flex-direction: column; }
.ax-row, .ax-problem { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--border); cursor: pointer; }
.ax-row:hover, .ax-problem:hover { background: rgba(255,255,255,.03); }
.ax-row.off .ax-main b { opacity: .55; }
.ax-problem { border: 1px solid rgba(248,113,113,.3); border-radius: 8px; margin-bottom: 6px; background: rgba(248,113,113,.05); }
.ax-main { flex: 1; min-width: 0; }
.ax-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax-detail { font-size: 13px; }
.ax-line { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; }
.ax-line .icon { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--muted); }
.ax-run { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 6px; cursor: pointer; }
.ax-run:hover { background: rgba(255,255,255,.04); }
.ax-run.sel { background: rgba(34,211,238,.1); }
.ax-runsteps { margin: 6px 0 4px 10px; padding-left: 12px; border-left: 2px solid var(--border); }
.ax-why { padding: 7px 10px; border-radius: 6px; margin-bottom: 6px; background: rgba(255,255,255,.04); }
.ax-why.bad { background: rgba(248,113,113,.1); color: var(--bad); } .ax-why.warn { background: rgba(251,191,36,.1); color: var(--warn); } .ax-why.good { background: rgba(52,211,153,.1); color: var(--good); }
.ax-step { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.ax-step.no { opacity: .6; }
.ax-mark { width: 14px; flex: none; font-weight: 700; }
.ax-step.ok .ax-mark { color: var(--good); } .ax-step.no .ax-mark { color: var(--bad); }
.ax-kind { flex: none; width: 72px; font-family: var(--mono); font-size: 10px; text-transform: uppercase; color: var(--muted); }
.ax-err { margin-top: 6px; padding: 7px 10px; border-radius: 6px; background: rgba(248,113,113,.1); color: var(--bad); font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
/* device health (shared with Docker) */
.hh-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.hh-main { flex: 1; min-width: 0; }
.hh-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hh-bat { width: 70px; height: 8px; flex: none; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.hh-bat-fill { height: 100%; background: var(--good); border-radius: 4px; }
.hh-bat-fill.low { background: var(--bad); }
.hh-pct { width: 40px; flex: none; text-align: right; font-family: var(--mono); font-size: 12px; }
.hh-pct.low { color: var(--bad); }
.hh-all { margin-top: 10px; }
.hh-all > summary { cursor: pointer; padding: 6px 2px; color: var(--muted); font-size: 12px; }

/* ===== 5.13 Docker: overview, badges, logs, stack editor ===== */
.dk-badge { display: inline-block; min-width: 16px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #04121a; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.dk-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 8px; vertical-align: middle; }
.dk-upd { cursor: pointer; background: transparent; }
.dk-upd:hover { background: rgba(34,211,238,.12); }
.dk-envcard { padding: 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; transition: border-color .15s, transform .15s; }
.dk-envcard:hover { border-color: rgba(34,211,238,.5); transform: translateY(-1px); }
.dk-autobox { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); }
.dk-autobox .nt-input { flex: 1; min-width: 180px; }
.dk-logs-wrap { display: flex; flex-direction: column; height: min(70vh, 640px); }
.dk-logbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.dk-logbar label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.dk-logview { flex: 1; overflow: auto; padding: 6px 0; background: #070b12; font-family: var(--mono); font-size: 12px; line-height: 1.45; color: #cbd5e1; }
.dk-logline { display: flex; gap: 10px; padding: 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dk-logview.nowrap .dk-logline { white-space: pre; overflow-wrap: normal; }
.dk-logline:hover { background: rgba(255,255,255,.04); }
.dk-logline.stderr { color: #fca5a5; }
.dk-logline.err { color: #f87171; background: rgba(248,113,113,.06); }
.dk-logline.warn { color: #fcd34d; }
.dk-logt { flex: none; color: #64748b; user-select: none; }
.sx-editor { display: flex; height: min(46vh, 460px); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #070b12; }
.sx-gutter { flex: none; width: 44px; overflow: hidden; padding: 8px 6px 8px 0; text-align: right; font-family: var(--mono); font-size: 12px; line-height: 18px; color: #475569; background: rgba(255,255,255,.02); border-right: 1px solid var(--border); user-select: none; }
.sx-code { flex: 1; resize: none; border: 0; outline: none; padding: 8px 10px; margin: 0; background: transparent; color: #e2e8f0; font-family: var(--mono); font-size: 12px; line-height: 18px; white-space: pre; overflow: auto; tab-size: 2; }
.sx-env { display: flex; flex-direction: column; gap: 6px; }
.sx-envrow { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; gap: 6px; }
.sx-envrow .nt-input { font-family: var(--mono); font-size: 12px; min-width: 0; }
.sx-deploy { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.sx-deploy label { display: inline-flex; align-items: center; gap: 4px; }
.sx-deploy .nt-input { flex: 1; min-width: 180px; }
.sx-diffpre { margin: 0; max-height: 40vh; overflow: auto; padding: 6px 0; border-radius: 8px; background: #070b12; font-family: var(--mono); font-size: 12px; line-height: 17px; }
.sx-d { padding: 0 10px; white-space: pre; color: #94a3b8; }
.sx-d.add { background: rgba(52,211,153,.12); color: #6ee7b7; }
.sx-d.del { background: rgba(248,113,113,.12); color: #fca5a5; }
.sx-hist .hh-row .btn { padding: 2px 10px; }
@media (max-width: 640px) {
  .sx-envrow { grid-template-columns: 1fr 1fr auto; }
  .hx-by { display: none; }
  .dk-logs-wrap { height: 72vh; }
  .fp-lbl { display: none; }
}
.fp-marker.warn { background: rgba(251,191,36,.92); color: #1f2937; border-color: var(--warn); }
.fp-marker.good { color: var(--good); border-color: rgba(52,211,153,.5); }

/* ===== 5.14 Domain app ===== */
.dm { display: flex; height: 100%; min-height: 0; }
.dm-nav { flex: 0 0 210px; display: flex; flex-direction: column; gap: 1px; padding: 10px 8px; border-right: 1px solid var(--border); overflow-y: auto; background: rgba(255,255,255,.015); }
.dm-col { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.dm-main { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dm-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px 8px; border-bottom: 1px solid var(--border); }
.dm-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.dm-title h2 { margin: 0; font-size: 18px; }
.dm-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.dm-body { flex: 1; overflow: auto; padding: 12px 16px 60px; min-height: 0; }
.dm-searchwrap { position: relative; margin-bottom: 8px; }
.dm-search { width: 100%; }
.dm-results { position: absolute; z-index: 30; left: 0; right: -120px; top: 100%; display: flex; flex-direction: column; background: var(--panel-solid); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.35); max-height: 60vh; overflow: auto; }
.dm-results:empty { display: none; }
.dm-results .hint { padding: 8px 10px; }
.dm-hit { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--border); background: none; color: inherit; text-align: left; cursor: pointer; }
.dm-hit:hover { background: rgba(34,211,238,.1); }
.dm-hit small { margin-left: auto; }
.dm-navgrp { margin: 12px 8px 4px; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.dm-navbtn { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 0; border-radius: 7px; background: none; color: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.dm-navbtn .icon { width: 16px; height: 16px; opacity: .8; flex: none; }
.dm-navbtn:hover { background: rgba(255,255,255,.05); }
.dm-navbtn.on { background: rgba(34,211,238,.14); color: var(--accent); }
.dm-banner-wrap:empty { display: none; }
.dm-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 14px; margin: 0 0 8px; border-radius: 8px; border: 1px solid rgba(251,191,36,.4); background: rgba(251,191,36,.08); font-size: 13px; }
.dm-banner-wrap .dm-banner { margin: 8px 12px 0; }
.dm-banner.bad { border-color: rgba(248,113,113,.45); background: rgba(248,113,113,.08); }
.dm-banner > .icon { flex: none; width: 18px; height: 18px; }
.dm-banner .btn { margin-left: auto; }
.dm-err { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; border: 1px solid rgba(248,113,113,.45); background: rgba(248,113,113,.07); font-size: 13px; }
.dm-err > .icon { flex: none; width: 18px; height: 18px; color: var(--bad); }
.dm-sect { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.dm-sect::after { content: ''; flex: 1; height: 1px; background: var(--border); order: 1; }
.dm-sect > .btn, .dm-sect > select { order: 2; text-transform: none; letter-spacing: 0; font-family: inherit; }
.dm-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.dm-toolbar select.nt-input { width: auto; max-width: 260px; }
.dm-table { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.dm-tr { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: default; min-width: 0; }
.dm-tr > * { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dm-tr > .dm-name { flex: 2 1 0; }
.dm-tr > .dm-row-acts { flex: 0 0 auto; overflow: visible; }
.dm-tr > span:has(> input[type=checkbox]) { flex: 0 0 20px; }
.dm-tr:last-child { border-bottom: 0; }
.dm-tr[onclick], .dm-table > .dm-tr:not(.dm-th):hover { background: rgba(255,255,255,.025); }
.dm-table > .dm-tr:not(.dm-th) { cursor: pointer; }
.dm-th { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: rgba(255,255,255,.02); cursor: default !important; }
.dm-tr.off { opacity: .6; }
.dm-tr.warnrow { background: rgba(251,191,36,.05); }
.dm-name { display: flex; flex-direction: column; gap: 1px; }
.dm-name b, .dm-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.dm-chips .chip, .dm-tr .chip { white-space: nowrap; }
button.chip { cursor: pointer; background: transparent; }
button.chip:hover { border-color: var(--accent); }
.dm-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 4px; font-size: 13px; line-height: 1; }
.dm-bulk { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.dm-bulk:not(:empty) { padding: 8px 10px; border-radius: 8px; background: rgba(34,211,238,.08); border: 1px solid rgba(34,211,238,.3); }
.dm-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.dm-row.small { padding: 5px 2px; }
.dm-row > .icon { flex: none; width: 15px; height: 15px; opacity: .7; }
.dm-main-txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dm-row-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dm-ic { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.05); }
.dm-ic .icon { width: 16px; height: 16px; }
.dm-ic.bad { background: rgba(248,113,113,.14); color: var(--bad); }
.dm-ic.warn { background: rgba(251,191,36,.14); color: var(--warn); }
.dm-allgood { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 8px; background: rgba(52,211,153,.08); color: var(--good); font-size: 13px; }
.dm-allgood .icon { width: 18px; height: 18px; }
.dm-click { cursor: pointer; }
.dm-click:hover { border-color: rgba(34,211,238,.5); }
.dm-sel { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent) inset; }
.dm-link { border: 0; background: none; color: var(--accent); text-align: left; cursor: pointer; padding: 0; font: inherit; }
.dm-policy { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 8px; background: rgba(255,255,255,.03); font-size: 13px; margin-bottom: 4px; }
.dm-policy .icon { width: 16px; height: 16px; flex: none; opacity: .7; }
/* drawer */
.dm-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); z-index: 20; display: flex; flex-direction: column; background: var(--panel-solid); border-left: 1px solid var(--border); box-shadow: -14px 0 40px rgba(0,0,0,.35); animation: dmSlide .18s ease-out; }
@keyframes dmSlide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.dm-drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.dm-drawer-title { flex: 1; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-drawer-body { flex: 1; overflow: auto; padding: 12px 14px 40px; }
.dm-btnrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; margin: 6px 0; }
.dm-btnrow .dm-field { margin: 0; }
.dm-kv { display: flex; gap: 10px; padding: 4px 0; font-size: 13px; border-bottom: 1px dashed rgba(255,255,255,.05); }
.dm-k { flex: 0 0 150px; color: var(--muted); }
.dm-v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dm-v .chip { margin: 0 4px 2px 0; }
.dm-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 12px; }
.dm-field { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; font-size: 12px; color: var(--muted); }
.dm-field > .nt-input, .dm-field > select, .dm-field > textarea, .dm-field > div { color: var(--text, inherit); }
.dm-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin: 4px 12px 4px 0; cursor: pointer; }
.dm-modal-body { display: block !important; padding: 16px 18px !important; overflow: auto; }
.dm-modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.dm-picklist { display: flex; flex-direction: column; max-height: 50vh; overflow: auto; margin-top: 8px; }
.dm-pick { text-align: left; padding: 8px 10px; background: none; border: 0; border-bottom: 1px solid var(--border); color: inherit; cursor: pointer; font-size: 13px; }
.dm-pick:hover { background: rgba(34,211,238,.1); }
.dm-card { padding: 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; background: rgba(255,255,255,.02); }
.dm-cred { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: baseline; padding: 12px 14px; margin: 12px 0; border-radius: 8px; background: rgba(34,211,238,.08); }
.dm-cred b { font-size: 16px; user-select: all; }
.dm-steps { display: flex; flex-direction: column; gap: 3px; }
.dm-step { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.dm-step.ok .ax-mark { color: var(--good); } .dm-step.no .ax-mark { color: var(--bad); }
.dm-history { display: flex; flex-direction: column; }
.dm-hrow { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.dm-hrow.undone .dm-main-txt > span { text-decoration: line-through; opacity: .6; }
.dm-snack { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 28px); padding: 8px 8px 8px 14px; border-radius: 10px; background: var(--panel-solid); border: 1px solid rgba(34,211,238,.4); box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 13px; animation: dmUp .2s ease-out; }
.dm-snack > span { overflow: hidden; text-overflow: ellipsis; }
@keyframes dmUp { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.dm-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.dm-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.02); color: inherit; text-align: left; cursor: pointer; font-size: 13px; }
.dm-tile:hover { border-color: rgba(34,211,238,.55); background: rgba(34,211,238,.06); }
.dm-tile .icon { width: 20px; height: 20px; color: var(--accent); }
.dm-side { margin: 12px 0 2px; font-weight: 600; font-size: 13px; }
.dm-area { margin: 8px 0 2px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.dm-setting { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-left: 2px solid rgba(34,211,238,.35); margin: 2px 0; font-size: 13px; background: rgba(255,255,255,.015); }
.dm-diff { padding: 6px 10px; border-radius: 6px; margin: 3px 0; font-size: 13px; }
.dm-diff.add { background: rgba(52,211,153,.1); } .dm-diff.del { background: rgba(248,113,113,.1); } .dm-diff.chg { background: rgba(251,191,36,.08); }
.dm-applies { border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; margin: 6px 0; }
.dm-applies.yes .ax-mark { color: var(--good); } .dm-applies.no { opacity: .7; } .dm-applies.no .ax-mark { color: var(--bad); }
.dm-applies-list { margin: 2px 0 6px 26px; padding: 0; font-size: 12px; color: var(--muted); }
.dm-embed .win-scroll { padding: 0 !important; }
.warn-text { color: var(--warn) !important; }
.mono { font-family: var(--mono); }
.hx-chip.warn { border-color: rgba(251,191,36,.5); color: var(--warn); }
/* printable welcome sheets */
.dm-sheet { font-family: Calibri, Arial, sans-serif; color: #111; padding: 30px; }
.dm-sheet h1 { font-size: 26px; margin: 0 0 12px; }
.dm-sheet table { border-collapse: collapse; margin: 16px 0; }
.dm-sheet th { text-align: left; padding: 8px 16px 8px 0; color: #555; font-weight: normal; }
.dm-sheet td { padding: 8px 0; font-size: 18px; font-weight: bold; }
.dm-sheet .mono { font-family: Consolas, monospace; letter-spacing: 1px; }
.dm-sheet-small { color: #888; font-size: 11px; }
.dm-sheet-page { page-break-after: always; }
#dm-print { display: none; }
@media print {
  body.dm-printing > *:not(#dm-print) { display: none !important; }
  body.dm-printing #dm-print { display: block !important; background: #fff; }
  body.dm-printing { background: #fff !important; }
}
/* narrow windows / phones: nav becomes a scrolling strip */
@media (max-width: 760px) {
  .dm { flex-direction: column; }
  .dm-nav { flex: none; flex-direction: row; align-items: center; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--border); padding: 6px; gap: 4px; }
  .dm-navgrp { display: none; }
  .dm-searchwrap { flex: 0 0 170px; margin: 0; }
  .dm-results { right: auto; width: 280px; }
  .dm-navbtn { white-space: nowrap; }
  .dm-hide-s { display: none; }
  .dm-k { flex-basis: 110px; }
  .dm-body { padding: 10px 10px 60px; }
}
.dm-hide-m { }
@media (max-width: 1000px) { .dm-hide-m { display: none; } }
/* 5.14 UniFi public IPs */
.wan-box { margin-bottom: 8px; }
.wan-site { margin: 12px 0 4px; font-size: 14px; }
.wan-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.wan-main { flex: 1; min-width: 0; }
.wan-num { flex: none; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.wan-spark { display: flex; gap: 1px; align-items: flex-end; flex: none; }
.wan-spark i { width: 3px; height: 12px; border-radius: 1px; background: var(--good); opacity: .8; }
.wan-spark i.down { background: var(--bad); }
@media (max-width: 640px) { .wan-spark { display: none; } }

/* ===== 5.15 Files app (Windows 11 style) ===== */
.fx { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; outline: none; font-size: 13px; }
.fx-tabs { display: flex; align-items: flex-end; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.fx-tab { display: flex; align-items: center; gap: 6px; max-width: 200px; padding: 6px 8px 6px 10px; border-radius: 8px 8px 0 0; cursor: pointer; color: var(--muted); white-space: nowrap; }
.fx-tab span { overflow: hidden; text-overflow: ellipsis; }
.fx-tab svg { width: 14px; height: 14px; flex: none; }
.fx-tab.on { background: var(--panel-solid); color: var(--text); box-shadow: 0 -1px 0 var(--border) inset; }
.fx-tab:hover:not(.on) { background: var(--accent-dim); }
.fx-tabx, .fx-tabnew { background: none; border: 0; color: inherit; cursor: pointer; border-radius: 6px; padding: 0 5px; font-size: 15px; line-height: 20px; }
.fx-tabx:hover, .fx-tabnew:hover { background: var(--accent-dim); }
.fx-tabnew { font-size: 18px; margin: 0 0 4px 4px; color: var(--muted); }
.fx-cmd { display: flex; align-items: center; gap: 4px; padding: 6px 8px; }
.fx-nav { background: none; border: 0; color: var(--text); width: 30px; height: 30px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; flex: none; }
.fx-nav:hover:not([disabled]) { background: var(--accent-dim); }
.fx-nav[disabled] { opacity: .35; cursor: default; }
.fx-nav svg { width: 16px; height: 16px; }
.fx-fwd svg { transform: scaleX(-1); }
.fx-up svg { transform: rotate(90deg); }
.fx-addrbox { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-head); }
.fx-addrbox > svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.fx-crumbs { flex: 1; min-width: 0; display: flex; align-items: center; overflow: hidden; cursor: text; height: 100%; }
.fx-crumb { background: none; border: 0; color: var(--text); padding: 3px 6px; border-radius: 4px; cursor: pointer; white-space: nowrap; font: inherit; }
.fx-crumb:hover { background: var(--accent-dim); }
.fx-sep { color: var(--faint); padding: 0 1px; }
.fx-addr { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font: inherit; outline: none; height: 100%; }
.fx-search { width: 230px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-head); color: var(--text); font: inherit; }
.fx-search:focus, .fx-addrbox:focus-within { border-color: var(--accent); outline: none; }
.fx-tools { display: flex; align-items: center; gap: 2px; padding: 4px 8px 6px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.fx-tool { display: flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--text); padding: 6px 9px; border-radius: 6px; cursor: pointer; white-space: nowrap; font: inherit; }
.fx-tool svg { width: 15px; height: 15px; }
.fx-tool:hover:not([disabled]) { background: var(--accent-dim); }
.fx-tool[disabled] { opacity: .38; cursor: default; }
.fx-tool.primary { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.fx-div { width: 1px; height: 22px; background: var(--border); margin: 0 4px; flex: none; }
.fx-body { flex: 1; min-height: 0; display: flex; }
.fx-side { width: 210px; flex: none; overflow-y: auto; padding: 6px; border-right: 1px solid var(--border); }
.fx-sitem { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; color: var(--text); padding: 6px 8px; border-radius: 6px; cursor: pointer; font: inherit; text-align: left; }
.fx-sitem span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-sitem svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.fx-sitem:hover { background: var(--accent-dim); }
.fx-sitem.on { background: var(--accent-dim); box-shadow: inset 3px 0 0 var(--accent); }
.fx-sitem.on svg { color: var(--accent); }
.fx-sitem.drop, .fx-row.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.fx-sub { padding-left: 26px; font-size: 12px; color: var(--muted); }
.fx-use { color: var(--faint); font-size: 11px; }
.fx-sgrp { margin: 12px 8px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.fx-soff { padding: 2px 10px; font-size: 11px; color: var(--faint); }
.fx-colors { display: flex; gap: 6px; padding: 4px 10px 6px; flex-wrap: wrap; }
.fx-cdot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; background: var(--faint); color: var(--muted); font-size: 10px; line-height: 10px; }
.fx-colors.big .fx-cdot { width: 24px; height: 24px; }
.fx-cdot.on { border-color: var(--text); }
.c-red { background: #ef4444 !important; } .c-orange { background: #f97316 !important; } .c-yellow { background: #eab308 !important; }
.c-green { background: #22c55e !important; } .c-blue { background: #3b82f6 !important; } .c-purple { background: #a855f7 !important; } .c-gray { background: #94a3b8 !important; }
.fx-cdot.none { background: transparent; border-color: var(--border-strong); }
.fx-main { flex: 1; min-width: 0; overflow: auto; position: relative; }
.fx-list { min-height: 100%; padding: 4px 6px 20px; outline: none; }
.fx-list.drop { background: var(--accent-dim); }
.fx-list.v-list .fx-row { display: grid; grid-template-columns: minmax(180px, 1fr) 150px 130px 90px; align-items: center; gap: 8px; padding: 0 8px; height: 30px; border-radius: 5px; cursor: default; user-select: none; }
.fx-list.v-list .fx-head { position: sticky; top: 0; z-index: 1; background: var(--panel-solid); height: 30px; border-bottom: 1px solid var(--border); border-radius: 0; margin-bottom: 2px; }
.fx-th { background: none; border: 0; color: var(--muted); font: inherit; text-align: left; cursor: pointer; padding: 0; font-size: 12px; }
.fx-th.c-size { text-align: right; }
.fx-row { transition: background .08s; }
.fx-row:hover:not(.fx-head) { background: rgba(127,160,200,.08); }
.fx-row.sel { background: var(--accent-dim) !important; box-shadow: inset 0 0 0 1px rgba(34,211,238,.35); }
.fx-row.cut { opacity: .5; }
.c-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.c-date, .c-type, .c-size { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-size { text-align: right; }
.fx-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fx-where { color: var(--faint); font-size: 11px; white-space: nowrap; margin-left: auto; padding-left: 8px; }
.fx-snip { display: block; color: var(--faint); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.fx-ic { position: relative; display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; }
.fx-ic svg { width: 17px; height: 17px; }
.k-folder svg { color: #f5c542; } .k-image svg { color: #34d399; } .k-video svg { color: #f472b6; } .k-audio svg { color: #a78bfa; }
.k-pdf svg { color: #f87171; } .k-office svg { color: #60a5fa; } .k-archive svg { color: #fbbf24; } .k-text svg { color: var(--muted); } .k-file svg { color: var(--muted); }
.fx-tagdot { position: absolute; right: -3px; bottom: -2px; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--panel-solid); }
.fx-list.v-icons, .fx-list.v-gallery { display: grid; gap: 6px; align-content: start; padding: 10px; }
.fx-list.v-icons { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.fx-list.v-gallery { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.fx-list.v-icons .fx-row, .fx-list.v-gallery .fx-row { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px; border-radius: 8px; text-align: center; user-select: none; }
.fx-list.v-icons .fx-n, .fx-list.v-gallery .fx-n { white-space: normal; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12px; }
.fx-list.v-icons .fx-ic { width: 64px; height: 64px; }
.fx-list.v-icons .fx-ic svg { width: 44px; height: 44px; }
.fx-list.v-gallery .fx-ic { width: 100%; height: 130px; background: rgba(127,160,200,.06); border-radius: 6px; overflow: hidden; }
.fx-list.v-gallery .fx-ic svg { width: 48px; height: 48px; }
.fx-ic.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.fx-list.v-icons .fx-tagdot, .fx-list.v-gallery .fx-tagdot { width: 12px; height: 12px; right: 2px; bottom: 2px; }
.fx-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 50px 20px; color: var(--muted); text-align: center; grid-column: 1 / -1; }
.fx-empty svg { width: 42px; height: 42px; opacity: .5; }
.fx-pane { width: 270px; flex: none; border-left: 1px solid var(--border); overflow-y: auto; padding: 14px; }
/* dual-pane commander */
.fx-cmd2 { display: none; flex: 1 1 50%; min-width: 0; flex-direction: column; border-left: 1px solid var(--border); overflow: hidden; }
.fx.split .fx-cmd2 { display: flex; }
.fx.split .fx-main { flex: 1 1 50%; }
.fx.split .fx-pane { display: none; }
.fx-tool.active { background: var(--accent-dim); color: var(--accent); }
.fx-c2head { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.fx-c2place { width: auto; max-width: 150px; }
.fx-c2path { flex: 1; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-cmd2-list { flex: 1; overflow: auto; padding: 4px; }
.fx-cmd2-list.drop { outline: 2px dashed var(--accent); outline-offset: -4px; }
.fx-c2row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; font-size: 13px; }
.fx-c2row:hover { background: rgba(255,255,255,.05); } .fx-c2row.sel { background: var(--accent-dim); }
.fx-c2row.drop { outline: 1px dashed var(--accent); }
.fx-c2row > svg { width: 16px; height: 16px; flex: none; }
.fx-c2row .fx-n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-c2size { font-size: 11px; color: var(--muted); font-family: var(--mono); flex: none; }
.fx-c2foot { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-top: 1px solid var(--border); font-size: 12px; }
.fx-c2n { color: var(--muted); }
@media (max-width: 720px) { .fx.split .fx-side { display: none; } }
.fx-pane.hide { display: none; }
.fx-pane-empty { color: var(--faint); text-align: center; margin-top: 60px; }
.fx-pv { display: grid; place-items: center; min-height: 150px; background: rgba(127,160,200,.06); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.fx-pv img, .fx-pv video { max-width: 100%; max-height: 240px; display: block; }
.fx-pv audio { width: 100%; }
.fx-pvic svg { width: 64px; height: 64px; }
.fx-pvname { font-weight: 600; word-break: break-word; margin-bottom: 2px; }
.fx-props { display: grid; gap: 6px; margin: 12px 0; }
.fx-prop { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.fx-prop span { color: var(--muted); } .fx-prop b { font-weight: 500; text-align: right; word-break: break-word; }
.fx-pvacts { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-status { display: flex; gap: 16px; padding: 4px 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; min-height: 24px; align-items: center; padding-right: 60px; }
.fx-xferbtn { position: absolute; right: 8px; bottom: 3px; display: flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; z-index: 3; }
.fx-xferbtn svg { width: 14px; height: 14px; }
.fx-xferbtn.busy { color: var(--accent); }
.fx-xferbtn.busy svg { animation: fxpulse 1.2s ease-in-out infinite; }
@keyframes fxpulse { 50% { opacity: .35; } }
.fx-xferpop { display: none; position: absolute; right: 8px; bottom: 30px; width: 340px; max-height: 60%; overflow-y: auto; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.4); padding: 10px; z-index: 5; }
.fx-xferpop.open { display: block; }
.fx-xferhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fx-xfer { padding: 6px 0; border-top: 1px solid var(--border); }
.fx-xfertop { display: flex; align-items: center; gap: 6px; }
.fx-xferlbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-xfer.failed .fx-xferlbl, .fx-xfer.failed small { color: var(--bad); }
.fx-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin: 4px 0 2px; }
.fx-bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.fx-xfer.done .fx-bar i { background: var(--good); }
.fx-menu { position: fixed; z-index: 100030; min-width: 190px; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 10px 34px rgba(0,0,0,.45); padding: 4px; }
.fx-menuitem { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--text); padding: 7px 10px; border-radius: 5px; cursor: pointer; font: inherit; font-size: 13px; text-align: left; }
.fx-menuitem svg, .fx-noic { width: 15px; height: 15px; flex: none; color: var(--muted); }
.fx-menuitem:hover { background: var(--accent-dim); }
.fx-menusep { height: 1px; background: var(--border); margin: 4px 6px; }
.fx-viewer { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; background: var(--panel-solid); }
.fx-vhead { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.fx-vtitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-vacts { display: flex; gap: 4px; flex-wrap: wrap; }
.fx-vbody { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.fx-vimg, .fx-vvid { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.fx-vbody:has(.fx-vimg), .fx-vbody:has(.fx-vvid) { background: #05080d; }
.fx-vpdf { flex: 1; width: 100%; border: 0; background: #fff; }
.fx-vaudio { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.fx-vaudio svg { width: 70px; height: 70px; color: #a78bfa; }
.fx-editor { flex: 1; width: 100%; border: 0; resize: none; padding: 14px 16px; background: transparent; color: var(--text); font: 13px/1.5 var(--mono); outline: none; tab-size: 2; }
.fx-editor.hide, .fx-md.hide { display: none; }
.fx-md { padding: 16px 26px; max-width: 860px; }
.fx-office { padding: 18px 26px; }
.fx-office.doc { max-width: 860px; margin: 0 auto; background: #fff; color: #1f2937; border-radius: 6px; margin-top: 14px; margin-bottom: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.3); padding: 40px 50px; line-height: 1.55; }
.fx-office .b { font-weight: 700; } .fx-office .i { font-style: italic; } .fx-office .u { text-decoration: underline; }
.fx-office img { max-width: 100%; }
.fx-office table { border-collapse: collapse; margin: 10px 0; }
.fx-office td, .fx-office th { border: 1px solid #cbd5e1; padding: 4px 8px; font-size: 12px; }
.fx-sheets { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 8px; }
.fx-sheets button { background: none; border: 1px solid var(--border); color: var(--muted); padding: 4px 10px; border-radius: 6px 6px 0 0; cursor: pointer; }
.fx-sheets button.on { background: var(--accent-dim); color: var(--text); border-color: var(--accent); }
.fx-grid { overflow: auto; }
.fx-grid table { border-collapse: collapse; font-size: 12px; }
.fx-grid td, .fx-grid th { border: 1px solid var(--border); padding: 3px 7px; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.fx-grid th { background: var(--panel-head); color: var(--muted); font-weight: 500; position: sticky; top: 0; }
.fx-slide { border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; margin: 10px 0; background: var(--panel-head); }
.fx-slide h3 { margin: 4px 0 8px; }
.fx-page { padding: 14px 18px 30px; }
.fx-pagehead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.fx-pagehead h2 { margin: 0; font-size: 18px; }
.fx-pageacts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.fx-sect { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.fx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.fx-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-head); color: var(--text); cursor: pointer; font: inherit; text-align: left; }
.fx-card svg { width: 26px; height: 26px; color: var(--accent); margin-bottom: 4px; }
.fx-card.small { padding: 10px; } .fx-card.small svg { width: 18px; height: 18px; }
.fx-card b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.fx-card:hover { border-color: var(--accent); }
.fx-share { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.fx-sharetop { display: flex; align-items: center; gap: 10px; }
.fx-sharemain { flex: 1; min-width: 0; } .fx-sharemain .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-shareacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.fx-sharelink { display: flex; gap: 6px; margin-top: 10px; } .fx-sharelink input { flex: 1; min-width: 0; }
.fx-log > div { padding: 6px 0; border-bottom: 1px solid var(--border); }
.fx-searchbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; } .fx-searchbar input { flex: 1; min-width: 200px; } .fx-searchbar select { width: auto; }
.fx-filters { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.fx-field { display: grid; gap: 4px; margin-bottom: 10px; } .fx-field > span { font-size: 12px; color: var(--muted); }
.fx-mbody { display: block; }
.fx-mfoot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; }
.fx-usage { display: grid; gap: 6px; }
.fx-urow { display: grid; grid-template-columns: 110px 1fr 80px; align-items: center; gap: 8px; font-size: 12px; } .fx-urow b { text-align: right; font-weight: 500; }
.fx-qv { display: block; padding: 0; overflow: auto; max-height: 82vh; background: #0b0f16; }
.fx-qv img, .fx-qv video { display: block; margin: 0 auto; max-width: 100%; max-height: 80vh; }
.fx-qv audio { width: calc(100% - 60px); margin: 40px 30px; }
.fx-qv iframe { width: 100%; height: 80vh; border: 0; background: #fff; }
.fx-qv pre { white-space: pre-wrap; word-break: break-word; padding: 16px; margin: 0; color: #dfe7f2; font: 13px var(--mono); }
.fx-qvtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }
@media (max-width: 900px) { .fx-pane { display: none; } .fx-search { width: 150px; } }
@media (max-width: 640px) {
  .fx-side { position: absolute; z-index: 4; left: 0; top: 0; bottom: 0; width: 200px; background: var(--panel-solid); transform: translateX(-100%); transition: transform .2s; }
  .fx-body { position: relative; }
  .fx.side-open .fx-side { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.4); }
  .fx-list.v-list .fx-row { grid-template-columns: 1fr 70px; } .fx-list.v-list .c-date, .fx-list.v-list .c-type { display: none; }
  .fx-tool span { display: none; } .fx-search { width: 110px; }
  .fx-status { font-size: 11px; gap: 10px; }
}
.fx-sidetoggle { display: none; }
@media (max-width: 640px) { .fx-sidetoggle { display: grid; } }
@media (max-width: 640px) { [data-shell="new"] .desk-files { display: none; } }
.fx-mini { padding: 3px 8px; font-size: 12px; gap: 4px; } .fx-mini svg { width: 13px; height: 13px; }
.fx-list.v-list .fx-row:has(.fx-snip) { height: 40px; }

/* 5.16 remote control (Screen window) */
.pl-screen.controlling { cursor: crosshair; outline: 2px solid var(--accent); outline-offset: -2px; }
.pl-screen.controlling .pl-screen-img { cursor: none; }
.pl-screen:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.pl-screen.controlling .pl-screen-note { background: var(--accent); color: #05080f; font-weight: 600; }
.pl-ind { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-top: 1px solid var(--border); }

/* 5.16 Security autopilot (Computers > Security > Score & fixes) */
.fl-secscore { display: flex; align-items: center; gap: 16px; padding: 6px 0 4px; }
.fl-secring { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 4px solid var(--border); }
.fl-secring b { font-size: 24px; line-height: 1; } .fl-secring span { font-size: 11px; color: var(--muted); }
.fl-secring.good { border-color: var(--good); } .fl-secring.warn { border-color: var(--warn); } .fl-secring.bad { border-color: var(--bad); }
.fl-secgrade { font-weight: 700; } .fl-secgrade.good { color: var(--good); } .fl-secgrade.warn { color: var(--warn); } .fl-secgrade.bad { color: var(--bad); }
.fl-checks { display: grid; gap: 6px; }
.fl-check { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.fl-check-main { flex: 1; min-width: 0; }
.fl-check-dot { flex: none; display: grid; place-items: center; } .fl-check-dot svg { width: 16px; height: 16px; }
.fl-check.ok .fl-check-dot { color: var(--good); } .fl-check.bad .fl-check-dot { color: var(--bad); }
.fl-check.bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }

/* 5.16 remote-control cursor overlay (the streamed remote cursor lags at low fps, so show a live one) */
.pl-softcursor { position: absolute; left: -100px; top: 0; width: 20px; height: 20px; pointer-events: none; z-index: 5; display: none;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20'%3E%3Cpath d='M4 2l7 18 2.5-7L21 10z' fill='%2322d3ee' stroke='%23001018' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E"); filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.pl-screen.controlling .pl-softcursor { display: block; }
.pl-click { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid var(--accent); border-radius: 50%; pointer-events: none; z-index: 6; animation: pl-click 0.45s ease-out forwards; }
@keyframes pl-click { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(2.2); opacity: 0; } }

/* 5.16 fleet health & lifecycle modal */
.fl-health-sum { margin-bottom: 8px; }
.fl-health th, .fl-health td { white-space: nowrap; }
.fl-health tr.fl-replace { background: color-mix(in srgb, var(--bad) 10%, transparent); }
.chip.muted { background: var(--border); color: var(--muted); }

/* 5.18 Hyper-V checkpoints */
.fl-checkpoints { margin: -2px 0 8px 22px; display: grid; gap: 3px; }
.fl-cp { display: flex; align-items: center; gap: 8px; padding: 3px 8px; border-left: 2px solid var(--border); }
.fl-cp .hint { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 5.19 power protection */
.fl-ups { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.fl-ups svg { width: 18px; height: 18px; }
.fl-ups.good { border-color: color-mix(in srgb, var(--good) 40%, var(--border)); } .fl-ups.good svg { color: var(--good); }
.fl-ups.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); } .fl-ups.warn svg { color: var(--warn); }
.fl-ups.bad { border-color: var(--bad); } .fl-ups.bad svg { color: var(--bad); }

/* ============================================================================
   Settings redesign (5.21): polished Control Panel, auto-save pill, sub-tabs,
   connection status dots, setup-health panel, Activity Log window.
   ============================================================================ */

/* --- nav polish --- */
.set-nav button { transition: background .12s ease, color .12s ease; border-radius: 8px; }
.set-nav button.active { box-shadow: inset 2px 0 0 var(--accent); }
.set-nav-home { font-weight: 600; }

/* --- auto-save pill in the footer --- */
.set-savepill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--faint); background: var(--panel-solid); }
.set-savepill svg { width: 14px; height: 14px; }
.set-savepill.saved { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--border)); }
.set-savepill.saving { color: var(--faint); }
.set-savepill.error { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
.set-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); display: inline-block; animation: set-spin .7s linear infinite; }
@keyframes set-spin { to { transform: rotate(360deg); } }

/* --- segmented sub-tabs inside a pane --- */
.set-subtabs { display: inline-flex; gap: 2px; padding: 3px; margin: 2px 0 14px; border-radius: 10px; background: var(--panel-solid); border: 1px solid var(--border); }
.set-subtab { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--faint);
  font-size: 12.5px; padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: background .12s ease, color .12s ease; }
.set-subtab svg { width: 14px; height: 14px; }
.set-subtab:hover { color: var(--text); }
.set-subtab.on { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
@media (max-width: 640px) { .set-subtabs { display: flex; overflow-x: auto; } }

/* --- connection status dot on a service card --- */
.svc-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); box-shadow: 0 0 0 3px transparent; transition: background .15s ease; }
.svc-dot.ok { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
.svc-dot.bad { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 20%, transparent); }
.svc-dot.wait { background: var(--accent); animation: svc-pulse 1s ease-in-out infinite; }
@keyframes svc-pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

/* --- Services: master (list) + detail --- */
.svc-master { display: flex; gap: 16px; align-items: flex-start; }
.svc-listcol { width: 260px; flex: 0 0 260px; }
.svc-search { width: 100%; padding: 8px 10px; margin-bottom: 8px; border-radius: 8px; border: 1px solid var(--border-strong); background: rgba(0,0,0,.35); color: var(--text); font-size: 13px; }
.svc-list { display: flex; flex-direction: column; gap: 2px; max-height: 62vh; overflow: auto; padding-right: 2px; }
.svc-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 9px 11px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text); cursor: pointer; font: inherit; }
.svc-row:hover { background: var(--panel-solid, rgba(128,128,128,.10)); }
.svc-row.active { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.svc-row-label { flex: 1; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-row-sub { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--faint); flex: none; }
.svc-row-sub.on { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.svc-detail { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--panel-solid); }
.svc-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.svc-detail-head h4 { margin: 0; font-size: 15px; flex: 1; }
.svc-detail-en { flex: none; }
.svc-detail-empty { color: var(--faint); font-size: 13px; padding: 24px 8px; text-align: center; }
@media (max-width: 720px) { .svc-master { flex-direction: column; } .svc-listcol { width: 100%; flex: 1 1 auto; } .svc-list { max-height: 240px; } .svc-detail { width: 100%; } }

/* --- Network Monitor (5.38) --- */
.nm-app { padding: 14px 16px; overflow: auto; height: 100%; }
.nm-topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.nm-topbar h2 { margin: 0; font-size: 17px; }
.nm-site { border: 1px solid var(--border); border-radius: 14px; background: var(--panel-solid); padding: 14px; margin-bottom: 16px; }
.nm-site-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.nm-site-head h3 { margin: 0 0 2px; font-size: 15px; }
.nm-diag { display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; border: 1px solid var(--border); }
.nm-diag svg { width: 15px; height: 15px; }
.nm-diag.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); background: color-mix(in srgb, var(--good) 8%, transparent); }
.nm-diag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.nm-diag.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.nm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.nm-tile { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: rgba(128,128,128,.05); }
.nm-tile-l { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; opacity: .6; }
.nm-tile-v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.nm-tile-s { font-size: 11px; opacity: .6; margin-top: 1px; }
.nm-sect { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .55; margin: 14px 0 6px; }
.nm-net { display: flex; flex-direction: column; gap: 2px; }
.nm-netrow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.nm-netrow:hover, .nm-row:hover { background: rgba(128,128,128,.10); }
.nm-netname { min-width: 130px; font-size: 13px; }
.nm-devs { display: flex; flex-direction: column; gap: 1px; }
.nm-row { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.nm-row-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nm-row-name b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-row-name small { font-size: 11px; }
.nm-row-ms { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }
.nm-row-up { min-width: 48px; text-align: right; font-size: 11px; opacity: .6; font-variant-numeric: tabular-nums; }
.nm-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.nm-dot.on { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
.nm-dot.off { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 20%, transparent); }
.nm-dot.unk { background: var(--muted); }
.nm-chart { border: 1px solid var(--border); border-radius: 10px; background: rgba(128,128,128,.05); padding: 6px; }
.nm-chart-wrap { margin-top: 8px; }
.nm-ranges { display: flex; gap: 4px; margin-left: 12px; }
.nm-range { padding: 4px 10px; border: 1px solid var(--border); background: transparent; color: inherit; border-radius: 999px; cursor: pointer; font: inherit; font-size: 12px; }
.nm-range.on { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }
.nm-events { display: flex; flex-direction: column; gap: 1px; }
.nm-ev { display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: 6px; font-size: 13px; }
.nm-hist-body { min-height: 320px; }
@media (max-width: 640px) { .nm-netname { min-width: 90px; } .nm-row-name small { display: none; } }

/* Network Monitor: heatmap, report, wall */
.nm-heat { display: flex; flex-direction: column; gap: 2px; overflow-x: auto; }
.nm-heat-row { display: grid; grid-template-columns: 46px repeat(24, 1fr); gap: 2px; align-items: center; }
.nm-heat-lbl { font-size: 10.5px; opacity: .6; text-align: right; padding-right: 4px; font-variant-numeric: tabular-nums; }
.nm-heat-h { font-size: 10px; opacity: .5; text-align: center; }
.nm-heat-c { height: 15px; border-radius: 2px; background: transparent; min-width: 6px; }
.nm-report { width: 100%; border-collapse: collapse; margin: 4px 0 14px; font-size: 13px; }
.nm-report th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; opacity: .55; padding: 4px 8px; border-bottom: 1px solid var(--border); }
.nm-report td { padding: 5px 8px; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); font-variant-numeric: tabular-nums; }
.nm-report tr:hover td { background: rgba(128,128,128,.06); }
.nm-wall { padding: 20px 24px; height: 100%; overflow: auto; background: var(--bg, #0b0f14); }
.nmw-top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.nmw-top h1 { margin: 0; font-size: 26px; }
.nmw-clock { margin-left: auto; font-size: 22px; font-variant-numeric: tabular-nums; opacity: .8; }
.nmw-site { border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; margin-bottom: 18px; background: var(--panel-solid); }
.nmw-site.alert { border-color: color-mix(in srgb, var(--bad) 60%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 20%, transparent); }
.nmw-name { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.nmw-name h2 { margin: 0; font-size: 22px; }
.nmw-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 14px; }
.nmw-tile { border-radius: 14px; padding: 16px; text-align: center; background: rgba(128,128,128,.08); }
.nmw-tile.good { background: color-mix(in srgb, var(--good) 12%, transparent); }
.nmw-tile.ok { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.nmw-tile.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.nmw-tile.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); }
.nmw-v { font-size: 40px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.nmw-l { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; opacity: .6; margin-top: 4px; }
.nmw-s { font-size: 12px; opacity: .6; }
.nmw-dev, .nmw-away { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nmw-away { margin-top: 6px; font-size: 13px; opacity: .8; }
.nmw-chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); }
.nmw-chip.on { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.nmw-chip.off { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }

/* --- setup-health panel on the Control Panel home --- */
.cp-health { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin: 4px 0 18px; background: var(--panel-solid); }
.cp-health-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.cp-health-head svg { width: 16px; height: 16px; }
.cp-health-head.ok { color: var(--good); }
.cp-health-head.warn { color: var(--warn); }
.cp-health-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); }
.cp-health-row:first-of-type { border-top: 0; }
.cp-health-main { flex: 1; min-width: 0; }
.cp-health-title { font-size: 13px; font-weight: 600; color: var(--text); }
.cp-health-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.cp-health-row.warn .cp-health-dot { background: var(--warn); }
.cp-health-row.info .cp-health-dot { background: var(--accent); }
.cp-health-row .btn { flex: none; }

/* --- category tile status line --- */
.cp-cat-status { font-size: 11.5px; color: var(--accent); margin: 3px 0 2px; opacity: .9; }

/* --- Activity Log app window --- */
.act-app { padding: 16px 18px; }
.act-apphead { display: flex; align-items: center; gap: 9px; }
.act-apphead h3 { margin: 0; font-size: 15px; }
.act-apphead svg { width: 17px; height: 17px; }

/* Camera view (5.23): the permanent "camera in use" notice — mirrors the on-screen indicator on the PC. */
.pl-cam-guard { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 12.5px;
  color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--panel-solid));
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border)); }
.pl-cam-guard svg { width: 15px; height: 15px; flex: none; }

/* ---- 5.42 SSH client ---- */
.ssh-app { display: flex; height: 100%; min-height: 0; background: var(--panel-solid); }
.ssh-side { width: 250px; flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--border); min-height: 0; }
.ssh-side-h { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ssh-side-f { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--border); }
.ssh-side-f .btn { flex: 1; justify-content: center; }
.ssh-list { flex: 1; overflow: auto; padding: 6px; }
.ssh-folder { margin-bottom: 4px; }
.ssh-folder-h { display: flex; align-items: center; gap: 6px; padding: 5px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.ssh-folder-h svg { width: 14px; height: 14px; } .ssh-folder-h span:first-of-type { flex: 1; } .ssh-count { background: rgba(255,255,255,.08); border-radius: 999px; padding: 0 6px; font-size: 10px; }
.ssh-folder-h .btn { opacity: 0; } .ssh-folder-h:hover .btn { opacity: .7; }
.ssh-host { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.ssh-host:hover { background: rgba(255,255,255,.05); } .ssh-host.on { background: var(--accent-dim); }
.ssh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.ssh-host-main { flex: 1; min-width: 0; } .ssh-host-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssh-host-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }
.ssh-host-edit { opacity: 0; } .ssh-host:hover .ssh-host-edit { opacity: .7; }
.ssh-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.ssh-bar { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.ssh-bar svg { width: 16px; height: 16px; } .ssh-bar > b { font-size: 13px; }
.ssh-term { flex: 1; min-height: 0; padding: 6px 8px; background: #0a0f1a; overflow: hidden; }
.ssh-welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.ssh-welcome svg { width: 38px; height: 38px; opacity: .5; }
.ssh-empty { padding: 16px 10px; color: var(--muted); font-size: 12px; text-align: center; }
.ssh-keys { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; margin-bottom: 8px; }
.ssh-key { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; }
.ssh-key svg { width: 16px; height: 16px; flex: none; } .ssh-key .mono { font-family: var(--mono); font-size: 10.5px; }
.ssh-mbody { display: block; padding: 16px 18px; overflow: auto; max-height: min(70vh, 640px); }
.ssh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.ssh-grid.hp { grid-template-columns: 1fr 120px; }
.ssh-mbody .fl-field { margin-bottom: 10px; }
.ssh-mbody .sm-sect { margin-top: 16px; }
.ssh-termwrap { display: flex; flex: 1; min-height: 0; }
.ssh-termwrap .ssh-term { flex: 1; }
.ssh-sftp { display: none; width: 340px; flex: none; border-left: 1px solid var(--border); flex-direction: column; overflow: hidden; background: var(--panel-solid); }
.ssh-termwrap.with-sftp .ssh-sftp { display: flex; }
.ssh-sftp-head { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.ssh-sftp-path { flex: 1; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssh-sftp-list { flex: 1; overflow: auto; padding: 4px; }
.ssh-sftp-row { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 6px; font-size: 12px; }
.ssh-sftp-row.dir { cursor: pointer; } .ssh-sftp-row:hover { background: rgba(255,255,255,.05); }
.ssh-sftp-row > svg { width: 15px; height: 15px; flex: none; color: var(--accent); }
.ssh-sftp-fi { width: 15px; flex: none; }
.ssh-sftp-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssh-sftp-size { font-size: 10.5px; color: var(--muted); font-family: var(--mono); flex: none; }
.ssh-sftp-row .btn { opacity: 0; } .ssh-sftp-row:hover .btn { opacity: .75; }
.ssh-sftp-load, .ssh-sftp-err { padding: 14px; text-align: center; color: var(--muted); font-size: 12px; }
.ssh-sftp-err { color: var(--bad); }
.ssh-sftp.drop { outline: 2px dashed var(--accent); outline-offset: -4px; background: var(--accent-dim); }
.ssh-snip-menu { min-width: 220px; max-width: 320px; max-height: 60vh; overflow: auto; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 12px 34px rgba(0,0,0,.5); padding: 4px; z-index: 100030; }
.ssh-snip-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 9px; border: 0; background: transparent; color: var(--text); border-radius: 7px; cursor: pointer; font-size: 13px; }
.ssh-snip-item:hover { background: rgba(255,255,255,.06); }
.ssh-snip-item svg { width: 15px; height: 15px; flex: none; }
.ssh-snip-n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssh-snip-run { font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--accent); background: var(--accent-dim); border-radius: 999px; padding: 1px 6px; flex: none; }
.ssh-snip-item.manage { border-top: 1px solid var(--border); margin-top: 4px; color: var(--muted); }
.ssh-snip-empty { padding: 10px; color: var(--muted); font-size: 12px; text-align: center; }
.ssh-snip-group, .ssh-snip-listgroup { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--faint); padding: 6px 9px 2px; }
.ssh-snip-switch { display: flex; align-items: center; gap: 8px; }
.ssh-snip-formfoot { margin-top: 12px; display: flex; }
.ssh-starters { margin-top: 4px; }
.ssh-starter-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ssh-starter-head .btn { margin-left: auto; }
.ssh-starter-list { display: flex; flex-direction: column; gap: 3px; max-height: 240px; overflow: auto; }
.ssh-starter-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }
.ssh-starter-edit { font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); flex: none; }
@media (max-width: 720px) { .ssh-side { width: 190px; } .ssh-grid { grid-template-columns: 1fr; } .ssh-sftp { width: 240px; } }

/* ---- 5.50.9 live event log (Computers > a PC > Tools > Event log) ---- */
.evl { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.evl-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.evl-lvls { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.evl-lvl { border: 1px solid var(--border-strong); background: transparent; color: var(--faint); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.evl-lvl.on { color: #fff; }
.evl-lvl.on.evl-crit { background: #9f1239; border-color: #9f1239; }
.evl-lvl.on.evl-err { background: var(--bad); border-color: var(--bad); }
.evl-lvl.on.evl-warn { background: var(--warn); border-color: var(--warn); color: #1f1300; }
.evl-lvl.on.evl-info { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.evl-lvl.on.evl-verb { background: rgba(148, 163, 184, .25); border-color: var(--border-strong); color: inherit; }
.evl-counts { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; font-size: 12px; padding: 2px 2px 0; }
.evl-count b { font-size: 15px; }
.evl-count.evl-crit b { color: #fb7185; } .evl-count.evl-err b { color: var(--bad); } .evl-count.evl-warn b { color: var(--warn); } .evl-count.evl-info b { color: var(--accent); }
.evl-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
/* details sit UNDER the list (side by side squeezed the message column to nothing in a normal-size window) */
.evl-body:has(.evl-detail:not([style*="none"])) .evl-listwrap { max-height: 40vh; }
.evl-listwrap { display: flex; flex-direction: column; min-width: 0; max-height: 62vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.evl-rows { display: flex; flex-direction: column; font-size: 12.5px; }
.evl-row { display: grid; grid-template-columns: 150px 96px minmax(90px, 180px) 56px minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 8px; border-bottom: 1px solid var(--border); cursor: pointer; }
.evl-row:hover, .evl-row:focus { background: var(--accent-dim); outline: none; }
.evl-row.sel { background: var(--accent-dim); box-shadow: inset 3px 0 0 var(--accent); }
.evl-row.evl-head { position: sticky; top: 0; z-index: 1; cursor: default; font-weight: 600; color: var(--faint); background: var(--panel, #0d1726); }
.evl-row.evl-head:hover { background: var(--panel, #0d1726); }
.evl-row.flash { animation: evlflash 2.4s ease-out; }
@keyframes evlflash { from { background: rgba(34, 211, 238, .28); } to { background: transparent; } }
.evl-time, .evl-id { font-family: var(--mono); font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.evl-prov, .evl-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evl-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; border: 1px solid var(--border-strong); white-space: nowrap; }
.evl-badge.evl-crit { background: #9f1239; border-color: #9f1239; color: #fff; }
.evl-badge.evl-err { background: rgba(248, 113, 113, .18); border-color: var(--bad); color: var(--bad); }
.evl-badge.evl-warn { background: rgba(251, 191, 36, .16); border-color: var(--warn); color: var(--warn); }
.evl-badge.evl-info { color: var(--accent); border-color: var(--accent-dim); }
.evl-detail { border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; max-height: 50vh; overflow: auto; }
.evl-dhead { display: flex; gap: 8px; align-items: center; }
.evl-dact { display: flex; flex-wrap: wrap; gap: 6px; }
.evl-dmsg, .evl-dxml { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12px; background: rgba(0, 0, 0, .22); padding: 8px; border-radius: 6px; max-height: 32vh; overflow: auto; }
.evl-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 12px; font-size: 12.5px; }
.evl-facts > span { overflow-wrap: anywhere; }
/* ---- Canaries (AD tripwires) ---- */
.cny-body { display: flex; flex-direction: column; gap: 12px; }
.cny-head { display: flex; flex-direction: column; gap: 8px; }
.cny-hero { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,.04); border-left-width: 4px; }
.cny-hero.good { border-left-color: var(--good); } .cny-hero.warn { border-left-color: var(--warn, #d19a00); } .cny-hero.bad { border-left-color: var(--bad); }
.cny-hero-ico { width: 28px; height: 28px; flex: none; color: var(--muted); }
.cny-hero.good .cny-hero-ico { color: var(--good); } .cny-hero.warn .cny-hero-ico { color: var(--warn, #d19a00); } .cny-hero.bad .cny-hero-ico { color: var(--bad); }
.cny-hero-t { flex: 1; min-width: 0; } .cny-h { font-size: 16px; font-weight: 600; }
.cny-hero-act { flex: none; }
.cny-how { font-size: 12.5px; color: var(--muted); padding: 0 6px; }
.cny-how summary { cursor: pointer; color: var(--accent); font-size: 12px; user-select: none; }
.cny-how p { margin: 6px 0 0 14px; line-height: 1.5; max-width: 72ch; }
.cny-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: rgba(255,255,255,.03); }
.cny-card-t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; margin-bottom: 8px; } .cny-card-t svg { width: 16px; height: 16px; color: var(--accent); }
.cny-add > summary { cursor: pointer; margin-bottom: 0; list-style: none; } .cny-add[open] > summary { margin-bottom: 10px; }
.cny-add > summary::-webkit-details-marker { display: none; }
.cny-tablewrap { overflow-x: auto; }
.cny-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cny-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--faint); padding: 4px 8px; border-bottom: 1px solid var(--border); font-weight: 500; }
.cny-table td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: top; }
.cny-table tr:last-child td { border-bottom: 0; }
.cny-table tr.cny-tripped td { background: rgba(224,36,94,.06); }
.cny-name { font-weight: 600; } .cny-sam, .cny-mono { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.cny-desc { color: var(--muted); max-width: 32ch; } .cny-muted { color: var(--faint); font-size: 11.5px; }
.cny-trips { font-family: var(--mono); font-weight: 700; font-size: 14px; } .cny-trips.bad { color: var(--bad); } .cny-trips.good { color: var(--good); }
.cny-actions { white-space: nowrap; text-align: right; } .cny-actions .btn { margin-left: 4px; }
.cny-danger:hover { color: var(--bad); border-color: var(--bad); }
.cny-form { display: flex; flex-direction: column; gap: 10px; }
.cny-form-row { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 10px; }
.cny-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .cny-field .nt-input { width: 100%; box-sizing: border-box; }
.cny-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cny-chip { cursor: pointer; background: transparent; text-transform: none; letter-spacing: 0; font-size: 11px; } .cny-chip:hover { border-color: var(--accent); color: var(--accent); }
.cny-form-act { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cny-events { display: flex; flex-direction: column; gap: 4px; }
.cny-ev { display: flex; gap: 12px; padding: 8px 10px; border-radius: 10px; border-left: 3px solid var(--faint); background: rgba(255,255,255,.02); }
.cny-ev.lvl-crit { border-left-color: var(--bad); } .cny-ev.lvl-warn { border-left-color: var(--warn, #d19a00); } .cny-ev.lvl-info { border-left-color: var(--accent); }
.cny-ev.acked { opacity: .45; }
.cny-ev-l { flex: none; width: 150px; display: flex; flex-direction: column; gap: 3px; }
.cny-lvl { font-family: var(--mono); font-size: 10px; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,.08); align-self: flex-start; }
.lvl-crit .cny-lvl { background: rgba(224,36,94,.2); color: var(--bad); } .lvl-warn .cny-lvl { background: rgba(209,154,0,.2); color: var(--warn, #d19a00); } .lvl-info .cny-lvl { color: var(--accent); }
.cny-ev-time { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.cny-ev-main { flex: 1; min-width: 0; } .cny-ev-t { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.cny-ev-d { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.cny-ev-meta { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.cny-dcs { max-width: 520px; }
.cny-dc { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.04); } .cny-dc:last-child { border-bottom: 0; }
.cny-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 4px; background: var(--faint); }
.cny-dot.good { background: var(--good); box-shadow: 0 0 6px var(--good); } .cny-dot.warn { background: var(--warn, #d19a00); } .cny-dot.bad { background: var(--bad); }
.cny-dc-main { min-width: 0; flex: 1; } .cny-dc-err { font-size: 11.5px; color: var(--bad); margin-top: 2px; word-break: break-word; }
.cny-note { font-size: 12px; padding: 0 4px; }
@media (max-width: 720px) {
  .cny-form-row { grid-template-columns: 1fr; }
  .cny-ev { flex-direction: column; gap: 6px; } .cny-ev-l { width: auto; flex-direction: row; align-items: center; gap: 8px; }
  .cny-hero { flex-wrap: wrap; }
}

/* Inventory (5.16): public scan page activity, reports, label maker */
.inv-row-chips { display: flex; align-items: center; gap: 5px; flex: none; }
.inv-row-chips .chip { white-space: nowrap; }
.inv-nolabel { width: 8px; height: 8px; border-radius: 50%; border: 1.5px dashed var(--warn); flex: none; }
.inv-lost { margin-left: 8px; vertical-align: middle; font-size: 11px; }
.inv-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 600; line-height: 1; }
.inv-badge[hidden] { display: none; }
.inv-count { float: right; font-family: var(--mono); font-size: 10.5px; }
.inv-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; font-size: 13px; cursor: pointer; }
.inv-check input { margin: 2px 0 0; flex: none; width: 16px; height: 16px; }
.inv-check .hint { display: block; margin-top: 2px; }
.inv-rep { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.inv-rep:last-child { border-bottom: 0; }
.inv-rep.acked { opacity: .65; }
.inv-rep-main { flex: 1; min-width: 0; }
.inv-rep-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.inv-rep-top .hint { margin-top: 0; }
.inv-rep-msg { white-space: pre-wrap; word-break: break-word; font-size: 13px; margin-top: 4px; }
.inv-rep-contact { font-size: 12px; color: var(--muted); margin-top: 3px; word-break: break-word; }
.inv-rep-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.inv-rep-acts .hint { margin-top: 0; }
.inv-rep-photo { flex: none; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: #000; display: block; }
.inv-rep-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-body.inv-dlg { display: block; padding: 16px; overflow: auto; }
.inv-dlg .dir-field .nt-input { width: 100%; }
.inv-lbl-preview { margin-top: 12px; padding: 14px; border-radius: 10px; border: 1px solid var(--border); background: repeating-conic-gradient(rgba(128,128,128,.14) 0% 25%, transparent 0% 50%) 50% / 16px 16px; overflow-x: auto; min-height: 60px; }
.inv-lbl-canvas { display: block; max-width: 100%; height: auto; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.35); }
.inv-lbl-canvas[hidden] { display: none; }
@media (max-width: 720px) { .inv-rep-photo { width: 56px; height: 56px; } .inv-row-chips { flex-direction: column; align-items: flex-end; gap: 3px; } }
/* ---- Games (5.53): the ROM library ---- */
.gm { display: flex; height: 100%; min-height: 0; }
.gm-rail { width: 210px; flex: none; overflow: auto; padding: 8px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.gm-sys { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.gm-sys:hover { background: rgba(255,255,255,.06); }
.gm-sys.active { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.gm-sys svg { width: 16px; height: 16px; flex: none; }
.gm-sys-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.gm-sys-n { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.gm-sys.gm-dl .gm-sys-t { opacity: .7; }
.gm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.gm-tools { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.gm-search { flex: 1 1 220px; max-width: 420px; }
.gm-summary { flex: 1; }
.gm-grid { flex: 1; min-height: 0; overflow: auto; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; align-content: start; }
.gm-foot { padding: 8px 12px; text-align: center; }
.gm-more[hidden] { display: none; }
.gm-card { cursor: pointer; border-radius: 10px; outline: none; }
.gm-card:focus-visible .gm-cover-wrap { box-shadow: 0 0 0 2px var(--accent); }
.gm-cover-wrap { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: #111; box-shadow: 0 6px 18px rgba(0,0,0,.35); transition: transform .15s; }
.gm-card:hover .gm-cover-wrap { transform: translateY(-3px); }
.gm-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.gm-play { position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: #04222a; display: grid; place-items: center; cursor: pointer; opacity: 0; transform: scale(.9); transition: opacity .15s, transform .15s; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.gm-play svg { width: 20px; height: 20px; }
.gm-card:hover .gm-play, .gm-card:focus-within .gm-play { opacity: 1; transform: scale(1); }
.gm-fav { position: absolute; left: 8px; top: 8px; color: #fbbf24; filter: drop-shadow(0 1px 3px rgba(0,0,0,.8)); }
.gm-fav svg { width: 18px; height: 18px; fill: #fbbf24; }
.gm-card-t { margin-top: 7px; font-size: 13px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gm-card-s { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 3px; font-size: 11px; color: var(--muted); }
.gm-chips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.gm-dlg-body { padding: 16px; }
.gm-dlg-top { display: flex; gap: 18px; align-items: flex-start; }
.gm-dlg-coverwrap { flex: none; width: 180px; }
.gm-dlg-cover { width: 180px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: #111; box-shadow: 0 8px 24px rgba(0,0,0,.4); display: block; }
.gm-dlg-info { flex: 1; min-width: 0; }
.gm-warn { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.4); color: var(--warn); font-size: 13px; }
.gm-fav-on svg { fill: #fbbf24; color: #fbbf24; }
.gm-variants { margin-top: 10px; }
.gm-variant { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.gm-variant.best .gm-variant-name { font-weight: 600; }
.gm-variant-k { flex: 1; min-width: 0; }
.gm-variant-name { font-size: 13px; overflow-wrap: anywhere; }
.gm-variant-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.gm-frame { width: 100%; height: 100%; border: 0; display: block; background: #000; }
@media (max-width: 720px) { .gm-rail { width: 150px; } .gm-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; padding: 8px; } .gm-dlg-top { flex-direction: column; } .gm-dlg-coverwrap, .gm-dlg-cover { width: 140px; } }.modal-body.gm-dlg { display: block; padding: 0; overflow: auto; }
.gm-check { font-size: 12px; white-space: nowrap; }
.gm-continue { flex: none; padding: 10px 12px 0; }
.gm-strip { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.gm-cont { flex: none; width: 200px; cursor: pointer; border-radius: 10px; outline: none; }
.gm-cont:focus-visible .gm-cont-img { box-shadow: 0 0 0 2px var(--accent); }
.gm-cont-img { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: #111; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.gm-cont-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gm-cont-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9); width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #04222a; display: grid; place-items: center; opacity: 0; transition: opacity .15s, transform .15s; }
.gm-cont-play svg { width: 22px; height: 22px; }
.gm-cont:hover .gm-cont-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.gm-cont-t { margin-top: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-cont-s { font-size: 11px; color: var(--muted); }.gm-sel { max-width: 170px; }
.gm-info { margin-top: 12px; }
.gm-facts { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.gm-summary { margin: 6px 0 8px; font-size: 13px; line-height: 1.5; color: var(--text); white-space: pre-wrap; }
.gm-shots { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.gm-shots img { height: 110px; border-radius: 8px; cursor: zoom-in; flex: none; background: #111; }.gm-night { flex: 1; min-height: 0; overflow: auto; padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.gm-night[hidden], .gm-tools[hidden], .gm-grid[hidden], .gm-continue[hidden], .gm-more[hidden] { display: none; }
.gm-night-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: rgba(255,255,255,.02); }
.gm-ch { display: flex; gap: 16px; align-items: flex-start; margin-top: 8px; }
.gm-ch-cover { width: 120px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: #111; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.4); flex: none; }
.gm-ch-body { flex: 1; min-width: 0; }
.gm-ch-title { font-size: 18px; font-weight: 700; }
.gm-ch-goal { margin-top: 6px; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 4px; }
.gm-ch-goal svg { width: 16px; height: 16px; }
.gm-board { margin-top: 10px; }
.gm-board-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.gm-board-row.me { color: var(--accent); }
.gm-board-pos { width: 28px; font-family: var(--mono); color: var(--muted); }
.gm-board-name { flex: 0 0 160px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-board-val { font-family: var(--mono); font-weight: 700; min-width: 70px; }
.gm-board-shot { height: 36px; border-radius: 6px; cursor: zoom-in; }
.gm-roulette-res { margin-top: 10px; min-height: 40px; }
.gm-wheel { width: 120px; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: #111; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.gm-wheel img { width: 100%; height: 100%; object-fit: cover; }
.gm-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.gm-stat-n { font-size: 22px; font-weight: 700; }
.gm-stat-l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.gm-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gm-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; color: var(--muted); opacity: .55; }
.gm-badge svg { width: 14px; height: 14px; }
.gm-badge.on { opacity: 1; color: #fbbf24; border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.08); }
@media (max-width: 720px) { .gm-ch { flex-direction: column; } .gm-board-name { flex-basis: 100px; } }.gm-shelves { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 10px; }
.gm-shelf { cursor: pointer; border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: rgba(255,255,255,.02); outline: none; }
.gm-shelf:hover, .gm-shelf:focus-visible { border-color: var(--accent); }
.gm-shelf-cover { height: 110px; border-radius: 8px; overflow: hidden; background: #111; display: grid; place-items: center; color: var(--muted); }
.gm-shelf-cover img { width: 100%; height: 100%; object-fit: cover; }
.gm-shelf-cover svg { width: 36px; height: 36px; }
.gm-shelf-t { margin-top: 8px; font-weight: 600; font-size: 13px; display: flex; align-items: center; }
.gm-shelf-s { font-size: 11px; color: var(--muted); margin-top: 2px; }
.gm-sys.gm-kid .gm-sys-t::after { content: ' · kids'; color: var(--good); font-size: 10px; }
.gm-chipbtn { cursor: pointer; background: transparent; }
.gm-cont-cover { aspect-ratio: 3 / 4; }.gm-live { position: absolute; left: 8px; top: 8px; background: #dc2626; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 1px; padding: 2px 6px; border-radius: 6px; }
/* 5.59.1: [hidden] must win over the display rules of these controls (the empty 2+ players filter) */
.gm-tools [hidden], .gm [hidden] { display: none !important; }
.gm-infonote { flex-basis: 100%; color: var(--warn); }

/* 5.60 Games: missing games report */
.gm-miss { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 14px; margin-top: 8px; }
.gm-miss-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; background: var(--surface-2, rgba(127,127,127,.06)); min-width: 0; }
.gm-miss-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-miss-row .chip { flex: none; font-size: 11px; }
/* 5.60 Games on a phone: the systems rail becomes a swipeable strip above the covers */
@media (max-width: 560px) {
  .gm { flex-direction: column; }
  .gm-rail { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--border); padding: 6px 8px; gap: 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .gm-rail::-webkit-scrollbar { display: none; }
  .gm-rail .sm-sect, .gm-rail .hint { display: none; }
  .gm-rail .gm-sys { flex: none; white-space: nowrap; width: auto; border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px; }
  .gm-rail .gm-sys-n { margin-left: 6px; }
  .gm-tools .gm-search { flex: 1 1 100%; }
  .gm-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .gm-miss { grid-template-columns: 1fr; }
}

/* 5.64 Computers: looking ahead / why is it slow */
.f64-ok { opacity: .8; }
.f64-find { border-left: 3px solid var(--border); padding: 6px 10px; margin: 6px 0; border-radius: 0 8px 8px 0; background: var(--surface-2, rgba(127,127,127,.05)); }
.f64-find.sev-high { border-left-color: #f87171; } .f64-find.sev-med { border-left-color: #fbbf24; } .f64-find.sev-low { border-left-color: #60a5fa; }
.f64-fix { font-size: 12px; margin-top: 3px; color: var(--good, #34d399); }

/* 5.65 Computers > Protection */
.btn.danger { background: #dc2626; color: #fff; border-color: #dc2626; font-weight: 600; }
.btn.danger:hover { background: #b91c1c; }
summary.f64-vuln { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 0; cursor: pointer; border-top: 1px solid var(--border); }
summary.f64-vuln .chip { flex: none; }
.unifi-card .nt-input, .unifi-card .btn { margin-top: 6px; max-width: 100%; }

/* ---- 5.73 Android / Roku devices: phones, tablets, watches and TVs in Computers (fleetandroid.js) ---- */
/* the kind icon on every row and in the detail header */
.fl-kind { display: inline-flex; align-items: center; flex: none; color: var(--muted); }
.fl-kind svg { width: 15px; height: 15px; }
.fl-kind.big { color: var(--text); opacity: .85; }
.fl-kind.big svg { width: 20px; height: 20px; }
/* a phone / TV row has no bulk checkbox (bulk actions are for PCs) - this keeps the rows lined up */
.fleet-cb-sp { width: 15px; height: 15px; margin: 0 2px 0 0; flex: none; }   /* (5.73 the size xp.css gives .fleet-cb in every theme) */
/* a phone not seen recently: a grey "last seen" */
.fleet-item .dir-sub .fl-subtxt.away { color: var(--faint); }
/* Setup > Add Android device: QR + typed code + countdown, install steps, managed mode */
.and-qrs { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; margin: 10px 0; }
.and-qrcol { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.and-qr { width: 200px; height: 200px; image-rendering: pixelated; background: #fff; border-radius: 10px; padding: 6px; box-sizing: border-box; display: block; }
.and-qr.small { width: 120px; height: 120px; padding: 4px; }
.and-codecol { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.and-code { font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: 3px; line-height: 1.2; user-select: all; }
.and-count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; } .and-count.bad { color: var(--bad); }
.and-codebox.expired .and-qr, .and-codebox.expired .and-code { opacity: .3; filter: grayscale(1); }
.and-steps { flex: 1; min-width: 240px; margin: 6px 0 4px; padding-left: 20px; } .and-steps li { margin: 5px 0; font-size: 13px; line-height: 1.45; }
.and-steps code { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.and-cmdrow { display: flex; align-items: center; gap: 6px; margin: 4px 0; min-width: 0; }
.and-cmd { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; background: rgba(0,0,0,.25); padding: 6px 8px; border-radius: 6px; user-select: all; overflow-wrap: anywhere; }
.and-managed { margin-top: 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; }
.and-managed summary { cursor: pointer; font-size: 13px; font-weight: 600; } .and-managed[open] summary { margin-bottom: 8px; }
.and-warn { margin-top: 8px; padding: 8px 10px; border-radius: 8px; border-left: 3px solid var(--warn, #fbbf24); background: color-mix(in srgb, var(--warn, #fbbf24) 9%, transparent); font-size: 12.5px; line-height: 1.45; }
/* Network > Where it is */
.and-map { height: 260px; margin-top: 8px; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; background: #04101c; }
/* Roku: Apps (launch a channel) and the Remote */
.rk-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.rk-app { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; padding: 10px 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: inherit; font: inherit; font-size: 12px; text-align: center; cursor: pointer; }
.rk-app:hover:not([disabled]) { border-color: var(--accent); }
.rk-app[disabled] { cursor: default; opacity: .7; }
.rk-app.active { box-shadow: inset 0 0 0 2px var(--accent); }
.rk-app b { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.rk-app span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-remote { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 340px; margin: 4px auto 0; padding: 14px 12px; border: 1px solid var(--border); border-radius: 18px; background: var(--panel); outline: none; }
.rk-remote:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.rk-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rk-key { min-width: 54px; height: 40px; justify-content: center; font-weight: 600; }
.rk-pad { display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(3, 58px); gap: 6px; }
.rk-pad .rk-key { width: 58px; height: 58px; min-width: 0; padding: 0; border-radius: 16px; font-size: 18px; }
.rk-pad .rk-ok { border-radius: 50%; background: var(--accent-dim, color-mix(in srgb, var(--accent) 16%, transparent)); color: var(--accent); }
.rk-status { min-height: 18px; text-align: center; }
/* 5.79 a TV's remote and live screen (Devices -> Remote) */
.ar-wrap { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.ar-view { flex: 1 1 420px; min-width: 0; }
.ar-frame { width: 100%; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; background: #000; border-radius: 10px; overflow: hidden; color: #bbb; font-size: 13px; text-align: center; padding: 0; }
.ar-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ar-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.ar-type { display: flex; gap: 6px; margin-top: 8px; }
.ar-type input { flex: 1; min-width: 0; }
.ar-pad { flex: 0 1 340px; min-width: 260px; margin: 0 auto; }
.ar-steps { margin: 6px 0 10px 20px; padding: 0; }
.ar-steps li { margin: 4px 0; }
.ar-appbtns { display: inline-flex; gap: 4px; margin-left: 8px; flex-shrink: 0; }
/* 5.73 round 2: the enroll link under the QR, the Live tab, Approve a device (pairing code), Belongs with */
.and-link { margin: 2px 0 8px; max-width: 560px; }
.and-livebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; } .and-livebar .hint { flex: 1; min-width: 200px; }
.and-live { min-height: 120px; }
.and-pairin { width: 170px; max-width: 100%; font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; text-align: center; }
.and-pend { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); min-width: 0; }
.and-pend b { display: block; overflow-wrap: anywhere; }
.and-pairbox { margin-top: 4px; }
.and-pairs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0; }
.and-pair { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; min-width: 0; }
.and-pair small { font-size: 11.5px; }
/* 5.74 Public IP of a device on the home Wi-Fi ("—" + why), the watch's "Installed from" line, the watch steps' two ways */
.and-ipval { font-weight: inherit; }
.and-ipnote { display: block; font-family: var(--sans); font-size: 11.5px; font-weight: 400; color: var(--faint); margin-top: 1px; }
.and-from { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.and-from b { color: var(--text); font-weight: 600; }
.and-way { margin-top: 10px; font-size: 13px; font-weight: 650; }
.and-way .chip { margin-left: 6px; vertical-align: 1px; }
@media (max-width: 560px) {
  .and-qr { width: 170px; height: 170px; } .and-code { font-size: 22px; letter-spacing: 2px; }
  .rk-pad { grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 52px); } .rk-pad .rk-key { width: 52px; height: 52px; }
}
/* 5.75 the Overview's Updates line (state, why, what to do) and Setup → Automatic updates (fleetupdates.js) */
.fl-upd { display: block; line-height: 1.45; }
.fl-upd-st { font-style: normal; display: inline-block; white-space: nowrap; margin-right: 6px; vertical-align: 1px; line-height: 1.3; }
.fl-pill.accent { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.fl-upd-fix { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 400; color: var(--faint); line-height: 1.4; }
.upd-std { font-size: 13px; line-height: 1.45; margin: 2px 0 8px; }
.upd-ways { display: grid; gap: 7px; margin: 4px 0 10px; }
.upd-way { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 12.5px; line-height: 1.4; }
.upd-way > svg { width: 16px; height: 16px; margin-top: 1px; color: var(--muted); }
.upd-way b { font-weight: 600; }
.upd-how { color: var(--muted); overflow-wrap: anywhere; }
.upd-sw { margin: 8px 0 2px; } .upd-sw .hint { margin: 2px 0 0 2px; }
.upd-devnote { margin: 4px 0 0 2px; color: var(--warn, #fbbf24); }
.upd-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.upd-needh { font-size: 12px; font-weight: 600; color: var(--muted); margin: 8px 0 2px; }
.upd-need { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--border); cursor: pointer; min-width: 0; border-radius: 6px; }
.upd-need:hover, .upd-need:focus-visible { background: color-mix(in srgb, var(--accent) 8%, transparent); outline: none; }
.upd-host { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upd-fixrow { grid-column: 2 / -1; font-size: 12px; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }

/* 5.81 Devices: quick select, group results, schedules, favorites, the battery and Wi-Fi charts (fleetgroups.js, fleetandroid.js) */
.fg-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.fg-chips-l { font-size: 11.5px; color: var(--muted); margin-right: 2px; }
.fg-chip { border: 1px solid var(--border); border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 12px; padding: 3px 10px; cursor: pointer; }
.fg-chip:hover { border-color: var(--accent); }
.fg-chip.active { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); color: var(--accent); }
.modal.fg-dlg { max-height: 90vh; display: flex; flex-direction: column; }
.fg-dlg-body { display: block !important; padding: 14px 16px; overflow-y: auto; min-width: 0; }
.fg-who { margin-top: 10px; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.fg-results { display: grid; gap: 2px; margin-top: 6px; }
.fg-res { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 1px 6px; padding: 5px 2px; border-bottom: 1px solid var(--border); font-size: 13px; min-width: 0; }
.fg-res b { font-weight: 600; overflow-wrap: anywhere; }
.fg-res-mark { font-size: 11px; font-weight: 700; line-height: 1.6; color: var(--good, #34d399); }
.fg-res.bad .fg-res-mark { color: var(--bad, #f87171); }
.fg-res.wait .fg-res-mark { color: var(--warn, #fbbf24); }
.fg-res-why { grid-column: 2; font-size: 12px; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }
.fg-res-sum { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.fg-preview { margin-top: 10px; }
.fg-pick { max-height: 180px; overflow-y: auto; }
.fg-when { max-width: 160px; margin-top: 8px; }
.fg-schs { display: grid; gap: 8px; }
.fg-sch { padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.fg-sch.off .fg-sch-what { opacity: .6; }
.fg-sch-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fg-sch-name { font-size: 13.5px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.fg-sch-what { margin-top: 4px; font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.fg-last { margin-top: 4px; font-size: 12px; color: var(--muted); }
.fg-last summary { cursor: pointer; }
.fg-sch-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.fg-answer { margin-top: 10px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.fg-said { padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 9%, transparent); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.fg-star { flex: none; width: 24px; height: 24px; padding: 3px; border: 0; border-radius: 6px; background: transparent; color: var(--faint); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.fg-star svg { width: 16px; height: 16px; }
.fg-star:hover { color: var(--accent); }
.fg-star.on { color: var(--warn, #fbbf24); }
.fg-star.on svg { fill: currentColor; }
.fg-rkwrap { position: relative; min-width: 0; display: grid; }
.fg-rkwrap .fg-star { position: absolute; top: 3px; right: 3px; }
.fg-favbox { width: 100%; max-width: 340px; margin: 0 auto; }
.fg-favs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 8px; }
.fg-fav { max-width: 100%; min-width: 0; font-size: 12.5px; }
.fg-fav-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-fav.gone { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 9px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); }
.fg-hist { margin-bottom: 10px; }
.fg-hist-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fg-segs { display: inline-flex; gap: 4px; }
.fg-seg.active { color: var(--accent); border-color: var(--accent); }
.fg-chart { margin-top: 8px; min-width: 0; }
.fg-chart-t { font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.fg-chart-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; margin-top: 2px; font-size: 11px; color: var(--muted); }
.fg-ha { margin-top: 6px; }
.fg-ha .hint { max-width: 100%; }
@media (max-width: 560px) {
  .fg-sch-btns .btn { flex: 1 1 auto; justify-content: center; }
  .dir-kv .fg-star { align-self: flex-start; }
}