/* KW Console styles. Colours are tokens on :root; dark is the default, light via data-theme. */
:root,
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b1220;
  --nav: #0c1723;
  --card: #111e2b;
  --card-hi: #162638;
  --sunk: #0c1723;
  --chip: #1b2c3d;
  --line: #26384a;
  --row: #203143;
  --line2: #40556a;
  --hover: #192a3b;
  --text: #e7eef6;
  --text2: #cbd7e4;
  --muted: #a2b3c5;
  --navfg: #c2cfdd;
  --dim: #91a3b7;
  --strong: #f7fafd;
  --accent: #38bdf8;
  --accent-text: #38bdf8;
  --focus: var(--accent);
  --on-accent: #05111c;
  --store9: #38bdf8;
  --store8: #c4a1ff;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --accent-ring: rgba(56, 189, 248, 0.4);
  --ok: #6ee7b7;
  --ok-bg: rgba(52, 211, 153, 0.14);
  --ok-dot: #34d399;
  --warn: #fcd34d;
  --warn-bg: rgba(251, 191, 36, 0.14);
  --warn-dot: #fbbf24;
  --warn-line: #523f13;
  --bad: #fca5a5;
  --bad-bg: rgba(248, 113, 113, 0.15);
  --bad-dot: #f87171;
  --idle: #cbd5e1;
  --idle-bg: rgba(148, 163, 184, 0.14);
  --idle-dot: #94a3b8;
  --live-bg: #0d221a;
  --live-line: #1f4535;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 22px 54px -12px rgba(0, 0, 0, 0.72);
  --glow: none;
  --glass: rgba(11, 18, 32, 0.96);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2393A1B5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #eef2f5;
  --nav: #f8fafc;
  --card: #ffffff;
  --card-hi: #ffffff;
  --sunk: #f3f6f9;
  --chip: #e6edf3;
  --line: #d3dde6;
  --row: #e4ebf1;
  --line2: #a7b8c9;
  --hover: #edf5fb;
  --text: #132638;
  --text2: #344c60;
  --muted: #52677a;
  --navfg: #344c60;
  --dim: #5b6d80;
  --strong: #102437;
  --accent: #38bdf8;
  --accent-text: #0369a1;
  --focus: var(--accent-text);
  --on-accent: #06121d;
  --store9: #0284c7;
  --store8: #7c3aed;
  --accent-soft: rgba(14, 165, 233, 0.1);
  --accent-ring: rgba(14, 165, 233, 0.3);
  --ok: #047857;
  --ok-bg: rgba(52, 211, 153, 0.14);
  --ok-dot: #10b981;
  --warn: #854d0e;
  --warn-bg: rgba(251, 191, 36, 0.16);
  --warn-dot: #d97706;
  --warn-line: #f2c879;
  --bad: #b91c1c;
  --bad-bg: rgba(248, 113, 113, 0.14);
  --bad-dot: #dc2626;
  --idle: #475569;
  --idle-bg: rgba(148, 163, 184, 0.16);
  --idle-dot: #94a3b8;
  --live-bg: #ecfdf5;
  --live-line: #a7f3d0;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 6px 20px -8px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 20px 50px -12px rgba(15, 23, 42, 0.25);
  --glow: none;
  --glass: rgba(238, 242, 245, 0.96);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23526072' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
* {
  box-sizing: border-box;
}
html {
  scrollbar-color: var(--line2) transparent;
  scrollbar-gutter: stable;
}
body.modal-open {
  overflow: hidden;
}
body {
  margin: 0;
  background: var(--glow), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Anuphan', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
::selection {
  background: var(--accent-ring);
}
.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
a:not(.btn),
a:not(.btn):visited {
  color: var(--accent-text);
  text-decoration: none;
}
a:not(.btn):hover,
a:not(.btn):focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.num {
  font-family: 'Space Grotesk', 'Anuphan', sans-serif;
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--muted);
}
.boot,
.center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.card.device-view-pending {
  position: sticky;
  top: var(--header-offset, 16px);
}

/* ---------- layout ---------- */
/* align-content keeps the phone layout (menu above page) from spreading out to fill the screen height */
.shell {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  transition: filter 0.25s ease;
}
body.privacy-blur .shell {
  filter: blur(18px) brightness(0.65);
  pointer-events: none;
  user-select: none;
}
.nav {
  flex: 1 1 280px;
  max-width: 280px;
  align-self: stretch;
  background: var(--nav);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
:root[data-theme='light'] .nav {
  background: var(--nav);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px;
}
.logo {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7dd3fc, var(--accent) 55%, #0284c7);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px -6px var(--accent-ring);
  flex: 0 0 auto;
}
.logo::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 15px;
  border: 1.5px dashed var(--accent-ring);
  animation: spin 16s linear infinite;
  pointer-events: none;
  opacity: 0.7;
}
.brand b {
  font-size: 15.5px;
  display: block;
  letter-spacing: 0.1px;
  color: var(--strong);
}
.brand small {
  font-size: 11.5px;
  color: var(--muted);
}
.nav .menu-btn {
  display: none;
  margin-left: auto;
}
.top-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.top-sub .mono {
  font-size: 12px;
}
.kv + .bar {
  margin-top: 6px;
}
.shops {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 2px;
}
.shops-lbl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--dim);
  padding: 0 6px;
}
.shop-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.shop-select {
  width: 100%;
  min-height: 40px;
  padding: 0 32px 0 36px;
  border-radius: 12px;
  border: 1px solid var(--accent-ring);
  background: var(--card-hi);
  color: var(--strong);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color 0.18s,
    background-color 0.18s,
    box-shadow 0.18s;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.3);
}
.shop-select:hover {
  border-color: var(--accent);
  background-color: var(--hover);
  box-shadow: 0 0 0 1px var(--accent-ring);
}
.shop-select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.shop-select-ico {
  position: absolute;
  left: 11px;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  font-size: 15px;
}
.shop-select-arr {
  position: absolute;
  right: 11px;
  pointer-events: none;
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
}
.shops select.field {
  width: 100%;
  font-weight: 600;
  border-color: var(--accent-ring);
  background-color: var(--card-hi);
}
.shop-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.shop-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--sunk);
  color: var(--navfg);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background-color 0.15s,
    transform 0.12s;
}
.shop-card:hover {
  border-color: var(--line2);
  background: var(--hover);
}
.shop-card.on {
  border-color: var(--accent);
  background: linear-gradient(145deg, var(--accent-soft), var(--card-hi));
  color: var(--strong);
  box-shadow: 0 6px 16px -8px var(--accent-ring);
}
.shop-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--strong);
}
.shop-card small {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-tools {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 0 2px;
}
.nav-search {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  align-items: center;
}
.nav-search svg {
  position: absolute;
  left: 10px;
  color: var(--dim);
  pointer-events: none;
}
.nav-search input {
  width: 100%;
  min-height: 35px;
  padding: 0 10px 0 31px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--sunk);
  color: var(--text);
  font-size: 12.5px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.nav-search input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px var(--accent-soft);
  background: var(--card);
}
.nav-compact-btn {
  min-height: 35px;
  padding: 0 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--sunk);
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.nav-compact-btn:hover,
.nav-compact-btn.on {
  border-color: var(--accent-ring);
  color: var(--strong);
  background: var(--accent-soft);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--dim);
  padding: 5px 8px 3px;
  cursor: pointer;
  text-align: left;
  border-radius: 7px;
  transition:
    color 0.15s,
    background-color 0.15s;
}
.group-title:hover {
  color: var(--text);
  background: var(--hover);
}
.group-title .g-cnt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--sunk);
  color: var(--muted);
}
.nav-group.folded .nav-group-body {
  display: none;
}
.nav-group-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--navfg);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.nav-item:hover {
  background: var(--hover);
  color: var(--strong);
  border-color: transparent;
}
.nav-item.on {
  background: var(--accent-soft);
  border-color: var(--accent-ring);
  color: var(--strong);
  font-weight: 600;
  box-shadow: none;
}
.nav-ico {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--muted);
}
.nav-item:hover .nav-ico {
  color: var(--strong);
  border-color: var(--line2);
}
.nav-item.on .nav-ico {
  background: transparent;
  color: var(--accent-text);
  border-color: transparent;
  box-shadow: none;
}
.nav-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.25;
}
.nav-txt b {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-txt small {
  font-size: 11px;
  color: var(--dim);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.nav-item.on .nav-txt small {
  color: var(--text2);
}
.nav.compact .nav-txt small {
  display: none;
}
.nav.compact .nav-item {
  min-height: 36px;
  padding: 4px 9px;
}
.nav.compact .nav-ico {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}
.nav-item.on::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: none;
}
.nav-item.soon {
  cursor: default;
  opacity: 0.5;
}
.soon-note {
  font-weight: 400;
  letter-spacing: 0;
}
.nav-item.soon:hover {
  background: transparent;
  transform: none;
}
.nav-item .badge {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--sunk);
  border: 1px solid var(--line);
  color: var(--muted);
  flex: 0 0 auto;
}
.nav-item.on .badge {
  background: var(--accent-soft);
  border-color: var(--accent-ring);
  color: var(--accent-text);
}
.nav-item .badge.b-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: transparent;
}
.nav-item .badge.b-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: transparent;
}
.nav-item .badge.b-bad {
  background: var(--bad-bg);
  color: var(--bad);
  border-color: transparent;
}
.nav-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.collector {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.collector b {
  color: var(--text);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.meter {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea5e9, var(--accent));
  width: 0;
}

.main {
  flex: 1 1 0;
  min-width: 0;
  padding: 20px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.top h1 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.35px;
  color: var(--strong);
}
.crumb,
.subtitle {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
form.tools,
.tools:has(> label.lbl) {
  align-items: flex-end;
} /* align controls below their labels on every page */
.tools > label.lbl {
  min-width: 0;
  max-width: 100%;
}
.tools > label.lbl > .field,
.tools > .tabs {
  max-width: 100%;
}
#lip {
  width: 290px;
  min-width: 0;
  max-width: 100%;
} /* hint fits on desktop without forcing a phone wider */

/* ---------- controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.05s;
}
.btn:hover {
  background: var(--hover);
  border-color: var(--dim);
}
.btn:active {
  transform: translateY(1px);
}
.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
  font-weight: 700;
  box-shadow: none;
}
.btn.primary:hover {
  background: var(--accent);
  filter: brightness(1.08);
}
.btn.small {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 12px;
}
.btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}
.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--live-line);
  background: var(--live-bg);
  color: var(--ok);
  font-size: 13px;
  font-weight: 600;
}
.live.off {
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn);
}
.live:not(.off) .dot {
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
}
.d-ok {
  background: var(--ok-dot);
}
.d-warn {
  background: var(--warn-dot);
}
.d-bad {
  background: var(--bad-dot);
}
.d-idle {
  background: var(--idle-dot);
}
select.field,
input.field {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background-color: var(--card);
  color: var(--text);
  font-size: 14px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
select.field {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
select.field:hover,
input.field:hover {
  border-color: var(--dim);
}
select.field:focus,
input.field:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input.field::placeholder {
  color: var(--dim);
}
label.lbl {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* ---------- surfaces ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.card:hover {
  border-color: var(--line);
}
.card h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--strong);
  overflow-wrap: anywhere;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.row > .card {
  flex: 1 1 300px;
}
.row > .card.wide {
  flex: 2 1 460px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 14px;
}
.kpi {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
}
.kpi:hover {
  border-color: var(--line2);
  transform: none;
}
.kpi span:first-child {
  font-size: 12px;
  color: var(--muted);
}
.kpi .v {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--strong);
  overflow-wrap: anywhere;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.kpi .n {
  font-size: 12px;
  color: var(--muted);
}
.kpi-val {
  font-size: 16px;
  font-weight: 600;
  color: var(--strong);
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.kpi-val.muted {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.kpi-sub {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.c-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.c-warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.c-bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.c-idle {
  background: var(--idle-bg);
  color: var(--idle);
}
.c-new {
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--accent-ring);
}
.talker-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.talker-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--sunk);
  border: 1px solid var(--line);
}
.audit-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--sunk);
  border: 1px solid var(--line);
  font-size: 12px;
}
.audit-cmd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--accent-text);
  display: block;
  margin-top: 2px;
}

.wan {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 220px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.wan.inuse {
  border-color: var(--accent-ring);
  background: linear-gradient(180deg, var(--accent-soft), transparent 55%), var(--card);
}
.wan .big {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  color: var(--strong);
}
.spark {
  width: 100%;
  height: 40px;
}
.health {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--text2);
  padding: 12px 14px;
  background: var(--sunk);
  border-bottom: 1px solid var(--line2);
  white-space: nowrap;
}
.ring {
  position: relative;
  width: 132px;
  height: 132px;
}
.ring div {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

/* ---------- tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.2px;
  color: var(--muted);
  padding: 11px 12px;
  background: var(--sunk);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--row);
  vertical-align: top;
  line-height: 1.6;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr {
  transition: background-color 0.12s;
}
tbody tr:hover {
  background: var(--hover);
}
td.mono {
  font-size: 13px;
  color: var(--text2);
}
.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  min-width: 60px;
}
.bar > i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea5e9, var(--accent));
  width: 0;
}
.stack {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  gap: 2px;
  background: var(--sunk);
}
.stack > i {
  display: block;
  height: 14px;
}
.legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 16px;
  font-size: 13px;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.event {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--row);
}
.event > :not(.t) {
  min-width: 0;
  overflow-wrap: anywhere;
}
.event:last-child {
  border-bottom: 0;
}
.event .t {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.empty {
  color: var(--muted);
  font-size: 14px;
  padding: 18px;
  text-align: center;
  border: 1px dashed var(--line2);
  border-radius: 12px;
}
.err {
  color: var(--bad);
  font-size: 14px;
  background: var(--bad-bg);
  border-radius: 10px;
  padding: 10px 14px;
}
.err:empty {
  display: none;
}
.note {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.updbar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 18px;
  border-radius: 16px;
  border: 1px solid var(--accent-ring);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}
.sub {
  font-family: 'Anuphan', system-ui, sans-serif;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
  margin-top: 2px;
  white-space: normal;
}
td.mono,
td.nw,
span.nw {
  white-space: nowrap;
}
td > .mono:not(.small) {
  white-space: nowrap;
} /* dates, groups and counts stay on one line; long rule text (.small) still wraps */
td.site {
  word-break: break-all;
  min-width: 180px;
}
td.app {
  min-width: 170px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 4px 0;
}
.chips .chip {
  white-space: normal;
  word-break: break-all;
  font-weight: 500;
  border-color: var(--line);
}
.risk {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--row);
}
.risk:last-child {
  border-bottom: 0;
}
/* finished items are toned down with readable grey text, not opacity (which fails contrast) */
.risk.done .title,
.risk.done .title b {
  text-decoration: line-through;
  color: var(--muted);
}
.risk.done .chip {
  background: var(--idle-bg);
  color: var(--idle);
}
.risk input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--accent);
  margin: 12px;
}
.chart {
  width: 100%;
  height: 190px;
}

