:root {
  color-scheme: dark;
  --canvas: oklch(0.125 0.008 165);
  --rail: oklch(0.145 0.008 165);
  --surface-1: oklch(0.17 0.009 165);
  --surface-2: oklch(0.20 0.01 165);
  --surface-3: oklch(0.235 0.011 165);
  --border-subtle: oklch(0.31 0.012 165 / 0.34);
  --border: oklch(0.38 0.012 165 / 0.46);
  --text: oklch(0.93 0.008 155);
  --text-soft: oklch(0.79 0.012 160);
  --muted: oklch(0.66 0.014 160);
  --faint: oklch(0.52 0.012 160);
  --accent: oklch(0.78 0.145 154);
  --accent-strong: oklch(0.84 0.15 154);
  --accent-ink: oklch(0.16 0.035 154);
  --accent-soft: oklch(0.78 0.145 154 / 0.11);
  --warning: oklch(0.80 0.13 82);
  --warning-soft: oklch(0.80 0.13 82 / 0.11);
  --danger: oklch(0.67 0.18 27);
  --danger-soft: oklch(0.67 0.18 27 / 0.12);
  --info: oklch(0.72 0.11 235);
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-pill: 999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --rail-width: 232px;
  font-family: "Bahnschrift", "DIN Alternate", "Avenir Next", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 320px; background: var(--canvas); }
html.hide-root-scrollbar { scrollbar-width: none; }
html.hide-root-scrollbar::-webkit-scrollbar { width: 0; height: 0; display: none; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  touch-action: manipulation;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, var(--accent-soft), transparent 30%),
    radial-gradient(circle at 85% 90%, oklch(0.55 0.08 235 / 0.12), transparent 34%),
    var(--canvas);
}

.auth-card {
  width: min(100%, 420px);
  display: grid;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-1);
  padding: 34px;
  box-shadow: 0 28px 80px rgb(0 0 0 / 0.34);
}

.brand-mark.auth-brand { width: 52px; height: 52px; margin-bottom: 4px; }
.auth-card h1 { margin: 0; font-size: 25px; letter-spacing: -0.025em; }
.auth-copy { margin: -8px 0 6px; color: var(--muted); font-size: 12px; }
.auth-submit { width: 100%; justify-content: center; margin-top: 4px; }
.auth-error { min-height: 18px; margin: -4px 0; color: var(--danger); font-size: 11px; }
.auth-footnote { color: var(--faint); font-size: 9px; line-height: 1.6; text-align: center; }

.portal-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, var(--accent-soft), transparent 30%),
    var(--canvas);
}

.portal-shell { width: min(100% - 32px, 620px); margin: 0 auto; padding: 48px 0; }
.portal-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.portal-brand strong, .portal-brand small { display: block; }
.portal-brand strong { font-size: 15px; }
.portal-brand small { color: var(--faint); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.portal-card { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-1); padding: 32px; box-shadow: 0 24px 70px rgb(0 0 0 / .28); }
.portal-card h1 { margin: 4px 0 8px; font-size: 24px; letter-spacing: -.02em; }
.portal-card > p:not(.eyebrow, .drawer-section-label, .portal-note) { margin: 0 0 24px; color: var(--muted); font-size: 12px; }
.portal-account .drawer-profile { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border-subtle); }
.portal-download { width: 100%; justify-content: center; margin-top: 24px; }
.portal-subscription { display: grid; gap: 14px; margin-top: 24px; padding: 20px; border: 1px solid var(--border); background: var(--canvas); }
.portal-subscription h2 { margin: 5px 0 0; color: var(--text-soft); font-size: 15px; font-weight: 600; }
.portal-subscription > div > p:not(.drawer-section-label) { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.portal-subscription > .button { width: 100%; justify-content: center; }
.portal-subscription-value { display: grid; gap: 10px; }
.portal-subscription-value[hidden] { display: none; }
.portal-subscription-value label { display: block; color: var(--faint); font-size: 10px; }
.portal-subscription-value > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.portal-subscription-value input { min-width: 0; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-soft); font-family: var(--font-mono); font-size: 10px; padding: 0 11px; }
.subscription-qr {
  display: grid;
  width: 208px;
  height: 208px;
  place-items: center;
  justify-self: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}
.portal-subscription-value > .subscription-qr { grid-template-columns: none; }
.portal-subscription-value > .subscription-client-picker,
.subscription-client-picker {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}
.subscription-client-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.subscription-client-heading strong,
.subscription-client-heading small { display: block; }
.subscription-client-heading strong { color: var(--text-soft); font-size: 10px; font-weight: 650; }
.subscription-client-heading small { color: var(--faint); font-size: 9px; text-align: right; }
.portal-subscription-value > .subscription-client-picker { grid-template-columns: none; }
.portal-subscription-value .subscription-client-heading { grid-template-columns: none; }
.portal-subscription-value .subscription-client-heading small { margin: 0; }
.portal-subscription-value .subscription-client-actions,
.subscription-client-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.subscription-client-action {
  display: grid;
  min-height: 76px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 13px;
  color: var(--text-soft);
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, transform 120ms var(--ease-out);
}
.subscription-client-action span,
.subscription-client-action strong,
.subscription-client-action small { display: block; min-width: 0; }
.subscription-client-actions .subscription-client-action strong { font-size: 10px; font-weight: 650; }
.subscription-client-actions .subscription-client-action small { margin-top: 6px; color: var(--faint); font-size: 8px; line-height: 1.45; }
.subscription-client-action .subscription-client-badge {
  border-radius: var(--r-pill);
  background: var(--surface-3);
  padding: 4px 7px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  white-space: nowrap;
}
.subscription-client-action.recommended {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}
.subscription-client-action.recommended .subscription-client-badge {
  background: var(--accent);
  color: var(--accent-ink);
}
.subscription-qr canvas,
.subscription-qr img { display: block; width: 184px; height: 184px; image-rendering: pixelated; }
.subscription-qr.unavailable {
  color: #24322c;
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}
.subscription-secret-note {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.55;
}
.portal-guide { margin-top: 16px; border-top: 1px solid var(--border-subtle); padding-top: 16px; }
.portal-guide summary { color: var(--text-soft); cursor: pointer; font-size: 11px; font-weight: 600; }
.portal-guide ol { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.portal-guide code { color: var(--text-soft); font-family: var(--font-mono); }

button, input, select, textarea { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

button:active { transform: scale(0.96); }

a { color: inherit; text-decoration: none; }

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-160%);
  transition: transform 160ms var(--ease-out);
}

.skip-link:focus { transform: translateY(0); }

.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;
}

.app-shell { min-height: 100vh; }

.rail {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--rail-width);
  flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  background: var(--rail);
  padding: 20px 14px 16px;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 8px;
  gap: 11px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  overflow: hidden;
  filter: drop-shadow(0 7px 18px rgb(38 218 178 / 0.12));
}

.brand-mark img { display: block; width: 100%; height: 100%; }
.brand-mark.small { width: 32px; height: 32px; }

.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 15px; letter-spacing: 0.01em; }
.brand-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }

.primary-nav {
  position: relative;
  display: grid;
  gap: 4px;
  margin-top: 30px;
}

.nav-indicator {
  position: absolute;
  z-index: 2;
  left: -14px;
  top: 0;
  width: 3px;
  height: 44px;
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  background: var(--accent);
  transition: transform 280ms var(--ease-out);
  pointer-events: none;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: transform 120ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}

