/* Pulse Connect: the Pulse design system (E:\Workspace\Pulse\DESIGN.md) applied to a home-network console.
   Monochrome, lit-or-not state, square cells for data, Schibsted Grotesk for real text.
   The one hue (--alert) is reserved for unhealthy state: offline, blocked, over limit. */

@font-face { font-family: "Schibsted Grotesk"; src: url("../fonts/SchibstedGrotesk-Variable.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }

:root {
  --good: #5fdc8c; --good-soft: rgba(95, 220, 140, 0.12); --good-line: rgba(95, 220, 140, 0.42);
  --warn: #ffb04a; --warn-soft: rgba(255, 176, 74, 0.12); --warn-line: rgba(255, 176, 74, 0.45);
  --bg: #090909; --bg-2: #0e0e0e; --well: #0f0f0e; --raise: #141413;
  --on: #f2f2ed; --mid: #b3b3ad; --text-dim: #8c8c88; --ink-dim: #757573;
  --edge-strong: #4a4a47; --rule-dotted: #3a3a37; --line: #303030; --edge: #2a2a28; --off: #262626; --on-hover: #fff;
  --alert: #ff6b63; --alert-soft: rgba(255, 107, 99, 0.12); --alert-line: rgba(255, 107, 99, 0.45);
  --body: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --wrap: 1240px; --gutter: clamp(16px, 4vw, 40px); --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --tabbar: 64px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scrollbar-color: #3a3a38 var(--bg); scrollbar-width: thin; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--mid); font: 400 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
::selection { background: var(--on); color: var(--bg); }
:focus-visible { outline: 2px solid var(--on); outline-offset: 3px; border-radius: 2px; }
img, svg, canvas { display: block; }
a { color: var(--on); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(242, 242, 237, 0.4); }
b, strong { color: var(--on); font-weight: 600; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
p { margin: 0; } h1, h2, h3 { margin: 0; color: var(--on); font-weight: 600; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.num { font-variant-numeric: tabular-nums; } .dim { color: var(--text-dim); } .on { color: var(--on); } .alert { color: var(--alert); }
.skip { position: fixed; left: 12px; top: -60px; z-index: 200; padding: 10px 14px; background: var(--on); color: var(--bg); font-weight: 600; }
.skip:focus { top: 12px; }

/* pixel type */
.px { display: block; color: var(--on); line-height: 0; }
.px .px-line { display: block; } .px .px-line + .px-line { margin-top: calc(var(--dot) * 3); }
.px-brand { --dot: 2.5px; } .px-h1 { --dot: 5px; } .px-h2 { --dot: 3px; } .px-stat { --dot: 4px; } .px-key { --dot: 2px; } .px-mid { color: var(--mid); } .px-dim { color: var(--ink-dim); }

/* ------------------------------------------------------------- shell: sidebar on desktop, top bar + tab bar on phones */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 26px; padding: 22px 14px 16px; background: var(--bg); border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; padding: 2px 10px; }
.brand-logo { width: 44px; height: 26px; color: var(--on); }
.brand-logo rect { fill: currentColor; }
.side nav { display: grid; gap: 22px; }
.side-group { display: grid; gap: 2px; }
.side-label { padding: 0 12px 8px; font: 600 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.side a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 6px; color: var(--mid); font-weight: 500; font-size: 15px; text-decoration: none; transition: color 160ms var(--ease), background 160ms var(--ease); }
.side a:hover { color: var(--on); background: rgba(242, 242, 237, 0.05); }
.side a[aria-current="page"] { color: var(--on); background: rgba(242, 242, 237, 0.09); }
.side a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; background: var(--on); }
.side a .nav-count { margin-left: auto; }
.nav-count { font: 600 11px/1 var(--mono); padding: 3px 6px; border-radius: 2px; background: var(--alert); color: #1a0907; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
.side-foot { margin-top: auto; display: grid; gap: 12px; }
.status-card { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--text-dim); }
.status-card b { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 4px 4px 0; min-width: 0; }
.user-row .who-me { flex: 1; min-width: 0; font-size: 13px; color: var(--mid); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .who-me b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; background: none; border: 1px solid transparent; border-radius: 6px; color: var(--text-dim); cursor: pointer; }
.icon-btn:hover { color: var(--on); border-color: var(--edge-strong); }
.live { display: inline-flex; align-items: center; gap: 8px; }
.pip { width: 6px; height: 6px; background: var(--on); animation: breathe 1.3s ease-in-out infinite; flex: none; }
.pip.is-off { background: var(--alert); animation: none; }
@keyframes breathe { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

.content { min-width: 0; }
.topbar { display: none; }
.tabbar { display: none; }
@media (max-width: 900px) {
  .app { display: block; }
  .side { display: none; }
  .topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 var(--gutter); background: rgba(9, 9, 9, 0.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .topbar .brand { padding: 0; } .topbar .brand .px { display: none; }
  .topbar .live { font-size: 13px; color: var(--text-dim); background: none; border: 0; cursor: pointer; padding: 8px 0; }
  .tabbar { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; height: var(--tabbar); display: grid; grid-template-columns: repeat(5, 1fr); background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: none; border: 0; color: var(--text-dim); font: 500 12px var(--body); text-decoration: none; cursor: pointer; min-height: 44px; position: relative; }
  .tabbar [aria-current="page"] { color: var(--on); }
  .tabbar [aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 22px; height: 2px; background: var(--on); }
  .tabbar .ico { width: 20px; height: 20px; }
  main { padding-bottom: calc(var(--tabbar) + 24px) !important; }
}

main { padding-block: 34px 96px; outline: none; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 32px; margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px dotted var(--rule-dotted); }
.page-head > div:first-child { flex: 1 1 340px; min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 13px; color: var(--text-dim); letter-spacing: 0.02em; }
.eyebrow .ico { width: 15px; height: 15px; }
.scanner { display: inline-flex; gap: 2px; } .scanner i { width: 3px; height: 3px; background: var(--off); animation: scan 1.28s steps(1) infinite; }
.scanner i:nth-child(2) { animation-delay: 0.16s; } .scanner i:nth-child(3) { animation-delay: 0.32s; } .scanner i:nth-child(4) { animation-delay: 0.48s; }
@keyframes scan { 0% { background: var(--on); } 25% { background: var(--mid); } 50% { background: var(--ink-dim); } 75%, 100% { background: var(--off); } }
.lede { margin-top: 12px; max-width: 64ch; color: var(--text-dim); font-size: 15px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
@media (max-width: 700px) { .head-actions { justify-content: flex-start; } }

/* ------------------------------------------------------------- controls */
.btn { --h: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 18px; font: 600 14px/1 var(--body); color: var(--bg); background: var(--on); border: 1px solid var(--on); border-radius: 4px; cursor: pointer; text-decoration: none; transition: background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease); white-space: nowrap; }
.btn:hover { background: var(--on-hover); } .btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--on); border-color: var(--edge-strong); }
.btn-ghost:hover { border-color: var(--on); background: rgba(242, 242, 237, 0.06); }
.btn-small { --h: 36px; padding: 0 12px; font-size: 13px; }
.btn-danger { background: transparent; color: var(--alert); border-color: var(--alert-line); }
.btn-danger:hover { background: var(--alert-soft); border-color: var(--alert); }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--text-dim); }
.field input, .field select, .search { height: 44px; padding: 0 12px; background: var(--well); color: var(--on); border: 1px solid var(--edge); border-radius: 6px; font: 400 15px var(--body); width: 100%; }
.field input:focus, .field select:focus, .search:focus { outline: 2px solid var(--on); outline-offset: 2px; border-color: var(--on); }
.field .hint { font-size: 12.5px; color: var(--text-dim); }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; color: var(--mid); font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--on); }
.switch { position: relative; width: 44px; height: 24px; flex: none; background: var(--off); border: 1px solid var(--edge-strong); border-radius: 3px; cursor: pointer; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: var(--ink-dim); transition: transform 180ms var(--ease), background 180ms; }
.switch[aria-checked="true"] { background: rgba(242, 242, 237, 0.12); border-color: var(--on); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--on); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 2px; font: 600 11px/1.2 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--mid); box-shadow: inset 0 0 0 1px var(--edge-strong); white-space: nowrap; }
.chip-on { color: var(--bg); background: var(--on); box-shadow: none; }
.chip-dim { color: var(--text-dim); box-shadow: inset 0 0 0 1px var(--edge); }
.chip-hot { background: var(--alert-soft); color: var(--alert); box-shadow: inset 0 0 0 1px var(--alert-line); }

