:root {
  color-scheme: light;
  --page-bg: #f4f7f5;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-subtle: #f8faf9;
  --surface-strong: #edf3ef;
  --text: #132019;
  --text-soft: #384a41;
  --muted: #66756d;
  --faint: #87948d;
  --border: #d8e2dc;
  --border-strong: #c3d0c8;
  --green: #0f8a5f;
  --green-strong: #08724d;
  --green-soft: #e3f5ec;
  --blue: #2e73dc;
  --blue-soft: #e8f1fe;
  --amber: #b86c0c;
  --amber-soft: #fff2da;
  --red: #c94743;
  --red-soft: #fce9e8;
  --violet: #7354b3;
  --violet-soft: #efeafb;
  --status-banner: #10271e;
  --status-banner-muted: #b8d0c3;
  --status-banner-border: #246147;
  --shadow-sm: 0 1px 2px rgba(18, 35, 26, 0.04), 0 8px 22px rgba(18, 35, 26, 0.035);
  --shadow-hover: 0 2px 4px rgba(18, 35, 26, 0.05), 0 12px 28px rgba(18, 35, 26, 0.06);
  --glow-green: rgba(15, 138, 95, 0.2);
  --glow-amber: rgba(184, 108, 12, 0.16);
  --glow-red: rgba(201, 71, 67, 0.17);
  --grid-line: rgba(38, 86, 61, 0.04);
  --tech-line: rgba(15, 138, 95, 0.24);
  --radius: 8px;
  --radius-sm: 6px;
  --content-width: 1320px;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #111613;
  --surface: #171d19;
  --surface-raised: #1b221e;
  --surface-subtle: #202823;
  --surface-strong: #27312b;
  --text: #edf3ef;
  --text-soft: #c2cdc7;
  --muted: #929f98;
  --faint: #76817b;
  --border: #2f3c35;
  --border-strong: #435149;
  --green: #49bd8c;
  --green-strong: #73d3a9;
  --green-soft: #19372a;
  --blue: #75a6f2;
  --blue-soft: #1d304b;
  --amber: #e1a64f;
  --amber-soft: #3d301e;
  --red: #ec7772;
  --red-soft: #422525;
  --violet: #af91df;
  --violet-soft: #332943;
  --status-banner: #0d2118;
  --status-banner-muted: #a9c5b6;
  --status-banner-border: #2d6f52;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24), 0 10px 24px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 2px 5px rgba(0, 0, 0, 0.28), 0 14px 32px rgba(0, 0, 0, 0.18);
  --glow-green: rgba(73, 189, 140, 0.26);
  --glow-amber: rgba(225, 166, 79, 0.2);
  --glow-red: rgba(236, 119, 114, 0.22);
  --grid-line: rgba(139, 185, 160, 0.04);
  --tech-line: rgba(73, 189, 140, 0.3);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--page-bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  appearance: none;
  border: 0;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

#overview,
#models {
  scroll-margin-top: 96px;
}

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

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  font-weight: 700;
  transform: translateY(-160%);
}

.skip-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  transform: translateY(0);
}

.content-shell {
  width: min(100% - 48px, var(--content-width));
  margin: 0 auto;
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 98%, var(--page-bg));
  box-shadow: 0 1px 8px rgba(18, 35, 26, 0.035);
}

.app-header::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0, var(--tech-line) 18%, var(--tech-line) 82%, transparent 100%);
  content: "";
  pointer-events: none;
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: min(100% - 48px, var(--content-width));
  min-height: 68px;
  margin: 0 auto;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 142px;
  gap: 10px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #0a6d4b;
  border-radius: 8px;
  background: #0c7e56;
  color: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 0 0 1px rgba(15, 138, 95, 0.12),
    0 0 18px var(--glow-green);
  clip-path: polygon(0 7px, 7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
}

.brand-mark::before {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 1px;
  box-shadow: -9px 0 0 -1px rgba(255, 255, 255, 0.18), 0 -9px 0 -1px rgba(255, 255, 255, 0.18);
  content: "";
}

.brand-mark::after {
  position: absolute;
  bottom: 6px;
  left: 5px;
  width: 10px;
  height: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  border-left: 1px solid rgba(255, 255, 255, 0.24);
  content: "";
}

.brand-mark-letter {
  position: relative;
  z-index: 1;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.brand-pulse {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 6px;
  height: 6px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: #83e8b8;
  box-shadow: 0 0 7px rgba(131, 232, 184, 0.72);
  animation: status-soft-pulse 2.8s ease-in-out infinite;
}

.brand-name {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 760;
  white-space: nowrap;
}

.primary-nav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  justify-content: flex-start;
  gap: 4px;
}

.nav-link {
  position: relative;
  display: grid;
  min-width: 66px;
  padding: 0 16px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color 160ms ease;
}