.nav-item svg { width: 17px; height: 17px; }
.nav-item.active { background: var(--accent-soft); color: var(--text); }
.nav-item.active svg { color: var(--accent); }
.nav-item span:nth-child(2) { font-weight: 550; }
.nav-count { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }

.rail-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: auto 5px 0;
  padding: 14px 9px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.rail-status strong, .rail-status small { display: block; }
.rail-status strong { color: var(--text-soft); font-size: 12px; font-weight: 600; }
.rail-status small { margin-top: 2px; color: var(--faint); font-size: 10px; }

.status-orbit {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid oklch(0.78 0.145 154 / 0.24);
  border-radius: 50%;
}

.status-orbit::after {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid oklch(0.78 0.145 154 / 0.34);
  border-radius: 50%;
  content: "";
  animation: status-ping 2.8s ease-out infinite;
}

.status-orbit span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

@keyframes status-ping {
  0%, 44% { opacity: 0; transform: scale(0.5); }
  55% { opacity: 1; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(1.65); }
}

.rail-footer { padding: 12px 3px 0; }
.profile-menu-wrap { position: relative; }
.profile-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 5;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.34);
}
.profile-menu[hidden] { display: none; }
.profile-menu button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border-radius: var(--r-xs);
  color: var(--text-soft);
  font-size: 12px;
  text-align: left;
}
.profile-menu button:hover, .profile-menu button:focus-visible {
  background: var(--surface-3);
  color: var(--text);
}
.profile-menu button:disabled { opacity: 0.5; }
.profile-menu svg { width: 16px; height: 16px; color: var(--muted); }
.profile-button {
  display: grid;
  width: 100%;
  min-height: 48px;
  grid-template-columns: 32px 1fr 18px;
  align-items: center;
  gap: 9px;
  padding: 6px;
  border-radius: var(--r-sm);
  background: transparent;
  text-align: left;
}
.profile-button .avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--text-soft);
  font-size: 11px;
}
.profile-button strong, .profile-button small { display: block; }
.profile-button strong { font-size: 12px; font-weight: 600; }
.profile-button small { color: var(--faint); font-size: 10px; }
.profile-button svg { color: var(--faint); }
.legal { display: flex; gap: 14px; padding: 8px 7px 0; color: var(--faint); font-size: 10px; }

.workspace {
  min-height: 100vh;
  margin-left: var(--rail-width);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: oklch(0.125 0.008 165 / 0.96);
  padding: 0 30px;
}

.environment { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.environment strong { color: var(--text-soft); font-weight: 600; }
.environment span:last-child::before { margin-right: 8px; color: var(--faint); content: "/"; }
.environment-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-button {
  position: relative;
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  transition: transform 120ms var(--ease-out), color 160ms ease, background-color 160ms ease;
}

.icon-button.small { width: 32px; height: 32px; min-width: 32px; }
.icon-button.small::after { position: absolute; inset: -4px; content: ""; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; border: 1px solid var(--canvas); border-radius: 50%; background: var(--warning); }

.command-button {
  display: flex;
  min-width: 232px;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  margin-right: 4px;
  padding: 0 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--muted);
  text-align: left;
  transition: transform 120ms var(--ease-out), border-color 160ms ease, background-color 160ms ease;
}
.command-button svg { width: 15px; height: 15px; }
.command-button span { flex: 1; }
.command-button kbd { padding: 2px 6px; border: 1px solid var(--border); border-radius: var(--r-xs); background: var(--surface-2); color: var(--faint); font-family: inherit; font-size: 10px; }
.mobile-menu { display: none; }

main {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 34px 34px 72px;
}

.view { display: none; animation: view-enter 340ms var(--ease-out) both; }
.view.active { display: block; }
@keyframes view-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

.page-heading {
  display: flex;
  min-height: 82px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1, h2, p { text-wrap: pretty; }
h1 {
  margin: 0;
  font-size: clamp(27px, 3vw, 32px);
  font-weight: 610;
  letter-spacing: -0.022em;
  line-height: 1.08;
  text-wrap: balance;
}
.page-heading > div > p:last-child { max-width: 620px; margin: 10px 0 0; color: var(--muted); }
h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.012em; line-height: 1.2; }

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  transition: transform 120ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}
.button svg { width: 16px; height: 16px; }
.button.primary { background: var(--accent); color: var(--accent-ink); }
.button.secondary { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft); }
.button.compact { min-height: 40px; padding: 0 12px; font-size: 10px; }
.button:disabled { cursor: not-allowed; opacity: 0.46; }
.heading-actions { display: flex; gap: 8px; }

.view#view-users .page-heading { margin-bottom: 16px; }
.account-panel { display: none; }
.account-panel.active { display: block; animation: view-enter 220ms var(--ease-out) both; }
.account-context {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  color: var(--faint);
  font-size: 10px;
}
.account-context span:first-child { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.account-panel .view-context { margin: 0 0 16px; }

.status-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}
.status-band article {
  position: relative;
  display: grid;
  min-height: 116px;
  align-content: center;
  padding: 19px 24px;
}
.status-band article + article::before { position: absolute; inset: 21px auto 21px 0; width: 1px; background: var(--border-subtle); content: ""; }
.status-band span { color: var(--muted); font-size: 11px; }
.status-band strong { margin: 4px 0 1px; font-size: 26px; font-variant-numeric: tabular-nums; font-weight: 590; letter-spacing: -0.02em; line-height: 1.2; }
.status-band strong small { color: var(--muted); font-size: 13px; font-weight: 500; }
.status-band em { color: var(--faint); font-size: 10px; font-style: normal; }
.status-band em.good { color: var(--accent); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, .85fr);
  gap: 20px;
}
.panel { min-width: 0; background: var(--surface-1); }
.traffic-panel, .host-summary, .deployment-panel, .event-panel { padding: 22px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading .eyebrow { margin-bottom: 4px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--border-subtle); border-radius: var(--r-sm); background: var(--canvas); }
.segmented button { min-width: 36px; min-height: 28px; border-radius: 5px; background: transparent; color: var(--faint); font-size: 10px; }
.segmented button.active { background: var(--surface-3); color: var(--text); }
.chart-legend { display: flex; gap: 24px; margin-top: 24px; color: var(--muted); font-size: 11px; }
.chart-legend span { display: flex; align-items: center; gap: 7px; }
.chart-legend .line { display: inline-block; width: 16px; height: 2px; }
.chart-legend .line.up { background: var(--warning); }
.chart-legend .line.down { background: var(--accent); }
.traffic-chart { position: relative; height: 250px; margin-top: 7px; padding: 8px 0 22px 34px; }
.traffic-chart > svg { width: 100%; height: 100%; overflow: visible; }
.grid-lines path { fill: none; stroke: var(--border-subtle); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-line { fill: none; stroke-width: 2.1; vector-effect: non-scaling-stroke; }
.chart-line.download { stroke: var(--accent); }
.chart-line.upload { stroke: var(--warning); }
.area-line { stroke: none; }
.down-area { fill: oklch(0.78 0.145 154 / 0.055); }
.chart-y { position: absolute; inset: 4px auto 22px 0; display: flex; flex-direction: column; justify-content: space-between; color: var(--faint); font-size: 9px; font-variant-numeric: tabular-nums; }
.chart-x { position: absolute; right: 0; bottom: 0; left: 34px; display: flex; justify-content: space-between; color: var(--faint); font-size: 9px; }
.dashboard-network-trend { margin-top: 24px; padding: 24px; }
.node-health-panel { margin-top: 24px; padding: 24px; }
.node-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.node-health-card {
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--canvas);
  padding: 16px;
}
.node-health-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.node-health-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 15px;
  border-top: 1px solid var(--border-subtle);
}
.node-health-metrics > span { position: relative; min-width: 0; padding: 14px 10px 0; }
.node-health-metrics > span:first-child { padding-left: 0; }
.node-health-metrics > span + span { border-left: 1px solid var(--border-subtle); }
.node-health-metrics small, .node-health-metrics strong, .node-health-metrics em { display: block; }
.node-health-metrics small { color: var(--faint); font-size: 9px; }
.node-health-metrics strong { margin-top: 4px; color: var(--text-soft); font-size: 15px; font-variant-numeric: tabular-nums; }
.node-health-metrics em {
  overflow: hidden;
  margin-top: 3px;
  color: var(--faint);
  font-size: 8px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.node-health-metrics i {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent) var(--load), var(--surface-3) var(--load));
}
.network-trend-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 24px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.network-trend-summary > span { min-width: 0; padding: 16px; }
.network-trend-summary > span + span { border-left: 1px solid var(--border-subtle); }
.network-trend-summary small, .network-trend-summary strong { display: block; }
.network-trend-summary small { color: var(--faint); font-size: 10px; }
.network-trend-summary strong {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.network-trend-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  color: var(--faint);
  font-size: 10px;
}
.network-trend-note span:last-child { flex: none; color: var(--muted); }