/* ------------------------------------------------------------- data marks */
.bar { display: flex; gap: 2px; height: 8px; } .bar.bar-thin { height: 4px; }
.bar i { flex: 1; background: var(--off); } .bar i.is-on { background: var(--on); } .bar i.is-part { background: var(--ink-dim); }
.bar.is-hot i.is-blink { animation: blink 1s steps(1) infinite; } @keyframes blink { 50% { background: var(--off); } }
.spark { width: 54px; height: 18px; } .chart { width: 100%; height: 120px; }
.strip { display: flex; gap: 1px; height: 14px; } .strip i { width: 4px; background: var(--off); } .strip i.up { background: var(--on); } .strip i.down { background: var(--alert); } .strip i.slow { background: var(--ink-dim); }
.signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.signal i { width: 3px; background: var(--off); } .signal i:nth-child(1) { height: 4px; } .signal i:nth-child(2) { height: 6px; } .signal i:nth-child(3) { height: 8px; } .signal i:nth-child(4) { height: 11px; } .signal i:nth-child(5) { height: 14px; }
.signal i.is-on { background: var(--on); }

/* ------------------------------------------------------------- layout blocks */
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); } .cols-3 { grid-template-columns: repeat(3, 1fr); } .cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1000px) { .cols-4 { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; } .cols-4.keep2 { grid-template-columns: 1fr 1fr; } }
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 18px; min-width: 0; }
.panel-raised { background: var(--bg-2); border-radius: 14px; padding: clamp(18px, 3vw, 28px); }
.panel h2 { font-size: 15px; margin-bottom: 14px; color: var(--on); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile { border: 1px solid var(--line); padding: 14px; display: grid; gap: 10px; background: var(--bg); }
.tile .sub { font-size: 13px; color: var(--mid); }
.section { margin-top: 28px; }
.rule { border: 0; border-top: 1px dotted var(--rule-dotted); margin: 18px 0; }

.rows { display: grid; }
.row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1.2fr) auto; gap: 14px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--line); cursor: pointer; transition: background 160ms var(--ease); }
.row:first-child { border-top: 0; } .row:hover { background: linear-gradient(90deg, rgba(242, 242, 237, 0.05), transparent); }
.row .name { color: var(--on); font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row .sub { font-size: 13px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub.wrap { white-space: normal; overflow: visible; text-overflow: clip; max-width: 72ch; }
.row .rate { font-size: 13px; text-align: right; } .row .chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row.is-off .name { color: var(--text-dim); }
.dot { width: 6px; height: 6px; background: var(--on); flex: none; } .dot.off { background: var(--off); outline: 1px solid var(--edge-strong); outline-offset: -1px; } .dot.bad { background: var(--alert); }
@media (max-width: 760px) { .row { grid-template-columns: 1fr auto; row-gap: 6px; } .row > :nth-child(2), .row > :nth-child(3) { grid-column: 1; } .row .chips { grid-column: 2; grid-row: 1 / span 2; align-self: start; } .row .rate { text-align: left; } }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 220px; max-width: 360px; }
.empty { padding: 28px 8px; color: var(--text-dim); text-align: center; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 14px; } .kv dt { color: var(--text-dim); } .kv dd { margin: 0; color: var(--on); overflow-wrap: anywhere; }

/* rank bars */
.rank { display: grid; gap: 12px; } .rank-row { display: grid; grid-template-columns: minmax(90px, 1.2fr) 3fr auto; gap: 12px; align-items: center; font-size: 14px; }
.rank-row .label { color: var(--on); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rank-row .val { color: var(--mid); font-variant-numeric: tabular-nums; text-align: right; min-width: 72px; }

/* wifi cards */
.net { display: grid; gap: 14px; }
.net-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.net .ssid { color: var(--on); font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.net-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.net.is-off .ssid { color: var(--text-dim); }

/* map */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 12px; padding-left: 18px; border-left: 1px dotted var(--rule-dotted); }
.tree li { position: relative; padding-top: 12px; min-width: 0; }
.tree ul > li::before { content: ""; position: absolute; left: -18px; top: 38px; width: 18px; border-top: 1px dotted var(--rule-dotted); }
.node { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); width: 100%; max-width: 560px; cursor: pointer; transition: border-color 160ms var(--ease); }
.node:hover { border-color: var(--edge-strong); }
.node.is-down { border-color: var(--alert-line); background: var(--alert-soft); }
.node-main { flex: 1; min-width: 0; } .node-main .t { color: var(--on); font-weight: 600; } .node-main .s { font-size: 13px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* modal + toast */
.scrim { position: fixed; inset: 0; z-index: 150; background: rgba(0, 0, 0, 0.72); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { width: min(560px, 100%); background: var(--bg-2); border: 1px solid var(--edge-strong); border-radius: 14px; padding: 22px; box-shadow: 0 24px 40px -18px rgba(0, 0, 0, 0.85); display: grid; gap: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-wide { width: min(760px, 100%); }
.modal h2 { font-size: 20px; } .modal .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.form { display: grid; gap: 14px; } .form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } @media (max-width: 520px) { .form-2 { grid-template-columns: 1fr; } }
.toasts { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
@media (max-width: 900px) { .toasts { bottom: calc(var(--tabbar) + 12px); } }
.toast { background: var(--on); color: var(--bg); padding: 12px 14px; border-radius: 6px; font-weight: 500; font-size: 14px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.9); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.toast.is-err { background: #2a1210; color: var(--alert); box-shadow: inset 0 0 0 1px var(--alert-line), 0 18px 40px -12px rgba(0, 0, 0, 0.9); }
.toast button { background: none; border: 0; color: inherit; font: 700 13px var(--body); text-decoration: underline; cursor: pointer; }

/* sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 22px; }
.auth-card .brand-logo { width: 66px; height: 39px; }

.activity-item { display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; padding: 12px 4px; border-top: 1px solid var(--line); align-items: center; font-size: 14px; }
.activity-item:first-child { border-top: 0; } .activity-item .when { color: var(--text-dim); font-size: 13px; } .activity-item .what { color: var(--mid); } .activity-item .what b { color: var(--on); }
@media (max-width: 640px) { .activity-item { grid-template-columns: 1fr auto; } .activity-item .when { grid-column: 1 / -1; } }

@media print { .nav, .tabbar, .toasts { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .pip { opacity: 0.85; } }

/* utilities used by generated markup (the CSP forbids inline style attributes) */
.head-actions.start { justify-content: flex-start; }
.search.w180 { flex: 0 1 180px; }
.h2row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
fieldset.days { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.days .seg { flex-wrap: wrap; }
.panel h2 a { font: 500 13px var(--body); }


/* ------------------------------------------------------------- overhaul: layout, cards, tables */
:root { --wrap: 1180px; }
.px-h1 { --dot: 3.5px; }
.grid.g12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; } .s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: 1 / -1; }
@media (max-width: 1000px) { .s4, .s5, .s6, .s7, .s8 { grid-column: 1 / -1; } }
.stack { display: grid; gap: 16px; align-content: start; }
.section { margin-top: 16px; }
.panel { border-radius: 10px; padding: 20px; }
.panel > h2, .panel-raised > h2 { font-size: 15px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel > h2 .dim, .panel-raised > h2 .dim { font-weight: 400; font-size: 13px; }
.panel-raised { border: 1px solid var(--line); background: var(--bg-2); border-radius: 12px; padding: clamp(18px, 2.4vw, 24px); }
.panel.flush { padding: 0; overflow: hidden; } .panel.flush > h2 { margin: 0; padding: 16px 20px; }
.sec-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 28px 0 12px; font-size: 16px; }
.sec-title:first-child { margin-top: 0; }

/* status banner */
.banner { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); margin-bottom: 16px; }
.banner .b-dot { width: 10px; height: 10px; background: var(--on); flex: none; animation: breathe 1.6s ease-in-out infinite; }
.banner.is-bad { border-color: var(--alert-line); background: var(--alert-soft); } .banner.is-bad .b-dot { background: var(--alert); animation: none; }
.banner.is-warn .b-dot { background: var(--mid); }
.banner .b-text { flex: 1; min-width: 0; } .banner .b-text b { display: block; font-size: 17px; } .banner .b-text span { font-size: 14px; color: var(--text-dim); }

/* stat tiles */
.tile { border-radius: 10px; padding: 16px; gap: 12px; align-content: start; }
.tile-top { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 13px; }
.tile-top .ico { width: 16px; height: 16px; }
.tile .sub { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
a.tile { text-decoration: none; color: inherit; cursor: pointer; transition: border-color 160ms var(--ease); } a.tile:hover { border-color: var(--edge-strong); }
.tile.is-hot { border-color: var(--alert-line); }

/* tables built from .row */
.thead { cursor: default; padding-block: 10px; font: 600 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); border-top: 0 !important; border-bottom: 1px solid var(--line); }
.thead:hover { background: none !important; } .thead > :nth-child(3) { text-align: right; }
.panel.flush .row { padding-inline: 20px; } .panel.flush .thead { padding-inline: 20px; }
.row { border-radius: 0; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who > div { min-width: 0; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border: 1px solid var(--edge-strong); border-radius: 8px; color: var(--mid); background: var(--bg-2); }
.avatar .ico { width: 19px; height: 19px; }
.is-off .avatar { color: var(--ink-dim); border-color: var(--edge); }
.avatar.is-bad { color: var(--alert); border-color: var(--alert-line); background: var(--alert-soft); }
@media (max-width: 760px) { .thead { display: none; } .panel.flush .row { padding-inline: 16px; } }

/* filters with counts */
.toolbar { position: relative; }
.search-wrap { position: relative; flex: 1 1 240px; max-width: 380px; }
.search-wrap .ico { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--ink-dim); pointer-events: none; }
.search-wrap .search { padding-left: 38px; max-width: none; }

/* wi-fi cards */
.net { padding: 20px; gap: 16px; }
.net .ssid { font-size: 19px; line-height: 1.2; }
.net-top .wifi-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--edge-strong); color: var(--on); flex: none; }
.net-head { display: flex; gap: 12px; min-width: 0; align-items: center; }
.cap { display: grid; gap: 8px; } .cap-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); }
.net-actions .btn { flex: 1 1 auto; }
.net-actions { padding-top: 14px; border-top: 1px solid var(--line); }
.router-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 30px 0 14px; font-size: 17px; }
.router-title:first-child { margin-top: 0; } .router-title .btn { margin-left: auto; }