.nav-link::after {
  position: absolute;
  right: 13px;
  bottom: -1px;
  left: 13px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--green);
  content: "";
  opacity: 0;
  transform: scaleX(0.45);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link[aria-current="page"]::after {
  opacity: 0.72;
  transform: scaleX(0.72);
}

.nav-link[aria-current="page"] {
  color: var(--text);
}

.header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.live-meta {
  position: relative;
  display: flex;
  align-items: center;
  height: 36px;
  margin-right: 2px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.header-actions .icon-button {
  border-color: var(--border);
  background: var(--surface-raised);
}

.live-meta time {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  gap: 5px;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.live-date {
  color: var(--muted);
  font-size: 11px;
}

.live-time {
  min-width: 62px;
}

.live-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
  animation: status-soft-pulse 2.8s ease-in-out infinite;
}

.live-meta.is-live .live-indicator {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.live-meta.is-stale .live-indicator {
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.live-meta.is-error .live-indicator {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.live-meta.is-stale .live-label {
  color: var(--amber);
}

.live-meta.is-error .live-label {
  color: var(--red);
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  place-items: center;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.icon-button:hover {
  border-color: var(--border);
  background: var(--surface-subtle);
  color: var(--text);
}

.icon-button:active {
  transform: translateY(1px);
}

.icon-button:focus-visible,
.segmented-control button:focus-visible,
.model-stat-item:focus-visible,
.empty-retry:focus-visible,
.nav-link:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--green) 72%, white);
  outline-offset: 2px;
}

.theme-icon-dark,
html[data-theme="dark"] .theme-icon-light {
  display: none;
}

html[data-theme="dark"] .theme-icon-dark {
  display: block;
}

.overview-section {
  position: relative;
  padding: 34px 0 44px;
  border-bottom: 1px solid var(--border);
  background-color: var(--page-bg);
  background-image:
    url("./assets/telemetry-field.png?v=20260804-2"),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 256px 256px, 32px 32px, 32px 32px;
}

.system-summary {
  --summary-accent: #4ad29e;
  --summary-border: var(--status-banner-border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 154px;
  margin-bottom: 20px;
  padding: 26px 28px;
  overflow: hidden;
  border: 1px solid var(--summary-border);
  border-left: 4px solid var(--summary-accent);
  border-radius: var(--radius);
  background-color: var(--status-banner);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 24px 24px;
  color: #ffffff;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--summary-accent) 10%, transparent),
    0 14px 34px rgba(11, 31, 22, 0.13),
    0 0 28px color-mix(in srgb, var(--summary-accent) 9%, transparent);
  gap: 34px;
}

.system-summary::before,
.system-summary::after {
  position: absolute;
  width: 18px;
  height: 18px;
  content: "";
  pointer-events: none;
}

.system-summary::before {
  top: 10px;
  right: 10px;
  border-top: 1px solid color-mix(in srgb, var(--summary-accent) 58%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--summary-accent) 58%, transparent);
}

.system-summary::after {
  bottom: 10px;
  left: 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--summary-accent) 48%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--summary-accent) 48%, transparent);
}

.system-summary.is-degraded {
  --summary-accent: #edaa43;
  --summary-border: #6c5529;
}

.system-summary.is-down {
  --summary-accent: #e97873;
  --summary-border: #70403d;
}

.system-summary.is-unknown {
  --summary-accent: #9aa6a0;
  --summary-border: #48554e;
}

.summary-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 20px;
}

.summary-status-mark {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 1px solid color-mix(in srgb, var(--summary-accent) 44%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--summary-accent) 14%, transparent);
  color: var(--summary-accent);
  box-shadow:
    inset 0 0 16px color-mix(in srgb, var(--summary-accent) 7%, transparent),
    0 0 18px color-mix(in srgb, var(--summary-accent) 12%, transparent);
  place-items: center;
}

.summary-status-mark .icon {
  width: 27px;
  height: 27px;
  stroke-width: 2.4;
}

.summary-copy {
  min-width: 0;
}

.summary-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 7px;
  gap: 8px;
  color: var(--summary-accent);
  font-size: 13px;
  font-weight: 740;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
}