.text-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 4px;
  padding: 0 2px 0 10px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}
.text-button svg { width: 14px; height: 14px; }
.node-list { margin-top: 15px; }
.node-row {
  display: grid;
  width: 100%;
  min-height: 58px;
  grid-template-columns: 12px minmax(120px, 1fr) 64px 47px;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border-subtle);
  background: transparent;
  text-align: left;
  transition: transform 120ms var(--ease-out), background-color 160ms ease;
}
.node-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.node-pulse.warning { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.node-name strong, .node-name small { display: block; }
.node-name strong { color: var(--text-soft); font-size: 12px; font-weight: 600; }
.node-name small { margin-top: 1px; color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.node-load { height: 3px; overflow: hidden; border-radius: var(--r-pill); background: var(--surface-3); }
.node-load i { display: block; width: var(--load); height: 100%; border-radius: inherit; background: var(--accent); }
.latency { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }
.latency.warning, .warning-text { color: var(--warning); }

.deployment-panel { min-height: 300px; }
.status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.status-badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-badge.good { background: var(--accent-soft); color: var(--accent); }
.status-badge.warning { background: var(--warning-soft); color: var(--warning); }
.status-badge.danger { background: var(--danger-soft); color: var(--danger); }
.status-badge.neutral { color: var(--muted); }
.deployment-meta { display: flex; gap: 20px; margin-top: 13px; color: var(--faint); font-size: 10px; }
.deployment-meta strong { color: var(--muted); font-weight: 550; }
.deploy-trail { display: grid; grid-template-columns: repeat(5, 1fr); margin: 24px 0 0; padding: 0; list-style: none; }
.deploy-trail li { position: relative; min-width: 0; text-align: center; }
.deploy-trail li:not(:last-child)::after { position: absolute; z-index: 0; top: 15px; left: calc(50% + 16px); width: calc(100% - 32px); height: 1px; background: var(--border); content: ""; }
.deploy-trail li.done:not(:last-child)::after { background: oklch(0.78 0.145 154 / 0.52); }
.deploy-trail li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 31px;
  height: 31px;
  margin: 0 auto 7px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-1);
  color: var(--faint);
  font-size: 10px;
}
.deploy-trail li.done > span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.deploy-trail li.current > span { border-color: var(--warning); background: var(--warning-soft); color: var(--warning); }
.deploy-trail li > span svg { width: 13px; height: 13px; }
.deploy-trail strong, .deploy-trail small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deploy-trail strong { color: var(--text-soft); font-size: 10px; font-weight: 600; }
.deploy-trail small { margin-top: 2px; color: var(--faint); font-size: 9px; }
.change-log { display: grid; gap: 4px; margin-top: 22px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.event-panel { min-height: 300px; }
.count-badge { display: grid; width: 24px; height: 24px; place-items: center; border-radius: var(--r-xs); background: var(--warning-soft); color: var(--warning); font-size: 10px; }
.event-list { margin-top: 12px; }
.event-list article { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border-subtle); }
.event-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: var(--r-sm); }
.event-icon svg { width: 15px; height: 15px; }
.event-icon.warning { background: var(--warning-soft); color: var(--warning); }
.event-icon.neutral { background: var(--surface-3); color: var(--muted); }
.event-list strong { color: var(--text-soft); font-size: 12px; font-weight: 600; }
.event-list p { margin: 3px 0 1px; color: var(--muted); font-size: 10px; }
.event-list small { color: var(--faint); font-size: 9px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.search-field {
  position: relative;
  display: flex;
  width: min(360px, 100%);
  align-items: center;
}
.search-field svg { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.search-field input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--text);
  padding: 0 12px 0 37px;
  outline: none;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
.search-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filter-group { display: flex; align-items: center; gap: 2px; }
.filter {
  min-height: 40px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}
.filter span { margin-left: 3px; color: var(--faint); font-variant-numeric: tabular-nums; }
.filter.active { background: var(--surface-2); color: var(--text-soft); }

.table-panel { background: var(--surface-1); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  height: 42px;
  border-bottom: 1px solid var(--border);
  color: var(--faint);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.07em;
  padding: 0 16px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
td { height: 64px; border-bottom: 1px solid var(--border-subtle); color: var(--muted); padding: 0 16px; font-size: 11px; white-space: nowrap; }
td.numeric { color: var(--text-soft); font-variant-numeric: tabular-nums; text-align: right; }
th:nth-last-child(2), td:nth-last-child(2) { text-align: right; }
.identity-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.avatar, .flag {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 650;
}
.identity-link strong, .identity-link small { display: block; }
.identity-link strong { color: var(--text-soft); font-size: 12px; font-weight: 600; }
.identity-link small { margin-top: 2px; color: var(--faint); font-size: 9px; }
.subscription-quick-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--canvas);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 120ms var(--ease-out), border-color 160ms ease, background-color 160ms ease;
}
.subscription-quick-button svg { width: 14px; height: 14px; color: var(--accent); }
.usage-cell { min-width: 160px; }
.usage-copy { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: var(--muted); font-variant-numeric: tabular-nums; }
.usage-copy span:last-child { color: var(--faint); }
.progress { height: 3px; overflow: hidden; border-radius: var(--r-pill); background: var(--surface-3); }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.progress.warning i { background: var(--warning); }
.tag { display: inline-flex; min-height: 22px; align-items: center; margin: 2px 3px 2px 0; padding: 0 7px; border: 1px solid var(--border-subtle); border-radius: var(--r-xs); background: var(--canvas); color: var(--muted); font-size: 9px; }
.entitlement-cell strong, .entitlement-cell small { display: block; }
.entitlement-cell strong { color: var(--text-soft); font-size: 11px; font-weight: 600; }
.entitlement-cell small { margin-top: 4px; color: var(--faint); font-size: 10px; }
.table-footer { display: flex; min-height: 54px; align-items: center; justify-content: space-between; padding: 0 16px; color: var(--faint); font-size: 10px; }
.pagination { display: flex; align-items: center; gap: 9px; }
.pagination button { min-height: 32px; padding: 0 10px; border: 1px solid var(--border-subtle); border-radius: var(--r-xs); background: var(--surface-2); color: var(--muted); font-size: 10px; }
.pagination button:disabled { opacity: .34; }