/* internet + traffic */
.line-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.line-split > .net { padding: 4px 24px; border-left: 1px solid var(--line); } .line-split > .net:first-child { padding-left: 0; border-left: 0; }
.line-split .net .lbl { display: flex; align-items: center; gap: 8px; color: var(--mid); font-size: 14px; font-weight: 500; }
@media (max-width: 760px) { .line-split { grid-template-columns: 1fr; gap: 24px; } .line-split > .net { padding: 0; border-left: 0; } .line-split > .net + .net { border-top: 1px solid var(--line); padding-top: 24px; } }
.port-count { font-weight: 400; }

/* map */
.node { padding: 14px 16px; gap: 14px; border-radius: 10px; }
.node-ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 1px solid var(--edge-strong); border-radius: 8px; color: var(--on); }
.node.is-down .node-ico { color: var(--alert); border-color: var(--alert-line); }
.tree ul > li::before { top: 40px; }

/* settings layout */
.setting { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 2fr); gap: 20px 40px; padding: 24px 0; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; padding-top: 6px; }
.setting h3 { font-size: 15px; margin-bottom: 6px; } .setting .why { font-size: 13.5px; color: var(--text-dim); max-width: 36ch; }
.setting .form { align-content: start; }
@media (max-width: 800px) { .setting { grid-template-columns: 1fr; gap: 14px; } }
.save-bar { display: flex; justify-content: flex-end; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); }