.status-healthy {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.status-degraded {
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.status-down {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.status-unknown {
  background: var(--faint);
  box-shadow: 0 0 0 3px var(--surface-strong);
}

.system-summary h1 {
  max-width: 680px;
  font-size: 30px;
  font-weight: 740;
  line-height: 1.25;
  color: #ffffff;
  text-wrap: balance;
}

.system-summary p {
  margin-top: 7px;
  color: var(--status-banner-muted);
  font-size: 14px;
}

.summary-facts {
  display: grid;
  grid-template-columns: repeat(3, auto);
  flex: 0 0 auto;
  align-items: center;
  gap: 0;
}

.summary-fact {
  min-width: 116px;
  padding: 6px 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.summary-fact:first-child {
  border-left: 0;
}

.summary-fact span,
.summary-fact strong {
  display: block;
  white-space: nowrap;
}

.summary-fact span {
  margin-bottom: 3px;
  color: var(--status-banner-muted);
  font-size: 12px;
}

.summary-fact strong {
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  --metric-accent: var(--green);
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 148px;
  padding: 18px 19px 17px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--metric-accent) 1.8%, var(--surface-raised));
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.metric-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--metric-accent);
  content: "";
}

.metric-card-requests {
  --metric-accent: var(--blue);
}

.metric-card-success {
  --metric-accent: var(--amber);
}

.metric-card-token {
  --metric-accent: var(--violet);
}

.metric-card:hover {
  border-color: var(--border-strong);
  box-shadow:
    var(--shadow-hover),
    0 0 0 1px color-mix(in srgb, var(--metric-accent) 15%, transparent),
    0 0 20px color-mix(in srgb, var(--metric-accent) 10%, transparent);
  transform: translateY(-1px);
}

.metric-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.metric-icon {
  display: grid;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 12px color-mix(in srgb, currentColor 10%, transparent);
  place-items: center;
}

.metric-icon .icon {
  width: 16px;
  height: 16px;
}

.metric-icon-green {
  background: var(--green-soft);
  color: var(--green-strong);
}

.metric-icon-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.metric-icon-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.metric-icon-violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.metric-value {
  display: block;
  margin-top: 16px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 31px;
  font-variant-numeric: tabular-nums;
  font-weight: 710;
  line-height: 1;
}

.metric-context {
  display: block;
  margin-top: auto;
  padding-top: 11px;
  color: var(--muted);
  font-size: 12px;
}

.metric-card-token .metric-heading {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.metric-token-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  line-height: 1.2;
}

.metric-token-stat {
  display: grid;
  min-width: 0;
  padding: 0 9px;
  border-left: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  gap: 3px;
}

.metric-token-stat:first-child {
  padding-left: 0;
  border-left: 0;
}

.metric-token-stat:last-child {
  padding-right: 0;
}

.metric-token-stat > span {
  color: var(--faint);
  font-size: 10px;
}

.metric-token-stat > strong {
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-token-rate {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--violet) 26%, transparent);
  border-radius: 10px;
  background: var(--violet-soft);
  color: var(--violet);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.panel {
  position: relative;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.panel:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.panel-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  gap: 20px;
}

.panel-header h2 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.panel-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.segmented-control {
  display: inline-grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.segmented-control button {
  min-width: 58px;
  height: 32px;
  padding: 0 9px;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.segmented-control button:hover {
  color: var(--text);
}

.segmented-control button.is-selected {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(13, 24, 18, 0.12);
}

html[data-theme="dark"] .segmented-control button.is-selected {
  background: var(--surface-strong);
}

.uptime-panel {
  overflow: hidden;
}

.uptime-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.uptime-panel-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.uptime-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.uptime-legend i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 2px;
}

.legend-good {
  background: var(--green);
}

.legend-degraded {
  background: var(--amber);
}

.legend-down {
  background: var(--red);
}

.uptime-chart {
  display: flex;
  align-items: end;
  height: 112px;
  margin: 18px 18px 0;
  border-bottom: 1px solid var(--border);
  background-image: linear-gradient(to top, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 25%;
  gap: 3px;
}

.uptime-chart:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--green) 72%, white);
  outline-offset: 4px;
}

.uptime-bar {
  position: relative;
  width: 100%;
  min-width: 2px;
  height: 80%;
  flex: 1 1 0;
  padding: 0;
  border-radius: 3px 3px 1px 1px;
  background: var(--green);
  cursor: pointer;
  opacity: 0.9;
  transition:
    height 220ms ease,
    opacity 120ms ease,
    transform 120ms ease;
}

.uptime-bar.height-0 { height: 30%; }
.uptime-bar.height-1 { height: 37%; }
.uptime-bar.height-2 { height: 44%; }
.uptime-bar.height-3 { height: 51%; }
.uptime-bar.height-4 { height: 58%; }
.uptime-bar.height-5 { height: 65%; }
.uptime-bar.height-6 { height: 72%; }
.uptime-bar.height-7 { height: 79%; }
.uptime-bar.height-8 { height: 86%; }
.uptime-bar.height-9 { height: 93%; }
.uptime-bar.height-10 { height: 100%; }

.uptime-bar:hover,
.uptime-bar.is-active {
  z-index: 2;
  opacity: 1;
  transform: scaleX(1.45);
  box-shadow: 0 0 9px var(--glow-green);
}