.view-context {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  margin: -16px 0 16px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--faint);
  font-size: 10px;
}
.view-context span:first-child { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.portal-note { margin: 16px 0 0; padding: 12px; background: var(--canvas); color: var(--muted); font-size: 10px; line-height: 1.55; }
.entitlement-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border-subtle); }
.entitlement-preview span { padding: 12px; background: var(--canvas); }
.entitlement-preview small, .entitlement-preview strong { display: block; }
.entitlement-preview small { color: var(--faint); font-size: 10px; }
.entitlement-preview strong { margin-top: 4px; color: var(--text-soft); font-size: 10px; font-weight: 600; }

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(350px, .75fr);
  align-items: start;
  gap: 20px;
}
.settings-form { display: grid; gap: 12px; }
.form-section { display: grid; grid-template-columns: 190px 1fr; gap: 28px; padding: 25px; background: var(--surface-1); }
.section-intro { display: flex; align-items: flex-start; gap: 10px; }
.section-intro > span { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--faint); font-size: 9px; }
.section-intro h2 { font-size: 15px; }
.section-intro p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 14px; }
.field { display: grid; gap: 7px; color: var(--muted); font-size: 10px; }
.field.full { grid-column: 1 / -1; }
.field > span { font-weight: 600; }
.field input, .field select, .field textarea, .input-affix {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  outline: 0;
  background: var(--surface-1);
  color: var(--text-soft);
  padding: 9px 11px;
  font-size: 12px;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input-affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.field input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field-hint { color: var(--faint); }
.field-error { display: none; color: var(--danger); }
.field-error.visible { display: block; }
.input-affix { display: flex; align-items: center; padding: 0; overflow: hidden; }
.input-affix span { padding-left: 11px; color: var(--faint); }
.input-affix input { min-height: 38px; border: 0; background: transparent; box-shadow: none !important; }
.format-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.format-options label {
  display: grid;
  min-height: 70px;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  background: var(--canvas);
  cursor: pointer;
}
input[type="checkbox"] { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--accent); }
.format-options strong, .format-options small { display: block; }
.format-options strong { color: var(--text-soft); font-size: 11px; font-weight: 600; }
.format-options small { margin-top: 4px; color: var(--faint); font-size: 9px; line-height: 1.45; }
.preview-panel { position: sticky; top: 88px; padding: 20px; background: var(--surface-1); }
.preview-heading { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.subscription-card { display: grid; grid-template-columns: 32px 1fr 48px; align-items: center; gap: 11px; margin-top: 20px; padding: 15px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.subscription-card p, .subscription-card strong { margin: 0; display: block; }
.subscription-card p { color: var(--faint); font-size: 9px; }
.subscription-card strong { margin-top: 2px; font-size: 12px; font-weight: 600; }
.usage-ring { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 50%; background: radial-gradient(circle closest-side, var(--surface-1) 78%, transparent 80% 100%), conic-gradient(var(--accent) calc(var(--usage) * 1%), var(--surface-3) 0); color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.preview-stats { display: grid; grid-template-columns: 1fr 1fr; padding: 15px; border-bottom: 1px solid var(--border-subtle); }
.preview-stats span + span { padding-left: 15px; border-left: 1px solid var(--border-subtle); }
.preview-stats small, .preview-stats strong { display: block; }
.preview-stats small { color: var(--faint); font-size: 9px; }
.preview-stats strong { margin-top: 3px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.preview-url { display: grid; gap: 7px; margin-top: 18px; color: var(--muted); font-size: 10px; }
.preview-url > div { display: grid; min-height: 44px; grid-template-columns: minmax(0,1fr) 40px; align-items: center; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--canvas); }
.preview-url code { overflow: hidden; padding-left: 11px; color: var(--text-soft); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.format-tabs { display: flex; margin-top: 18px; border-bottom: 1px solid var(--border); }
.format-tabs button { min-height: 37px; padding: 0 12px; border-bottom: 2px solid transparent; background: transparent; color: var(--faint); font-size: 10px; }
.format-tabs button.active { border-color: var(--accent); color: var(--text-soft); }
.code-preview { min-height: 213px; margin: 0; overflow: auto; padding: 16px 4px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; line-height: 1.7; }
.code-key { color: oklch(0.76 0.08 215); }
.code-num { color: var(--warning); }
.code-bool { color: oklch(0.76 0.11 320); }
.code-string { color: var(--accent); }
.code-variable { color: oklch(0.77 0.1 265); }

.host-map { margin-bottom: 20px; background: var(--surface-1); }
.runtime-console { margin-bottom: 24px; background: var(--surface-1); }
.runtime-console-heading {
  display: flex;
  min-height: 104px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  padding: 24px;
}
.runtime-console-heading h2 { margin-top: 4px; font-size: 20px; }
.runtime-console-heading p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.runtime-build {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  color: var(--faint);
  font-size: 10px;
}
.runtime-build code { margin-left: auto; color: var(--muted); }
.protocol-toolbar {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
}
.protocol-toolbar strong, .protocol-toolbar small { display: block; }
.protocol-toolbar strong { color: var(--text-soft); font-size: 12px; font-weight: 600; }
.protocol-toolbar small { margin-top: 4px; color: var(--faint); font-size: 10px; }
.protocol-toolbar a { color: var(--muted); font-size: 10px; }
.protocol-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}
.protocol-card {
  min-height: 220px;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px;
}
.protocol-card.enabled { box-shadow: inset 2px 0 var(--accent); }
.protocol-card header, .protocol-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.protocol-kind { color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; text-transform: uppercase; }
.protocol-card h3 { margin-top: 24px; color: var(--text-soft); font-size: 14px; }
.protocol-card > p { min-height: 48px; margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.protocol-meta { display: flex; gap: 8px; margin-top: 12px; }
.protocol-meta span { padding: 4px 6px; background: var(--canvas); color: var(--faint); font-size: 9px; }
.protocol-card footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.protocol-card footer a { color: var(--faint); font-size: 9px; }
.protocol-card footer .button { min-height: 40px; padding: 0 12px; font-size: 9px; }
.protocol-subsection { display: grid; gap: 12px; padding: 16px; background: var(--canvas); }
.protocol-subsection-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.protocol-subsection-heading strong, .protocol-subsection-heading small { display: block; }
.protocol-subsection-heading strong { color: var(--text-soft); font-size: 11px; }
.protocol-subsection-heading small { margin-top: 4px; color: var(--faint); font-size: 9px; }
.host-protocol-list { display: grid; gap: 1px; background: var(--border-subtle); }
.protocol-group { display: grid; gap: 1px; background: var(--border-subtle); }
.protocol-group + .protocol-group { margin-top: 12px; }
.protocol-group-heading {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: var(--canvas);
}
.protocol-group-heading strong { color: var(--text-soft); font-size: 10px; }
.protocol-group-heading small { color: var(--faint); font-size: 9px; line-height: 1.5; }
.protocol-host-row {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: var(--surface-1);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.protocol-host-row:hover { background: var(--surface-2); }
.protocol-activation-card {
  display: grid;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-1));
  padding: 16px;
}
.protocol-activation-card strong { color: var(--text); font-size: 12px; }
.protocol-activation-card small { color: var(--muted); font-size: 10px; line-height: 1.7; }
.protocol-activation-card .activation-error { color: var(--danger); }
.activation-flow { display: flex; align-items: center; gap: 7px; margin-top: 4px; color: var(--text-soft); font-size: 9px; }
.activation-flow i { width: 18px; height: 1px; background: var(--accent); opacity: .55; }
.protocol-one-click > .drawer-section-label,
.protocol-one-click > .field,
.protocol-one-click > .quota-input,
.protocol-one-click > .protocol-subsection,
.protocol-one-click > .source-note { display: none; }
.source-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; background: var(--canvas); color: var(--faint); font-size: 9px; }
.source-note a { color: var(--muted); }
.map-header { display: flex; height: 52px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-subtle); padding: 0 20px; color: var(--muted); font-size: 10px; }
.map-header span:last-child { display: flex; align-items: center; gap: 7px; }
.map-header i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.map-header .partial i { background: var(--warning); }
.map-header .offline i { background: var(--danger); }
.map-stage {
  position: relative;
  height: 320px;
  overflow: hidden;
  isolation: isolate;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 48px 48px;
}
.map-stage::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, var(--accent-soft), transparent 22%),
    radial-gradient(circle at 50% 50%, transparent 44%, var(--surface-1) 88%);
  pointer-events: none;
  content: "";
}
.map-stage::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(90deg, var(--surface-1), transparent 8% 92%, var(--surface-1));
  pointer-events: none;
  content: "";
}
.map-loading,
.topology-empty {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 72%;
  color: var(--faint);
  font-size: 10px;
  transform: translate(-50%, -50%);
}
.topology-links {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.topology-link {
  stroke: var(--faint);
  stroke-linecap: round;
  stroke-width: 1.25;
  opacity: .4;
  transition: stroke 180ms ease, opacity 180ms ease;
}
.topology-link.online {
  stroke: var(--accent);
  opacity: .58;
  filter: drop-shadow(0 0 4px color-mix(in oklab, var(--accent) 38%, transparent));
}
.topology-link.pending {
  stroke: var(--warning);
  stroke-dasharray: 5 7;
  opacity: .48;
}
.topology-link.warning {
  stroke: var(--danger);
  stroke-dasharray: 3 6;
  opacity: .58;
}
.map-origin,
.map-node {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
}
.topology-panel {
  left: 50%;
  top: 50%;
  display: grid;
  width: 190px;
  min-height: 68px;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in oklab, var(--accent) 42%, var(--border));
  border-radius: var(--r-md);
  background: color-mix(in oklab, var(--surface-2) 92%, transparent);
  box-shadow:
    0 16px 44px oklch(0 0 0 / .28),
    0 0 0 5px color-mix(in oklab, var(--accent) 5%, transparent);
  backdrop-filter: blur(10px);
}
.topology-panel-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--surface-3);
}
.topology-panel-mark img { width: 28px; height: 28px; }
.topology-panel strong,
.topology-panel small,
.topology-panel em,
.topology-node strong,
.topology-node small,
.topology-node em { display: block; min-width: 0; }
.topology-panel strong { color: var(--text); font-size: 11px; font-weight: 650; }
.topology-panel small {
  max-width: 116px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--faint);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topology-panel em {
  grid-column: 1 / -1;
  color: var(--accent);
  font-size: 8px;
  font-style: normal;
  letter-spacing: .05em;
}
.topology-panel em i,
.topology-node em i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in oklab, currentColor 12%, transparent);
  vertical-align: 1px;
}
.topology-node {
  left: var(--topology-x);
  top: var(--topology-y);
  display: grid;
  width: clamp(154px, 16vw, 188px);
  min-height: 64px;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: color-mix(in oklab, var(--surface-2) 94%, transparent);
  color: var(--faint);
  text-align: left;
  box-shadow: 0 10px 28px oklch(0 0 0 / .2);
  backdrop-filter: blur(8px);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
.topology-node-mark {
  position: relative;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  font: 8px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.topology-node-mark > i {
  position: absolute;
  right: -1px;
  bottom: 1px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--surface-2);
  border-radius: 50%;
  background: var(--faint);
}
.topology-node-copy { min-width: 0; }
.topology-node strong {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topology-node small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--faint);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topology-node em {
  margin-top: 6px;
  color: var(--faint);
  font-size: 8px;
  font-style: normal;
}
.topology-node.online { border-color: color-mix(in oklab, var(--accent) 28%, var(--border)); }
.topology-node.online .topology-node-mark > i { background: var(--accent); }
.topology-node.online em { color: var(--accent); }
.topology-node.pending .topology-node-mark > i { background: var(--warning); }
.topology-node.pending em { color: var(--warning); }
.topology-node.warning .topology-node-mark > i { background: var(--danger); }
.topology-node.warning em { color: var(--danger); }
.host-table td { height: 70px; }
.host-table td:nth-child(3) { min-width: 280px; white-space: normal; }
.host-protocol-tags {
  display: flex;
  max-width: 520px;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}
.host-protocol-tags .tag { margin: 0; }
.protocol-latency-tag { gap: 7px; }
.protocol-latency-value {
  font-size: 8px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.protocol-latency-value.good { color: var(--accent); }
.protocol-latency-value.warning { color: var(--warning); }
.protocol-latency-value.danger { color: var(--danger); }
.protocol-latency-value.neutral { color: var(--faint); }
.flag { border-radius: 50%; font-size: 9px; }

.release-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 15px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.release-header > div { display: flex; align-items: center; gap: 10px; }
.release-version { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 600; }
.release-header p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.deploy-trail.full { margin: 24px 0; padding: 18px 10px; background: var(--surface-1); }
.deploy-trail.full li > span { background: var(--surface-1); }
.deploy-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .65fr); gap: 20px; align-items: start; }
.config-editor { overflow: hidden; background: oklch(0.105 0.006 165); }
.editor-tabs { display: flex; min-height: 48px; align-items: flex-end; border-bottom: 1px solid var(--border); padding: 0 10px; }
.editor-tabs button { min-height: 40px; padding: 0 12px; border-bottom: 2px solid transparent; background: transparent; color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.editor-tabs button.active { border-color: var(--accent); color: var(--text-soft); }
.editor-tabs span { margin: 0 5px 12px auto; color: var(--faint); font-size: 9px; }
.editor-body { display: grid; min-height: 430px; grid-template-columns: 46px minmax(0,1fr); overflow: auto; padding: 16px 0 22px; }
.line-numbers { margin: 0; padding: 0 13px 0 0; border-right: 1px solid var(--border-subtle); color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.9; list-style: none; text-align: right; user-select: none; }
.editor-body pre { margin: 0; padding: 0 18px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.9; }
.editor-footer { display: flex; min-height: 38px; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding: 0 14px; color: var(--faint); font-size: 9px; }
.editor-footer span:first-child { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.good-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.validation-panel { padding: 20px; background: var(--surface-1); }
.check-list { margin-top: 16px; border-top: 1px solid var(--border); }
.check-list > div { display: grid; min-height: 58px; grid-template-columns: 27px 1fr; align-items: center; gap: 10px; border-bottom: 1px solid var(--border-subtle); }
.check-list > div > span { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--faint); font-size: 9px; }
.check-list > div.pass > span { border-color: oklch(0.78 0.145 154 / .4); background: var(--accent-soft); color: var(--accent); }
.check-list > div.running > span { border-color: var(--warning); color: var(--warning); animation: rotate-status 900ms linear infinite; }
@keyframes rotate-status { to { transform: rotate(360deg); } }
.check-list svg { width: 12px; height: 12px; }
.check-list strong, .check-list small { display: block; }
.check-list strong { color: var(--text-soft); font-size: 11px; font-weight: 600; }
.check-list small { margin-top: 2px; color: var(--faint); font-size: 9px; }
.change-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; padding: 13px 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.change-summary span { color: var(--muted); font-size: 9px; text-align: center; }
.change-summary i { margin-right: 3px; font-style: normal; }
.change-summary i.add { color: var(--accent); }
.change-summary i.modify { color: var(--warning); }
.change-summary i.remove { color: var(--danger); }
.change-summary strong { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.target-nodes { margin-top: 18px; }
.target-nodes > p { margin: 0 0 8px; color: var(--faint); font-size: 9px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.target-nodes label { display: grid; min-height: 37px; grid-template-columns: 22px 1fr auto; align-items: center; color: var(--muted); font-size: 10px; cursor: pointer; }
.target-nodes small { color: var(--faint); font-variant-numeric: tabular-nums; }

.not-found { max-width: 540px; padding: 14vh 0; }
.not-found .brand-mark { margin-bottom: 28px; }
.not-found h1 { margin-bottom: 14px; font-size: 38px; }
.not-found > p:not(.eyebrow) { margin: 0 0 28px; color: var(--muted); }

.drawer {
  position: fixed;
  z-index: 102;
  inset: 0 0 0 auto;
  display: grid;
  width: min(440px, 100vw);
  grid-template-rows: auto 1fr auto;
  border-left: 1px solid var(--border);
  border-radius: var(--r-md) 0 0 var(--r-md);
  background: var(--surface-2);
  opacity: 0;
  overscroll-behavior: contain;
  transform: translateX(102%);
  transition: transform 280ms var(--ease-out), opacity 200ms ease;
}
.drawer.open { opacity: 1; transform: translateX(0); }
.drawer-header { display: flex; min-height: 82px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 16px 24px; }
.drawer-header .eyebrow { margin-bottom: 4px; }
.drawer-header h2 { font-size: 18px; }
.drawer-content { overflow-y: auto; padding: 24px; }
.drawer-footer { display: flex; min-height: 64px; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); }
.drawer-scrim { position: fixed; z-index: 101; inset: 0; background: oklch(0.06 0.004 165 / .7); opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer-form { display: grid; gap: 20px; }
.drawer-profile { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.drawer-profile .avatar { width: 42px; height: 42px; }
.drawer-profile strong, .drawer-profile small { display: block; }
.drawer-profile strong { font-size: 14px; }
.drawer-profile small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.quota-input { display: grid; grid-template-columns: 1fr 90px; gap: 8px; }
.drawer-section-label { margin: 2px 0 -8px; color: var(--faint); font-size: 9px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.switch-row { display: flex; min-height: 48px; align-items: center; justify-content: space-between; border-top: 1px solid var(--border-subtle); }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { color: var(--text-soft); font-size: 11px; font-weight: 600; }
.switch-row small { margin-top: 2px; color: var(--faint); font-size: 9px; }
.switch { position: relative; width: 40px; height: 24px; flex: 0 0 auto; padding: 0; border-radius: var(--r-pill); background: var(--surface-3); transition: transform 120ms var(--ease-out), background-color 160ms ease; }
.switch::before { position: absolute; inset: -8px 0; content: ""; }
.switch::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); content: ""; transition: transform 180ms var(--ease-out), background-color 160ms ease; }
.switch.on { background: var(--accent-soft); }
.switch.on::after { background: var(--accent); transform: translateX(18px); }
.user-access-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--canvas);
  padding: 16px;
}
.user-access-card strong,
.user-access-card small { display: block; }
.user-access-card strong { color: var(--text-soft); font-size: 11px; font-weight: 600; }
.user-access-card small { margin-top: 4px; color: var(--faint); font-size: 9px; line-height: 1.55; }
.secure-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.secure-link-row input {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 0 10px;
}
.subscription-access {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}
.subscription-access > .button { width: 100%; justify-content: center; }
.subscription-result { display: grid; gap: 10px; }
.subscription-result[hidden] { display: none; }
.quick-subscription-panel { display: grid; gap: 20px; }
.portal-login-help { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 16px; background: var(--canvas); }
.portal-login-help svg { width: 18px; height: 18px; margin: 4px 0 0 4px; color: var(--muted); }
.portal-login-help strong, .portal-login-help small { display: block; }
.portal-login-help strong { color: var(--text-soft); font-size: 12px; font-weight: 600; }
.portal-login-help small { margin-top: 4px; color: var(--faint); font-size: 10px; }
.portal-home { display: grid; gap: 24px; }
.portal-home .drawer-profile { padding-bottom: 16px; }
.portal-home .drawer-profile .status-badge { margin-left: auto; }
.portal-entitlement h3 { margin: 8px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -0.012em; }
.portal-entitlement > p:not(.drawer-section-label) { margin: 4px 0 16px; color: var(--muted); font-size: 11px; }
.portal-client-list { display: grid; border-top: 1px solid var(--border); }
.portal-client-list button { display: grid; min-height: 60px; grid-template-columns: 1fr auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--border-subtle); background: transparent; text-align: left; }
.portal-client-list button strong, .portal-client-list button small { display: block; }
.portal-client-list button strong { color: var(--text-soft); font-size: 12px; font-weight: 600; }
.portal-client-list button small { margin-top: 4px; color: var(--faint); font-size: 10px; }
.portal-client-list button > span:last-child { color: var(--accent); font-size: 10px; font-weight: 600; }