/* ---------- phase 2 pages ---------- */
.small {
  font-size: 12px;
}
.ports {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: 10px;
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}
.port {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  transition: border-color 0.15s;
}
.port:hover {
  border-color: var(--line2);
}
.port.warn {
  border-color: var(--warn-line);
}
.port.down {
  background: var(--sunk);
  border-style: dashed;
}
.port.down .port-name,
.port.down b {
  color: var(--muted);
}
.port-name {
  font-size: 13px;
  color: var(--text2);
  min-height: 38px;
  overflow-wrap: anywhere;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sunk);
}
.tab {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition:
    background-color 0.15s,
    color 0.15s;
}
.tab:hover {
  color: var(--strong);
}
.tab.on {
  background: var(--card);
  color: var(--strong);
  font-weight: 600;
  box-shadow: var(--shadow);
}
.tl-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tl-day {
  width: 48px;
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--text2);
}
.tl {
  position: relative;
  flex: 1 1 auto;
  height: 18px;
  border-radius: 6px;
  background: var(--sunk);
  overflow: hidden;
}
.tl .seg {
  position: absolute;
  top: 0;
  bottom: 0;
  display: block;
}
.topo {
  align-items: center;
  text-align: center;
}
.topo > * {
  flex: 0 0 auto;
}
.nodes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
}
.node {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  text-align: left;
  min-width: 170px;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  background: var(--sunk);
}
.node b {
  display: flex;
  align-items: center;
  gap: 8px;
}
.node.main {
  border: 2px solid var(--accent);
  align-items: center;
  text-align: center;
  background: var(--accent-soft);
}
.lm {
  overflow-x: auto;
}
.lm svg {
  display: block;
  width: 100%;
  max-width: 640px;
  min-width: 520px;
  height: auto;
  margin: 0 auto;
}
.lm svg.wide {
  max-width: 940px;
  min-width: 760px;
}
.lm-box {
  fill: var(--sunk);
  stroke: var(--line2);
  stroke-width: 1.5;
}
.lm-box.k-rt {
  fill: var(--accent-soft);
  stroke: var(--accent);
}
.lm-t {
  fill: var(--strong);
  font-size: 14px;
  font-weight: 600;
}
.lm-s {
  fill: var(--muted);
  font-size: 11.5px;
}
.lm-l {
  fill: none;
  stroke: var(--idle-dot);
  stroke-width: 2.5;
}
.lm-l.ok {
  stroke: var(--ok-dot);
}
.lm-l.bad {
  stroke: var(--bad-dot);
  stroke-dasharray: 7 5;
}
.lm-l.q {
  stroke-dasharray: 2 6;
}
.lm-lab {
  fill: var(--text);
  font-size: 11.5px;
}
.lm-labbg {
  fill: var(--card);
  stroke: var(--line);
}
.lm-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: center;
}
.vline {
  width: 2px;
  height: 24px;
  background: var(--line2);
}
.pools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px 24px;
}
.days-card {
  flex: 1 1 220px !important;
  max-width: 320px;
  gap: 4px;
}
.day {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--navfg);
  cursor: pointer;
  font-size: 13px;
  overflow-wrap: anywhere;
  transition: background-color 0.15s;
}
.day:hover {
  background: var(--hover);
}
.day.on {
  background: var(--accent-soft);
  color: var(--strong);
  font-weight: 600;
}
.diff {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
}
.diff > div {
  padding: 3px 12px;
  white-space: pre;
  font-size: 12.5px;
}
.diff-sec {
  background: var(--sunk);
  color: var(--muted);
}
.diff-plus {
  background: var(--ok-bg);
  color: var(--ok);
}
.diff-minus {
  background: var(--bad-bg);
  color: var(--bad);
}
pre.raw {
  margin: 0;
  padding: 14px;
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text2);
  white-space: pre;
}
.bar.grow {
  flex: 1 1 auto;
}
.pre {
  white-space: pre-line;
}
.steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text2);
}
label.risk {
  cursor: pointer;
}

/* ---------- sign-in ---------- */
:root[data-accent='emerald'] {
  --accent: #34d399;
  --accent-text: #34d399;
  --accent-soft: rgba(52, 211, 153, 0.14);
  --accent-ring: rgba(52, 211, 153, 0.42);
}
:root[data-accent='violet'] {
  --accent: #a78bfa;
  --accent-text: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.15);
  --accent-ring: rgba(167, 139, 250, 0.42);
}
:root[data-accent='amber'] {
  --accent: #fbbf24;
  --accent-text: #fbbf24;
  --accent-soft: rgba(251, 191, 36, 0.14);
  --accent-ring: rgba(251, 191, 36, 0.42);
}
:root[data-accent='rose'] {
  --accent: #fb7185;
  --accent-text: #fb7185;
  --accent-soft: rgba(251, 113, 133, 0.15);
  --accent-ring: rgba(251, 113, 133, 0.42);
}
:root[data-theme='light'][data-accent='emerald'] {
  --accent-text: #047857;
}
:root[data-theme='light'][data-accent='violet'] {
  --accent-text: #6d28d9;
}
:root[data-theme='light'][data-accent='amber'] {
  --accent-text: #854d0e;
}
:root[data-theme='light'][data-accent='rose'] {
  --accent-text: #be123c;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.75;
}

.auth {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  overflow: hidden;
  gap: 14px;
  perspective: 1200px;
  z-index: 1;
}
.auth::before,
.auth::after {
  content: '';
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
  filter: blur(72px);
  opacity: 0.5;
  animation: authFloat 11s ease-in-out infinite alternate;
}
.auth::before {
  width: 420px;
  height: 420px;
  top: -110px;
  left: -80px;
  background: radial-gradient(circle, var(--accent-ring), transparent 70%);
}
.auth::after {
  width: 460px;
  height: 460px;
  bottom: -130px;
  right: -90px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.18), var(--accent-soft) 55%, transparent 72%);
  animation-delay: -5.5s;
}
@keyframes authFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(26px, -22px) scale(1.08);
  }
}

.auth-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 950px;
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  border-radius: 26px;
  border: 1px solid var(--line2);
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 65%), var(--card);
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(56, 189, 248, 0.08);
  overflow: hidden;
  animation: authIn 0.42s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
  transition:
    transform 0.1s ease-out,
    filter 0.25s ease,
    border-color 0.25s;
}
.auth-shell:hover {
  border-color: var(--accent-ring);
}
.auth-shell.blurred {
  filter: blur(18px) brightness(0.7);
  pointer-events: none;
  user-select: none;
}
@keyframes authIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.scan-laser {
  position: absolute;
  left: 0;
  right: 0;
  top: -10%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent), #34d399, var(--accent), transparent);
  box-shadow: 0 0 22px 4px var(--accent);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
}
.auth-shell.scanning .scan-laser {
  opacity: 1;
  animation: laserScan 0.72s ease-in-out infinite alternate;
}
@keyframes laserScan {
  0% {
    top: 4%;
  }
  100% {
    top: 96%;
  }
}

.auth-hero {
  position: relative;
  padding: 28px 28px;
  background: radial-gradient(560px 320px at 15% 15%, var(--accent-soft), transparent 70%), linear-gradient(160deg, var(--sunk), transparent);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  overflow: hidden;
}
.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 50% 45%, #000 45%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 45%, transparent 85%);
  pointer-events: none;
}
.auth-hero > * {
  position: relative;
  z-index: 1;
}
.auth-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--live-line);
  background: var(--live-bg);
  color: var(--ok);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.auth-pill .dot {
  animation: pulse 2.4s ease-out infinite;
}
.auth-clock {
  font-size: 11.5px;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
}
.auth-title h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--strong);
  letter-spacing: -0.3px;
}
.auth-title h2 span {
  background: linear-gradient(90deg, var(--accent), #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
:root[data-theme='light'] .auth-title h2 span {
  background: none;
  color: var(--accent-text);
}
.auth-title p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-viz {
  width: 100%;
  height: auto;
  display: block;
  padding: 2px 0;
}
.av-line {
  stroke: var(--line2);
  stroke-width: 2;
  stroke-dasharray: 6 5;
}
.av-flow {
  stroke: var(--accent);
  animation: avDash 14s linear infinite;
  transition: stroke-width 0.2s;
}
.av-flow.d2 {
  animation-direction: reverse;
  stroke: #34d399;
}
.av-flow.d3 {
  animation-duration: 11s;
}
.av-flow.d4 {
  animation-direction: reverse;
  animation-duration: 16s;
  stroke: #34d399;
}
.av-flow.boost {
  stroke-width: 3.5;
  animation-duration: 2s !important;
}
@keyframes avDash {
  to {
    stroke-dashoffset: -220;
  }
}
.av-node {
  cursor: pointer;
}
.av-node rect {
  fill: var(--card);
  stroke: var(--line2);
  stroke-width: 1.5;
  transition:
    stroke 0.2s,
    fill 0.2s;
}
.av-node:hover rect,
.av-node.active rect {
  stroke: var(--accent);
  fill: var(--card-hi);
}
.av-dot-ok {
  fill: var(--ok-dot);
}
.av-t {
  fill: var(--strong);
  font-size: 12.5px;
  font-weight: 700;
}
.av-s {
  fill: var(--muted);
  font-size: 10.5px;
}
.av-hub {
  cursor: pointer;
}
.av-radar {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-dasharray: 26 60;
  transform-origin: 210px 78px;
  animation: spin 5s linear infinite;
  opacity: 0.75;
}
.av-pulse {
  fill: var(--accent-soft);
  stroke: var(--accent-ring);
  stroke-width: 1.5;
  transform-origin: 210px 78px;
  animation: avPulse 3s ease-in-out infinite;
}
@keyframes avPulse {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.12);
    opacity: 0.25;
  }
}
.av-core {
  fill: var(--card-hi);
  stroke: var(--accent);
  stroke-width: 2.2;
  transition: transform 0.2s;
  transform-origin: 210px 78px;
}
.av-hub:hover .av-core {
  transform: scale(1.08);
}
.av-ct {
  fill: var(--strong);
  font-size: 11.5px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.5px;
}
.av-cs {
  fill: var(--accent-text);
  font-size: 9.5px;
  font-family: 'JetBrains Mono', monospace;
}
.av-pkt {
  fill: var(--accent);
  filter: drop-shadow(0 0 4px var(--accent));
}
.av-pkt.g {
  fill: #34d399;
  filter: drop-shadow(0 0 4px #34d399);
}

.hb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 12px;
}
.hb-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
}
.hb-spark {
  width: 52px;
  height: 20px;
  flex: 0 0 auto;
}
.hb-spark polyline {
  fill: none;
  stroke: var(--ok-dot);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hb-text {
  color: var(--muted);
  line-height: 1.35;
}
.hb-text b {
  color: var(--strong);
}
.hb-ms {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ok-bg);
  border: 1px solid var(--live-line);
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.ping-btn {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--accent-ring);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition:
    transform 0.12s,
    background-color 0.15s,
    color 0.15s;
}
.ping-btn:hover {
  background: var(--accent);
  color: var(--on-accent);
}
.ping-btn:active {
  transform: scale(0.96);
}

.auth-feats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.auth-feat {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 12px;
  transition:
    border-color 0.18s,
    transform 0.18s;
}
.auth-feat:hover {
  border-color: var(--accent-ring);
  transform: translateY(-1px);
}
.auth-feat svg {
  color: var(--accent-text);
  flex: 0 0 auto;
  margin-top: 2px;
}
.auth-feat b {
  display: block;
  font-size: 12px;
  color: var(--strong);
  margin-bottom: 1px;
}
.auth-feat span {
  color: var(--muted);
  font-size: 11px;
}

.auth-box.card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 28px 32px;
  gap: 14px;
  justify-content: center;
  background: transparent;
  position: relative;
}
.auth-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.auth-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  flex-wrap: wrap;
}
.auth-tools .btn.small {
  min-height: 29px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  gap: 5px;
}

.swatches {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--sunk);
  border: 1px solid var(--line);
}
.swatch {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition:
    border-color 0.15s,
    background-color 0.15s;
}
.swatch::before {
  content: '';
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--swatch-color);
}
.swatch:hover {
  background: var(--hover);
}
.swatch.on {
  border-color: var(--strong);
}
.sw-cyan {
  --swatch-color: #38bdf8;
}
.sw-emerald {
  --swatch-color: #34d399;
}
.sw-violet {
  --swatch-color: #a78bfa;
}
.sw-amber {
  --swatch-color: #fbbf24;
}
.sw-rose {
  --swatch-color: #fb7185;
}

.auth-brand {
  padding: 2px 0 4px;
  gap: 14px;
}
.auth-brand .logo {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #0284c7);
  box-shadow: 0 10px 24px -6px var(--accent-ring);
}
.auth-brand .logo::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 17px;
  border: 1.5px dashed var(--accent-ring);
  animation: spin 12s linear infinite;
  pointer-events: none;
}
.auth-brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--strong);
  letter-spacing: -0.2px;
}
.auth-brand small {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.lbl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.lbl-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pw-count {
  font-size: 11px;
  color: var(--dim);
}
.caps-warn {
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
}

.eq-wrap {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}
.eq-bar {
  width: 3px;
  height: 4px;
  border-radius: 99px;
  background: var(--dim);
  transition:
    height 0.12s ease,
    background-color 0.12s;
}
.eq-bar.on {
  background: var(--accent);
}
.pw-meter {
  height: 3px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
  margin-top: 2px;
}
.pw-meter > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #34d399);
  transition: width 0.2s ease;
}

.inp-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.inp-ico {
  position: absolute;
  left: 13px;
  color: var(--dim);
  display: inline-flex;
  pointer-events: none;
  transition: color 0.15s;
}
.inp-wrap:focus-within .inp-ico {
  color: var(--accent-text);
}
.auth input.field {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  background: var(--sunk);
}
.auth input.field:focus {
  background: var(--card);
}
.auth input.field.has-ico {
  padding-left: 40px;
}
.auth input.field.has-act {
  padding-right: 42px;
}
.inp-act {
  position: absolute;
  right: 6px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 0.15s,
    color 0.15s;
}
.inp-act:hover,
.inp-act.on {
  background: var(--hover);
  color: var(--accent-text);
}

.auth-submit {
  min-height: 48px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1px;
  background: linear-gradient(135deg, var(--accent), #0284c7);
  box-shadow: 0 10px 24px -8px var(--accent-ring);
  margin-top: 2px;
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    filter 0.15s;
}
.auth-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -8px var(--accent-ring);
}
.auth-submit svg {
  transition: transform 0.18s ease;
}
.auth-submit:hover:not(:disabled) svg {
  transform: translateX(4px);
}
.spin {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2.2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  animation: spin 0.65s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.shake {
  animation: authShake 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes authShake {
  10%,
  90% {
    transform: translateX(-3px);
  }
  20%,
  80% {
    transform: translateX(5px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-7px);
  }
  40%,
  60% {
    transform: translateX(7px);
  }
}

.auth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--dim);
  flex-wrap: wrap;
}
.kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line2);
  background: var(--sunk);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--muted);
}

