:root {
  color-scheme: dark;
  --bg: #111417;
  --bg-elevated: #171b20;
  --bg-strong: #0e1115;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-alt: rgba(255, 255, 255, 0.06);
  --surface-muted: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f2f5f7;
  --text-muted: rgba(242, 245, 247, 0.72);
  --accent: #4fa3ff;
  --accent-strong: #6bd3ff;
  --success: #31c48d;
  --warning: #f0b429;
  --danger: #f05252;
  --info: #6aa9ff;
  --chrome-bg: linear-gradient(180deg, rgba(23, 27, 32, 0.96), rgba(15, 18, 23, 0.98));
  --panel-bg: linear-gradient(180deg, rgba(23, 27, 32, 0.96), rgba(15, 18, 23, 0.98));
  --menu-bg: linear-gradient(180deg, rgba(23, 27, 32, 0.99), rgba(15, 18, 23, 1));
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.028));
  --legacy-bg: linear-gradient(180deg, rgba(25, 34, 45, 0.96), rgba(16, 22, 30, 0.99));
  --button-bg: rgba(255, 255, 255, 0.04);
  --input-bg: rgba(255, 255, 255, 0.04);
  --overlay-bg: rgba(2, 9, 6, 0.7);
  --divider: rgba(255, 255, 255, 0.08);
  --empty-bg: rgba(255, 255, 255, 0.025);
  --empty-border: rgba(255, 255, 255, 0.16);
  --body-glow-a: color-mix(in srgb, var(--accent) 18%, transparent);
  --body-glow-b: color-mix(in srgb, var(--accent-strong) 14%, transparent);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  --shadow-hover: 0 14px 34px rgba(0, 0, 0, 0.18);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.24);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-sans: "SF Pro Display", "Inter", "Segoe UI", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Menlo", monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3f8;
  --bg-elevated: #ffffff;
  --bg-strong: #dde7f1;
  --surface: rgba(7, 26, 42, 0.04);
  --surface-alt: rgba(7, 26, 42, 0.06);
  --surface-muted: rgba(7, 26, 42, 0.03);
  --border: rgba(7, 26, 42, 0.1);
  --text: #10202e;
  --text-muted: rgba(16, 32, 46, 0.72);
  --accent: #0d82ff;
  --accent-strong: #1690ff;
  --chrome-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(237, 243, 249, 0.98));
  --panel-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 252, 0.98));
  --menu-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(241, 246, 250, 1));
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 251, 0.98));
  --legacy-bg: linear-gradient(180deg, rgba(236, 244, 255, 0.98), rgba(226, 238, 249, 0.98));
  --button-bg: rgba(7, 26, 42, 0.04);
  --input-bg: rgba(7, 26, 42, 0.04);
  --overlay-bg: rgba(16, 32, 46, 0.22);
  --divider: rgba(7, 26, 42, 0.08);
  --empty-bg: rgba(7, 26, 42, 0.03);
  --empty-border: rgba(7, 26, 42, 0.14);
  --body-glow-a: rgba(13, 130, 255, 0.08);
  --body-glow-b: rgba(22, 144, 255, 0.05);
  --shadow: 0 10px 30px rgba(23, 40, 57, 0.08);
  --shadow-hover: 0 14px 34px rgba(23, 40, 57, 0.12);
  --shadow-modal: 0 24px 64px rgba(23, 40, 57, 0.18);
}