.uptime-bar::after {
  position: absolute;
  top: -3px;
  right: 1px;
  left: 1px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  content: "";
}

.uptime-bar.is-degraded {
  background: var(--amber);
}

.uptime-bar.is-degraded:hover,
.uptime-bar.is-degraded.is-active {
  box-shadow: 0 0 9px var(--glow-amber);
}

.uptime-bar.is-degraded::after {
  background: var(--amber);
}

.uptime-bar.is-down {
  background: var(--red);
}

.uptime-bar.is-down:hover,
.uptime-bar.is-down.is-active {
  box-shadow: 0 0 9px var(--glow-red);
}

.uptime-bar.is-down::after {
  background: var(--red);
}

.uptime-bar.is-empty {
  height: 14%;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  cursor: default;
  opacity: 0.75;
}

.chart-axis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 7px 18px 16px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

.chart-tooltip {
  position: fixed;
  bottom: 20px;
  left: 50%;
  z-index: 80;
  display: none;
  min-width: 134px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--surface);
  box-shadow: 0 8px 30px rgba(10, 20, 14, 0.2);
  pointer-events: none;
  font-size: 11px;
  transform: translateX(-50%);
}

.chart-tooltip.is-visible {
  display: block;
}

.chart-tooltip strong,
.chart-tooltip span {
  display: block;
}

.chart-tooltip strong {
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.compact-header {
  min-height: 72px;
  align-items: center;
}

.model-status-section {
  padding: 48px 0 60px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.model-status-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 24px;
}

.model-status-heading h2 {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 26px;
  font-weight: 730;
  line-height: 1.3;
  text-wrap: balance;
}

.model-status-heading h2::after {
  width: 7px;
  height: 7px;
  margin-left: 10px;
  border: 1px solid var(--green);
  box-shadow: 0 0 9px var(--glow-green);
  content: "";
}

.model-status-heading p {
  display: flex;
  align-items: center;
  margin-top: 6px;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.model-status-heading time {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.model-source {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 22px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.model-source.is-live {
  background: var(--green-soft);
  color: var(--green-strong);
}

.model-source.is-stale {
  background: var(--amber-soft);
  color: var(--amber);
}

.model-source.is-error {
  background: var(--red-soft);
  color: var(--red);
}

.model-select-controls {
  display: flex;
  align-items: center;
  gap: 9px;
}

.compact-select {
  position: relative;
  display: block;
  width: 160px;
}

.compact-select.sort-select {
  width: 180px;
}

.compact-select select {
  width: 100%;
  height: 40px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: 0;
  appearance: none;
  background: var(--surface-raised);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.compact-select select:hover,
.compact-select select:focus {
  border-color: var(--border-strong);
  background: var(--surface-raised);
  color: var(--text);
}

.compact-select select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--green) 72%, white);
  outline-offset: 2px;
}

.model-stat-strip {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.model-stat-strip::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--tech-line);
  content: "";
}

.model-stat-item {
  display: flex;
  min-width: 0;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-left: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  gap: 12px;
  text-align: left;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.model-stat-item:first-child {
  border-left: 0;
}

.model-stat-item:hover,
.model-stat-item[aria-pressed="true"] {
  background: color-mix(in srgb, var(--text) 3%, transparent);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, currentColor 22%, transparent);
}

.model-stat-item.is-green[aria-pressed="true"] {
  color: var(--green-strong);
  box-shadow: inset 0 -2px 0 var(--green);
}

.model-stat-item.is-yellow[aria-pressed="true"] {
  color: var(--amber);
  box-shadow: inset 0 -2px 0 var(--amber);
}

.model-stat-item.is-red[aria-pressed="true"] {
  color: var(--red);
  box-shadow: inset 0 -2px 0 var(--red);
}

.model-stat-item span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.model-stat-item span::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--faint);
  content: "";
}

.model-stat-item.is-green span::before { background: var(--green); }
.model-stat-item.is-yellow span::before { background: var(--amber); }
.model-stat-item.is-red span::before { background: var(--red); }

.model-stat-item strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

.compact-select .icon {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.model-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 18px;
  gap: 18px;
}

.model-search {
  position: relative;
  display: block;
  width: min(100%, 380px);
}

.model-search .icon {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.model-search input {
  width: 100%;
  height: 42px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 12px;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.model-search input::placeholder {
  color: var(--muted);
}

.model-search input:focus {
  border-color: var(--green);
  background: var(--surface-raised);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-soft) 82%, transparent);
}

.model-status-filter button {
  min-width: 62px;
}

.model-status-filter button[data-status="green"].is-selected {
  background: var(--green-soft);
  color: var(--green-strong);
}

.model-status-filter button[data-status="yellow"].is-selected {
  background: var(--amber-soft);
  color: var(--amber);
}