.shield-msg {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: rgba(7, 11, 19, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.shield-msg.on {
  display: flex;
}
.shield-box {
  padding: 18px 28px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--accent-ring);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.shield-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--strong);
  margin-bottom: 4px;
}

/* ---------- Cyber-NOC telemetry command bar, LED matrix, DDM & inline rename ---------- */
.cmd-bar {
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--sunk);
  box-shadow: none;
}
.vitals-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.vital-pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-hi);
  font-size: 12px;
  color: var(--text2);
  overflow-wrap: anywhere;
}
.vital-pill b {
  color: var(--strong);
  font-weight: 700;
}
.vital-pill .sep {
  color: var(--dim);
}
.cmd-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}
.btn.icon-pill {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  gap: 6px;
}
.btn.icon-pill.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* Card spotlight & subtle glow */
.card,
.kpi,
.wan {
  position: relative;
  overflow: hidden;
}
.card::after,
.kpi::after,
.wan::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, -200px) var(--my, -200px), rgba(56, 189, 248, 0.07), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s;
}
.card:hover::after,
.kpi:hover::after,
.wan:hover::after {
  opacity: 1;
}
.card-hd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-hd h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--strong);
}

/* Switch Port LED Matrix Strip */
.sw-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 16px;
}
@media (max-width: 1220px) {
  .sw-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .sw-strip {
    grid-template-columns: 1fr;
  }
}
.sw-mini {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--sunk);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition:
    border-color 0.18s,
    transform 0.15s,
    background-color 0.18s;
  text-align: left;
}
.sw-mini:hover {
  border-color: var(--accent-ring);
  background: var(--card-hi);
  transform: translateY(-2px);
}
.sw-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sw-mini-top b {
  font-size: 13.5px;
  color: var(--strong);
  display: flex;
  align-items: center;
  gap: 6px;
}
.led-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 2px;
}
.led {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background: var(--line);
  border: 1px solid var(--line2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  color: var(--dim);
  position: relative;
}
.led.up {
  background: rgba(52, 211, 153, 0.22);
  border-color: var(--ok-dot);
  color: var(--ok);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.35);
}
.led.fast {
  background: rgba(56, 189, 248, 0.24);
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 0 8px var(--accent-ring);
}
.led.poe::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: #fbbf24;
}

/* Per-Core CPU & SFP+ Optical DDM */
.core-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.core-box {
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--sunk);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.core-box-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.opt-card {
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--sunk);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.opt-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 22%, #10b981 35%, #10b981 82%, #f59e0b 92%, #ef4444 100%);
}
.opt-bar > .opt-pin {
  position: absolute;
  top: -3px;
  width: 6px;
  height: 14px;
  border-radius: 3px;
  background: #ffffff;
  border: 1.5px solid #0f172a;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
  transform: translateX(-50%);
}

/* Watchlist Cards */
.watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
  gap: 10px;
}
.watch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--sunk);
  transition:
    border-color 0.15s,
    background-color 0.15s;
}
.watch-item:hover {
  border-color: var(--line2);
  background: var(--hover);
}
.watch-item.off {
  border-color: var(--bad-dot);
  background: var(--bad-bg);
}
.watch-info {
  min-width: 0;
  flex: 1 1 auto;
}
.watch-info b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.watch-info small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

/* Inline Custom Rename Button & Modal */
.edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  margin-left: 5px;
  border-radius: 6px;
  border: 1px solid var(--line2);
  background: var(--sunk);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  vertical-align: middle;
  transition:
    background-color 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.1s;
}
.edit-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent-ring);
  transform: scale(1.04);
}
.custom-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 10.5px;
  font-weight: 600;
  margin-left: 4px;
}
.rename-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(7, 11, 19, 0.68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.rename-dialog {
  width: 100%;
  min-width: 0;
  max-width: 440px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-radius: 20px;
  border: 1px solid var(--accent-ring);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rename-dialog h3 {
  margin: 0;
  font-size: 17px;
  color: var(--strong);
  display: flex;
  align-items: center;
  gap: 8px;
}
.rename-dialog .field {
  width: 100%;
}
.rename-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* ---------- Cyber-NOC Bento Grid & Deep Telemetry Showcase ---------- */
.bento-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.bento-hero.wans-2 {
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, 1fr));
}
.health-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}
.health-grid > .ring {
  flex: 0 0 132px;
}
.health-list {
  flex: 1 1 160px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-score {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--strong);
}

.wan-card {
  position: relative;
  overflow: hidden;
}
.wan-card.inuse {
  border-color: var(--accent-ring);
  background: radial-gradient(280px circle at 90% 0%, var(--accent-soft), transparent 70%), var(--card);
}
.wan-card.inuse::before {
  content: 'เส้นหลักตอนนี้';
  position: absolute;
  top: 0;
  right: 0;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 0 0 0 10px;
}
.wan-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--sunk);
  border: 1px solid var(--line);
}
.wan-m-lbl {
  font-size: 10.5px;
  color: var(--muted);
}
.wan-m-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--strong);
  line-height: 1.2;
}
.wan-speeds {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
}
.spd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wan-quota {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}

.section-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--accent-soft), transparent 85%);
  border-left: 4px solid var(--accent);
  margin: 16px 0 10px;
  flex-wrap: wrap;
}
.section-divider b {
  font-size: 14.5px;
  color: var(--strong);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-divider span {
  font-size: 12px;
  color: var(--muted);
}

.sw-mini.active-sw {
  border-color: var(--accent);
  background: var(--card-hi);
  box-shadow: 0 0 0 1px var(--accent-ring);
}
.sw-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sw-tab-btn {
  padding: 7px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--sunk);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.sw-tab-btn:hover {
  background: var(--hover);
  color: var(--strong);
}
.sw-tab-btn.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--strong);
  box-shadow: 0 4px 12px -4px var(--accent-ring);
}
.sw-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faceplate {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--sunk);
  border: 1px solid var(--line2);
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.fp-port {
  width: 52px;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  position: relative;
}
.fp-port.up {
  border-color: var(--live-line);
  background: rgba(16, 185, 129, 0.09);
}
.fp-port.poe {
  border-color: var(--warn-line);
}
.fp-port b {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--strong);
}
.fp-port .w-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: var(--warn);
  font-weight: 600;
}
.fp-port .s-tag {
  font-size: 9px;
  color: var(--ok);
}

.sfp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.sfp-box {
  padding: 11px 13px;
  border-radius: 13px;
  background: var(--sunk);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sfp-box .lbl {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 8px;
}
.sfp-box .val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--strong);
  overflow-wrap: anywhere;
}
.opt-meter {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 25%, #10b981 50%, #10b981 85%, #f59e0b 100%);
  margin-top: 4px;
}
.opt-meter > .opt-pin {
  position: absolute;
  top: -3px;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 6px #000;
  transform: translateX(-50%);
}

.core-grid.ccr-36 {
  grid-template-columns: repeat(9, 1fr);
  gap: 5px;
}
.core-cell {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--sunk);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
}
.core-grid.ccr-36 .core-cell {
  padding: 4px 6px;
  font-size: 10px;
  text-align: center;
}

.row-equal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.row-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.donuts-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
  align-items: start;
}
@media (max-width: 900px) {
  .donuts-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.kpi-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.kpi-pill {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-pill b {
  color: var(--strong);
}
.kpi-pill span {
  color: var(--muted);
}

.chart-tele-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.chart-tele-strip .c-tele-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chart-tele-strip .c-tele-lbl {
  font-size: 11px;
  color: var(--muted);
}
.chart-tele-strip .c-tele-item b {
  font-size: 12.5px;
  color: var(--strong);
  font-family: 'JetBrains Mono', monospace;
}
@media (max-width: 600px) {
  .chart-tele-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.talker-list-compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.talker-row-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--sunk);
  border: 1px solid var(--line);
  font-size: 12px;
  transition: all 0.15s;
}
.talker-row-compact:hover {
  background: var(--hover);
  border-color: var(--accent-ring);
}
.talker-rank {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--dim);
  width: 22px;
  flex-shrink: 0;
}
.talker-id-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1.2;
}
.talker-id-col b {
  font-size: 12px;
  color: var(--strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.talker-id-col small {
  font-size: 10.5px;
  color: var(--muted);
}
.talker-bar-col {
  flex: 1;
  min-width: 50px;
}
.talker-val-col {
  font-size: 11.5px;
  font-weight: 600;
  text-align: right;
  min-width: 65px;
  flex-shrink: 0;
}

.vlan-donut-layout {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 0;
}
.donut-svg-wrap {
  position: relative;
  width: 136px;
  height: 136px;
  flex-shrink: 0;
}
.donut-svg {
  transform: rotate(-90deg);
  overflow: visible;
}
.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.donut-center-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--strong);
  line-height: 1;
  display: block;
}
.donut-center-lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 2px;
}
.vlan-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  flex: 1;
}
.vlan-legend-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--sunk);
  border: 1px solid var(--line);
}
.vlan-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.vlan-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.vlan-info b {
  font-size: 12px;
  color: var(--strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 768px) {
  .vlan-donut-layout {
    flex-direction: column;
    align-items: flex-start;
  }
}

.tbl-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--sunk);
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}
table.tbl th {
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}
table.tbl td {
  padding: 8.5px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.tbl tr:last-child td {
  border-bottom: 0;
}
table.tbl tr:hover td {
  background: var(--hover);
}

.label-input {
  background: var(--card);
  border: 1px dashed var(--line2);
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--strong);
  width: 175px;
}
.label-input:focus {
  border-style: solid;
  border-color: var(--focus);
}

.fs-10 {
  font-size: 10px;
}
.fs-10-5 {
  font-size: 10.5px;
}
.fs-11 {
  font-size: 11px;
}
.fs-11-5 {
  font-size: 11.5px;
}
.fs-12 {
  font-size: 12px;
}
.fs-12-5 {
  font-size: 12.5px;
}
.fs-13 {
  font-size: 13px;
}
.fs-15 {
  font-size: 15px;
}
.fs-17 {
  font-size: 17px;
}
.fs-18 {
  font-size: 18px;
}
.fw-400 {
  font-weight: 400;
}
.fw-600 {
  font-weight: 600;
}
.fw-700 {
  font-weight: 700;
}
.c-strong {
  color: var(--strong);
}
.c-ok-text {
  color: var(--ok);
}
.c-warn-text {
  color: var(--warn);
}
.c-accent-text {
  color: var(--accent-text);
}
.c-muted {
  color: var(--muted);
}
.c-amber {
  color: var(--warn);
}
.gap-14 {
  gap: 14px;
}
.kpi-4 {
  grid-template-columns: repeat(4, 1fr) !important;
}
.h-44 {
  width: 100%;
  height: 44px;
  display: block;
}
.h-175 {
  width: 100%;
  height: 175px;
  display: block;
}
.border-accent {
  border-color: var(--accent-ring) !important;
}
.bg-warn-soft {
  background: rgba(251, 191, 36, 0.07);
}
.mt-2 {
  margin-top: 2px;
}
.mt-4 {
  margin-top: 4px;
}
.mr-6 {
  margin-right: 6px;
}
.chip-xs {
  font-size: 10px;
  padding: 1px 6px;
}

@media (max-width: 1220px) {
  .bento-hero,
  .bento-hero.wans-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .row-2,
  .row-equal {
    grid-template-columns: 1fr;
  }
}

/* ---------- wide screens: menu and page header stay in view ---------- */
@media (min-width: 821px) {
  .nav {
    flex: 0 0 280px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    align-self: flex-start;
    scrollbar-width: thin;
  }
  .top {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: -20px -28px 0;
    padding: 16px 28px 14px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }
}