:root[data-theme="green"] {
  --bg: #0d1713;
  --bg-elevated: #13211c;
  --bg-strong: #0a120f;
  --surface: rgba(128, 255, 187, 0.05);
  --surface-alt: rgba(128, 255, 187, 0.08);
  --surface-muted: rgba(128, 255, 187, 0.03);
  --border: rgba(128, 255, 187, 0.14);
  --text: #f0fff8;
  --text-muted: rgba(240, 255, 248, 0.72);
  --accent: #5ae0a1;
  --accent-strong: #8ef0c2;
  --chrome-bg: linear-gradient(180deg, rgba(19, 33, 28, 0.97), rgba(10, 18, 15, 0.99));
  --panel-bg: linear-gradient(180deg, rgba(19, 33, 28, 0.97), rgba(10, 18, 15, 0.99));
  --menu-bg: linear-gradient(180deg, rgba(19, 33, 28, 0.99), rgba(10, 18, 15, 1));
  --card-bg: linear-gradient(180deg, rgba(128, 255, 187, 0.06), rgba(128, 255, 187, 0.03));
  --legacy-bg: linear-gradient(180deg, rgba(18, 34, 29, 0.98), rgba(9, 18, 15, 1));
  --button-bg: rgba(128, 255, 187, 0.05);
  --input-bg: rgba(128, 255, 187, 0.05);
  --overlay-bg: rgba(3, 11, 8, 0.72);
  --divider: rgba(128, 255, 187, 0.1);
  --empty-bg: rgba(128, 255, 187, 0.025);
  --empty-border: rgba(128, 255, 187, 0.16);
  --body-glow-a: color-mix(in srgb, var(--accent) 14%, transparent);
  --body-glow-b: color-mix(in srgb, var(--accent-strong) 10%, transparent);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--body-glow-a), transparent 32%),
    radial-gradient(circle at top right, var(--body-glow-b), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 80%, #000 20%) 100%);
}

.shell {
  width: min(1760px, calc(100vw - 32px));
  margin: 18px auto 42px;
}

.shell-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

body.admin-shell.sidebar-visible .shell-layout {
  grid-template-columns: 280px minmax(0, 1fr);
}

.page-shell {
  min-width: 0;
}

.topbar,
.hero,
.login-panel,
.notice,
.panel,
.metric-card,
.metric-ring-card,
.incident-card,
.server-card,
.service-card,
.action-card,
.diag-card,
.admin-card {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(280px, auto) minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px 24px;
  border-radius: var(--radius-xl);
  background: var(--chrome-bg);
  position: sticky;
  top: 12px;
  z-index: 30;
  backdrop-filter: blur(22px);
}

.sidebar {
  position: sticky;
  top: 110px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  padding: 20px 20px 18px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--chrome-bg);
  box-shadow: var(--shadow);
  align-self: start;
  max-height: calc(100vh - 126px);
  overflow: hidden;
}

.sidebar-scroll {
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  display: grid;
  gap: 14px;
  padding-right: 4px;
}

.sidebar-head h3,
.settings-head h3 {
  margin: 0;
}

.sidebar-link,
.sidebar-sublink,
.settings-fab {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--button-bg);
  border-radius: 18px;
  padding: 12px 14px;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.sidebar-link:hover,
.sidebar-sublink:hover,
.settings-fab:hover {
  transform: translateY(-1px);
  border-color: rgba(107, 211, 255, 0.26);
  box-shadow: var(--shadow-hover);
}

.sidebar-link.active,
.sidebar-sublink.active,
.settings-fab.active {
  background: linear-gradient(135deg, rgba(79, 163, 255, 0.2), rgba(107, 211, 255, 0.16));
  border-color: rgba(107, 211, 255, 0.28);
}

.sidebar-group {
  border-top: 1px solid var(--divider);
  padding-top: 14px;
}

.sidebar-group summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.sidebar-group summary::-webkit-details-marker {
  display: none;
}

.sidebar-subitems {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.sidebar-sublink {
  padding: 10px 12px;
  border-radius: 14px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
  background: transparent;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(79, 163, 255, 0.2), rgba(107, 211, 255, 0.18));
  color: var(--accent);
  border: 1px solid rgba(107, 211, 255, 0.22);
}

.brand-copy h1,
.hero h2,
.section-heading h3,
.page-header h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  min-width: 0;
}

body.admin-shell .topnav {
  justify-content: flex-end;
}

body.admin-shell .public-nav-chip {
  display: none;
}

.nav-chip,
.ghost-button,
.primary-button,
.danger-button,
.inline-action {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--button-bg);
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.nav-link {
  text-decoration: none;
}

.nav-chip:hover,
.ghost-button:hover,
.primary-button:hover,
.danger-button:hover,
.inline-action:hover {
  transform: translateY(-1px);
  border-color: rgba(107, 211, 255, 0.26);
  box-shadow: var(--shadow-hover);
}

.nav-chip.active,
.primary-button {
  background: linear-gradient(135deg, rgba(79, 163, 255, 0.94), rgba(107, 211, 255, 0.92));
  color: #08121c;
  font-weight: 700;
}

