:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1d212b;
  --border: #272c38;
  --text: #e6e9ef;
  --muted: #8b93a7;
  --accent: #4f8cff;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --gray: #4b5263;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* keep display rules from defeating the hidden attribute */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.brand { display: flex; align-items: center; gap: 13px; }
.logo { width: 44px; height: auto; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
.brand-text { display: flex; flex-direction: column; gap: 1px; }
h1 { font-size: 20px; margin: 0; font-weight: 800; letter-spacing: -0.2px; }
.wm-my { color: #79c83f; }
.wm-pk { color: #4f9bff; }
.tagline { font-size: 11px; font-style: italic; color: var(--muted); letter-spacing: 0.3px; }
h2 { font-size: 14px; margin: 0; font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 16px; }
.muted { color: var(--muted); font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.conn { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); }
.conn.ok .dot { background: var(--green); }
.conn.err .dot { background: var(--red); }

main { padding: 24px; display: flex; flex-direction: column; gap: 24px; max-width: 1200px; margin: 0 auto; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.head-actions { display: flex; align-items: center; gap: 8px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.badge {
  display: inline-block;
  min-width: 20px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 18px; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
tbody tr { border-top: 1px solid var(--border); }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--panel-2); }
tbody tr.selected { background: var(--panel-2); }

.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gray); }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(52,211,153,0.15); }
.status-dot.idle { background: var(--amber); }
.status-dot.offline { background: var(--gray); }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--panel-2);
  font-size: 12px;
  text-transform: capitalize;
}