/* ---------- phones and narrow windows (menu sits above the page): it folds away behind a button ---------- */
@media (max-width: 820px) {
  .shell {
    flex-direction: column;
  }
  .main {
    width: 100%;
    flex: 1 1 auto;
  }
  .nav {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    padding: 12px 12px 14px;
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav .menu-btn {
    display: inline-flex;
  }
  .nav:not(.open) > div:not(.brand) {
    display: none;
  }
  .nav-item.on::before {
    left: -12px;
  }
  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
  .auth-hero {
    padding: 24px 22px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .auth-box.card {
    padding: 24px 22px;
  }
  .auth-feats {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .main {
    padding: 16px;
  }
  .tools > label.lbl {
    flex: 1 1 100%;
  }
  .tools > label.lbl > .field {
    width: 100%;
  }
  form.tools > .btn {
    flex: 1 1 100%;
  }
  .top h1 {
    font-size: 22px;
  }
  .card {
    padding: 16px;
    border-radius: 16px;
  }
  .kpi .v {
    font-size: 24px;
  }
  .bento-hero,
  .bento-hero.wans-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .sfp-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .core-grid.ccr-36 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Multi-Site Onboarding Wizard & Telemetry Banners ---------- */
.wizard-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 9, 18, 0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.15s ease-out;
}
.wizard-dialog {
  width: 100%;
  max-width: 680px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 20px;
  border: 1px solid var(--accent-ring);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wizard-dialog h3 {
  margin: 0;
  font-size: 18px;
  color: var(--strong);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}
.wizard-dialog h3 .btn {
  white-space: nowrap;
  padding: 0 10px;
}
.wizard-field-grid,
.wizard-address-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
}
.wizard-field-grid > *,
.wizard-address-grid > * {
  min-width: 0;
}
.wizard-address-grid {
  grid-template-columns: 3fr 1fr;
}
.wizard-steps-bar {
  display: flex;
  border-radius: 12px;
  background: var(--sunk);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 6px;
}
.w-step-item {
  flex: 1;
  padding: 8px 10px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.w-step-item:last-child {
  border-right: none;
}
.w-step-item.current {
  color: var(--accent);
  background: var(--card);
  border-bottom: 2px solid var(--accent);
  font-weight: 700;
}
.w-step-item.done {
  color: var(--ok);
}
.w-step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--line2);
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.w-step-item.current .w-step-num {
  background: var(--accent);
  color: var(--on-accent);
}
.w-step-item.done .w-step-num {
  background: var(--ok);
  color: #041019;
}
.wizard-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13px;
}
.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.fingerprint-card {
  background: var(--sunk);
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent-text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-wrap: anywhere;
}

.banner-offline {
  border-radius: 14px;
  padding: 14px 18px;
  background: var(--bad-bg);
  border: 1px solid var(--bad-border, rgba(248, 113, 113, 0.35));
  color: var(--bad);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.banner-stale {
  border-radius: 14px;
  padding: 14px 18px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border, rgba(251, 191, 36, 0.35));
  color: var(--warn);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.wizard-dialog {
  min-width: 0;
  overflow-x: hidden;
}
.wizard-body,
.wizard-body > div,
.wizard-body select,
.wizard-body input {
  min-width: 0;
  max-width: 100%;
}
.wizard-dialog pre {
  overflow-x: auto;
  max-width: 100%;
}
@media (max-width: 600px) {
  .wizard-dialog {
    padding: 16px;
  }
  .w-step-item {
    min-width: 0;
    padding: 6px 2px;
    flex-direction: column;
    font-size: 10px;
    gap: 3px;
  }
  .wizard-dialog .field {
    width: 100%;
  }
  .wizard-field-grid,
  .wizard-address-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .wizard-actions {
    gap: 8px;
    flex-wrap: wrap;
  }
}

/* Phone: summary tiles two per row (was one tile per row, a long scroll) */
@media (max-width: 650px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }
  .kpi-grid .kpi {
    padding: 12px 13px;
  }
  .kpi-grid .kpi .v {
    font-size: 21px;
  }
}

.disk-capacity {
  display: block;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  appearance: none;
  background: var(--line);
  accent-color: #22c55e;
}
.disk-capacity::-webkit-progress-bar {
  background: var(--line);
}
.disk-capacity::-webkit-progress-value {
  background: #22c55e;
}
.disk-capacity::-moz-progress-bar {
  background: #22c55e;
}
.disk-capacity.warn {
  accent-color: #f59e0b;
}
.disk-capacity.full {
  accent-color: #ef4444;
}
.disk-capacity.warn::-webkit-progress-value {
  background: #f59e0b;
}
.disk-capacity.full::-webkit-progress-value {
  background: #ef4444;
}
.disk-capacity.unknown {
  opacity: 0.4;
}
.disk-scale {
  font-size: 10px;
}

/* Traffic shares use the full byte total, including items outside the top five. */
.usage-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 8px 0;
}
.usage-chart {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--sunk);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.usage-chart h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--strong);
}
.usage-chart p {
  margin: 5px 0 0;
}
.usage-chart-body {
  display: grid;
  grid-template-columns: minmax(130px, 0.85fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: center;
}
.usage-donut {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  margin: auto;
  overflow: visible;
}
.usage-track,
.usage-slice {
  fill: none;
  stroke-width: 23;
}
.usage-track {
  stroke: var(--line);
}
.usage-slice {
  stroke: var(--usage-color);
  transition: stroke-width 0.15s;
}
.usage-slice:hover {
  stroke-width: 29;
}
.usage-total {
  fill: var(--strong);
  font-family: 'Space Grotesk', 'Anuphan', sans-serif;
  font-size: 23px;
  font-weight: 700;
}
.usage-caption {
  fill: var(--muted);
  font-size: 11px;
}
.usage-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.usage-key {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.usage-swatch {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex: 0 0 auto;
  background: var(--usage-color);
}
.usage-key-name {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.usage-key-name b,
.usage-key-name a {
  font-weight: 500;
  color: var(--text);
}
.usage-key-name a:hover {
  color: var(--accent-text);
}
.usage-key-name > span {
  color: var(--muted);
  font-size: 11px;
}
.usage-percent {
  color: var(--strong);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}
.usage-percent small {
  font-size: 10px;
  margin-left: 2px;
  color: var(--muted);
}
.usage-footnote {
  font-size: 11px;
  color: var(--muted);
  margin-top: auto !important;
}
.usage-tone-0 {
  --usage-color: #38bdf8;
}
.usage-tone-1 {
  --usage-color: #a78bfa;
}
.usage-tone-2 {
  --usage-color: #34d399;
}
.usage-tone-3 {
  --usage-color: #fbbf24;
}
.usage-tone-4 {
  --usage-color: #fb7185;
}
.usage-tone-5 {
  --usage-color: #94a3b8;
}
@media (max-width: 1220px) {
  .usage-charts {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 700px) {
  .usage-chart {
    padding: 16px;
  }
  .usage-chart-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
}
/* UniFi shares the console's type, palette and table breakpoints. */
.unifi-select,
.unifi-sensors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block: 12px;
}
.unifi-select .btn {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: left;
}
.unifi-sensors > span {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.unifi-json {
  max-width: 100%;
  max-height: 560px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre;
}

.ap-metric-chart {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
}

/* Readable AP insights, responsive within the existing console layout. */
.ap-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.ap-chart-grid > section {
  min-width: 0;
}
.ap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-block: 10px;
  font-size: 12px;
  color: var(--text2);
}
.ap-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  overflow-wrap: anywhere;
}
.ap-timeline {
  list-style: none;
  padding-left: 12px;
  border-left: 2px solid var(--line2);
  margin-top: 20px;
}
.ap-timeline li {
  padding: 0 0 18px 12px;
  overflow-wrap: anywhere;
}
.card meter {
  width: 150px;
  max-width: 100%;
  height: 18px;
}
@media (max-width: 1100px) {
  .ap-chart-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== MODERN DE-CLUTTERED DASHBOARD & DONUT ANALYTICS ==================== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.kpi-card:hover {
  border-color: var(--accent-ring);
  transform: translateY(-2px);
}
.kpi-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}
.kpi-card.ok::before {
  background: var(--ok-dot);
}
.kpi-card.warn::before {
  background: var(--warn-dot);
}
.kpi-card.purple::before {
  background: #8b5cf6;
}
.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.kpi-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.kpi-value {
  font-family: 'Space Grotesk', 'Anuphan', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--strong);
  line-height: 1.1;
}
.kpi-sub {
  font-size: 11.5px;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 5px;
}
.kpi-sub.up {
  color: var(--ok-dot);
}
.kpi-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-card.ok .kpi-badge {
  background: var(--ok-bg);
  color: var(--ok-dot);
}
.kpi-card.warn .kpi-badge {
  background: var(--warn-bg);
  color: var(--warn-dot);
}
.kpi-card.purple .kpi-badge {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.donuts-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 8px 0;
}
.chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.chart-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--strong);
  margin: 0;
}
.chart-header p {
  font-size: 11.5px;
  color: var(--muted);
  margin: 2px 0 0;
}
.chart-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--accent-ring);
  white-space: nowrap;
}

.donut-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 6px 0;
}
.donut-svg-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  flex-shrink: 0;
}
.donut-svg {
  transform: rotate(-90deg);
  overflow: visible;
}
.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.donut-center-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--strong);
  display: block;
  line-height: 1.1;
}
.donut-center-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.legend-item:hover {
  background: var(--hover);
}
.legend-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-name {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.legend-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.split-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  margin: 8px 0;
}
.split-row > *,
.chart-card,
.switch-board,
.ports-faceplate {
  min-width: 0;
  max-width: 100%;
}
.switch-tabs {
  max-width: 100%;
}
.switch-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.switch-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.switch-tab-btn {
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--sunk);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  transition:
    background 0.15s,
    border-color 0.15s;
  text-align: left;
}
.switch-tab-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.switch-tab-count {
  white-space: nowrap;
}
.switch-tab-btn:hover {
  background: var(--hover);
  color: var(--strong);
}
.switch-tab-btn.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-ring);
}

.ports-faceplate {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ports-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(44px, 100%), 1fr));
  gap: 6px;
}
.mini-port {
  min-width: 0;
  min-height: 44px;
  aspect-ratio: 1;
  padding: 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.mini-port-label {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mini-port:hover {
  border-color: var(--accent);
}
.mini-port[aria-pressed='true'] {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.port-preview {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
  min-width: 0;
}
.mini-port.up {
  background: var(--ok-bg);
  border-color: var(--ok-dot);
  color: var(--ok);
}
.mini-port.poe {
  background: var(--warn-bg);
  border-color: var(--warn-dot);
  color: var(--warn);
}
.mini-port.sfp {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.mini-port.sfp-slot {
  border-style: dashed;
  border-color: var(--accent);
}
.mini-port.sfp-slot.up,
.mini-port.sfp-slot.poe,
.mini-port.sfp-slot.sfp {
  border-style: solid;
}
.mini-port .p-kind {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 8px;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--accent-text);
}
.p-leg-sfp {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1px dashed var(--accent);
  border-radius: 2px;
}
.mini-port .p-led {
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background: currentColor;
  margin-top: 1.5px;
}
.ports-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.port-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-width: 0;
}
.p-leg {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.ports-footer > a {
  min-width: 0;
  overflow-wrap: anywhere;
  padding-block: 8px;
}

/* Interaction light: no scaling of port cells or motion during telemetry refresh. */
.chart-card,
.gauge-box,
.branch-card {
  position: relative;
}
.chart-card::after,
.kpi-card::after,
.gauge-box::after,
.branch-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 65%);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.chart-card:focus-within::after,
.gauge-box:focus-within::after {
  opacity: 0.6;
}
.mini-port {
  transition:
    border-color 0.18s,
    background-color 0.18s,
    box-shadow 0.18s,
    filter 0.18s;
}
.mini-port.up .p-led,
.mini-port.poe .p-led,
.mini-port.sfp .p-led {
  box-shadow: 0 0 6px currentColor;
}
.mini-port[aria-pressed='true'] {
  border-color: var(--accent);
  box-shadow:
    inset 0 0 0 2px var(--accent),
    0 0 12px var(--accent-soft);
}
.switch-tab-btn {
  transition:
    background-color 0.18s,
    border-color 0.18s,
    box-shadow 0.18s;
}
.btn:active:not(:disabled),
.switch-tab-btn:active {
  filter: brightness(1.12);
}
@media (hover: hover) and (pointer: fine) {
  .chart-card:hover::after,
  .kpi-card:hover::after,
  .gauge-box:hover::after,
  .branch-card:hover::after {
    opacity: 1;
  }
  .mini-port:hover {
    box-shadow:
      inset 0 0 0 1px var(--accent-ring),
      0 0 14px var(--accent-soft);
    filter: brightness(1.08);
  }
  .switch-tab-btn:hover {
    box-shadow: 0 3px 12px var(--accent-soft);
  }
}
@media (prefers-reduced-motion: reduce) {
  .chart-card::after,
  .kpi-card::after,
  .gauge-box::after,
  .branch-card::after {
    background: none;
  }
}

.gauges-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.gauge-box {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.gauge-title {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  width: 100%;
  text-align: left;
}
.semi-gauge-wrap {
  width: 120px;
  max-width: 100%;
  min-height: 62px;
  padding-top: 20px;
  position: relative;
  display: grid;
  align-items: end;
  justify-items: center;
}
.semi-gauge-wrap > svg {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 100%;
}
.gauge-center-text {
  position: relative;
  text-align: center;
  min-width: 0;
  overflow-wrap: anywhere;
}
.gauge-center-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--strong);
  line-height: 1;
}
.gauge-center-status {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  font-weight: 500;
  display: block;
  text-align: center;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.gauge-center-status[data-state='error'] {
  color: var(--bad);
}
.gauge-center-status[data-state='warning'] {
  color: var(--warn);
}
@media (max-width: 480px) {
  .gauges-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.alerts-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
  flex: 1 1 300px;
}
.alerts-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.alerts-header > div {
  min-width: 0;
  flex: 1 1 180px;
  overflow-wrap: anywhere;
}
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--sunk);
  border: 1px solid var(--line);
  gap: 12px;
  transition: all 0.15s;
}
.alert-row:hover {
  border-color: var(--accent-ring);
  background: var(--hover);
}
.alert-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.alert-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
}
.alert-icon.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.alert-icon.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.alert-icon.info {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.alert-text b {
  font-size: 12.5px;
  color: var(--strong);
  display: block;
}
.alert-text span {
  font-size: 11px;
  color: var(--muted);
}
.alert-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
}