.toast-region { position: fixed; z-index: 160; right: 18px; bottom: 18px; pointer-events: none; }
.toast {
  display: grid;
  min-width: 290px;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-3);
  opacity: 0;
  transform: translateY(14px);
  transition: transform 230ms var(--ease-out), opacity 180ms ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: var(--r-xs); background: var(--accent-soft); color: var(--accent); }
.toast svg { width: 15px; height: 15px; }
.toast strong, .toast p { display: block; margin: 0; }
.toast strong { font-size: 11px; font-weight: 650; }
.toast p { margin-top: 2px; color: var(--muted); font-size: 9px; }

.mobile-nav { display: none; }

.workspace-tabs {
  display: flex;
  min-height: 48px;
  align-items: flex-end;
  gap: 24px;
  margin: -8px 0 22px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.workspace-tabs button {
  position: relative;
  min-height: 48px;
  flex: 0 0 auto;
  padding: 0 2px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.workspace-tabs button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  content: "";
}

.workspace-tabs button.active { color: var(--text); }
.workspace-tabs button.active::after { background: var(--accent); }
.workspace-tabs button span { margin-left: 5px; color: var(--faint); font-size: 10px; }

.resource-panel {
  min-height: 300px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-1);
  padding: 24px;
}

.resource-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.resource-panel-heading h2 { margin-bottom: 7px; }
.resource-panel-heading p:last-child { max-width: 620px; margin: 0; color: var(--muted); font-size: 11px; }
.resource-list { display: grid; }
.resource-list article {
  display: grid;
  min-height: 76px;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.resource-list strong, .resource-list small { display: block; }
.resource-list strong { color: var(--text-soft); font-size: 12px; }
.resource-list small { margin-top: 3px; color: var(--faint); font-size: 10px; }

.resource-icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.resource-icon svg { width: 15px; height: 15px; }

.empty-resource {
  display: grid;
  min-height: 250px;
  place-items: center;
  align-content: center;
  text-align: center;
}
.empty-resource h2 { margin: 14px 0 5px; }
.empty-resource p { max-width: 480px; margin: 0 0 18px; color: var(--muted); font-size: 11px; }

.policy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 20px;
}
.policy-list, .policy-inspector { padding: 22px; }
.rule-row {
  display: grid;
  min-height: 72px;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.rule-row strong, .rule-row small { display: block; }
.rule-row strong { color: var(--text-soft); font-size: 11px; font-weight: 600; }
.rule-row small { margin-top: 3px; color: var(--faint); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.rule-order { color: var(--faint); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.rule-row.final { border-bottom: 0; }
.policy-inspector > p:not(.eyebrow) { margin: 8px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.setting-row {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border-subtle);
}
.setting-row strong, .setting-row small { display: block; }
.setting-row strong { color: var(--text-soft); font-size: 11px; }
.setting-row small { margin-top: 3px; color: var(--faint); font-size: 9px; }

.operations-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 22px;
  border: 1px solid var(--border-subtle);
  background: var(--border-subtle);
}
.operations-summary article {
  display: flex;
  min-height: 82px;
  align-items: center;
  gap: 13px;
  background: var(--surface-1);
  padding: 17px;
}
.operations-summary small, .operations-summary strong { display: block; }
.operations-summary small { color: var(--faint); font-size: 9px; }
.operations-summary strong { margin-top: 4px; color: var(--text-soft); font-size: 13px; }
.operations-tabs { margin-top: 0; }
.runtime-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
  border: 1px solid var(--border-subtle);
}
.runtime-facts > span { min-width: 0; padding: 16px; }
.runtime-facts > span + span { border-left: 1px solid var(--border-subtle); }
.runtime-facts small, .runtime-facts strong { display: block; }
.runtime-facts small { color: var(--faint); font-size: 9px; }
.runtime-facts strong { margin-top: 5px; overflow-wrap: anywhere; color: var(--text-soft); font-size: 11px; font-weight: 600; }
.terminal-log {
  display: grid;
  gap: 8px;
  min-height: 230px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--border-subtle);
  background: var(--canvas);
  color: var(--muted);
  font: 10px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.terminal-log time { margin-right: 10px; color: var(--faint); }
.diagnostic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.diagnostic-grid article {
  display: grid;
  min-height: 74px;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-subtle);
  padding: 14px;
}
.diagnostic-grid article > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--warning); }
.diagnostic-grid article.pass > span { background: var(--accent-soft); color: var(--accent); }
.diagnostic-grid svg { width: 13px; height: 13px; }
.diagnostic-grid strong, .diagnostic-grid small { display: block; }
.diagnostic-grid strong { color: var(--text-soft); font-size: 11px; }
.diagnostic-grid small { margin-top: 3px; color: var(--faint); font-size: 9px; }