.model-status-filter button[data-status="red"].is-selected {
  background: var(--red-soft);
  color: var(--red);
}

.model-status-filter button[data-status="unknown"].is-selected {
  background: var(--surface-strong);
  color: var(--text-soft);
}

.model-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  align-items: stretch;
  gap: 18px;
}

.model-card {
  --model-accent: var(--green);
  --model-edge: var(--border-strong);
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-top: 3px solid var(--model-edge);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.model-card.is-yellow {
  --model-accent: var(--amber);
  --model-edge: var(--amber);
}

.model-card.is-red {
  --model-accent: var(--red);
  --model-edge: var(--red);
}

.model-card.is-unknown {
  --model-accent: var(--faint);
  --model-edge: var(--border-strong);
}

.model-card.is-green .model-card-header {
  background: var(--surface-raised);
}

.model-card:hover {
  border-color: var(--border-strong);
  box-shadow:
    var(--shadow-hover),
    0 0 0 1px color-mix(in srgb, var(--model-accent) 12%, transparent);
  transform: translateY(-1px);
}

.model-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 94px;
  padding: 17px 18px;
  background: color-mix(in srgb, var(--model-accent) 5%, var(--surface-raised));
  gap: 16px;
}

.model-identity {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 13px;
}

.model-provider-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid color-mix(in srgb, var(--model-accent) 28%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--model-accent) 9%, var(--surface-subtle));
  color: var(--model-accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 780;
  clip-path: polygon(0 6px, 6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
  place-items: center;
}

.model-identity-copy {
  min-width: 0;
}

.model-identity-copy > strong,
.model-identity-copy > code,
.model-identity-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-identity-copy strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 710;
}

.model-identity-copy code {
  margin-top: 3px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
}

.model-identity-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  margin-top: 5px;
  gap: 7px;
}

.model-identity-meta span {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
}

.model-card-status {
  flex: 0 0 auto;
  text-align: right;
}

.model-status-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 9px;
  border-radius: 12px;
  gap: 6px;
  font-size: 11px;
  font-weight: 670;
}

.model-status-pill::before {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.model-status-pill.is-green {
  background: var(--green-soft);
  color: var(--green-strong);
}

.model-status-pill.is-yellow {
  background: var(--amber-soft);
  color: var(--amber);
}

.model-status-pill.is-red {
  background: var(--red-soft);
  color: var(--red);
}

.model-status-pill.is-unknown {
  background: var(--surface-strong);
  color: var(--muted);
}

.is-refreshing #refresh-button .icon {
  animation: status-refresh-spin 900ms linear infinite;
}

@keyframes status-refresh-spin {
  to { transform: rotate(360deg); }
}

.model-request-count {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.model-metrics {
  display: grid;
  grid-template-columns: 1.15fr repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.model-metric {
  min-width: 0;
  padding: 14px 15px;
  border-left: 1px solid var(--border);
}

.model-metric:first-child {
  border-left: 0;
  background: color-mix(in srgb, var(--model-accent) 7%, transparent);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--model-accent) 55%, transparent);
}

.model-metric span,
.model-metric strong {
  display: block;
}

.model-metric span {
  color: var(--muted);
  font-size: 11px;
}

.model-metric strong {
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-metric:first-child strong {
  color: var(--model-accent);
  font-size: 16px;
  font-weight: 730;
}

.model-metric-errors.has-alert strong {
  color: var(--red);
}

.model-slot-section {
  padding: 16px 18px 17px;
}

.model-slot-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 14px;
}

.model-slot-heading span:first-child {
  color: var(--muted);
  font-size: 10px;
}

.model-slot-heading span:last-child {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
}

.model-slot-track {
  display: grid;
  grid-template-columns: repeat(24, minmax(2px, 1fr));
  height: 30px;
  align-items: stretch;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-subtle);
  gap: 2px;
}

.model-slot {
  min-width: 2px;
  border-radius: 1px;
  background: var(--green);
  opacity: 0.88;
}

.model-slot.is-yellow {
  background: var(--amber);
}

.model-slot.is-red {
  background: var(--red);
}

.model-slot.is-empty {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  opacity: 1;
}

.model-card-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 58px;
  align-items: center;
  padding: 0 18px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-subtle) 68%, transparent);
  gap: 16px;
}

.model-card-footer > div:last-child {
  text-align: right;
}

.model-card-footer span,
.model-card-footer strong {
  display: block;
}

.model-card-footer span {
  color: var(--muted);
  font-size: 10px;
}

.model-card-footer strong {
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-empty {
  display: grid;
  min-height: 180px;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--muted);
  place-items: center;
  align-content: center;
  gap: 6px;
  text-align: center;
}

.model-empty[hidden] {
  display: none;
}

.model-empty .icon {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  color: var(--faint);
}