.danger-button {
  background: rgba(98, 34, 34, 0.78);
  border-color: rgba(240, 82, 82, 0.24);
  color: #ffe6e6;
}

.ghost-button {
  background: var(--empty-bg);
}

.topbar-side {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notification-center {
  position: relative;
}

.notification-bell {
  position: relative;
  min-width: 48px;
  width: 48px;
  padding: 0;
}

.notification-icon {
  font-size: 18px;
}

.notification-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(240, 82, 82, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.notification-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(460px, calc(100vw - 32px));
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--menu-bg);
  box-shadow: var(--shadow-modal);
  z-index: 40;
}

.notification-menu-head h3 {
  margin: 0;
}

.notification-feed {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-height: 420px;
  overflow: auto;
}

.notification-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--divider);
  background: var(--empty-bg);
}

.notification-item.unread {
  border-color: rgba(107, 211, 255, 0.22);
  background: rgba(79, 163, 255, 0.08);
}

.notification-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.auth-pill,
.status-badge,
.micro-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--button-bg);
}

body.public-shell #authPill,
body.public-shell #streamPill {
  display: none !important;
}

.status-badge.online,
.micro-pill.online,
.auth-pill.online {
  color: var(--success);
}

.status-badge.degraded,
.micro-pill.warning,
.auth-pill.degraded {
  color: var(--warning);
}

.status-badge.unreachable,
.micro-pill.critical,
.auth-pill.unreachable {
  color: var(--danger);
}

.status-badge.legacy,
.micro-pill.legacy,
.auth-pill.legacy {
  color: var(--info);
}

.login-panel,
.notice,
.panel {
  margin-top: 18px;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--panel-bg);
}

.confirm-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--overlay-bg);
  backdrop-filter: blur(10px);
  z-index: 60;
}

.confirm-card {
  width: min(520px, 100%);
  padding: 26px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-modal);
  background: var(--menu-bg);
}

.confirm-card h3 {
  margin: 0 0 12px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
  align-items: start;
}

.hero-copy {
  margin: 14px 0 0;
  color: var(--text-muted);
  max-width: 70ch;
  line-height: 1.6;
}

.hero-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.login-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.modal-form,
.form-fields {
  display: grid;
  gap: 12px;
}

.modal-form label {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
}

.form-card {
  width: min(720px, calc(100vw - 32px));
}

.form-help {
  font-size: 13px;
  color: var(--text-muted);
}

.login-form label {
  display: grid;
  gap: 8px;
  min-width: 220px;
  color: var(--text-muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.notice {
  font-weight: 600;
  color: var(--text);
}

.notice.error {
  border-color: rgba(255, 139, 139, 0.22);
  color: #ffd5d5;
}

.page {
  margin-top: 18px;
  display: grid;
  gap: 18px;
  min-width: 0;
}

.global-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.global-status-bar .micro-pill {
  padding: 10px 14px;
}

.settings-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  min-width: 52px;
  padding: 0;
  border-radius: 18px;
  font-size: 22px;
  line-height: 1;
}

.public-settings-toggle {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 45;
}

.inline-settings-button {
  position: static;
  z-index: 1;
  margin: 0;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0;
  border-radius: 16px;
  font-size: 20px;
  line-height: 1;
}

.settings-panel {
  position: fixed;
  left: 18px;
  bottom: 78px;
  width: min(380px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--menu-bg);
  box-shadow: var(--shadow-modal);
  z-index: 55;
}

.palette-card {
  width: min(860px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
}

.palette-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.palette-results {
  display: grid;
  gap: 10px;
  max-height: min(62vh, 560px);
  overflow: auto;
}

.palette-result {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--divider);
  background: var(--empty-bg);
  text-align: left;
}

.palette-result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.palette-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-head,
.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.settings-block {
  display: grid;
  gap: 10px;
}

.compact-notes .info-row {
  padding: 8px 0;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-end;
}

.page-header-copy p {
  margin: 8px 0 0;
  color: var(--text-muted);
}

.page-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.saved-view-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.saved-view-chip {
  padding: 9px 14px;
  border-radius: 999px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--button-bg);
  color: var(--text-muted);
  min-height: 50px;
}

.inline-check input {
  width: auto;
  margin: 0;
}