/* scenes + schedules */
.scene-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.scene-lines li { display: flex; gap: 10px; align-items: baseline; color: var(--mid); font-size: 14px; } .scene-lines li::before { content: ""; width: 5px; height: 5px; background: var(--ink-dim); flex: none; translate: 0 -2px; }
.hint-line { margin-top: 20px; padding: 14px 16px; border: 1px dotted var(--rule-dotted); border-radius: 8px; font-size: 14px; color: var(--text-dim); }

/* modal polish */
.modal { border-radius: 14px; } .modal h2 { font-size: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.modal .actions { padding-top: 6px; }

/* ------------------------------------------------------------- sign-in: pixel theme, no glow. Square grid, lit cells, solid card. */
.px-hero { --dot: 5px; }
.px.assembling rect { animation: dot-in 420ms steps(1) both; }
@keyframes dot-in { from { opacity: 0; } }

.login { position: relative; isolation: isolate; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 5vw, 88px); padding: clamp(20px, 5vw, 72px); overflow: hidden; background: var(--bg); }

.login-hero { display: grid; gap: 30px; align-content: center; max-width: 600px; justify-self: end; animation: rise 600ms var(--ease) both; }
.hero-brand { display: flex; align-items: center; gap: 14px; }
.hero-brand .brand-logo { width: 54px; height: 32px; }
.hero-sub { max-width: 46ch; font-size: 16px; color: var(--text-dim); }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hero-points li { display: flex; gap: 14px; align-items: center; color: var(--mid); font-size: 15px; }
.hero-points .pt { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid var(--edge-strong); border-radius: 10px; color: var(--on); background: var(--bg-2); }