.model-empty strong {
  color: var(--text-soft);
  font-size: 12px;
}

.model-empty span {
  font-size: 10px;
}

.model-empty.is-error {
  border-color: color-mix(in srgb, var(--red) 38%, var(--border));
  background: color-mix(in srgb, var(--red-soft) 48%, var(--surface-raised));
}

.model-empty.is-error .icon {
  color: var(--red);
}

.empty-retry {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-soft);
  cursor: pointer;
  gap: 7px;
  font-size: 12px;
  font-weight: 650;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.empty-retry:hover {
  border-color: var(--red);
  color: var(--red);
}

.empty-retry:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--red) 72%, white);
  outline-offset: 2px;
}

.model-pagination {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
  gap: 20px;
  color: var(--muted);
  font-size: 11px;
}

.model-pagination[hidden] {
  display: none;
}

.model-pagination > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.model-pagination .icon-button {
  border-color: var(--border);
  background: var(--surface-raised);
}

.model-pagination .icon-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

#model-page-number {
  min-width: 44px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: flex;
  min-width: 150px;
  min-height: 42px;
  align-items: center;
  padding: 9px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--surface);
  box-shadow: 0 10px 30px rgba(12, 20, 15, 0.22);
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast .icon {
  width: 14px;
  height: 14px;
  color: #66d9a6;
  stroke-width: 2.5;
}