@media (max-width: 1220px) {
  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .donuts-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .split-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==================== COMPACT SPACE-OPTIMIZED TELEMETRY & TALKERS ==================== */
.chart-telemetry-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.c-tele-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.c-tele-lbl {
  font-size: 10.5px;
  color: var(--muted);
}
.c-tele-item b {
  font-size: 12.5px;
  color: var(--strong);
}

.talker-compact-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.talker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--sunk);
  border: 1px solid var(--line);
  font-size: 12px;
  transition: all 0.15s;
}
.talker-row:hover {
  background: var(--hover);
  border-color: var(--accent-ring);
}
.talker-rank {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--dim);
  width: 20px;
  flex-shrink: 0;
}
.talker-col-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1.2;
}
.talker-col-info b {
  font-size: 12px;
  color: var(--strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.talker-col-info small {
  font-size: 10.5px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}
.talker-col-bar {
  flex: 1;
  min-width: 60px;
}
.talker-bytes {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent-text);
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
  min-width: 65px;
}

.member-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.member-form .lbl {
  min-width: 0;
}
.member-form .field {
  width: 100%;
  min-width: 0;
}
.member-form fieldset {
  grid-column: 1/-1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 16px;
  min-width: 0;
}
.member-form fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.member-form .note {
  grid-column: 1/-1;
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .member-form {
    grid-template-columns: 1fr;
  }
}

/* MFA secrets stay local to the authenticated page; wrap on narrow screens. */
.mfa-codes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 10px;
  margin: 16px 0;
}
.mfa-codes code,
.mfa-secret {
  overflow-wrap: anywhere;
  user-select: all;
}
.mfa-codes code {
  display: block;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* Fleet Multi-Site Grid & Branch Cards */
.fleet-section {
  margin-top: 14px;
  margin-bottom: 14px;
}
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.branch-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 3px solid var(--accent);
  transition: all 0.2s;
}
.branch-card:hover {
  border-top-color: var(--ok);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.branch-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.branch-body {
  background: var(--sunk);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12px;
}
.branch-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.branch-drill-btn {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  color: var(--accent-text);
  border-color: var(--accent);
  cursor: pointer;
}
.branch-drill-btn:hover {
  background: var(--accent-soft);
}
.c-ok-text {
  color: var(--ok);
  font-weight: 600;
}
.c-warn-text {
  color: var(--warn);
  font-weight: 600;
}

.mfa-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}
.mfa-form > .note,
.mfa-form > .mfa-ack {
  grid-column: 1/-1;
}
.mfa-form .mfa-ack {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}
.mfa-form .mfa-ack input {
  flex: 0 0 auto;
  margin-top: 4px;
}
.mfa-form > .btn {
  justify-self: start;
}
@media (max-width: 760px) {
  .mfa-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Static presentation extracted from trusted templates for strict CSP compatibility. */
[data-static-css='s00f75804ea16'] {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
[data-static-css='s0560631d2804'] {
  font-size: 13px;
  font-weight: 600;
  color: var(--strong);
  margin-top: 2px;
}
[data-static-css='s097ae647c22f'] {
  color: var(--accent);
}
[data-static-css='s0cd38a099221'] {
  font-size: 14px;
  font-weight: 700;
  color: var(--strong);
  margin-top: 2px;
}
[data-static-css='s0ee7f66ad9c0'] {
  margin-top: 12px;
}
[data-static-css='s1d436efc1f88'] {
  margin-top: 6px;
}
[data-static-css='s311c619ca0b6'] {
  display: flex;
  align-items: center;
  gap: 6px;
}
[data-static-css='s315dd25e8a93'] {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}
[data-static-css='s33ee29812798'] {
  font-size: 11px;
}
[data-static-css='s3a07a2839079'] {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--sunk);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
[data-static-css='s3b8c3e7bd728'] {
  font-size: 12px;
  padding: 4px 12px;
}
[data-static-css='s3d20931827cd'] {
  font-size: 11px;
  min-width: 68px;
}
[data-static-css='s3ffece8a251d'] {
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 600;
}
[data-static-css='s43a97fe4943c'] {
  margin-top: 8px;
}
[data-static-css='s4ac55f75094a'] {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
[data-static-css='s4c35263b0aec'] {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
[data-static-css='s5574ae352acc'] {
  color: var(--warn-dot);
}
[data-static-css='s6b4e3a04dc25'] {
  font-size: 10px;
  padding: 2px 6px;
}
[data-static-css='s6b9936f25395'] {
  font-size: 13px;
  color: var(--muted);
}
[data-static-css='s6d936361de22'] {
  display: flex;
  gap: 14px;
  margin: 6px 0;
}
[data-static-css='s795d1d2d5c8f'] {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}
[data-static-css='s79ab00ef111b'] {
  font-size: 10px;
}
[data-static-css='s7b8fb0261aa6'] {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
[data-static-css='s83725d2c6e00'] {
  flex: 1;
}
[data-static-css='s8a2c7566c231'] {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
[data-static-css='s8a9c212d4e9c'] {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
[data-static-css='s8b8522c0b7f1'] {
  font-size: 11px;
  color: var(--dim);
}
[data-static-css='s8e26c5f7a105'] {
  margin-bottom: 8px;
}
[data-static-css='s98bc2e8d8c70'] {
  color: var(--warn);
}
[data-static-css='s9ccc4ca9d661'] {
  width: 100%;
}
[data-static-css='s9d0b23f5fa44'] {
  font-size: 13px;
  font-weight: 700;
}
[data-static-css='s9ecde7be31e8'] {
  height: 130px;
}
[data-static-css='s9f836306f300'] {
  padding: 4px 8px;
  font-size: 12px;
}
[data-static-css='sa25c06091ac1'] {
  grid-column: 1/-1;
  text-align: center;
  padding: 12px;
}
[data-static-css='sa3970b9f8a9d'] {
  font-size: 15px;
}
[data-static-css='sa6fb384a88ae'] {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
[data-static-css='sad90a0345598'] {
  margin: 0;
  padding: 12px 14px;
}
[data-static-css='sb0455c230f23'] {
  color: var(--dim);
}
[data-static-css='sb0ac710e00f5'] {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ok);
  cursor: pointer;
}
[data-static-css='sb0f3435cf6fd'] {
  color: var(--ok);
}
[data-static-css='sb385a625d938'] {
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.95;
}
[data-static-css='sb887bfd5436e'] {
  display: flex;
  gap: 8px;
}
[data-static-css='sbe74bc7ba3b6'] {
  color: var(--accent-text);
}
[data-static-css='sc517046751a3'] {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
[data-static-css='scab27a3ff9dd'] {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
[data-static-css='scca1159ec37a'] {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--strong);
}
[data-static-css='scdcf30d38bbd'] {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok);
}
[data-static-css='sd1dc646165e3'] {
  margin-top: 2px;
}
[data-static-css='sd6a0e87fb27c'] {
  color: var(--text2);
  margin-top: 2px;
}
[data-static-css='sd7283bb72a2c'] {
  font-size: 10.5px;
  color: var(--muted);
}
[data-static-css='sd9e1420b52d2'] {
  background: var(--ok-bg);
  color: var(--ok);
}
[data-static-css='sdaa6981aa970'] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
[data-static-css='sddffdebfebd7'] {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  word-break: break-all;
}
[data-static-css='sdf05155ff054'] {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
[data-static-css='sdf928149c547'] {
  margin-top: 10px;
}
[data-static-css='se17251c59279'] {
  font-weight: 400;
  color: var(--dim);
}
[data-static-css='se1f5ccbf016f'] {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
[data-static-css='se3d2bd01039d'] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
[data-static-css='se826290d5793'] {
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  line-height: 1.5;
}
[data-static-css='sf8e66ac4922d'] {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}
[data-static-css='sff611a7cc059'] {
  font-size: 13px;
  color: var(--ok);
}
[data-probe-result] {
  border-radius: 12px;
  padding: 14px;
  border: 1px solid;
}
[data-probe-result='ok'] {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok);
}
[data-probe-result='bad'] {
  background: var(--bad-bg);
  color: var(--bad);
  border-color: var(--bad);
}
.disk-capacity.unknown {
  opacity: 0.55;
}
.collector .kv {
  gap: 8px;
}
.collector .kv > span:last-child {
  overflow-wrap: anywhere;
}
.branch-body {
  min-width: 0;
}
.branch-body .kv {
  flex-wrap: wrap;
  gap: 8px;
}
.branch-body .note {
  overflow-wrap: anywhere;
}
.fleet-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  min-width: 0;
}
.fleet-grid > .branch-card {
  min-width: 0;
  max-width: 100%;
}
.alert-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.alert-text b {
  overflow-wrap: anywhere;
}

/* 2026-11-15: larger touch targets on small screens */
@media (max-width: 820px) {
  .btn,
  .nav-item,
  .seg button,
  .tab,
  .chip {
    min-height: 44px;
  }
  .swatch {
    width: 44px;
    height: 44px;
  }
}

/* 2026-11-15: readiness lights. Pill + popover in the top bar, and the all-devices table (page "readiness"). */
.rdy-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--dim);
}
.rdy-dot.ok {
  background: var(--ok-dot);
  box-shadow: 0 0 5px var(--ok-dot);
}
.rdy-dot.warn {
  background: var(--warn-dot);
}
.rdy-dot.bad {
  background: var(--bad-dot);
  animation: rdyBlink 1.1s steps(2, start) infinite;
}
.rdy-dot.off {
  background: transparent;
  border: 1.5px solid var(--dim);
}
@keyframes rdyBlink {
  to {
    opacity: 0.25;
  }
}
.rdy-pill {
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  flex-wrap: nowrap;
}
.rdy-pill:hover,
.rdy-pill[aria-expanded='true'] {
  border-color: var(--accent);
}
.rdy-pill.warn {
  border-color: var(--warn-line);
}
.rdy-pill.bad {
  border-color: var(--bad-dot);
  box-shadow: 0 0 0 1px var(--bad-dot) inset;
}
.rdy-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.rdy-dots .rdy-dot {
  width: 7px;
  height: 7px;
}
.rdy-pop {
  flex: 1 1 100%;
  max-width: 380px;
  margin-left: auto;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.15s ease;
}
.rdy-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rdy-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  min-width: 0;
}
.rdy-list li:last-child {
  border-bottom: 0;
}
.rdy-name {
  color: var(--strong);
  white-space: nowrap;
}
.rdy-val {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rdy-val.warn {
  color: var(--warn);
}
.rdy-val.bad {
  color: var(--bad);
}
.rdy-pop-ft {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 6px;
}
.rdy-pop .note {
  overflow-wrap: anywhere;
}
.rdy-sum {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  font-size: 13px;
}
.rdy-sum > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rdy-preview {
  margin: 10px 0;
}
.rdy-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}
.rdy-scroll:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.rdy-table {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.rdy-table th,
.rdy-table td {
  padding: 0;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.rdy-table thead th {
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  background: var(--sunk);
}
.rdy-table tbody tr:last-child > * {
  border-bottom: 0;
}
.rdy-table .rdy-dev {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: var(--card);
  min-width: 130px;
  max-width: 200px;
  box-shadow: 1px 0 0 var(--line);
}
.rdy-table thead .rdy-dev {
  background: var(--sunk);
  z-index: 2;
  padding-left: 12px;
}
.rdy-site th {
  padding: 7px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--sunk);
}
.rdy-site th[scope='colgroup'] {
  position: sticky;
  left: 0;
}
.rdy-dev-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  min-height: 48px;
  padding: 7px 12px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.rdy-dev-btn b {
  color: var(--strong);
  overflow-wrap: anywhere;
}
.rdy-dev-btn small {
  color: var(--muted);
  font-size: 11.5px;
}
.rdy-dev-btn:hover b {
  color: var(--accent-text);
  text-decoration: underline;
}
.rdy-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.rdy-cell .rdy-dot {
  width: 12px;
  height: 12px;
}
.rdy-cell:hover {
  border-color: var(--line2, var(--line));
}
.rdy-cell[aria-pressed='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.rdy-err {
  color: var(--bad);
}
.rdy-na {
  color: var(--dim);
}
@media (prefers-reduced-motion: reduce) {
  .rdy-dot.bad {
    animation: none;
  }
  .rdy-pop {
    animation: none;
  }
}
@media (max-width: 560px) {
  .rdy-pop {
    max-width: none;
    margin-left: 0;
  }
}
/* 2026-11-15: neutral chip + off chips for readiness levels */
.c-off {
  background: var(--sunk);
  color: var(--muted);
}
.rdy-chip.off {
  opacity: 0.8;
}
.rdy-chip.off .d {
  background: var(--dim);
}
/* 2026-11-15: readiness page site filter */
.rdy-sites {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 8px;
}
.rdy-sites .btn {
  min-height: 32px;
}
/* RB5009 faceplate: fixed physical map, separate measured status and accessible port details. */
.router-face-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  scroll-margin-top: 260px;
}
.router-face-scroll-hint {
  display: none;
}
.router-face-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: #080b10;
}
.router-face {
  position: relative;
  width: 100%;
  min-width: 1000px;
  max-width: 1800px;
  margin: 0 auto;
}
.router-face img {
  display: block;
  width: 100%;
  height: auto;
}
.router-face-port {
  position: absolute;
  top: 50.4%;
  left: var(--face-x);
  transform: translate(-50%, -50%);
  width: 6.2%;
  height: 20%;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}
.router-face-port[data-port='ether1'] {
  --face-x: 41.8%;
}
.router-face-port[data-port='ether2'] {
  --face-x: 49%;
}
.router-face-port[data-port='ether3'] {
  --face-x: 56.2%;
}
.router-face-port[data-port='ether4'] {
  --face-x: 63.4%;
}
.router-face-port[data-port='ether5'] {
  --face-x: 71.1%;
}
.router-face-port[data-port='ether6'] {
  --face-x: 78.3%;
}
.router-face-port[data-port='ether7'] {
  --face-x: 85.4%;
}
.router-face-port[data-port='ether8'] {
  --face-x: 92.6%;
}
.router-face-port[data-port='sfp-sfpplus1'] {
  --face-x: 23%;
  width: 8.8%;
}
.router-face-port:hover {
  border-color: #b6c2d4;
  background: rgba(255, 255, 255, 0.04);
}
.router-face-port[aria-pressed='true'] {
  border-color: #7dd3fc;
  box-shadow:
    0 0 0 2px #07111c,
    0 0 14px rgba(56, 189, 248, 0.3);
}
.router-face-port:focus-visible {
  outline: 3px solid #f8fafc;
  outline-offset: 4px;
}
.router-face-led {
  position: absolute;
  left: 3%;
  top: 6%;
  width: 23%;
  height: 16%;
  border: 1px solid #152127;
  border-radius: 2px;
  background: #64748b;
  box-shadow: 0 0 0 1px #080d16;
  pointer-events: none;
}
.router-face-led.secondary {
  left: auto;
  right: 3%;
  background: #64748b;
}
.router-face-port[data-link='up'] .router-face-led:not(.secondary) {
  background: #34d399;
}
.router-face-port[data-link='unknown'] .router-face-led {
  background: #fbbf24;
}
.router-face-port[data-port='sfp-sfpplus1'] .router-face-led {
  left: 83%;
  top: 111%;
  width: 18%;
  height: 11%;
}
.router-face-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--text2);
  font-size: 12px;
}
.face-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.face-key::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 2px;
  border: 1px solid var(--line2);
  background: var(--idle-dot);
}
.face-key.up::before {
  background: var(--ok-dot);
}
.face-key.unknown::before {
  background: var(--warn-dot);
}
.router-face-selected {
  border: 1px solid var(--line2);
  border-left: 3px solid var(--accent-text);
  border-radius: 12px;
  background: var(--sunk);
  padding: 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.router-face-selected h3 {
  margin: 0;
  color: var(--strong);
  font-size: 15px;
  overflow-wrap: anywhere;
}
.router-face-selected .kv {
  flex-wrap: wrap;
  gap: 8px;
}
.router-face-selected .port-name {
  min-height: 0;
}
.router-face-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.router-face-metrics > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-wrap: anywhere;
}
.router-face-metrics span {
  font-size: 12px;
  color: var(--muted);
}
.router-face-metrics b {
  color: var(--strong);
  font-size: 15px;
}
.router-face-all {
  min-width: 0;
}
.router-face-all summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
  color: var(--accent-text);
}
.router-face-all .ports {
  margin-top: 10px;
}
.router-face-fallback {
  display: none;
}
.face-image-failed .router-face-scroll {
  display: none;
}
.face-image-failed .router-face-fallback {
  display: block;
}
@media (max-width: 1450px) {
  .router-face-scroll-hint {
    display: inline;
  }
}
@media (max-width: 820px) {
  .router-face-section {
    scroll-margin-top: 20px;
  }
}
@media (max-width: 600px) {
  .router-face-metrics {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Port relationship view: observed neighbors and learned MACs, never inferred cables. */
.router-face-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.router-face-tools .tools {
  margin: 0;
}
.router-face-tools .btn[aria-pressed='true'] {
  color: var(--accent-text);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.router-face-device {
  position: relative;
}
.face-port-symbol,
.face-port-number {
  display: none;
}
.router-face.trace-view {
  min-width: 1120px;
  aspect-ratio: 2172/950;
  isolation: isolate;
  background: radial-gradient(ellipse at 68% 51%, #123247 0%, #0b1723 43%, #080d15 78%);
}
.trace-view .router-face-device {
  position: absolute;
  top: 11%;
  left: 0;
  width: 100%;
}
.trace-view .router-face-device img {
  opacity: 0.3;
}
.trace-view .router-face-port {
  z-index: 3;
  height: 23%;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #e2e8f0;
}
.trace-view .router-face-port:hover {
  background: none;
}
.trace-view .router-face-led {
  display: none;
}
.trace-view .face-port-symbol {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 3px 7px #020617);
}
.trace-view .face-port-symbol path {
  fill: #111e2c;
  stroke: #aebdca;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.trace-view .face-port-symbol .face-port-pins {
  fill: none;
  stroke: #cbd5e1;
  stroke-width: 1.5;
}
.trace-view [data-link='up'] .face-port-symbol path:first-child {
  fill: #1164a3;
  stroke: #e0f2fe;
}
.trace-view [data-link='unknown'] .face-port-symbol path:first-child {
  fill: #573c1b;
  stroke: #fcd68a;
}
.trace-view .router-face-port[aria-pressed='true'] .face-port-symbol {
  filter: drop-shadow(0 0 7px #38bdf8);
}
.trace-view .router-face-port[aria-pressed='true'] .face-port-symbol path:first-child {
  stroke: #67e8f9;
  stroke-width: 3;
}
.trace-view .router-face-port:hover .face-port-symbol path:first-child {
  stroke: #fff;
}
.trace-view .face-port-number {
  display: block;
  position: absolute;
  top: 34%;
  left: 0;
  width: 100%;
  text-align: center;
  font:
    700 clamp(13px, 1.1vw, 20px) / 1.2 'JetBrains Mono',
    monospace;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}
.face-trace-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.face-trace-line {
  fill: none;
  stroke: #6889a2;
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
  vector-effect: non-scaling-stroke;
}
.face-trace-line.selected {
  stroke: #38bdf8;
  stroke-width: 2;
}
.face-peer {
  position: absolute;
  left: var(--face-x);
  transform: translateX(-50%);
  z-index: 2;
  width: 140px;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 10px;
  border: 1px solid #24374a;
  border-radius: 9px;
  background: #0c1724;
  color: #cbd5e1;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s,
    background-color 0.15s;
}
.face-peer.above {
  top: 3%;
}
.face-peer.below {
  bottom: 3%;
}
.face-peer svg {
  width: 26px;
  height: 26px;
  flex: none;
  color: #93c5fd;
}
.face-peer b {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
  color: #f1f5f9;
}
.face-peer span,
.face-peer small {
  font-size: 11px;
  color: #b2c3d4;
  line-height: 1.45;
}
.face-peer .face-peer-port {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
}
.face-peer.unidentified {
  background: #0a121c;
  border-style: dashed;
}
.face-peer.unidentified svg {
  color: #8ba0b4;
}
.face-peer .face-peer-stale {
  color: #fcd68a;
}
.face-peer:hover,
.face-peer.selected {
  border-color: #56baf3;
  background: #10273c;
}
.face-peer.selected {
  box-shadow: 0 0 0 1px #56baf3;
}
.face-peer:focus-visible {
  outline: 3px solid #f8fafc;
  outline-offset: 3px;
}
.face-peer[data-port='ether1'] {
  --face-x: 41.8%;
}
.face-peer[data-port='ether2'] {
  --face-x: 49%;
}
.face-peer[data-port='ether3'] {
  --face-x: 56.2%;
}
.face-peer[data-port='ether4'] {
  --face-x: 63.4%;
}
.face-peer[data-port='ether5'] {
  --face-x: 71.1%;
}
.face-peer[data-port='ether6'] {
  --face-x: 78.3%;
}
.face-peer[data-port='ether7'] {
  --face-x: 85.4%;
}
.face-peer[data-port='ether8'] {
  --face-x: 92.6%;
}
.face-peer[data-port='sfp-sfpplus1'] {
  --face-x: 23%;
}
.trace-legend .face-key.up::before {
  background: #1164a3;
  border-color: #93c5fd;
}
.trace-legend .face-key.down::before {
  background: #111e2c;
  border-color: #aebdca;
}
.trace-legend .face-key.unknown::before {
  background: #573c1b;
  border-color: #fcd68a;
}
.face-device-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
}
.face-device-heading > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.face-device-heading > div > b {
  color: var(--strong);
  font-size: 16px;
  overflow-wrap: anywhere;
}
.face-device-heading > div > span {
  font-size: 12px;
  color: var(--muted);
}
.face-status-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.face-status-summary > span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sunk);
}
.face-status-summary .up b {
  color: var(--accent-text);
}
.face-status-summary .unknown b {
  color: var(--warn);
}
.face-port-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding-top: 4px;
}
.face-port-picker > span {
  color: var(--muted);
  font-size: 12px;
}
.face-port-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.face-select-port {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line2);
  border-radius: 7px;
  background: var(--sunk);
  color: var(--text);
  font:
    600 13px/1.2 'JetBrains Mono',
    monospace;
  cursor: pointer;
}
.face-select-port[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  box-shadow: inset 0 -2px var(--accent);
}
.face-select-port:hover {
  border-color: var(--accent);
}
.face-select-port:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.face-select-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dim);
}
.face-select-port[data-link='up'] .face-select-dot {
  background: var(--ok-dot);
}
.face-select-port[data-link='unknown'] .face-select-dot {
  background: var(--warn-dot);
}
.face-evidence {
  min-width: 0;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 14px;
}
.face-evidence h4 {
  margin: 0 0 10px;
  color: var(--strong);
  font-size: 13px;
}
.face-evidence .table-wrap {
  max-height: 320px;
  overflow: auto;
  overscroll-behavior: contain;
}
.face-evidence th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--sunk);
}
.face-evidence td {
  vertical-align: top;
}
@media (max-width: 600px) {
  .face-port-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
  }
  .face-port-picker {
    gap: 8px;
  }
  .face-device-heading > div > b {
    font-size: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .face-peer {
    transition: none;
  }
}