/* lit-cell meter: each column fills in whole square steps, like the Pulse bars */
.cells { display: flex; gap: 4px; height: 80px; align-items: flex-end; }
.cells i { display: block; width: 10px; height: 80px; flex: none;
  background: linear-gradient(to top, #4a4a47, #b3b3ad 60%, #f2f2ed);
  -webkit-mask-image: repeating-linear-gradient(to top, #000 0 8px, transparent 8px 10px); mask-image: repeating-linear-gradient(to top, #000 0 8px, transparent 8px 10px);
  clip-path: inset(80% 0 0 0); animation: lvl 3.6s steps(8, end) infinite; }
.cells i:nth-child(5n+1) { animation-duration: 2.8s; animation-delay: -0.6s; } .cells i:nth-child(5n+2) { animation-duration: 4.4s; animation-delay: -1.9s; }
.cells i:nth-child(5n+3) { animation-duration: 3.2s; animation-delay: -2.4s; } .cells i:nth-child(5n+4) { animation-duration: 5s; animation-delay: -0.2s; }
.cells i:nth-child(3n) { opacity: 0.55; } .cells i:nth-child(7n) { opacity: 0.3; }
@keyframes lvl { 0%, 100% { clip-path: inset(80% 0 0 0); } 35% { clip-path: inset(10% 0 0 0); } 62% { clip-path: inset(45% 0 0 0); } 80% { clip-path: inset(25% 0 0 0); } }
.cells-cap { display: flex; justify-content: space-between; max-width: 392px; font: 600 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }

.login-card { position: relative; width: min(404px, 100%); justify-self: start; padding: 30px 28px 24px; display: grid; gap: 14px; border-radius: 20px; background: var(--bg-2); border: 1px solid var(--edge-strong); box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.9); animation: rise 520ms var(--ease) 80ms both; }
.login-card.is-error { animation: shake 360ms var(--ease); }
@keyframes shake { 20% { transform: translateX(-6px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }
.login-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.login-top .scanner i { width: 4px; height: 4px; }
.login-brand { display: none; justify-items: center; gap: 12px; }
.login-brand .brand-logo { width: 54px; height: 32px; color: var(--on); }
.login-card h1 { font-size: 26px; letter-spacing: -0.02em; color: var(--on); }
.login-sub { font-size: 14px; color: var(--text-dim); margin-top: -6px; margin-bottom: 6px; }
.login-demo { font: 600 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; color: var(--mid); box-shadow: inset 0 0 0 1px var(--edge-strong); }
.login-field { position: relative; display: block; }
.login-field input { width: 100%; height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--edge); background: var(--well); color: var(--on); font: 400 15px var(--body); transition: border-color 160ms var(--ease), background-color 160ms var(--ease); }
.login-field input::placeholder { color: var(--ink-dim); }
.login-field input:hover { border-color: var(--edge-strong); }
.login-field input:focus { outline: none; border-color: var(--on); background: var(--bg); }
.login-field input#pw { padding-right: 64px; }
.login-eye { position: absolute; right: 7px; top: 7px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-dim); font: 500 13px var(--body); cursor: pointer; }
.login-eye:hover { color: var(--on); background: rgba(242, 242, 237, 0.07); }
.login-hint { font-size: 12.5px; color: var(--text-dim); margin-top: -4px; }
.login-err { font-size: 13.5px; color: var(--alert); background: var(--alert-soft); border-radius: 10px; padding: 9px 12px; box-shadow: inset 0 0 0 1px var(--alert-line); }
.login-go { height: 48px; border: 1px solid var(--on); border-radius: 12px; background: var(--on); color: var(--bg); font: 600 15px var(--body); cursor: pointer; margin-top: 4px; transition: background-color 160ms var(--ease), transform 120ms var(--ease); }
.login-go:hover { background: var(--on-hover); } .login-go:active { transform: scale(0.99); } .login-go[disabled] { opacity: 0.5; }
.login-foot { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }
.login-foot .ico { width: 14px; height: 14px; }
@media (max-width: 980px) {
  .login { grid-template-columns: 1fr; justify-items: center; align-content: center; }
  .login-hero { display: none; } .login-brand { display: grid; } .login-card { justify-self: center; } .login-card h1, .login-sub { text-align: center; } .login-top { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .login-hero, .login-card, .login-card.is-error, .cells i { animation: none !important; } .cells i { clip-path: inset(40% 0 0 0); } }

/* ------------------------------------------------------------- charts (shadcn style) */
.ch { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "y plot" ". x" ". key"; column-gap: 10px; row-gap: 8px; }
.ch-y { grid-area: y; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font: 500 11px/1 var(--mono); color: var(--ink-dim); padding-block: 0; min-width: 34px; }
.ch-plot { grid-area: plot; position: relative; touch-action: pan-y; cursor: crosshair; border-radius: 8px; }
.ch-plot.h-sm { height: 72px; } .ch-plot.h-md { height: 110px; } .ch-plot.h-lg { height: 156px; }
.ch-plot svg { width: 100%; height: 100%; overflow: visible; }
.ch-x { grid-area: x; display: flex; justify-content: space-between; font: 500 11px var(--mono); color: var(--ink-dim); }
.ch-key { grid-area: key; display: flex; gap: 16px; font-size: 12.5px; color: var(--text-dim); }
.ch-key span, .ch-tip div { display: inline-flex; align-items: center; gap: 8px; }
.ch-key i, .ch-tip i { width: 8px; height: 8px; border-radius: 1px; background: #f2f2ed; flex: none; } .ch-key i.k1, .ch-tip i.k1 { background: #b3b3ad; opacity: .7; }
.ch-cursor { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(242, 242, 237, 0.28); pointer-events: none; }
.ch-tip { position: absolute; top: -6px; translate: 0 -100%; z-index: 5; display: grid; gap: 6px; min-width: 150px; padding: 10px 12px; background: rgba(14, 14, 14, 0.96); border: 1px solid var(--edge-strong); border-radius: 10px; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.85); pointer-events: none; font-size: 12.5px; color: var(--mid); animation: tip-in 120ms var(--ease); }
.ch-tip em { font-style: normal; color: var(--text-dim); font-size: 12px; } .ch-tip div { justify-content: flex-start; } .ch-tip b { margin-left: auto; padding-left: 16px; font-variant-numeric: tabular-nums; }
@keyframes tip-in { from { opacity: 0; translate: 0 -92%; } }

/* ------------------------------------------------------------- soft corners */
:root { --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px; }
.btn { border-radius: var(--r-sm); } .btn-small { border-radius: 9px; }
.field input, .field select, .search { border-radius: var(--r-sm); }
.chip { border-radius: 999px; padding: 4px 9px; }
.switch { width: 46px; height: 26px; border-radius: 999px; } .switch::after { top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; } .switch[aria-checked="true"]::after { transform: translateX(20px); }
.panel, .tile, .node, .banner { border-radius: var(--r-md); } .panel-raised { border-radius: var(--r-lg); }
.modal { border-radius: var(--r-xl); } .toast { border-radius: var(--r-sm); }
.check input { border-radius: 5px; }
.dot { border-radius: 50%; } .pip, .banner .b-dot { border-radius: 50%; }
.bar i { border-radius: 2px; } .bar.bar-thin i { border-radius: 1.5px; }
.signal i { border-radius: 1.5px; } .strip i { border-radius: 1px; }
.nav-count { border-radius: 999px; } .side a { border-radius: var(--r-sm); } .side a[aria-current="page"]::before { border-radius: 0 3px 3px 0; }
.status-card { border-radius: var(--r-md); } .avatar { border-radius: 11px; } .node-ico { border-radius: 11px; } .hero-points .pt { border-radius: 11px; }
.hint-line { border-radius: var(--r-sm); } .login-demo { border-radius: 999px; padding: 5px 10px; }
.icon-btn { border-radius: var(--r-sm); } .tabbar [aria-current="page"]::before { border-radius: 0 0 3px 3px; }
.row:hover { border-radius: 0; }

/* ------------------------------------------------------------- motion */
@keyframes rise { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; scale: 0.96; translate: 0 8px; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes slide-in { from { opacity: 0; translate: 0 14px; scale: 0.98; } }
main > * { animation: rise 460ms var(--ease) both; }
main > *:nth-child(2) { animation-delay: 40ms; } main > *:nth-child(3) { animation-delay: 80ms; } main > *:nth-child(4) { animation-delay: 120ms; } main > *:nth-child(5) { animation-delay: 160ms; } main > *:nth-child(n+6) { animation-delay: 200ms; }
main.is-refresh > * { animation: none; }
.grid > * { animation: rise 460ms var(--ease) both; } .grid > *:nth-child(2) { animation-delay: 60ms; } .grid > *:nth-child(3) { animation-delay: 110ms; } .grid > *:nth-child(4) { animation-delay: 160ms; }
main.is-refresh .grid > * { animation: none; }
.scrim { animation: fade 180ms ease both; backdrop-filter: blur(4px); } .modal { animation: pop 260ms var(--ease) both; }
.toast { animation: slide-in 320ms var(--ease) both; }
.btn, .seg button, .switch, .switch::after, .chip, .icon-btn, .tile, .panel, .node, .row, .side a, .login-field input, .field input, .field select, .search, .avatar { transition-property: background-color, border-color, color, box-shadow, transform, translate, opacity, fill-opacity; transition-duration: 200ms; transition-timing-function: var(--ease); }
.btn:hover { translate: 0 -1px; } .btn:active { translate: 0 0; transform: scale(0.98); }
.switch::after { transition: transform 240ms var(--ease), background 200ms var(--ease); }
a.tile:hover, .panel.is-link:hover, .node:hover { translate: 0 -2px; box-shadow: 0 14px 28px -18px rgba(0, 0, 0, 0.9); }
.row { transition: background-color 200ms var(--ease), padding 200ms var(--ease); }
.row:hover { background: rgba(242, 242, 237, 0.045); }
.bar i { transition: background-color 400ms var(--ease); }
.side a .ico, .tabbar .ico { transition: transform 240ms var(--ease); } .side a:hover .ico { translate: 2px 0; }
:focus-visible { outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { main > *, .grid > *, .scrim, .modal, .toast, .ch-tip { animation: none !important; } .btn:hover, a.tile:hover, .node:hover { translate: none; } }

/* fixes after first look */
.demo-bar { margin: 0; padding: 8px var(--gutter); font-size: 13px; color: var(--text-dim); background: var(--bg-2); border-bottom: 1px solid var(--line); }
button.status-card { width: 100%; text-align: left; background: var(--bg-2); color: var(--text-dim); font: inherit; font-size: 13px; cursor: pointer; }
button.status-card:hover { border-color: var(--edge-strong); } button.status-card b { color: var(--on); }
.rows.compact .row { grid-template-columns: minmax(0, 1fr) auto; }
.rows.compact .row > span:empty, .rows.compact .row > .rate { display: none; }
.rows.compact .row .sub { white-space: normal; }
.rows.compact .row .name { flex-wrap: wrap; }

/* segmented control (shared look with Pulse Sync): recessed track, raised graphite pill that slides */
.seg { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 3px; max-width: 100%; background: #111110; border: 1px solid var(--line); border-radius: 10px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.seg::-webkit-scrollbar { display: none; }
.seg button { position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-dim); font: 500 13px/1 var(--body); white-space: nowrap; cursor: pointer; transition: color 180ms var(--ease), background-color 180ms var(--ease); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--mid); background: rgba(242, 242, 237, 0.035); }
.seg button[aria-pressed="true"] { color: var(--on); font-weight: 600; }
.seg:not([data-seg]) button[aria-pressed="true"] { background: #262624; box-shadow: inset 0 0 0 1px rgba(242, 242, 237, 0.1); }
.seg button:focus-visible { outline: 2px solid var(--on); outline-offset: 1px; }
.seg-thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 7px; background: linear-gradient(to bottom, #2c2c2a, #232321); box-shadow: inset 0 0 0 1px rgba(242, 242, 237, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.6), 0 6px 14px -6px rgba(0, 0, 0, 0.9); transition: transform 300ms var(--ease), width 300ms var(--ease); pointer-events: none; }
.seg-thumb.is-still { transition: none; }
.seg .count { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; margin: 0 -2px 0 0; border-radius: 5px; font: 600 11px/1 var(--mono); font-variant-numeric: tabular-nums; background: rgba(242, 242, 237, 0.06); color: var(--text-dim); opacity: 1; transition: background-color 180ms var(--ease), color 180ms var(--ease); }
.seg button[aria-pressed="true"] .count { background: rgba(242, 242, 237, 0.12); color: var(--on); }
fieldset.days .seg { flex-wrap: wrap; overflow: visible; }
@media (prefers-reduced-motion: reduce) { .seg-thumb { transition: none; } }

/* ------------------------------------------------------------- status colour: green is healthy, orange needs a look, red is at risk */
.dot { background: var(--on); } .dot.good { background: var(--good); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--alert); }
.pip { background: var(--good); } .pip.is-off { background: var(--alert); }
.chip-good { color: var(--good); background: var(--good-soft); box-shadow: inset 0 0 0 1px var(--good-line); }
.chip-warn { color: var(--warn); background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--warn-line); }
.avatar.is-good { color: var(--good); border-color: var(--good-line); background: var(--good-soft); }
.avatar.is-warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.node:not(.is-down) .node-ico { color: var(--good); border-color: var(--good-line); background: var(--good-soft); }
.node-ico { background: var(--bg-2); }
.node.is-down .node-ico { background: var(--alert-soft); }
.banner.is-good { border-color: var(--good-line); background: var(--good-soft); } .banner.is-good .b-dot { background: var(--good); }
.banner.is-warn { border-color: var(--warn-line); background: var(--warn-soft); } .banner.is-warn .b-dot { background: var(--warn); }
.banner.is-bad .b-dot { background: var(--alert); }
.tile.is-good { border-color: var(--good-line); } .tile.is-good .tile-top .ico { color: var(--good); }
.tile.is-warn { border-color: var(--warn-line); } .tile.is-warn .tile-top .ico { color: var(--warn); }
.tile.is-hot .tile-top .ico { color: var(--alert); }
.tile.is-good .px { color: var(--good); } .tile.is-warn .px { color: var(--warn); } .tile.is-hot .px { color: var(--alert); }
.bar.tone-good i.is-on { background: var(--good); } .bar.tone-good i.is-part { background: rgba(95, 220, 140, 0.45); }
.bar.tone-warn i.is-on { background: var(--warn); } .bar.tone-warn i.is-part { background: rgba(255, 176, 74, 0.45); }
.bar.tone-bad i.is-on { background: var(--alert); } .bar.tone-bad i.is-part { background: rgba(255, 107, 99, 0.45); }
.signal.tone-good i.is-on { background: var(--good); } .signal.tone-warn i.is-on { background: var(--warn); } .signal.tone-bad i.is-on { background: var(--alert); }
.toast.is-ok { background: #0f2a1a; color: var(--good); box-shadow: inset 0 0 0 1px var(--good-line), 0 18px 40px -12px rgba(0, 0, 0, 0.9); }

/* ------------------------------------------------------------- checkboxes: soft square, springy tick, no browser default */
input[type="checkbox"], .check input[type="checkbox"] { -webkit-appearance: none; appearance: none; position: relative; display: inline-grid; place-content: center; flex: none; width: 20px; height: 20px; margin: 0; padding: 0; background: var(--well); border: 1px solid var(--edge-strong); border-radius: 6px; cursor: pointer; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5); transition: background-color 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 160ms var(--ease); }
input[type="checkbox"]::after { content: ""; width: 5px; height: 10px; margin-top: -2px; border: solid var(--bg); border-width: 0 2px 2px 0; border-radius: 1px; transform: rotate(45deg) scale(0); transition: transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1); }
input[type="checkbox"]:hover { border-color: var(--mid); background: var(--bg-2); }
input[type="checkbox"]:active { transform: scale(0.92); }
input[type="checkbox"]:checked { background: var(--on); border-color: var(--on); box-shadow: 0 0 0 3px rgba(242, 242, 237, 0.08); }
input[type="checkbox"]:checked::after { transform: rotate(45deg) scale(1); }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--on); outline-offset: 2px; border-radius: 6px; }
input[type="checkbox"]:disabled { opacity: 0.4; cursor: not-allowed; }
.check { gap: 12px; padding: 4px 0; transition: color 160ms var(--ease); }
.check:hover { color: var(--on); }
fieldset.days .check { min-height: 32px; padding: 0 10px; border-radius: 7px; }
fieldset.days .check:has(input:checked) { color: var(--on); background: #262624; box-shadow: inset 0 0 0 1px rgba(242, 242, 237, 0.1); }
@media (prefers-reduced-motion: reduce) { input[type="checkbox"], input[type="checkbox"]::after { transition: none; } }

/* ------------------------------------------------------------- dropdowns (shared look with Pulse Sync): recessed field + chevron, themed open list where supported */
select, select.search, .field select { -webkit-appearance: none; appearance: none; height: 44px; min-width: 120px; padding: 0 38px 0 14px; border: 1px solid var(--edge); border-radius: 10px; background-color: #111110; color: var(--on); font: 500 14px var(--body); cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--mid) 50%), linear-gradient(135deg, var(--mid) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5); transition: border-color 160ms var(--ease), background-color 160ms var(--ease); }
select:hover { border-color: var(--edge-strong); background-color: #161615; }
select:focus-visible, select:focus { outline: 2px solid var(--on); outline-offset: 2px; border-color: var(--on); }
select option { background: #141413; color: var(--on); }
.search.w180 { height: 40px; }
@supports (appearance: base-select) {
  select, select.search, .field select, ::picker(select) { appearance: base-select; }
  select, select.search, .field select { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; background-image: none; }
  select::picker-icon { content: ""; width: 9px; height: 6px; background: var(--mid); clip-path: polygon(0 0, 50% 70%, 100% 0, 100% 30%, 50% 100%, 0 30%); transition: rotate 220ms var(--ease); }
  select:open::picker-icon { rotate: 180deg; }
  select:open { border-color: var(--edge-strong); }
  ::picker(select) { margin-top: 6px; padding: 6px; min-width: anchor-size(width); border: 1px solid var(--rule-dotted); border-radius: 12px; background: rgba(19, 19, 18, 0.98); color: var(--mid); box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.95);
    opacity: 0; transform: translateY(-4px) scale(0.985); transform-origin: top; transition: opacity 150ms var(--ease), transform 220ms var(--ease), overlay 220ms allow-discrete, display 220ms allow-discrete; }
  select:open::picker(select) { opacity: 1; transform: none; }
  @starting-style { select:open::picker(select) { opacity: 0; transform: translateY(-4px) scale(0.985); } }
  option { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 12px 0 10px; border-radius: 8px; font: 500 14px var(--body); color: var(--mid); background: transparent; cursor: pointer; transition: background-color 120ms var(--ease), color 120ms; }
  option:hover, option:focus-visible { background: rgba(242, 242, 237, 0.07); color: var(--on); outline: none; }
  option:checked { color: var(--on); font-weight: 600; }
  option::checkmark { order: 1; margin-left: auto; content: "✓"; color: var(--on); font-size: 12px; }
  option:not(:checked)::checkmark { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) { ::picker(select) { transition: none; } select::picker-icon { transition: none; } }

/* ---- cameras */
.cams { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.cam { border: 1px solid var(--line); background: var(--bg-2); border-radius: 10px; overflow: hidden; min-width: 0; }
.cam-bar, .cam-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; }
.cam-foot { font-size: 12.5px; color: var(--text-dim); }
.cam-view { position: relative; aspect-ratio: 16 / 9; background: #000; }
.cam-view video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.cam-note { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 12px; color: var(--text-dim); font-size: 13px; pointer-events: none; }
.cam-view.is-live .cam-note { display: none; }
.cam-view.is-down video { visibility: hidden; }
.cam-big { width: 100%; max-height: 70vh; }
.cam-view:fullscreen { width: 100vw; height: 100vh; max-height: none; aspect-ratio: auto; }
details summary { cursor: pointer; color: var(--mid); font-size: 13px; margin: 4px 0 10px; }

/* ---- guest pass slip */
.slip { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 8px 0; }
.slip-wifi { display: grid; gap: 2px; color: var(--mid); }
.slip-wifi b { color: var(--on); font-size: 1.25rem; }
.slip-code { font-family: var(--mono); font-size: clamp(1.6rem, 6vw, 2.2rem); letter-spacing: 0.12em; color: var(--on); border: 1px solid var(--edge-strong); padding: 10px 18px; }
.slip-valid { margin: 0; color: var(--mid); }
.slip-qr { width: 168px; max-width: 60vw; }
.slip-qr .qr { width: 100%; height: auto; display: block; }
.slip-steps { margin: 0; padding-left: 1.2em; text-align: left; color: var(--mid); }
@media print {
  body.printing-slip > *:not(.scrim) { display: none !important; }
  body.printing-slip .scrim { position: static; background: #fff; }
  body.printing-slip .modal { box-shadow: none; border: 0; background: #fff; color: #000; }
  body.printing-slip .modal h2, body.printing-slip .modal .actions, body.printing-slip .modal [data-err] { display: none !important; }
  body.printing-slip .slip, body.printing-slip .slip * { color: #000 !important; border-color: #000 !important; }
}

/* Management reports: tables and plain numbers so they print reliably */
.report { display: grid; gap: 20px; }
.report-head h2 { font-size: 1.5rem; margin: 0 0 4px; }
.report-head p { margin: 0; color: var(--mid); }
.report .figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.report .figure { border: 1px solid var(--edge); padding: 10px 12px; }
.report .figure b { display: block; font-size: 1.4rem; color: var(--on); }
.report .figure span { color: var(--mid); font-size: 13px; }
.report section { border-top: 1px solid var(--edge); padding-top: 12px; }
.report section h3 { margin: 0 0 8px; font-size: 1.1rem; }
.report h4 { margin: 12px 0 6px; font-size: 0.95rem; color: var(--mid); }
.report table { width: 100%; border-collapse: collapse; }
.report th, .report td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--edge); font-size: 13px; vertical-align: top; }
.report th { color: var(--mid); font-weight: 600; }
.report .note { color: var(--mid); font-size: 13px; margin: 4px 0; }
.report section > p { margin: 8px 0; }
.report-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
@media (max-width: 720px) { .report .figures { grid-template-columns: repeat(2, 1fr); } }
@media print {
  .report-tools { display: none !important; }
  body, main { background: #fff !important; }
  .report, .report * { color: #000 !important; background: transparent !important; border-color: #999 !important; box-shadow: none !important; }
  .report section { break-inside: avoid; }
  .report .figures { grid-template-columns: repeat(4, 1fr); }
}