.page-actions input,
.page-actions select {
  width: auto;
  min-width: 160px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.compact-grid {
  margin-bottom: 14px;
}

.metric-card,
.metric-ring-card,
.incident-card,
.server-card,
.service-card,
.action-card,
.diag-card,
.admin-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
}

.metric-card h3,
.metric-ring-card h3,
.server-card h3,
.service-card h3,
.action-card h3,
.diag-card h3,
.admin-card h3,
.incident-card h3 {
  margin: 0 0 10px;
}

.service-card.compact-service-card {
  padding: 18px;
}

.service-card.compact-service-card header {
  margin-bottom: 12px;
}

.metric-value {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
}

.metric-ring-card {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  min-width: 0;
}

.metric-ring {
  --ring-accent: var(--accent);
  width: clamp(148px, 16vw, 172px);
  height: clamp(148px, 16vw, 172px);
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ring-accent) 22%, transparent),
    0 12px 26px color-mix(in srgb, var(--ring-accent) 10%, transparent);
  isolation: isolate;
}

.metric-ring.healthy { --ring-accent: var(--success); }
.metric-ring.warning { --ring-accent: var(--warning); }
.metric-ring.degraded,
.metric-ring.offline { --ring-accent: var(--danger); }
.metric-ring.legacy,
.metric-ring.recovering { --ring-accent: var(--accent); }

.metric-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.metric-ring-bg,
.metric-ring-progress {
  fill: none;
  stroke-linecap: round;
  transform-origin: 80px 80px;
}

.metric-ring-bg {
  stroke: color-mix(in srgb, var(--ring-accent) 16%, var(--border));
  stroke-width: 16;
}

.metric-ring-progress {
  stroke: var(--ring-accent);
  stroke-width: 16;
  transition: stroke-dasharray 200ms ease;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--ring-accent) 26%, transparent));
}

.metric-ring-center {
  width: clamp(92px, 10vw, 108px);
  height: clamp(92px, 10vw, 108px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--ring-accent) 14%, transparent), transparent 58%),
    color-mix(in srgb, var(--bg-elevated) 96%, transparent);
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px;
  position: relative;
  z-index: 2;
  border: 1px solid color-mix(in srgb, var(--ring-accent) 18%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent);
}

.metric-ring-orbit,
.metric-ring-track {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  pointer-events: none;
}

.metric-ring-orbit {
  border: 1px solid color-mix(in srgb, var(--ring-accent) 26%, transparent);
  opacity: 0.8;
}

.metric-ring-track {
  inset: 20px;
  border: 1px dashed color-mix(in srgb, var(--ring-accent) 18%, transparent);
  opacity: 0.42;
}

.metric-ring-value-row {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.metric-ring-value {
  font-size: clamp(30px, 3.6vw, 42px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-ring-unit {
  font-size: 12px;
  line-height: 1.1;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-ring-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.metric-ring-detail {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 28ch;
}

.metric-label,
.muted,
.card-note {
  color: var(--text-muted);
}

.metric-stack,
.info-list,
.token-list,
.route-list,
.incident-list,
.actions-stack,
.diag-stack,
.notes-list,
.action-log-grid {
  display: grid;
  gap: 12px;
}

.info-row,
.route-row,
.incident-row,
.service-placement,
.process-row,
.action-log-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--divider);
}

.info-row:first-child,
.route-row:first-child,
.incident-row:first-child,
.service-placement:first-child,
.process-row:first-child,
.action-log-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.key {
  color: var(--text-muted);
  flex: 0 0 32%;
}

.value,
.mono {
  font-family: var(--font-mono);
}

.mono {
  font-size: 13px;
  word-break: break-word;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.service-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.service-toolbar .inline-action {
  padding: 10px 14px;
}

.legacy-panel {
  border-color: color-mix(in srgb, var(--info) 32%, transparent);
  background: var(--legacy-bg);
}

.process-command {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 6px;
}

.history-card {
  display: grid;
  gap: 14px;
}

.history-card-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.history-card-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.history-card-value {
  font-size: clamp(24px, 3vw, 40px);
}

.history-chart-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.history-chart-stage {
  min-height: 210px;
  padding: 10px 10px 4px;
  border-radius: 22px;
  border: 1px solid var(--divider);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-alt) 94%, transparent), color-mix(in srgb, var(--surface-muted) 96%, transparent));
}