/* Shared NOC presentation: quiet controls, readable data, one clear workspace. */
.main {
  font-variant-numeric: tabular-nums;
}
.brand .logo {
  border-radius: 9px;
  box-shadow: none;
}
.brand .logo::after {
  display: none;
}
.group-title {
  letter-spacing: 0;
  font-size: 12px;
  padding-top: 10px;
}
.shop-select {
  border-radius: 8px;
  min-height: 44px;
  box-shadow: none;
}
.nav-search input {
  border-radius: 7px;
  min-height: 40px;
}
.nav .collector {
  border-radius: 9px;
  background: var(--sunk);
  box-shadow: none;
}
.nav-foot > .btn {
  justify-content: flex-start;
  border-color: var(--line);
  font-size: 12px;
}
.nav-txt {
  line-height: 1.4;
}
.nav-txt small {
  font-size: 11px;
  margin-top: 2px;
}
.crumb {
  font-size: 12px;
  line-height: 1.6;
}
.subtitle {
  margin-top: 5px;
  max-width: 78ch;
  line-height: 1.6;
}
.page-actions {
  gap: 8px;
}
.page-actions > .btn,
.page-actions > .live {
  min-height: 40px;
  border-radius: 8px;
}
.display-menu {
  position: relative;
}
.display-menu > summary {
  list-style: none;
  min-height: 40px;
}
.display-menu > summary::-webkit-details-marker {
  display: none;
}
.display-menu[open] > summary {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.display-menu-body {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 10px);
  z-index: 45;
  width: 264px;
  max-width: calc(100vw - 32px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
}
.display-menu:not([open]) > .display-menu-body {
  display: none;
}
.display-menu-label {
  font-size: 12px;
  color: var(--muted);
}
.display-menu .swatches {
  justify-content: space-between;
  border: 0;
  border-radius: 6px;
  padding: 4px;
  background: var(--sunk);
}
.display-menu .btn {
  justify-content: flex-start;
  border-radius: 7px;
  min-height: 40px;
}
.vital-pill {
  border-radius: 5px;
  box-shadow: none;
  background: transparent;
}
.cmd-actions {
  border-top: 1px solid var(--line);
  padding-top: 6px;
  width: 100%;
}
.cmd-actions .note {
  font-size: 11px;
}
.card .kpi {
  background: var(--sunk);
  border: 0;
  border-left: 2px solid var(--line2);
  border-radius: 4px;
  box-shadow: none;
}
.card h2,
.chart-header h3 {
  font-size: 16px;
  line-height: 1.5;
}
.chart-header {
  gap: 12px;
  flex-wrap: wrap;
}
.chart-header p {
  font-size: 12px;
  line-height: 1.6;
}
.chart-tag,
.chip {
  border-radius: 6px;
}
.kpi .v {
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.5px;
}
.kpi .n,
.kpi-sub {
  font-size: 12px;
  line-height: 1.6;
}
.card > .tools {
  padding-block: 4px;
}
.tools > label.lbl {
  gap: 7px;
}
.tabs {
  border-radius: 8px;
}
.tab {
  border-radius: 5px;
}
.tab.on {
  box-shadow: none;
  color: var(--accent-text);
  background: var(--accent-soft);
}
.card .table-wrap {
  background: var(--card);
}
tbody tr:hover {
  background: var(--accent-soft);
}
.table-wrap td .btn.small {
  min-height: 32px;
}
.empty {
  line-height: 1.7;
  padding: 22px 16px;
  border-radius: 8px;
  color: var(--muted);
}
.note {
  line-height: 1.65;
}
.wan,
.wan-card,
.branch-card {
  border-radius: 12px;
  box-shadow: none;
}
.branch-card:hover {
  transform: none;
  box-shadow: none;
}
.wan-metrics,
.chart-telemetry-strip {
  border-radius: 8px;
}
.port,
.sfp-box,
.sfp-card {
  border-radius: 8px;
}
.port-name {
  line-height: 1.6;
}
.ports {
  border-radius: 10px;
}
.main[data-page='live'] .table-wrap,
.main[data-page='logs'] .table-wrap {
  border-color: var(--line2);
}
.main[data-page='unifi'] .table-wrap td:nth-child(2) {
  min-width: 140px;
}
.main[data-page='account'] .card,
.main[data-page='members'] .card,
.main[data-page='password'] .card {
  gap: 18px;
}
.member-form,
.mfa-form {
  gap: 18px;
}
.member-form .field,
.mfa-form .field {
  border-radius: 8px;
}
.wizard-dialog,
.rename-dialog {
  border-radius: 14px;
}
.auth-shell {
  border-radius: 16px;
  background: var(--card);
}
.auth-hero {
  background: var(--sunk);
}
.auth-hero::before {
  opacity: 0.6;
}
.auth-brand h1 {
  letter-spacing: -0.4px;
}
.auth input.field {
  border-radius: 8px;
}
.auth-submit {
  border-radius: 8px;
  box-shadow: none;
}
.auth-submit:hover:not(:disabled) {
  box-shadow: none;
}
@media (min-width: 821px) {
  .top {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}
@media (max-width: 820px) {
  .top {
    gap: 14px;
  }
  .top h1 {
    font-size: 25px;
  }
  .page-actions {
    width: 100%;
  }
  .page-actions > .btn,
  .page-actions > .live,
  .display-menu > summary,
  .display-menu .btn {
    min-height: 44px;
  }
  .display-menu-body {
    left: 0;
    right: auto;
  }
  .display-menu .swatches {
    gap: 0;
    padding: 2px;
  }
  .card,
  .chart-card {
    padding: 16px;
    border-radius: 10px;
  }
  .card h2,
  .chart-header h3 {
    font-size: 15px;
  }
  .kpi .v {
    font-size: 26px;
  }
  .tools {
    gap: 10px;
  }
  .cmd-bar {
    padding: 10px;
    gap: 8px;
  }
  .cmd-bar {
    background: transparent;
    border-width: 1px 0;
    border-radius: 0;
    padding: 10px 0;
  }
  .vitals-strip {
    gap: 6px 14px;
  }
  .vital-pill {
    border: 0;
    padding: 0;
    gap: 5px;
    font-size: 11px;
  }
  .vital-pill.rdy-pill {
    min-height: 44px;
  }
  .cmd-actions {
    display: none;
  }
  th,
  td {
    padding: 10px 12px;
  }
}
@media (max-width: 600px) {
  .page-actions .refresh-label,
  .page-actions .live-time {
    display: none;
  }
  .page-actions > [data-act='refresh'] {
    min-width: 44px;
    padding-inline: 10px;
    font-size: 18px;
  }
}
@media (min-width: 1100px) and (max-width: 1699px) {
  .kpi-grid:has(> .kpi:nth-child(6)):not(:has(> .kpi:nth-child(7))) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 380px) {
  .page-actions {
    gap: 6px;
  }
  .page-actions > .btn,
  .display-menu > summary {
    padding-inline: 10px;
    font-size: 12px;
  }
  .page-actions > .live {
    padding-inline: 10px;
    font-size: 12px;
  }
}

/* Analytics Dashboard reference: eight metrics, four plots, then an evidence table. */
.analytics-dashboard {
  --ad-head: #1c374c;
  --ad-tile: #142b3e;
  --ad-chart: #13232f;
  --ad-stroke: #344c60;
  display: flex;
  flex-direction: column;
  gap: 12px;
  container-type: inline-size;
}
:root[data-theme='light'] .analytics-dashboard {
  --ad-head: #dfeaf2;
  --ad-tile: #fff;
  --ad-chart: #fff;
  --ad-stroke: #b8cad9;
}
.ad-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  padding: 12px 14px;
  background: var(--ad-head);
  border: 1px solid var(--ad-stroke);
  color: var(--text2);
  font-size: 12px;
}
.ad-context b {
  color: var(--strong);
  font-size: 15px;
  margin-right: auto;
}
.ad-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--ad-stroke);
  background: var(--ad-stroke);
}
.ad-metric {
  min-width: 0;
  padding: 14px 16px;
  background: var(--ad-tile);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ad-metric > span {
  color: var(--text2);
  font-size: 12px;
}
.ad-metric > strong {
  color: var(--strong);
  font:
    600 26px/1.35 'Space Grotesk',
    'Anuphan',
    sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ad-metric > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.ad-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ad-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 266px;
  padding: 14px 16px;
  border: 1px solid var(--ad-stroke);
  border-radius: 5px;
  background: var(--ad-chart);
}
.ad-panel > header {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.ad-panel h2 {
  font-size: 14px;
  color: var(--strong);
  margin: 0;
  line-height: 1.6;
}
.ad-panel header p {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin: 3px 0 0;
}
.ad-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 150px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
}
.ad-line-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  font-size: 11px;
  color: var(--text2);
}
.ad-line-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ad-series-rx::before,
.ad-series-tx::before {
  content: '';
  display: inline-block;
  width: 15px;
  border-top: 3px solid var(--accent);
}
.ad-series-tx::before {
  border-color: var(--warn-dot);
  border-top-style: dashed;
}
.ad-plot {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 5px;
  min-width: 0;
}
.ad-plot svg {
  width: 100%;
  height: 160px;
  display: block;
  overflow: visible;
}
.ad-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 2px 0;
  font-size: 10.5px;
  color: var(--muted);
}
.ad-grid-line {
  stroke: var(--line2);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.ad-line-rx,
.ad-line-tx {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.ad-line-tx {
  stroke: var(--warn-dot);
  stroke-dasharray: 5 4;
}
.ad-bar-rx {
  fill: var(--accent);
}
.ad-bar-tx {
  fill: var(--warn-dot);
}
.ad-x-axis {
  display: flex;
  justify-content: space-between;
  padding-left: 67px;
  color: var(--muted);
  font-size: 11px;
}
.ad-column-labels {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  padding-left: 67px;
  text-align: center;
  color: var(--text2);
  font-size: 11px;
}
.ad-column-labels > span {
  overflow-wrap: anywhere;
}
.ad-rank-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ad-rank > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 5px;
  font-size: 12px;
}
.ad-rank span[title] {
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  color: var(--text2);
}
.ad-rank b {
  flex: none;
  color: var(--strong);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.ad-rank .bar {
  height: 7px;
  border-radius: 2px;
}
.ad-pie-layout {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  flex: 1;
}
.ad-pie {
  width: 128px;
  height: 128px;
  position: relative;
}
.ad-pie svg {
  display: block;
  width: 100%;
  height: 100%;
}
.ad-pie > div {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}
.ad-pie strong {
  font:
    600 24px/1.2 'Space Grotesk',
    sans-serif;
  color: var(--strong);
}
.ad-pie > div > span {
  font-size: 11px;
  color: var(--muted);
}
.ad-pie-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  min-width: 0;
}
.ad-pie-legend li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}
.ad-pie-legend li > span:nth-child(2) {
  overflow-wrap: anywhere;
}
.ad-key {
  width: 8px;
  height: 8px;
  border-radius: 1px;
}
.ad-pie-legend b {
  color: var(--strong);
  text-align: right;
}
.ad-pie-legend small {
  display: block;
  font-weight: 400;
  color: var(--muted);
}
.ad-status-table {
  min-height: 0;
}
.ad-status-table tbody th {
  background: transparent;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
  white-space: normal;
  min-width: 140px;
}
.ad-status-table .table-wrap {
  border-radius: 2px;
}
@container (max-width:720px) {
  .ad-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ad-chart-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 380px) {
  .ad-metric {
    padding: 12px;
  }
  .ad-metric > strong {
    font-size: 22px;
  }
  .ad-panel {
    padding: 12px;
  }
  .ad-pie-layout {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
  }
  .ad-pie {
    width: 108px;
    height: 108px;
  }
}