.toast.is-error .icon {
  color: var(--red);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.is-refreshing .metric-value {
  opacity: 0.6;
}

@media (max-width: 1080px) {
  .summary-fact {
    min-width: 105px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .uptime-chart {
    gap: 1px;
  }

  .model-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .header-inner {
    gap: 14px;
  }

  .brand {
    min-width: auto;
  }

  .live-label {
    display: inline;
    font-size: 10px;
  }

  .system-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .summary-facts {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-fact {
    min-width: 0;
  }

  .summary-fact:first-child {
    padding-left: 0;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 120px;
  }

  .content-shell,
  .header-inner {
    width: min(100% - 32px, var(--content-width));
  }

  .app-header {
    position: sticky;
  }

  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-rows: 64px 42px;
    min-height: 106px;
    gap: 0 12px;
  }

  .brand {
    align-self: center;
    grid-column: 1;
    grid-row: 1;
  }

  .header-actions {
    align-self: center;
    grid-column: 2;
    grid-row: 1;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: calc(100% + 32px);
    height: 42px;
    margin-right: -16px;
    margin-left: -16px;
    border-top: 1px solid var(--border);
  }

  .nav-link {
    width: auto;
    min-width: 0;
    flex: 1;
    padding-right: 8px;
    padding-left: 8px;
  }

  .overview-section {
    padding-top: 24px;
  }

  .system-summary h1 {
    font-size: 27px;
  }

  .model-status-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .model-select-controls {
    width: 100%;
  }

  .compact-select,
  .compact-select.sort-select {
    width: auto;
    flex: 1;
  }

  .model-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

}

@media (max-width: 540px) {
  .content-shell,
  .header-inner {
    width: min(100% - 20px, var(--content-width));
  }

  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 8px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand-name {
    font-size: 14px;
  }

  .live-meta {
    display: flex;
    width: 88px;
    min-width: 88px;
    height: 36px;
    min-height: 36px;
    margin-right: 0;
    padding: 3px 6px 3px 14px;
    align-items: flex-end;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    line-height: 1.25;
  }

  .live-meta .live-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
  }

  .live-meta time {
    align-items: flex-end;
    flex-direction: column;
    gap: 0;
  }

  .live-date {
    font-size: 9px;
    white-space: nowrap;
  }

  .live-time {
    min-width: 0;
    font-size: 10px;
  }

  .header-actions {
    gap: 3px;
  }

  .header-actions .icon-button {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .primary-nav {
    width: calc(100% + 20px);
    margin-right: -10px;
    margin-left: -10px;
  }

  .system-summary {
    padding: 18px 14px;
    gap: 16px;
  }

  .summary-main {
    align-items: flex-start;
    gap: 14px;
  }

  .summary-status-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .summary-status-mark .icon {
    width: 21px;
    height: 21px;
  }

  .system-summary h1 {
    font-size: 22px;
  }

  .system-summary p {
    font-size: 12px;
  }

  .summary-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-fact {
    min-width: 0;
    padding: 3px 7px;
  }

  .summary-fact span {
    font-size: 10px;
  }

  .summary-fact strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
  }

  .metric-card {
    min-height: 136px;
    padding: 14px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-context {
    overflow-wrap: anywhere;
  }

  .metric-heading {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    font-size: 12px;
  }

  .metric-heading > span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .metric-value {
    margin-top: 12px;
    font-size: 24px;
  }

  .metric-context {
    font-size: 11px;
  }

  .metric-token-detail {
    gap: 0;
  }

  .metric-token-stat > strong {
    font-size: 11px;
  }

  .metric-token-rate {
    padding-right: 5px;
    padding-left: 5px;
    font-size: 9px;
  }

  .panel-header {
    align-items: flex-start;
    min-height: 0;
    padding: 16px;
  }

  .uptime-panel .panel-header {
    flex-direction: column;
    gap: 10px;
  }

  .uptime-panel-meta {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .uptime-legend {
    width: 100%;
    justify-content: flex-start;
  }

  .uptime-chart {
    height: 88px;
    margin-right: 16px;
    margin-left: 16px;
  }

  .chart-axis {
    margin-right: 16px;
    margin-left: 16px;
  }

  .model-status-section {
    padding-top: 32px;
    padding-bottom: 38px;
  }

  .model-status-heading h2 {
    font-size: 21px;
  }

  .model-status-heading p {
    flex-wrap: wrap;
  }

  .model-select-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-select,
  .compact-select.sort-select {
    width: 100%;
  }

  .model-stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .model-stat-item:nth-child(odd) {
    border-left: 0;
  }

  .model-stat-item:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .model-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .model-search,
  .model-status-filter {
    width: 100%;
  }

  .model-status-filter button {
    min-width: 0;
    padding-right: 5px;
    padding-left: 5px;
    font-size: 11px;
  }

  .model-card-header,
  .model-slot-section {
    padding-right: 14px;
    padding-left: 14px;
  }

  .model-metric {
    padding-right: 12px;
    padding-left: 12px;
  }

  .model-card-footer {
    padding-right: 14px;
    padding-left: 14px;
  }

  .model-pagination {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-card {
    min-height: 132px;
  }

  .model-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .model-metric:nth-child(odd) {
    border-left: 0;
  }

  .model-metric:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
}

@keyframes status-soft-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.66;
    transform: scale(0.82);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Visual refresh: one quiet monitoring surface instead of stacked white cards. */
:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #0a100e;
  --surface: #0e1713;
  --surface-raised: #111c17;
  --surface-subtle: #15221c;
  --surface-strong: #1d3027;
  --text: #e8f2ed;
  --text-soft: #c5d5cc;
  --muted: #8ea59a;
  --faint: #63796e;
  --border: #22352b;
  --border-strong: #365143;
  --green: #3ec891;
  --green-strong: #72ddb0;
  --green-soft: #17372a;
  --blue: #77aaf5;
  --blue-soft: #1c304b;
  --amber: #e0a24c;
  --amber-soft: #3a2c1b;
  --red: #ef7774;
  --red-soft: #412322;
  --violet: #b194ea;
  --violet-soft: #302744;
  --status-banner: #10271e;
  --status-banner-muted: #aac7b8;
  --status-banner-border: #2f7655;
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.025), 0 12px 28px rgba(0, 0, 0, 0.16);
  --shadow-hover: 0 1px 0 rgba(255, 255, 255, 0.04), 0 16px 32px rgba(0, 0, 0, 0.24);
  --grid-line: rgba(115, 176, 145, 0.055);
  --tech-line: rgba(62, 200, 145, 0.36);
}

html[data-theme="light"] {
  color-scheme: light;
  --page-bg: #f1f5f3;
  --surface: #f8fbf9;
  --surface-raised: #ffffff;
  --surface-subtle: #f3f7f5;
  --surface-strong: #e4eee8;
  --text: #102019;
  --text-soft: #30453a;
  --muted: #667b70;
  --faint: #8b9c93;
  --border: #d3e0d8;
  --border-strong: #b7cabe;
  --green: #108d62;
  --green-strong: #08724d;
  --green-soft: #e1f4e9;
  --blue: #2c70d6;
  --blue-soft: #e7f0fe;
  --amber: #b66a08;
  --amber-soft: #fff1d7;
  --red: #c84541;
  --red-soft: #fbe8e7;
  --violet: #704fac;
  --violet-soft: #eee8fb;
  --status-banner: #e8f2ec;
  --status-banner-muted: #547266;
  --status-banner-border: #b9d4c3;
  --grid-line: rgba(38, 86, 61, 0.055);
  --tech-line: rgba(16, 141, 98, 0.28);
  --shadow-sm: 0 1px 2px rgba(18, 35, 26, 0.035), 0 8px 22px rgba(18, 35, 26, 0.045);
  --shadow-hover: 0 2px 4px rgba(18, 35, 26, 0.055), 0 12px 28px rgba(18, 35, 26, 0.08);
}

body {
  background: var(--page-bg);
}

.content-shell,
.header-inner {
  width: min(100% - 64px, 1240px);
}

.app-header {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--page-bg) 91%, transparent);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.11);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 64px;
  gap: 24px;
}