.history-chart-svg {
  width: 100%;
  height: 196px;
  display: block;
}

.history-grid-line {
  stroke: color-mix(in srgb, var(--border) 85%, transparent);
  stroke-width: 1;
  stroke-dasharray: 5 7;
}

.history-axis-y {
  display: grid;
  align-content: stretch;
  gap: 0;
  min-width: 86px;
  padding: 10px 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

.history-axis-y span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.history-axis-y span:first-child {
  align-self: start;
}

.history-axis-y span:nth-child(2) {
  align-self: center;
}

.history-axis-y span:last-child {
  align-self: end;
}

.history-axis-x {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.history-axis-x span:nth-child(2) {
  text-align: center;
}

.history-axis-x span:last-child {
  text-align: right;
}

.metric-card .metric-value,
.history-card .metric-value {
  min-width: 0;
}

.empty-state {
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--empty-border);
  background: var(--empty-bg);
  color: var(--text-muted);
  text-align: center;
}

.panel-nested {
  margin-top: 0;
  background: var(--card-bg);
}

.compact-heading {
  margin-top: 18px;
}

.hidden {
  display: none !important;
}

.clipboard-helper {
  position: fixed;
  top: -1000px;
  opacity: 0;
  pointer-events: none;
}

.server-card header,
.service-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.subtle-link {
  color: var(--accent-strong);
}

.incident-card.is-link {
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.incident-card.is-link:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent-strong) 34%, transparent);
  box-shadow: var(--shadow-hover);
}

[data-public-block] {
  scroll-margin-top: 118px;
}

.public-focus-target {
  animation: publicFocusPulse 1.4s ease;
}

@keyframes publicFocusPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
  30% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 12%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}

.skeleton-stack,
.skeleton-grid {
  display: grid;
  gap: 18px;
}

.skeleton-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.skeleton-card,
.skeleton-line {
  position: relative;
  overflow: hidden;
}

.skeleton-card {
  min-height: 164px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-alt) 94%, transparent), color-mix(in srgb, var(--surface-muted) 96%, transparent));
}

.skeleton-line {
  height: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-alt) 90%, transparent);
}

.skeleton-line::after,
.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, #fff 10%, transparent), transparent);
  animation: skeletonSweep 1.6s ease-in-out infinite;
}

.skeleton-line.short { width: 34%; }
.skeleton-line.medium { width: 58%; }
.skeleton-line.long { width: 82%; }

@keyframes skeletonSweep {
  100% { transform: translateX(120%); }
}

@media (max-width: 1600px) {
  body.admin-shell.sidebar-visible .shell-layout {
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: minmax(240px, auto) minmax(0, 1fr) auto;
  }
}

@media (max-width: 1320px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  body.admin-shell .topnav {
    justify-content: flex-start;
  }

  .topbar-side {
    justify-self: stretch;
    justify-content: flex-start;
  }
}

@media (max-width: 1180px) {
  .shell-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .topbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 18px, 100%);
    margin: 10px auto 28px;
  }

  .topbar,
  .login-panel,
  .notice,
  .panel {
    padding: 18px;
  }

  .page-actions,
  .inline-actions,
  .topbar-side,
  .settings-actions {
    width: 100%;
  }

  .inline-check {
    width: 100%;
    justify-content: center;
  }

  .palette-search-row {
    grid-template-columns: 1fr;
  }

  .ghost-button,
  .primary-button,
  .danger-button,
  .nav-chip,
  .sidebar-link,
  .sidebar-sublink,
  .public-settings-toggle {
    width: 100%;
    justify-content: center;
  }

  .icon-button,
  .inline-settings-button {
    width: 52px;
    justify-content: center;
  }

  .confirm-actions {
    flex-direction: column;
  }

  .topnav {
    justify-content: flex-start;
  }

  .settings-panel {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: 72px;
  }

  .public-settings-toggle {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .action-log-row {
    flex-direction: column;
  }

  .history-chart-shell {
    grid-template-columns: 1fr;
  }

  .history-axis-y {
    grid-auto-flow: column;
    min-width: 0;
    justify-content: space-between;
    text-align: left;
  }

  .history-axis-y span {
    justify-content: flex-start;
  }
}