/* UI/UX Pro Max: operations-first reading, predictable targets, keyboard access. */
:root {
  --header-offset: 180px;
  --control-height: 36px;
}
html {
  scroll-padding-top: var(--header-offset);
}
body {
  font-size: 16px;
}
.page-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  scroll-margin-top: 16px;
}
.page-content:focus {
  outline: none;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 16px;
  z-index: 10000;
  padding: 12px 18px;
  background: var(--card);
  border: 2px solid var(--focus);
  border-radius: 8px;
  color: var(--strong) !important;
  transform: translateY(-160%);
}
.skip-link:focus {
  transform: translateY(0);
}
.main :is(input, select, textarea, button, a, summary, [tabindex]) {
  scroll-margin-top: 16px;
  scroll-margin-bottom: 20px;
}
.top h1 {
  font-size: 30px;
  line-height: 1.4;
  letter-spacing: -0.5px;
}
.crumb {
  font-size: 12px;
  line-height: 1.6;
}
.subtitle {
  font-size: 13px;
  line-height: 1.65;
  max-width: 78ch;
}
.btn,
.field {
  min-height: var(--control-height);
}
.btn {
  gap: 7px;
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.edit-btn {
  min-width: 28px;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.5;
}
.edit-btn:hover {
  transform: none;
}
.field {
  font-size: 14px;
  line-height: 1.6;
}
textarea.field {
  min-height: 100px;
}
input[type='checkbox'],
input[type='radio'] {
  accent-color: var(--accent-text);
}
button:disabled {
  cursor: not-allowed;
}
.nav-item:focus-visible,
.btn:focus-visible,
.edit-btn:focus-visible {
  outline-offset: 3px;
}
.ad-metric > span,
.ad-metric > small,
.ad-panel header p,
.ad-line-legend,
.ad-pie-legend,
.ad-pie > div > span,
.ad-column-labels,
.ad-x-axis {
  font-size: 12px;
  line-height: 1.6;
}
.ad-context {
  border-radius: 8px;
}
.ad-metrics {
  border-radius: 8px;
  overflow: hidden;
}
.ad-panel {
  border-radius: 8px;
}
.ad-metric {
  padding-block: 16px;
}
.ad-metric > strong {
  font-size: 28px;
}
.ad-metric > small {
  min-height: 1.6em;
}
.table-wrap tbody tr:focus-within {
  background: var(--hover);
}
.card h2 {
  line-height: 1.65;
}
.note,
.empty {
  line-height: 1.75;
}
@media (max-width: 820px) {
  :root {
    --control-height: 44px;
  }
  .top h1 {
    font-size: 26px;
  }
  .main .field,
  .auth .field {
    font-size: 16px;
  }
  .edit-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
  }
  .page-content {
    gap: 14px;
  }
  .ad-panel {
    padding: 14px;
  }
  .ad-metric > strong {
    font-size: 25px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active:not(:disabled) {
    transform: none;
  }
}

/* Native checks and their labels remain comfortable at narrow widths. */
.vpn-map {
  gap: 16px;
}
.vmap-heading,
.vmap-list-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.vmap-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.vmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 12px;
  color: var(--text2);
}
.vmap-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.vmap-legend > span::before {
  content: '';
  width: 24px;
  border-top: 2px solid var(--line2);
}
.vmap-legend > .is-up::before {
  border-color: var(--ok);
}
.vmap-legend > .is-down::before {
  border-color: var(--bad);
  border-top-style: dotted;
}
.vmap-legend > .is-disabled::before {
  border-color: var(--idle-dot);
  border-top-style: dashed;
}
.vmap-legend > .is-stale::before {
  border-color: var(--muted);
  border-top-style: dashed;
}
.vmap-legend > .is-unknown::before {
  border-color: var(--warn-dot);
  border-top-style: dotted;
}
.vmap-scroll {
  width: 100%;
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sunk);
}
.vmap-scene {
  position: relative;
  width: 100%;
  min-width: 1100px;
  height: 640px;
  background-image: radial-gradient(var(--line) 0.8px, transparent 0.8px);
  background-size: 24px 24px;
}
.vmap-scene > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.vmap-edge {
  fill: none;
  stroke: var(--warn-dot);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 3 7;
}
.vmap-edge.is-up {
  stroke: var(--ok);
  stroke-dasharray: none;
}
.vmap-edge.is-down {
  stroke: var(--bad);
  stroke-dasharray: 2 6;
}
.vmap-edge.is-disabled {
  stroke: var(--idle-dot);
  stroke-dasharray: 8 7;
}
.vmap-edge.is-stale {
  stroke: var(--muted);
  stroke-dasharray: 4 6;
  opacity: 0.65;
}
.vmap-edge.muted-edge {
  opacity: 0.18;
}
.vmap-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 190px;
  height: 136px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.vmap-node:hover {
  border-color: var(--accent-text);
  background: var(--card-hi);
}
.vmap-node.selected {
  border: 2px solid var(--accent-text);
  padding: 9px 11px;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.vmap-node.type-peer {
  border-style: dashed;
}
.vmap-node-type {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.vmap-node > b {
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.vmap-node code {
  font:
    12px/1.6 'JetBrains Mono',
    monospace;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.vmap-node small {
  font-size: 12px;
  color: var(--muted);
}
.vmap-caption {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.vmap-list-heading h3 {
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
  overflow-wrap: anywhere;
}
.vmap-list-heading h3 > span {
  font-weight: 400;
  color: var(--muted);
}
.vmap-connections {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.vmap-connection {
  padding: 16px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
}
.vmap-connection:last-child {
  border-bottom: 0;
}
.vmap-connection-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) minmax(160px, 0.65fr);
  align-items: center;
  gap: 14px;
}
.vmap-connection-grid > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.vmap-connection-grid b {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.vmap-connection-grid > div > span:first-child {
  font-size: 12px;
  color: var(--muted);
}
.vmap-connection code,
.vmap-evidence code {
  font:
    13px/1.6 'JetBrains Mono',
    monospace;
  overflow-wrap: anywhere;
}
.vmap-arrow {
  color: var(--muted);
}
.vmap-state small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.vmap-connection-grid > .vmap-state > .vmap-status {
  color: var(--warn);
}
.vmap-connection-grid > .vmap-state > .vmap-status.is-up {
  color: var(--ok);
}
.vmap-connection-grid > .vmap-state > .vmap-status.is-down {
  color: var(--bad);
}
.vmap-connection-grid > .vmap-state > .vmap-status.is-disabled,
.vmap-connection-grid > .vmap-state > .vmap-status.is-stale {
  color: var(--muted);
}
.vmap-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.vmap-evidence > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.vmap-routes {
  margin-top: 10px;
  font-size: 13px;
}
.vmap-routes > summary {
  cursor: pointer;
  padding: 10px 0;
  min-height: 44px;
  color: var(--accent-text);
}
.vmap-routes > ul {
  list-style: none;
  padding: 0;
  margin: 4px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vmap-routes li {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 18px;
  padding: 8px 10px;
  background: var(--sunk);
  border-radius: 4px;
  color: var(--text2);
  overflow-wrap: anywhere;
}
@media (max-width: 820px) {
  .vmap-connection-grid {
    grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
    gap: 10px;
  }
  .vmap-connection-grid > .vmap-state {
    grid-column: 1/-1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 12px;
  }
  .vmap-connection {
    padding: 12px;
  }
}
@media (max-width: 380px) {
  .vmap-connection-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .vmap-arrow {
    transform: rotate(90deg);
    justify-self: start;
  }
}
.main input[type='checkbox'],
.main input[type='radio'] {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.main label:has(> input[type='checkbox']),
.main label:has(> input[type='radio']) {
  min-height: 36px;
  cursor: pointer;
}
@media (max-width: 820px) {
  .main .btn,
  .auth .btn {
    min-height: 44px;
  }
  .main label:has(> input[type='checkbox']),
  .main label:has(> input[type='radio']) {
    min-height: 44px;
  }
}

@media (max-width: 820px) {
  .vmap-scroll {
    max-height: 480px;
  }
}

/* Server8 is the explicitly selected point 0, not inferred from link count. */
.vmap-node.type-hub {
  width: 210px;
  border: 2px solid var(--accent-text);
  padding: 9px 11px;
  background: var(--card-hi);
  box-shadow: 0 0 0 6px var(--accent-soft);
}
.vmap-node.type-hub .vmap-node-type {
  color: var(--accent-text);
}
.vmap-edge.hub-link {
  stroke-width: 3;
}
.vmap-edge.other-link {
  stroke-width: 1.5;
  opacity: 0.6;
}
.vmap-edge.muted-edge {
  opacity: 0.15;
}
.vmap-legend > .hub-key::before {
  border-top-width: 3px;
  border-color: var(--text2);
}
.vmap-legend > .other-key::before {
  border-top-width: 1px;
  border-color: var(--muted);
}

/* 2026-11-20 storage card: keep "ใช้ 19.1 GB" / "ว่าง 187.8 GB" on one line each */
.collector .nowrap {
  white-space: nowrap;
}

/* ---------- Switch front panel (2026-11-20) ---------- */
.sw-face {
  margin-bottom: 12px;
  padding: 14px 16px 12px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--card-hi), var(--sunk));
  box-shadow: var(--shadow);
}
.sw-face-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}
.sw-face-model {
  font-weight: 600;
  color: var(--text2);
  letter-spacing: 0.02em;
}
.sw-face-body {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.sw-face-g {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
}
.sw-face-g.g-fiber {
  padding-left: 16px;
  border-left: 1px dashed var(--line2);
}
.sw-face-gl {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.sw-face-group {
  display: grid;
  grid-auto-flow: column;
  gap: 4px;
}
.sw-face-group.rows-2 {
  grid-template-rows: auto auto;
}
.sw-jack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 42px;
  padding: 4px 3px 3px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s;
}
.sw-jack:hover {
  background: var(--hover);
}
.sw-jack:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.sw-jack[aria-pressed='true'] {
  background: var(--accent-soft);
  border-color: var(--accent-ring);
}
.sw-jack svg,
.port-ico svg {
  display: block;
  width: 34px;
  height: 29px;
}
.jk-body {
  fill: var(--sunk);
  stroke: var(--line2);
  stroke-width: 1.4;
}
.jk-hole {
  fill: var(--bg);
  stroke: var(--line);
  stroke-width: 1;
}
.jk-pins {
  fill: none;
  stroke: var(--line2);
  stroke-width: 1.2;
  stroke-linecap: round;
}
.jk-led {
  fill: var(--line2);
}
.is-up .jk-body {
  stroke: var(--ok-dot);
}
.is-up .jk-pins,
.is-up .jk-led {
  stroke: var(--ok-dot);
  fill: var(--ok-dot);
}
.is-up .jk-pins {
  fill: none;
}
.kind-fiber.is-up .jk-body,
.kind-fiber.is-up .jk-pins {
  stroke: var(--accent);
}
.kind-fiber.is-up .jk-led {
  fill: var(--accent);
}
.is-poe.is-up .jk-led.l2 {
  fill: var(--warn-dot);
}
.is-warn .jk-body,
.is-warn .jk-pins {
  stroke: var(--warn-dot);
}
.is-warn .jk-led {
  fill: var(--warn-dot);
}
.sw-jack-no {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text2);
}
.is-down .sw-jack-no {
  color: var(--muted);
}
.sw-jack-sp {
  font-size: 10px;
  line-height: 1.1;
  color: var(--muted);
}
.is-up .sw-jack-sp {
  color: var(--ok);
}
.kind-fiber.is-up .sw-jack-sp {
  color: var(--accent-text);
}
.is-warn .sw-jack-sp {
  color: var(--warn);
}
.jk-bolt {
  width: 11px;
  height: 11px;
  flex: none;
  fill: var(--warn-dot);
  vertical-align: -1px;
}
.sw-face-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.sw-face-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.lg-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line2);
}
.lg-up {
  background: var(--ok-dot);
}
.lg-fiber {
  background: var(--accent);
}
.lg-warn {
  background: var(--warn-dot);
}
.port-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.port-ico svg {
  width: 22px;
  height: 19px;
}
.sw-jack svg.jk-bolt,
.port-title svg.jk-bolt,
.sw-face-legend svg.jk-bolt {
  width: 11px;
  height: 11px;
}
.port-title {
  flex-wrap: wrap;
  row-gap: 2px;
}
/* fibre colour: --accent-text is the same blue in dark and a darker one in light, so the jack outline keeps 3:1 contrast */
.kind-fiber.is-up .jk-body,
.kind-fiber.is-up .jk-pins {
  stroke: var(--accent-text);
}
.kind-fiber.is-up .jk-led,
.lg-fiber {
  fill: var(--accent-text);
  background: var(--accent-text);
}

/* ---------- site-wide heading / KPI icons (2026-11-20) ---------- */
.h-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  margin-right: 9px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-text);
  vertical-align: middle;
}
.h-ico svg {
  display: block;
}
.k-ico {
  display: inline-flex;
  margin-right: 5px;
  color: var(--accent-text);
  vertical-align: -2px;
  opacity: 0.9;
}
.k-ico svg {
  display: block;
}
/* Dashboard port matrix: the same jack drawings as the switch page */
.mini-port-ico svg {
  display: block;
  width: 20px;
  height: 17px;
}
.mini-port.up .jk-body,
.mini-port.up .jk-pins {
  stroke: var(--ok-dot);
}
.mini-port.up .jk-led {
  fill: var(--ok-dot);
}
.mini-port.poe .jk-body,
.mini-port.poe .jk-pins {
  stroke: var(--warn-dot);
}
.mini-port.poe .jk-led {
  fill: var(--warn-dot);
}
.mini-port.sfp .jk-body,
.mini-port.sfp .jk-pins {
  stroke: var(--accent-text);
}
.mini-port.sfp .jk-led {
  fill: var(--accent-text);
}