.brand-mark {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15), 0 0 20px var(--glow-green);
}

.live-meta,
.header-actions .icon-button {
  border-color: var(--border);
  background: color-mix(in srgb, var(--surface-raised) 76%, transparent);
}

.overview-section {
  padding: 30px 0 42px;
  border-bottom-color: var(--border);
}

.system-summary {
  min-height: 136px;
  margin-bottom: 14px;
  padding: 22px 24px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm), 0 0 0 1px color-mix(in srgb, var(--summary-accent) 10%, transparent);
}

.summary-main {
  gap: 16px;
}

.summary-status-mark {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  border-radius: 8px;
}

.system-summary h1 {
  font-size: clamp(25px, 2.4vw, 34px);
  letter-spacing: -0.02em;
}

.summary-fact {
  min-width: 112px;
  padding-right: 16px;
  padding-left: 16px;
}

.metric-grid {
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 132px;
  padding: 16px 17px 15px;
  border-color: var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--metric-accent) 3%, var(--surface-raised));
  box-shadow: var(--shadow-sm);
}

.metric-card::before {
  height: 2px;
  opacity: 0.86;
}

.metric-card:hover {
  box-shadow: var(--shadow-hover), 0 0 0 1px color-mix(in srgb, var(--metric-accent) 14%, transparent);
}

.metric-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.metric-value {
  margin-top: 14px;
  font-size: 29px;
}

.metric-context {
  padding-top: 9px;
}

.panel {
  border-color: var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.panel:hover {
  box-shadow: var(--shadow-hover);
}

.panel-header {
  min-height: 66px;
  padding: 14px 17px;
}

.panel-header h2 {
  font-size: 16px;
}

.uptime-chart {
  height: 118px;
  margin: 16px 17px 0;
  gap: 2px;
}

.chart-axis {
  margin: 7px 17px 14px;
}

.model-status-section {
  padding: 42px 0 58px;
  border-bottom-color: var(--border);
  background: var(--page-bg);
}

.model-status-heading {
  margin-bottom: 16px;
}

.model-status-heading h2 {
  font-size: 24px;
  letter-spacing: -0.015em;
}

.model-status-heading h2::after {
  width: 6px;
  height: 6px;
  margin-left: 8px;
}

.model-stat-strip {
  border-color: var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.model-stat-item {
  min-height: 50px;
  padding: 8px 16px;
}

.model-stat-item strong {
  font-size: 18px;
}

.model-toolbar {
  margin: 14px 0 16px;
}

.model-search input,
.compact-select select {
  border-color: var(--border);
  background: var(--surface-raised);
}

.model-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
  gap: 14px;
}

.model-card {
  border-color: var(--border);
  border-top-width: 2px;
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.model-card:hover {
  box-shadow: var(--shadow-hover), 0 0 0 1px color-mix(in srgb, var(--model-accent) 12%, transparent);
}

.model-card-header {
  min-height: 84px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--model-accent) 4%, var(--surface-raised));
}

.model-provider-mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 7px;
}

.model-identity {
  gap: 11px;
}

.model-identity-copy strong {
  font-size: 14px;
}

.model-metrics {
  background: var(--surface-subtle);
}

.model-metric {
  padding: 12px 13px;
}

.model-metric span {
  font-size: 10px;
}

.model-metric strong {
  font-size: 13px;
}

.model-metric:first-child strong {
  font-size: 15px;
}

.model-slot-section {
  padding: 13px 16px 14px;
}

.model-slot-track {
  height: 26px;
  background: color-mix(in srgb, var(--surface-subtle) 82%, var(--page-bg));
}

.model-card-footer {
  min-height: 52px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--surface-subtle) 70%, transparent);
}

.model-empty {
  border-color: var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
}

html[data-theme="light"] .system-summary {
  border-color: var(--summary-border);
  background-color: var(--status-banner);
  background-image: linear-gradient(rgba(16, 52, 34, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(16, 52, 34, 0.035) 1px, transparent 1px);
  color: var(--text);
  box-shadow: var(--shadow-sm), 0 0 0 1px color-mix(in srgb, var(--summary-accent) 10%, transparent);
}

html[data-theme="light"] .system-summary h1 {
  color: var(--text);
}

html[data-theme="light"] .summary-fact strong {
  color: var(--text);
}

@media (max-width: 720px) {
  .content-shell,
  .header-inner {
    width: min(100% - 32px, 1240px);
  }

  .overview-section {
    padding-top: 22px;
  }

  .system-summary {
    padding: 19px 17px;
  }

  .model-status-section {
    padding-top: 34px;
  }
}

@media (max-width: 540px) {
  .content-shell,
  .header-inner {
    width: min(100% - 20px, 1240px);
  }
}