.system-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.system-card { display: grid; min-height: 230px; grid-template-columns: 42px 1fr; align-content: start; gap: 16px; padding: 24px; }
.system-card h2 { margin-bottom: 8px; }
.system-card p:not(.eyebrow) { margin: 0 0 20px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.certificate-settings-form { display: grid; gap: 14px; }
.certificate-settings-form .heading-actions { align-items: center; justify-content: space-between; }
.advanced-preview {
  max-height: 520px;
  overflow: auto;
  margin: 20px 0 0;
  border: 1px solid var(--border-subtle);
  background: var(--canvas);
  padding: 18px;
  color: var(--text-soft);
  font: 10px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre;
}
.advanced-drawer { display: grid; gap: 16px; }
.advanced-drawer .advanced-preview { max-height: none; margin: 0; }
.notice-card {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  border: 1px solid var(--border);
  background: var(--canvas);
  padding: 15px;
}
.notice-card > span { color: var(--accent); }
.notice-card svg { width: 18px; height: 18px; }
.notice-card strong { color: var(--text-soft); font-size: 11px; }
.notice-card p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
#runtime-update-notice { grid-template-columns: 32px 1fr auto; align-items: center; margin-bottom: 14px; }
#operational-alert-notice {
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  margin-bottom: 14px;
  border-color: color-mix(in srgb, var(--warning) 45%, var(--border));
}
#operational-alert-notice > span { color: var(--warning); }
.access-management-panel, .audit-panel { padding: 22px; margin-bottom: 14px; }
.admin-create-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.4fr) minmax(140px, .8fr) auto;
  gap: 12px;
  align-items: end;
  margin: 18px 0;
}
.admin-access-list { display: grid; border-top: 1px solid var(--border); }
.admin-access-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(140px, .7fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  border-bottom: 1px solid var(--border);
}
.admin-access-row strong, .admin-access-row small { display: block; }
.admin-access-row small { margin-top: 4px; color: var(--faint); }
.admin-access-row input, .admin-access-row select { width: 100%; }
.audit-panel .operations-log { max-height: 320px; overflow: auto; }