/* ---------- switch port balloon (2026-11-20) ---------- */
.sw-face {
  position: relative;
}
.sw-pop {
  position: absolute;
  z-index: 30;
  left: 8px;
  top: 0;
  width: min(330px, calc(100% - 16px));
  padding: 12px 14px;
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  visibility: hidden;
}
.sw-pop.ready {
  visibility: visible;
  animation: sw-pop-in 0.14s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .sw-pop.ready {
    animation: none;
  }
}
@keyframes sw-pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.sw-pop::before {
  content: '';
  position: absolute;
  top: -7px;
  left: calc(var(--arrow-x, 24px) - 7px);
  width: 12px;
  height: 12px;
  background: var(--card);
  border-left: 1px solid var(--line2);
  border-top: 1px solid var(--line2);
  transform: rotate(45deg);
}
.sw-pop-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.sw-pop-head b {
  font-size: 15px;
}
.sw-pop-kind {
  font-size: 12px;
  color: var(--muted);
}
.sw-pop-x {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sunk);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.sw-pop-x:hover {
  color: var(--strong);
  border-color: var(--line2);
}
.sw-pop-x:focus-visible {
  outline: 2px solid var(--focus);
}
.sw-pop-alias {
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text2);
  overflow-wrap: anywhere;
}
.sw-pop .chip svg.jk-bolt {
  width: 11px;
  height: 11px;
}
.sw-pop-grid {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.sw-pop-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
}
.sw-pop-row > span {
  color: var(--muted);
  flex: none;
}
.sw-pop-row > b {
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sw-pop-names {
  display: block;
  font-weight: 400;
  font-size: 11.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.sw-pop-more {
  width: 100%;
}
/* The card holding an open port balloon must not clip it, and must sit above the card below it. */
.card.has-sw-pop {
  overflow: visible;
  z-index: 6;
}
.card.has-sw-pop::after {
  border-radius: inherit;
}
.sw-pop-head b,
.sw-pop-head .btn {
  white-space: nowrap;
  flex: none;
}
.sw-pop-kind {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 2026-11-20 layout: tabs for pages merged under one menu entry (TAB_SETS in app.js). Scrolls sideways on phones. */
.page-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sunk);
  overflow-x: auto;
  scrollbar-width: thin;
}
.page-tab {
  flex: none;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text2);
  font: inherit;
  font-size: 13.5px;
  white-space: nowrap;
  cursor: pointer;
}
.page-tab:hover {
  background: var(--hover);
}
.page-tab:focus-visible {
  outline: 2px solid var(--focus, var(--accent-text));
  outline-offset: 1px;
}
.page-tab.on {
  background: var(--accent-soft);
  border-color: var(--accent-text);
  color: var(--accent-text);
  font-weight: 600;
}

/* 2026-11-20 NVR cards on the network devices page */
.nvr-card {
  gap: 4px;
}
.nvr-card .n b.bad {
  color: var(--bad);
}

/* 2026-11-20 PoE vs warning colours on the switch front panel: errors are red, a slow link stays green with amber speed text,
   so amber means PoE only (bolt + second LED). */
.is-bad .jk-body,
.is-bad .jk-pins {
  stroke: var(--bad-dot);
}
.is-bad .jk-led {
  fill: var(--bad-dot);
}
.is-bad .sw-jack-sp {
  color: var(--bad);
}
.is-slow .sw-jack-sp,
.lg-slow {
  color: var(--warn);
  font-weight: 700;
}
.lg-slow {
  font-size: 10px;
}
.lg-bad {
  background: var(--bad-dot);
}

/* 2026-11-20 camera menu: NVR cards are buttons that open the NVR page */
button.nvr-card {
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  border-left: 4px solid var(--line2);
  transition: border-color 0.15s, transform 0.15s;
}
button.nvr-card:hover,
button.nvr-card:focus-visible {
  transform: translateY(-1px);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button.nvr-card.nvr-ok {
  border-left-color: var(--ok);
}
button.nvr-card.nvr-bad {
  border-left-color: var(--bad);
}
button.nvr-card.nvr-warn {
  border-left-color: var(--warn);
}
.nvr-card .nvr-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.nvr-card b.bad,
.note b.bad {
  color: var(--bad);
}
.nvr-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.cam-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
/* Note under the switch legend when PoE per port is estimated from the devices behind it. */
.sw-face-note {
  flex-basis: 100%;
  color: var(--muted);
}

/* 2026-11-20 add switch / NVR from the web */
.managed-tools {
  margin: 8px 0 12px;
}
.managed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px 14px;
  margin-bottom: 10px;
}
.managed-grid .lbl {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.managed-check {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}
.ok-note {
  color: var(--ok);
}

/* 2026-11-20 site maintenance mode */
.maint-chip {
  white-space: nowrap;
  font-weight: 600;
}
.btn.warn-btn {
  border-color: var(--warn-line, var(--warn));
  background: var(--warn-bg);
  color: var(--warn);
}
.maint-dialog {
  max-width: 460px;
}
.maint-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--warn-line, var(--line2));
  background: var(--warn-bg);
}
.maint-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.maint-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.maint-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--sunk);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.maint-row.active {
  border-color: var(--warn-line, var(--warn));
}
.maint-row-hd {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
}
.maint-row-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}
.maint-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line2);
}
.maint-note-lbl {
  flex: 1 1 200px;
  min-width: 0;
}
.maint-note-lbl .field {
  width: 100%;
  min-width: 0;
}

/* 2026-11-20 phones: the open menu is a full-screen layer with the close button always in view.
   Before, the open menu pushed the page down; after scrolling the menu the "ปิดเมนู" button was 2000 px above
   and the page showed underneath while the menu was still open. */
@media (max-width: 820px) {
  .nav.open {
    position: fixed;
    inset: 0;
    z-index: 60;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-top: 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .nav.open > .brand {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 -12px;
    padding: calc(12px + env(safe-area-inset-top)) 18px 10px;
    background: var(--nav);
    border-bottom: 1px solid var(--line);
  }
  html:has(.nav.open),
  body:has(.nav.open) {
    overflow: hidden;
  }
}

/* 2026-11-20 table cards: on phones each table row is a card (labels come from app.js labelTables) */
@media (max-width: 640px) {
  .table-wrap.cards {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }
  .table-wrap.cards table,
  .table-wrap.cards tbody {
    display: block;
    width: 100%;
  }
  .table-wrap.cards thead {
    display: none;
  }
  .table-wrap.cards tbody tr {
    display: block;
    margin: 0 0 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card-hi);
  }
  .table-wrap.cards tbody tr:last-child {
    margin-bottom: 0;
  }
  .table-wrap.cards td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 5px 0;
    border: 0;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 0;
  }
  .table-wrap.cards td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 42%;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
  }
  .table-wrap.cards td:first-child {
    display: block;
    text-align: left;
    padding: 0 0 6px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
  }
  .table-wrap.cards td:first-child::before {
    display: none;
  }
  .table-wrap.cards td:empty {
    display: none;
  }
  .table-wrap.cards tr.card-row-wide td {
    display: block;
    text-align: left;
  }
  .table-wrap.cards tr.card-row-wide td::before {
    display: none;
  }
}

/* 2026-11-20 page of one access point added from the web (any brand) */
.ap-kv .kv {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.ap-kv .kv b {
  text-align: right;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* 2026-11-21 readiness details float under the pill on wide screens instead of stretching the status bar (owner screenshot) */
@media (min-width: 561px) {
  .cmd-bar {
    position: relative;
  }
  .rdy-pop {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30;
    width: min(380px, calc(100vw - 32px));
    margin-left: 0;
  }
}

/* Drawn device panels (devfaces.js, owner 2026-11-22) */
.df-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* true scale: the width/height attributes are the real size (2.12 px per mm); shrink only when the card is narrower */
svg.df { display: block; max-width: 100%; height: auto; }
svg.df.df-rack { min-width: 700px; }
.df-size { margin-top: 4px; }
.df-port { cursor: pointer; outline: none; }
.df-port:hover > rect:first-of-type, .df-port:focus-visible > rect:first-of-type { stroke: var(--accent, #3b82f6); stroke-width: 2; }
.df-port.sel > rect:first-of-type, .df-port[aria-pressed="true"] > rect:first-of-type { stroke: var(--accent, #3b82f6); stroke-width: 3; }
.df-rear { margin-top: 8px; }
.df-rear > summary { cursor: pointer; color: var(--muted, #9aa1ab); font-size: 13px; padding: 4px 0; }
.df-rear .df-wrap { margin-top: 6px; }
.df-router { margin-bottom: 12px; }
.df-legend span:has(> .lg-fiber) { display: none; }
.lg-frame { display: inline-block; width: 12px; height: 10px; border: 2px solid var(--muted, #6b7280); border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.lg-frame.lg-up { border-color: #2fbf71; }
.lg-frame.lg-bad { border-color: #e5484d; }
/* 2026-11-26 a link slower than 1G: yellow frame (owner asked for yellow; the jack itself is not filled, which looked like PoE) */
.df-port.df-up.is-slow .df-frame { stroke: #eab308; }
.lg-frame.lg-slow { border-color: #eab308; }
.df-router-card { margin-bottom: 16px; }
.df-router-card .chart-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }

/* 2026-11-26 storage of server9 and server8 in one short card, a colour for each */
.store-bar {
  display: block;
  width: 100%;
  height: 10px;
  margin: 6px 0 8px;
}
.store-bar .track {
  fill: var(--line);
}
.store-bar .fill.t9 {
  fill: var(--store9);
}
.store-bar .fill.t8 {
  fill: var(--store8);
}
.store-bar .fill.warn {
  fill: var(--warn-dot);
}
.store-bar .fill.full {
  fill: var(--bad-dot);
}
.store-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  margin-top: 4px;
}
.store-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 3px;
}
.store-dot.t9 {
  background: var(--store9);
}
.store-dot.t8 {
  background: var(--store8);
}
.store-sub {
  color: var(--muted);
  font-size: 12px;
}
.collector strong.store-warn {
  color: var(--warn);
}
.collector strong.store-full {
  color: var(--bad);
}
/* Neon VPN map (vpnmap.js): one canvas, colours from the tokens above. */
.nmap-card {
  overflow: hidden;
}
.nmap-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-start;
  justify-content: space-between;
}
.nmap-head h2 {
  margin: 0;
}
.nmap-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.nmap-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nmap-tab {
  min-height: 34px;
  padding: 4px 12px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: var(--chip);
  color: var(--text2);
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
}
.nmap-tab:hover {
  background: var(--hover);
}
.nmap-tab.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
}
.nmap-tab:focus-visible,
.nmap-chip:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.nmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 12px 0 8px;
  color: var(--text2);
  font-size: 12.5px;
  line-height: 1.6;
}
.nmap-legend span::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 0;
  margin-right: 6px;
  vertical-align: middle;
  border-top: 3px solid var(--idle-dot);
  border-radius: 2px;
}
.nmap-legend .k-down::before {
  border-top-color: var(--accent-text);
}
.nmap-legend .k-up::before {
  border-top-color: var(--warn-dot);
}
.nmap-legend .k-bad::before {
  border-top: 3px dashed var(--bad-dot);
}
.nmap-legend .k-idle::before {
  border-top: 3px dashed var(--idle-dot);
}
:root[data-theme='dark'] .nmap-legend .k-down::before {
  border-top-color: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
:root[data-theme='dark'] .nmap-legend .k-up::before {
  box-shadow: 0 0 6px var(--warn-dot);
}
.nmap-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sunk);
}
:root[data-theme='dark'] .nmap-stage {
  border-color: var(--accent-ring);
  box-shadow: inset 0 0 40px var(--accent-soft);
}
.nmap-stage canvas {
  display: block;
  width: 100%;
  touch-action: manipulation;
}
.nmap-notes p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.nmap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.nmap-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 32px;
  padding: 3px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.6;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nmap-chip .d {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--idle-dot);
}
.nmap-chip .d-hub,
.nmap-chip.s-up .d {
  background: var(--accent);
}
.nmap-chip.s-down {
  border-color: var(--bad-dot);
  color: var(--bad);
}
.nmap-chip.s-down .d {
  background: var(--bad-dot);
}
.nmap-chip.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.nmap-detail {
  margin-top: 12px;
}
.nmap-detail h3 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.6;
}
.nmap-detail dl {
  display: grid;
  grid-template-columns: minmax(110px, max-content) 1fr;
  gap: 4px 14px;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.6;
}
.nmap-detail dt {
  color: var(--muted);
}
.nmap-detail dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.nmap-detail .c-down {
  color: var(--accent-text);
  font-weight: 600;
}
.nmap-detail .c-up {
  color: var(--warn);
  font-weight: 600;
}
.nmap-detail .s-up {
  color: var(--ok);
}
.nmap-detail .s-down {
  color: var(--bad);
  font-weight: 700;
}
.nmap-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}
@media (max-width: 420px) {
  .nmap-detail dl {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .nmap-detail dd {
    margin-bottom: 6px;
  }
}
.nmap-num {
  margin-right: 6px;
  color: var(--muted);
  font-weight: 600;
}
.nmap-tab.on .nmap-num {
  color: inherit;
}
.nmap-legend .k-sw::before {
  border-top-color: var(--store8);
}
.nmap-stage + .nmap-legend {
  margin: 10px 0 0;
}
.nmap-head + .nmap-stage {
  margin-top: 12px;
}
.nmap-google { width: 100%; min-height: 210px; height: 28rem; border: 0; display: block; }
.nmap-google[hidden], .nmap-stage canvas[hidden] { display: none; }