.chev { color: var(--muted); }
/* Bulk-select checkbox column. .chk-admin only shows for admins (body.is-admin). */
.chk { width: 30px; text-align: center; }
.chk input { cursor: pointer; }
.chk-admin { display: none; }
.is-admin .chk-admin { display: table-cell; }
.row-end { white-space: nowrap; text-align: right; }
.row-end .chev { margin-left: 6px; }
/* Delete device: admin-only, revealed by body.is-admin (see loadMe). */
.dev-del { display: none; padding: 2px 8px; font-size: 13px; line-height: 1; }
.is-admin .dev-del { display: inline-flex; }
.dev-del:hover { color: #ff8a8a; border-color: #5a2f2f; }
.empty { padding: 24px 18px; color: var(--muted); margin: 0; }

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 7px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12px;
}
button.ghost:hover { color: var(--text); border-color: var(--muted); }
/* Destructive actions (Delete selected, ✕): red, and fill red on hover — matches the portal. */
button.ghost.danger, .ghost.danger { color: #ff8a8a; border-color: #5a2f2f; }
button.ghost.danger:hover, .ghost.danger:hover { color: #fff; background: #7a2b2b; border-color: #7a2b2b; }

code.data {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
  max-width: 360px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

/* --- Auth pages (login / signup) --- */
.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #1a2230, var(--bg));
}
.auth-card {
  width: 100%;
  max-width: 380px;
  margin: 24px;
  padding: 28px 28px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.auth-brand { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 18px; }
.auth-brand .logo { filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5)); margin-bottom: 6px; }
.auth-brand h1 { font-size: 22px; }
.auth-title { text-align: center; font-size: 15px; color: var(--muted); font-weight: 500; margin: 0 0 16px; }
.auth-error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fca5a5;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin: 0 0 14px;
}
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.auth-card .hint { color: var(--gray); font-size: 11px; }
.auth-card input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 14px;
}
.auth-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18); }
.auth-card button {
  margin-top: 4px;
  padding: 12px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, #4f9bff, #2f7fd1);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.auth-card button:disabled { opacity: 0.6; cursor: default; }
.auth-alt { text-align: center; color: var(--muted); font-size: 13px; margin: 16px 0 0; }
.auth-alt a { color: var(--accent); text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

/* --- Device provisioning + blocking (node dashboard) --- */
.panel-actions { display: flex; align-items: center; gap: 14px; }
.small { font-size: 11px; }
.search {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 7px; padding: 6px 11px; font-size: 12px; min-width: 190px;
}
.search:focus { outline: none; border-color: var(--accent); }
td .del { padding: 3px 10px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 12px; }
.pager button:disabled { opacity: 0.4; cursor: default; }

/* Activity panel: stat tiles, 24h volume chart, breakdown bars */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; padding: 16px 18px; }
.tile { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.tile-n { font-size: 24px; font-weight: 800; }
.tile-l { color: var(--muted); font-size: 12px; margin-top: 3px; }
.tile.warn { border-color: #7a3b3b; }
.tile.warn .tile-n { color: #ff8a8a; }
/* A tile that opens a drill-down dialog. */
.tile-btn { text-align: left; cursor: pointer; font: inherit; color: var(--text); transition: border-color .12s ease, transform .12s ease; }
.tile-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.dialog-head h3 { margin: 0; }
.wide-dialog { max-width: 640px; width: 92vw; }
.ai-table-wrap { max-height: 60vh; overflow-y: auto; margin-top: 10px; }
.ai-table { width: 100%; border-collapse: collapse; }
.ai-table th { position: sticky; top: 0; background: var(--panel); }
.ai-table td { font-size: 12px; }
.chart-block { padding: 4px 18px 12px; }
.chart-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.legend { text-transform: none; letter-spacing: 0; font-size: 11px; display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.lg-q { background: var(--accent); }
.lg-b { background: #ff8a8a; }
.volume-chart { width: 100%; height: 150px; display: block; }
.area-q { fill: rgba(79, 140, 255, 0.20); stroke: none; }
.line-q { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.line-b { fill: none; stroke: #ff8a8a; stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-x { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; }
.breakdowns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 8px 18px 18px; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 56px; align-items: center; gap: 10px; font-size: 12px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: capitalize; }
.bar-track { background: var(--bg); border: 1px solid var(--border); border-radius: 5px; height: 12px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); }
.bar-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .breakdowns { grid-template-columns: 1fr; } }

button.primary {
  background: linear-gradient(135deg, #4f9bff, #2f7fd1);
  border: 0;
  color: #fff;
  border-radius: 7px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
button.primary:hover { filter: brightness(1.07); }

/* Blocking toggle switch */
.switch { position: relative; display: inline-block; width: 38px; height: 21px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--gray); transition: background 0.15s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 15px; width: 15px; left: 3px; top: 3px;
  border-radius: 50%; background: #fff; transition: transform 0.15s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(17px); }
.block-cell { text-align: center; }
.org-select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 4px 8px; font-size: 12px; max-width: 160px;
}
.org-select:focus { outline: none; border-color: var(--accent); }

/* Domain-activity pills */
.pill.cat { background: rgba(79,140,255,0.16); color: #9cc2ff; }
.pill.blocked { background: rgba(248,113,113,0.16); color: #fca5a5; }
.pill.allowed { background: rgba(52,211,153,0.14); color: #6ee7b7; }
.pill.alert { background: rgba(248,113,113,0.18); color: #fca5a5; font-weight: 600; }
/* Amber, not red: a stale tamper check is "we can't vouch for this right now",
   which is weaker than a confirmed profile removal. */
.pill.warn { background: rgba(251,191,36,0.16); color: #fcd34d; font-weight: 600; }
.badge.alert { background: rgba(248,113,113,0.18); color: #fca5a5; margin-left: 6px; }

/* Provisioning panel */
/* Device detail / status panel */
.detail-body { display: flex; flex-wrap: wrap; gap: 24px; padding: 16px 18px; align-items: flex-start; justify-content: space-between; }
.detail-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 26px; margin: 0; flex: 1; }
.detail-fields > div { display: flex; flex-direction: column; gap: 2px; }
.detail-fields dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.detail-fields dd { margin: 0; font-size: 14px; }
.detail-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.detail-switch { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }

.provision { display: flex; gap: 26px; padding: 18px; flex-wrap: wrap; }
.provision-qr { text-align: center; }
.provision-qr img { background: #fff; border-radius: 10px; padding: 8px; }
.provision-info { flex: 1; min-width: 280px; }
.provision-info label { display: block; color: var(--muted); font-size: 12px; margin: 10px 0 5px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input {
  flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 7px; padding: 8px 10px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
}
.steps { margin: 12px 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.steps strong { color: var(--text); }

/* Dialogs (add device, add domain, category rule, override) */
dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px; width: 340px;
}
dialog::backdrop { background: rgba(0,0,0,0.55); }
dialog form h3 { margin: 0 0 14px; }
dialog form label { display: block; color: var(--muted); font-size: 12px; margin: 12px 0 5px; }
dialog form input, dialog form select {
  width: 100%; box-sizing: border-box; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 9px 11px; font-size: 14px;
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* --- Device insights: apps inferred from DNS (no agent on the device) --- */
.insights { margin-top: 18px; border-top: 1px solid var(--border, #272c38); padding-top: 14px; }
.insight-h { font-size: 13px; margin: 0 0 10px; font-weight: 600; }
.muted-sm { color: var(--muted, #8b93a7); font-size: 12px; font-weight: 400; }
.app-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.app-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border: 1px solid var(--border, #272c38); border-radius: 999px;
  background: var(--panel-2, #1d212b); font-size: 13px; }
.app-chip .app-cat { color: var(--muted, #8b93a7); font-size: 11px; text-transform: capitalize; }
.insight-bypass { background: rgba(255,91,91,.10); border: 1px solid rgba(255,91,91,.35);
  color: #ffb4b4; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.insight-note { color: var(--muted, #8b93a7); font-size: 11px; margin: 10px 0 0; }
.insight-bypass .insight-note { display: block; color: #ffb4b4; opacity: .8; margin-top: 4px; }

/* Per-device 24h activity chart (device detail panel) */
.dev-chart-wrap { position: relative; }
.dev-chart { height: 110px; }
.dev-band { fill: transparent; }
.dev-band:hover { fill: rgba(255,255,255,.05); }
.dev-tip { position: absolute; top: 4px; transform: translateX(-50%);
  background: var(--panel-2, #1d212b); border: 1px solid var(--border, #272c38);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; pointer-events: none;
  white-space: nowrap; z-index: 5; }
.dev-tip .tip-apps { color: var(--muted, #8b93a7); font-size: 11px; margin-top: 3px; }
.dev-tip .tip-blk { color: #ff8a8a; }

/* Device network context (which network it connects from) */
.net-line { font-size: 13px; }
.net-hist { margin: 8px 0 0; padding-left: 18px; color: var(--muted, #8b93a7); font-size: 12px; }
.net-hist li { margin: 2px 0; }

/* ── Fleet status strip + needs-attention band (dashboard redesign) ───────── */
#fleet-panel { padding:16px 18px; }
.fleet { display:flex; align-items:center; gap:20px; flex-wrap:wrap; }
.fleet-total { display:flex; align-items:baseline; gap:8px; padding-right:20px; border-right:1px solid var(--border); }
.fleet-total .n { font-size:32px; font-weight:800; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.fleet-total .l { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; font-weight:600; }
.fleet-stats { display:flex; gap:8px; flex-wrap:wrap; }
.fstat { display:flex; align-items:center; gap:8px; padding:8px 13px; border-radius:9px;
  border:1px solid var(--border); background:var(--panel-2); color:var(--text); cursor:pointer; transition:border-color .12s, transform .06s; }
.fstat:hover { transform:translateY(-1px); }
.fstat.active { border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.fstat .c { font-size:18px; font-weight:700; font-variant-numeric:tabular-nums; line-height:1; }
.fstat .t { font-size:12px; color:var(--muted); }
.fdot { width:9px; height:9px; border-radius:50%; }
.fdot.ok { background:var(--green); } .fdot.warn { background:var(--amber); } .fdot.crit { background:var(--red); }

.attn-label { margin:18px 0 10px; font-size:12px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--muted); }
.attn-label span { color:var(--red); }
.attn-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:10px; }
.attn-card { text-align:left; width:100%; background:var(--panel-2); border:1px solid var(--border);
  border-left:3px solid var(--sev); border-radius:10px; padding:12px 14px; display:grid; gap:8px; cursor:pointer; transition:transform .07s; }
.attn-card:hover { transform:translateY(-2px); }
.attn-head { display:flex; align-items:center; gap:9px; }
.attn-head .an { font-weight:700; font-size:14.5px; }
.attn-head .aw { margin-left:auto; font-size:11.5px; color:var(--muted); }
.attn-plat { font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted);
  border:1px solid var(--border); border-radius:5px; padding:2px 6px; }
.attn-alert { display:flex; gap:8px; align-items:flex-start; font-size:12.5px; }
.attn-alert .prov { color:var(--muted); }

/* severity chips + row stripe */
.sev-chip { font-size:10px; font-weight:700; letter-spacing:.03em; text-transform:uppercase; padding:2px 6px; border-radius:5px; white-space:nowrap; }
.sev-chip.crit { color:var(--red); background:rgba(248,113,113,.13); border:1px solid rgba(248,113,113,.32); }
.sev-chip.warn { color:var(--amber); background:rgba(251,191,36,.12); border:1px solid rgba(251,191,36,.30); }
.sev-chip.ok { color:var(--green); background:rgba(52,211,153,.12); border:1px solid rgba(52,211,153,.30); }
.row-chips { display:inline-flex; gap:5px; flex-wrap:wrap; margin-left:8px; vertical-align:middle; }
tr.sev-critical td:first-child { box-shadow:inset 3px 0 0 var(--red); }
tr.sev-warning  td:first-child { box-shadow:inset 3px 0 0 var(--amber); }

/* detail: alerts with provenance */
.detail-alerts { display:flex; flex-direction:column; gap:9px; margin-bottom:16px; }
.da-label { font-size:11px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--muted); }
.da { border:1px solid var(--border); border-left:3px solid var(--sev); border-radius:9px; padding:11px 13px; background:var(--panel-2); display:grid; gap:5px; }
.da-top { display:flex; align-items:center; gap:8px; }
.da-top .when { margin-left:auto; font-size:11.5px; color:var(--muted); }
.da-detail { font-size:13.5px; }
.da-prov { font-size:12px; color:var(--muted); padding-top:5px; border-top:1px dashed var(--border); }
.da-prov b { color:var(--muted); font-weight:600; text-transform:uppercase; font-size:10px; letter-spacing:.05em; }
.da-clear { text-align:center; padding:16px; color:var(--muted); }
.da-clear b { color:var(--green); display:block; font-size:14px; margin-bottom:2px; }

/* Device health + Safety monitoring panels (mirror the personal dashboard). */
.detail-health { margin-top: 14px; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 6px 0; }
.health-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--panel-2); }
.health-item .hdot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex: none; background: var(--muted); }
.health-item.on .hdot { background: #34d399; }
.health-item.off .hdot { background: #fbbf24; }
/* "unknown" is deliberately neutral, not amber: not having seen a check on this
   node is an absence of information, and colouring it as a warning is what made
   one console read as an alarm while the other read as healthy. */
.health-item.unknown .hdot { background: var(--gray); }
/* Not-scanned is neutral, never green: it must not read as reassurance. */
.detail-safety.unknown { border-color: var(--border); background: var(--panel-2); }
.detail-safety.unknown .insight-h { color: var(--muted); }
.detail-safety { margin-top: 14px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.detail-safety .insight-h { margin-top: 0; }
.detail-safety.clear { border-color: rgba(52, 211, 153, 0.5); }
.detail-safety.clear .insight-h { color: #34d399; }
.detail-safety.hit { border-color: rgba(248, 113, 113, 0.55); }
.detail-safety.hit .insight-h { color: #f87171; }
.detail-safety .safety-row { margin: 6px 0; }

/* Top-blocked + activity-by-day tables in the device detail. */
.detail-blocked, .detail-byday { margin-top: 12px; }
table.mini { width: 100%; border-collapse: collapse; }
table.mini th { text-align: left; }
table.mini td, table.mini th { padding: 6px 8px; border-top: 1px solid var(--border); font-size: 13px; }
table.mini thead th { border-top: 0; }

/* Events: collapsed list + expand control. */
.events-more { padding: 8px 12px; }

/* Portal sync liveness, inside the throughput panel. Deliberately a list of
   plain sentences rather than another row of tiles: a stalled sync is a
   condition to read, not a number to scan past — which is how the last one went
   unnoticed while every tile on this panel looked fine. */
.sync-alert {
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.32);
}
.sync-head {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.sync-list { list-style: none; margin: 8px 0 0; padding: 0; }
.sync-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 12.5px;
}
.sync-row + .sync-row { border-top: 1px solid rgba(39, 44, 56, 0.6); }
.sync-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--gray); }
.sync-row.ok   .sync-dot { background: var(--green); }
.sync-row.warn .sync-dot { background: var(--amber); }
.sync-row.crit .sync-dot { background: var(--red); }
.sync-name { flex: none; min-width: 15em; }
.sync-state { color: var(--muted); }
.sync-row.warn .sync-state { color: var(--amber); }
.sync-row.crit .sync-state { color: var(--red); font-weight: 600; }
@media (max-width: 620px) {
  .sync-row { flex-wrap: wrap; gap: 2px 8px; }
  .sync-name { min-width: 0; }
}

/* A mirrored device's row does not advance. Neutral and stated, never styled to
   look like live data — the whole point is that it cannot be mistaken for it. */
.mirror-note.warn { color: #fecaca; background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.32); }
.mirror-note {
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
}