@media (hover: hover) {
  .nav-item:hover, .icon-button:hover, .profile-button:hover, .node-row:hover { background-color: var(--surface-2); color: var(--text); }
  .button.primary:hover { background-color: var(--accent-strong); }
  .button.secondary:hover, .command-button:hover { border-color: var(--border); background-color: var(--surface-3); }
  .subscription-client-action:hover { border-color: var(--accent-border); background: var(--surface-3); transform: translateY(-1px); }
  .subscription-client-action.recommended:hover { background: var(--accent-soft); }
  .text-button:hover, .identity-link:hover strong { color: var(--accent); }
  .subscription-quick-button:hover { transform: translateY(-1px); border-color: var(--accent-border); background: var(--accent-soft); }
  .filter:hover { color: var(--text-soft); }
  .topology-node:hover {
    border-color: var(--accent);
    background: var(--surface-2);
    transform: translate(-50%, -50%) translateY(-2px);
  }
  .pagination button:not(:disabled):hover { color: var(--text); }
}

@media (max-width: 1120px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .traffic-panel { grid-column: 1 / -1; }
  .settings-layout { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .form-section { grid-template-columns: 170px 1fr; }
  .deploy-layout { grid-template-columns: 1fr; }
  .protocol-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .policy-layout { grid-template-columns: 1fr; }
  .runtime-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .runtime-facts > span:nth-child(3) { border-left: 0; border-top: 1px solid var(--border-subtle); }
  .runtime-facts > span:nth-child(4) { border-top: 1px solid var(--border-subtle); }
  .node-health-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  :root { --rail-width: 0px; }
  .rail {
    width: 232px;
    opacity: 0;
    transform: translateX(-102%);
    transition: transform 260ms var(--ease-out), opacity 180ms ease;
  }
  .rail.open { opacity: 1; transform: translateX(0); }
  .workspace { margin-left: 0; }
  .mobile-menu { display: inline-grid; }
  .topbar { padding: 0 20px; }
  .environment { margin-right: auto; margin-left: 12px; }
  main { padding: 28px 22px 72px; }
  .command-button { min-width: 40px; width: 40px; padding: 0; justify-content: center; }
  .command-button span, .command-button kbd { display: none; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .search-field { width: 100%; }
  .filter-group { width: 100%; overflow-x: auto; }
  .release-header { flex-direction: column; gap: 8px; }
}

@media (max-width: 680px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .topbar { height: 58px; padding: 0 14px; }
  .environment span:last-child { display: none; }
  .topbar-actions .icon-button:last-child { display: none; }
  main { padding: 24px 14px 36px; }
  .page-heading { min-height: 0; flex-direction: column; margin-bottom: 24px; }
  .page-heading .button { width: 100%; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .subscription-client-actions { grid-template-columns: 1fr; }
  .status-band { grid-template-columns: 1fr 1fr; }
  .status-band article { min-height: 96px; padding: 15px 16px; }
  .status-band article:nth-child(3)::before { inset: 0 14px auto; width: auto; height: 1px; }
  .status-band article:nth-child(4)::after { position: absolute; inset: 0 14px auto; height: 1px; background: var(--border-subtle); content: ""; }
  .status-band strong { font-size: 22px; }
  .dashboard-grid { display: block; }
  .dashboard-grid > .panel + .panel { margin-top: 14px; }
  .traffic-panel, .host-summary, .deployment-panel, .event-panel { padding: 18px 14px; }
  .dashboard-network-trend, .node-health-panel { margin-top: 16px; padding: 16px; }
  .traffic-chart { height: 210px; }
  .network-trend-summary { grid-template-columns: 1fr 1fr; }
  .network-trend-summary > span { padding: 12px; }
  .network-trend-summary > span:nth-child(3) { border-left: 0; }
  .network-trend-summary > span:nth-child(n + 3) { border-top: 1px solid var(--border-subtle); }
  .network-trend-summary strong { font-size: 16px; }
  .network-trend-note { align-items: flex-start; flex-direction: column; gap: 8px; }
  .node-health-metrics { grid-template-columns: 1fr 1fr; }
  .node-health-metrics > span { padding: 12px 10px; }
  .node-health-metrics > span:nth-child(2n + 1) { border-left: 0; }
  .node-health-metrics > span:nth-child(n + 3) { border-top: 1px solid var(--border-subtle); }
  .deployment-meta { flex-wrap: wrap; gap: 7px 14px; }
  .deploy-trail.compact small { display: none; }
  .node-row { grid-template-columns: 12px minmax(120px,1fr) 44px; }
  .node-load { display: none; }
  .toolbar { margin-bottom: 10px; }
  .account-context, .account-panel .view-context { align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; padding: 8px 0; }
  .filter-group { padding-bottom: 4px; }
  .table-panel { background: transparent; }
  .table-scroll { overflow: visible; }
  table, tbody { display: block; }
  thead { display: none; }
  tr {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
    padding: 15px;
    background: var(--surface-1);
  }
  td { display: block; height: auto; min-width: 0; border: 0; padding: 0; white-space: normal; }
  td:first-child { grid-column: 1 / -1; padding-bottom: 10px; border-bottom: 1px solid var(--border-subtle); }
  td:last-child { position: absolute; top: 14px; right: 12px; }
  td::before { display: block; margin-bottom: 5px; color: var(--faint); font-size: 8px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
  #user-table-body td:nth-child(2)::before { content: "状态"; }
  #user-table-body td:nth-child(3)::before { content: "已用 / 配额"; }
  #user-table-body td:nth-child(4)::before { content: "节点 / 订阅"; }
  #user-table-body td:nth-child(5)::before { content: "到期时间"; }
  #user-table-body td:nth-child(6)::before { content: "订阅"; }
  #user-table-body td:nth-child(7)::before { display: none; }
  .usage-cell { min-width: 0; }
  .table-footer { background: var(--surface-1); }
  .pagination { display: none; }
  .form-section { display: block; padding: 18px 14px; }
  .section-intro { margin-bottom: 20px; }
  .field-grid, .format-options { grid-template-columns: 1fr; }
  .quota-input { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .preview-panel { padding: 18px 14px; }
  .map-stage { height: 320px; }
  .topology-node { width: 150px; padding: 8px 10px; }
  .topology-panel { width: 176px; }
  .runtime-console-heading, .protocol-toolbar { align-items: flex-start; flex-direction: column; }
  .runtime-console-heading { padding: 16px; }
  .runtime-build { align-items: flex-start; flex-direction: column; gap: 8px; padding: 12px 16px; }
  .runtime-build code { margin-left: 0; overflow-wrap: anywhere; }
  .protocol-grid { grid-template-columns: 1fr; }
  .workspace-tabs { gap: 20px; margin-bottom: 18px; }
  .resource-panel { padding: 18px 14px; }
  .resource-panel-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .resource-list article { grid-template-columns: 38px 1fr auto; }
  .resource-list article .tag { display: none; }
  .operations-summary { grid-template-columns: 1fr; }
  .operations-summary article { min-height: 68px; }
  .runtime-facts { grid-template-columns: 1fr; }
  .runtime-facts > span + span { border-top: 1px solid var(--border-subtle); border-left: 0; }
  .diagnostic-grid, .system-card-grid { grid-template-columns: 1fr; }
  .system-card { min-height: 190px; padding: 18px 14px; }
  .host-table td:nth-child(2)::before { content: "状态"; }
  .host-table td:nth-child(3)::before { content: "入口协议"; }
  .host-table td:nth-child(4)::before { content: "CPU"; }
  .host-table td:nth-child(5)::before { content: "吞吐"; }
  .host-table td:nth-child(6)::before { content: "最后同步"; }
  .deploy-trail.full { margin: 16px 0; padding: 14px 4px; }
  .deploy-trail.full li > span { width: 28px; height: 28px; }
  .deploy-trail.full li:not(:last-child)::after { top: 14px; left: calc(50% + 14px); width: calc(100% - 28px); }
  .deploy-trail.full small { display: none; }
  .editor-body { min-height: 380px; grid-template-columns: 36px minmax(520px,1fr); }
  .validation-panel { padding: 18px 14px; }
  .drawer { width: 100%; border-radius: 0; }
  .drawer-scrim { display: none; }
  .toast-region { right: 12px; bottom: calc(75px + env(safe-area-inset-bottom)); left: 12px; }
  .toast { min-width: 0; width: 100%; }
  .mobile-nav {
    position: fixed;
    z-index: 90;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: calc(64px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(4,1fr);
    border-top: 1px solid var(--border);
    background: var(--rail);
    padding: 4px 5px env(safe-area-inset-bottom);
  }
  .mobile-nav button { display: grid; min-width: 0; min-height: 52px; place-items: center; align-content: center; gap: 3px; border-radius: var(--r-sm); background: transparent; color: var(--faint); font-size: 8px; }
  .mobile-nav button svg { width: 17px; height: 17px; }
  .mobile-nav button.active { color: var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
