@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap");

:root {
  --bg: #08141c;
  --panel: rgba(8, 23, 31, 0.82);
  --panel-strong: rgba(7, 20, 28, 0.94);
  --shell-bg: rgba(4, 14, 20, 0.88);
  --line: rgba(152, 189, 201, 0.18);
  --text: #e6f1f4;
  --muted: #90aab1;
  --teal: #36d3c4;
  --amber: #ffb347;
  --red: #ff6f61;
  --sky: #6fc6ff;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
  --bg-accent-1: rgba(54, 211, 196, 0.15);
  --bg-accent-2: rgba(111, 198, 255, 0.12);
  --bg-base-1: #071018;
  --bg-base-2: #0b1820;
  --bg-base-3: #12212a;
  --grid-line: rgba(255, 255, 255, 0.02);
  --logo-filter: brightness(0) invert(1) contrast(1.08) drop-shadow(0 0 14px rgba(255, 255, 255, 0.22));
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --copy-font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono-font: "IBM Plex Mono", "SFMono-Regular", monospace;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #edf5f7;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --shell-bg: rgba(247, 251, 252, 0.94);
  --line: rgba(21, 54, 66, 0.12);
  --text: #10222a;
  --muted: #5d727a;
  --teal: #118e87;
  --amber: #c77c11;
  --red: #c14c40;
  --sky: #116c9c;
  --shadow: 0 18px 55px rgba(32, 54, 61, 0.12);
  --bg-accent-1: rgba(17, 142, 135, 0.1);
  --bg-accent-2: rgba(17, 108, 156, 0.08);
  --bg-base-1: #f5fbfc;
  --bg-base-2: #edf5f7;
  --bg-base-3: #e4eef1;
  --grid-line: rgba(16, 34, 42, 0.03);
  --logo-filter: none;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--copy-font);
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--bg-accent-1), transparent 28%),
    radial-gradient(circle at 80% 20%, var(--bg-accent-2), transparent 22%),
    linear-gradient(145deg, var(--bg-base-1) 0%, var(--bg-base-2) 54%, var(--bg-base-3) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
}

.app-shell,
.api-shell {
  width: min(1680px, calc(100% - 24px));
  margin: 24px auto;
  padding: 30px 30px 120px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--shell-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.app-content.is-disabled {
  opacity: 0.38;
  pointer-events: none;
  user-select: none;
  filter: grayscale(0.18);
}

.hero,
.api-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
  gap: 20px;
  align-items: end;
  padding-bottom: 20px;
}

.brand-row {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.logo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  min-height: 56px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.logo-pill img {
  display: block;
  max-width: 168px;
  max-height: 52px;
  width: auto;
  height: auto;
  filter: var(--logo-filter);
}

.logo-pill img.logo-static {
  filter: none;
}

.eyebrow,
.section-kicker,
.callout-label {
  margin: 0 0 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--teal);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--copy-font);
  font-weight: 600;
  line-height: 1.04;
}

h1 {
  max-width: none;
  font-size: clamp(1.2rem, 1.8vw, 2rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.7rem, 2vw, 2.25rem);
  line-height: 1.08;
}

h3 {
  font-size: clamp(1.16rem, 1.6vw, 1.45rem);
  line-height: 1.16;
}

.hero-copy,
.section-copy,
.callout-copy,
.stacked-stats span,
.stacked-stats strong,
.rack-detail-body,
.optimizer-state,
.optimizer-result,
.lookup-card,
.field span,
.check span,
.modal-copy,
.trace-summary,
.setup-feedback,
.selection-note,
.helper-text {
  line-height: 1.55;
}

.hero-copy,
.section-copy,
.callout-copy,
.stacked-stats span,
.lookup-card,
.optimizer-state,
.modal-copy,
.selection-note,
.helper-text,
.trace-summary.is-empty,
.setup-feedback.is-empty {
  color: var(--muted);
}

.api-note,
code,
.code-chip {
  font-family: var(--mono-font);
}

.api-note {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--sky);
}

.hero-copy {
  max-width: 56ch;
  margin-top: 12px;
}

.clock-readout {
  margin: 8px 0 0;
  color: var(--sky);
  font-family: var(--mono-font);
  font-size: 0.88rem;
}

.hero-meta,
.api-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hero-side {
  display: grid;
  gap: 12px;
  align-self: stretch;
}

.hero-side-actions {
  display: flex;
  justify-content: flex-end;
}

.metric-card,
.insight-panel,
.rack-detail-card,
.intake-card,
.optimizer-card,
.setup-card,
.history-card,
.api-card,
.endpoint-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.metric-card {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.optimizer-card {
  align-self: start;
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 150px);
  overflow: auto;
  border-color: rgba(54, 211, 196, 0.35);
  background:
    radial-gradient(circle at top right, rgba(54, 211, 196, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(8, 35, 39, 0.96), rgba(6, 20, 27, 0.92));
}

.optimizer-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--teal), var(--sky));
}

.metric-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.metric-card strong {
  font-size: clamp(2rem, 2vw, 2.5rem);
}

.tab-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px;
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  overflow-x: auto;
}

.tab-group,
.utility-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tab,
.tab-link {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.tab:hover,
.tab:focus-visible,
.tab-link:hover,
.tab-link:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.tab.is-active {
  color: #031417;
  background: linear-gradient(135deg, var(--teal), #83e8de);
}

.utility-button {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.utility-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.utility-icon-badge {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(124, 231, 219, 0.12);
  border: 1px solid rgba(124, 231, 219, 0.18);
  flex: 0 0 auto;
}

.utility-icon-image {
  display: block;
  width: 15px;
  height: 15px;
}

.theme-toggle-button {
  width: auto;
  min-width: 114px;
  padding: 0 16px;
  gap: 8px;
  border-radius: 999px;
  font-size: 0.95rem;
}

html[data-theme="light"] .tab,
html[data-theme="light"] .tab-link,
html[data-theme="light"] .utility-button {
  color: var(--muted);
}

html[data-theme="light"] .tab:hover,
html[data-theme="light"] .tab:focus-visible,
html[data-theme="light"] .tab-link:hover,
html[data-theme="light"] .tab-link:focus-visible {
  background: rgba(16, 34, 42, 0.05);
  color: var(--text);
}

html[data-theme="light"] .utility-button {
  background: rgba(16, 34, 42, 0.03);
  border-color: rgba(16, 34, 42, 0.08);
}

html[data-theme="light"] .utility-icon-badge {
  background: rgba(17, 142, 135, 0.1);
  border-color: rgba(17, 142, 135, 0.15);
}

html[data-theme="light"] .metric-card,
html[data-theme="light"] .insight-panel,
html[data-theme="light"] .rack-detail-card,
html[data-theme="light"] .intake-card,
html[data-theme="light"] .setup-card,
html[data-theme="light"] .history-card,
html[data-theme="light"] .api-card,
html[data-theme="light"] .endpoint-card,
html[data-theme="light"] .busbar-stage,
html[data-theme="light"] .dashboard-summary-card {
  background: var(--panel);
}

html[data-theme="light"] .optimizer-card {
  border-color: rgba(17, 142, 135, 0.22);
  background:
    radial-gradient(circle at top right, rgba(17, 142, 135, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(248, 253, 253, 0.98), rgba(235, 246, 247, 0.96));
}

html[data-theme="light"] .optimizer-card::before {
  background: linear-gradient(180deg, var(--teal), var(--sky));
}

html[data-theme="light"] .dashboard-hero-card {
  border-color: rgba(17, 142, 135, 0.18);
  background:
    radial-gradient(circle at top right, rgba(17, 142, 135, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(248, 253, 253, 0.98), rgba(235, 246, 247, 0.96));
}

html[data-theme="light"] .dashboard-value-card,
html[data-theme="light"] .reason-item,
html[data-theme="light"] .optimizer-mini-metrics div,
html[data-theme="light"] .dashboard-benefit-strip span {
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .optimizer-banner {
  background:
    linear-gradient(135deg, rgba(17, 142, 135, 0.08), rgba(17, 108, 156, 0.05)),
    rgba(255, 255, 255, 0.82);
  border-color: rgba(17, 142, 135, 0.16);
}

html[data-theme="light"] .lookup-card,
html[data-theme="light"] .trace-summary,
html[data-theme="light"] .setup-feedback,
html[data-theme="light"] .optimizer-result,
html[data-theme="light"] .optimizer-insight,
html[data-theme="light"] .insight-callout,
html[data-theme="light"] .check,
html[data-theme="light"] .modal-card,
html[data-theme="light"] .tab-row,
html[data-theme="light"] .data-boundary,
html[data-theme="light"] .boundary-card {
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .data-boundary {
  border-color: rgba(17, 108, 156, 0.14);
  box-shadow: 0 14px 36px rgba(32, 54, 61, 0.08);
}

html[data-theme="light"] .boundary-card {
  border-color: rgba(16, 34, 42, 0.08);
}

html[data-theme="light"] .modal-shell {
  background: rgba(227, 238, 242, 0.62);
}

.utility-button:hover,
.utility-button:focus-visible,
.utility-button.is-active {
  background: rgba(54, 211, 196, 0.12);
  border-color: rgba(54, 211, 196, 0.45);
  transform: translateY(-1px);
}

.api-button {
  width: auto;
  min-width: 64px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 0.95rem;
}

.documentation-button {
  width: auto;
  min-width: 160px;
  padding: 0 16px;
  gap: 8px;
  border-radius: 999px;
  font-size: 0.95rem;
}

.docs-link-row {
  margin: 14px 0 0;
}

.inline-doc-link {
  color: var(--sky);
  text-decoration: none;
  border-bottom: 1px solid rgba(111, 198, 255, 0.35);
}

.inline-doc-link:hover,
.inline-doc-link:focus-visible {
  color: var(--text);
  border-bottom-color: rgba(230, 241, 244, 0.45);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

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

.dashboard-heading {
  margin-bottom: 18px;
}

.dashboard-hero-card,
.dashboard-summary-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.dashboard-hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
  background:
    radial-gradient(circle at top right, rgba(54, 211, 196, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(8, 35, 39, 0.96), rgba(6, 20, 27, 0.92));
}

.dashboard-hero-copy {
  display: grid;
  gap: 8px;
}

.dashboard-benefit-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.dashboard-benefit-strip span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(54, 211, 196, 0.18);
  background: rgba(54, 211, 196, 0.08);
  color: var(--text);
  font-size: 0.86rem;
}

.dashboard-hero-copy h3 {
  font-size: clamp(1.5rem, 2vw, 2.2rem);
}

.dashboard-status-copy {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 1rem;
}

.dashboard-hero-actions {
  display: grid;
  gap: 12px;
  width: min(320px, 100%);
}

.dashboard-primary-button,
.dashboard-secondary-button {
  min-height: 56px;
  font-size: 1rem;
}

.dashboard-metric-grid,
.dashboard-summary-grid,
.dashboard-value-grid {
  display: grid;
  gap: 18px;
}

.dashboard-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.dashboard-value-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

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

.dashboard-metric-card {
  min-height: 148px;
  padding: 24px;
}

.dashboard-metric-card strong {
  font-size: clamp(2.3rem, 2.8vw, 3.3rem);
}

.dashboard-value-card {
  padding: 18px 20px;
  border: 1px solid rgba(54, 211, 196, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(54, 211, 196, 0.08), rgba(255, 255, 255, 0.02)),
    var(--panel);
}

.dashboard-value-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.35rem, 1.8vw, 1.8rem);
  line-height: 1.18;
}

.reason-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.reason-item {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.reason-item strong {
  font-size: 0.9rem;
}

.reason-item span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.data-boundary {
  margin: 12px 0 26px;
  padding: 22px;
  border: 1px solid rgba(111, 198, 255, 0.2);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(111, 198, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(8, 23, 31, 0.94), rgba(6, 18, 25, 0.92));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.data-boundary-api {
  margin-top: 24px;
}

.data-boundary-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.data-boundary-header .section-copy {
  max-width: 54ch;
  margin: 0;
}

.data-boundary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.boundary-card {
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 21, 28, 0.74);
}

.boundary-card-positive {
  border-color: rgba(54, 211, 196, 0.28);
}

.boundary-card-negative {
  border-color: rgba(255, 179, 71, 0.28);
}

.boundary-title {
  margin: 0 0 12px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}

.boundary-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.boundary-list li::marker {
  color: var(--sky);
}

.overview-grid,
.busbar-layout,
.intake-layout,
.setup-layout,
.api-grid,
.api-docs-grid {
  display: grid;
  gap: 24px;
}

.overview-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr);
  align-items: start;
}

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

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

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

.busbar-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.05), transparent),
    var(--panel-strong);
  padding: 20px;
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.busbar-card:hover,
.busbar-card:focus-visible,
.busbar-card.is-selected {
  transform: translateY(-3px);
  border-color: rgba(54, 211, 196, 0.55);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.busbar-card-header,
.capacity-row,
.busbar-card-stats,
.stacked-stats,
.trace-grid,
.api-list,
.detail-list {
  display: flex;
  gap: 12px;
}

.busbar-card-header,
.capacity-row,
.busbar-card-stats,
.detail-row,
.trace-grid,
.api-list {
  justify-content: space-between;
}

.busbar-card-header,
.capacity-row {
  align-items: center;
}

.busbar-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.busbar-health,
.tag,
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.busbar-health {
  background: rgba(255, 255, 255, 0.06);
  color: var(--sky);
}

.capacity-bar {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.capacity-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.capacity-text,
.busbar-card-stats span,
.stacked-stats span,
.stacked-stats strong {
  font-size: 0.92rem;
}

.busbar-card-stats {
  color: var(--muted);
  flex-wrap: wrap;
  row-gap: 8px;
}

.stacked-stats {
  flex-direction: column;
  margin: 4px 0 0;
  gap: 0;
}

.stacked-stats strong {
  color: var(--text);
}

.stacked-stats div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stacked-stats div:first-child {
  padding-top: 0;
}

.stacked-stats div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.insight-callout {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.busbar-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
}

.busbar-stage {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
}

.rack-slots,
.intake-slot-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
}

.rack-slots {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.rack-slot,
.intake-slot {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 16px 14px;
  min-height: 160px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.rack-slot {
  display: flex;
  flex-direction: column;
}

.rack-slot-running {
  background: rgba(54, 211, 196, 0.11);
  border-color: rgba(54, 211, 196, 0.28);
}

.rack-slot-scheduled {
  background: rgba(255, 179, 71, 0.11);
  border-color: rgba(255, 179, 71, 0.28);
}

.rack-slot-error {
  background: rgba(255, 111, 97, 0.12);
  border-color: rgba(255, 111, 97, 0.3);
}

.rack-slot:hover,
.rack-slot:focus-visible,
.rack-slot.is-selected,
.intake-slot:hover,
.intake-slot:focus-visible,
.intake-slot.is-selected {
  transform: translateY(-2px);
  border-color: rgba(111, 198, 255, 0.48);
  box-shadow: 0 12px 18px rgba(0, 0, 0, 0.18);
}

.intake-slot {
  min-height: 82px;
}

.intake-slot.is-selected {
  border-color: rgba(54, 211, 196, 0.72);
  background: rgba(54, 211, 196, 0.12);
}

.intake-slot:disabled,
.intake-slot.is-occupied {
  cursor: not-allowed;
  color: rgba(230, 241, 244, 0.42);
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: none;
  transform: none;
}

.rack-slot-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
}

.rack-slot-title,
.intake-slot-value {
  display: block;
  font-weight: 600;
}

.rack-slot-title {
  min-height: 48px;
  font-size: 0.96rem;
  line-height: 1.28;
}

.rack-kpi-row {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.rack-kpi,
.detail-row {
  display: flex;
  gap: 12px;
}

.rack-kpi-label,
.detail-label,
.trace-item span,
.server-type-card span,
.endpoint-meta,
.intake-slot-label {
  color: var(--muted);
}

.rack-kpi-value {
  color: var(--text);
}

.status-running {
  background: rgba(54, 211, 196, 0.16);
  color: #98fff4;
}

.status-scheduled {
  background: rgba(255, 179, 71, 0.16);
  color: #ffd28d;
}

.status-empty {
  background: rgba(255, 255, 255, 0.07);
  color: #cad8dc;
}

.status-hold {
  background: rgba(255, 111, 97, 0.18);
  color: #ffb4ac;
}

.status-error {
  background: rgba(255, 111, 97, 0.18);
  color: #ffb4ac;
}

.detail-list {
  flex-direction: column;
  margin-top: 14px;
}

.detail-row {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.busbar-heading-actions,
.location-header,
.modal-actions {
  display: flex;
  gap: 12px;
}

.field {
  display: grid;
  gap: 9px;
}

.field.compact {
  min-width: 220px;
}

.checkin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 12px;
  align-items: stretch;
}

input,
select,
.primary-button,
.secondary-button {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] .secondary-button {
  background: rgba(16, 34, 42, 0.03);
  border-color: rgba(16, 34, 42, 0.08);
  color: var(--text);
}

html[data-theme="light"] .rack-slot,
html[data-theme="light"] .intake-slot {
  background: rgba(255, 255, 255, 0.82);
}

input[type="file"] {
  padding: 12px;
}

input::placeholder {
  color: rgba(230, 241, 244, 0.36);
}

input:focus-visible,
select:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible {
  outline: 2px solid rgba(54, 211, 196, 0.55);
  outline-offset: 1px;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, #dffbff 0%, #7ce7db 50%, #28b5d3 100%);
  color: #05202a;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button {
  cursor: pointer;
}

.secondary-button:disabled {
  cursor: not-allowed;
  color: rgba(230, 241, 244, 0.36);
  border-color: rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}

.intake-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
  align-items: start;
}

.setup-layout {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
}

.setup-stack,
.server-type-list {
  display: grid;
  gap: 20px;
}

.form-grid,
.check-grid,
.trace-grid {
  display: grid;
  gap: 18px;
}

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

.intake-form-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.8fr) minmax(220px, 0.8fr);
  align-items: start;
}

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

.lookup-card,
.trace-summary,
.setup-feedback,
.optimizer-result,
.optimizer-insight {
  margin-top: 20px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.optimizer-insight {
  border: 1px solid rgba(54, 211, 196, 0.14);
}

.optimizer-insight-card h4 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.optimizer-mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.optimizer-mini-metrics div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.optimizer-mini-metrics span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.optimizer-mini-metrics strong {
  font-size: 0.98rem;
  line-height: 1.35;
}

.optimizer-compare-stats {
  margin-top: 16px;
}

.optimizer-banner {
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid rgba(54, 211, 196, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(54, 211, 196, 0.11), rgba(111, 198, 255, 0.06)),
    rgba(255, 255, 255, 0.02);
}

.optimizer-banner h3 {
  margin-bottom: 10px;
}

.helper-placeholder {
  visibility: hidden;
}

.optimizer-steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.optimizer-step {
  min-height: 152px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.optimizer-step.is-active {
  border-color: rgba(54, 211, 196, 0.34);
  background: linear-gradient(180deg, rgba(54, 211, 196, 0.12), rgba(255, 255, 255, 0.04));
}

.optimizer-step.is-complete {
  border-color: rgba(54, 211, 196, 0.24);
  background: rgba(54, 211, 196, 0.08);
}

.optimizer-step.is-current {
  border-color: rgba(111, 198, 255, 0.34);
  background: linear-gradient(180deg, rgba(111, 198, 255, 0.16), rgba(255, 255, 255, 0.05));
}

.optimizer-step strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 1rem;
  line-height: 1.2;
}

.optimizer-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.optimizer-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: var(--mono-font);
  font-size: 0.9rem;
}

.optimizer-step-arrow {
  color: var(--teal);
  font-size: 1.4rem;
  line-height: 1;
}

.optimizer-step.is-pulsing {
  animation: optimizerPulse 1s ease-in-out infinite;
}

@keyframes optimizerPulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(111, 198, 255, 0);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 24px rgba(111, 198, 255, 0.2);
    transform: scale(1.015);
  }
}

.scan-button {
  min-width: 0;
}

.history-table-shell {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.history-table th {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.history-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.history-serial,
.history-location {
  display: block;
}

.history-serial {
  font-family: var(--mono-font);
  color: var(--text);
}

.history-location {
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--muted);
}

.status-chip {
  align-self: flex-start;
  margin-top: 10px;
}

.remove-button {
  margin-top: 18px;
}

.lookup-card.is-empty,
.trace-summary.is-empty,
.setup-feedback.is-empty {
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.lookup-title {
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 600;
}

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

.lookup-item span,
.trace-item span,
.server-type-card span,
.endpoint-meta {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.check {
  display: flex;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.check input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
}

.progress-shell {
  margin-top: 18px;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky), var(--teal));
  transition: width 280ms linear;
}

.tag {
  background: rgba(111, 198, 255, 0.12);
  color: var(--sky);
}

.modal-shell {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 10, 14, 0.72);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.modal-shell.is-hidden,
.is-hidden {
  display: none !important;
}

.modal-card {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(5, 18, 24, 0.96);
  box-shadow: var(--shadow);
}

#manualAssignModal .modal-card {
  width: min(640px, 100%);
}

.spinner {
  width: 64px;
  height: 64px;
  margin: 24px auto 18px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--teal);
  animation: spin 0.9s linear infinite;
}

.modal-optimizer-path {
  margin-top: 20px;
}

.optimizer-steps.optimizer-steps-compact .optimizer-step {
  min-height: 0;
  padding: 14px;
}

.optimizer-steps.optimizer-steps-compact .optimizer-step strong {
  font-size: 0.96rem;
}

.optimizer-steps.optimizer-steps-compact .optimizer-step p {
  font-size: 0.86rem;
}

.modal-result-meta {
  margin-top: 18px;
}

.modal-result-meta p {
  margin: 0 0 8px;
}

.modal-result-meta p:last-child {
  margin-bottom: 0;
}

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

.endpoint-card h3,
.api-card h3 {
  margin-bottom: 12px;
}

.endpoint-route {
  font-family: var(--mono-font);
  font-size: 0.92rem;
  color: var(--sky);
}

.code-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.78rem;
}

.api-list {
  flex-wrap: wrap;
  margin-top: 12px;
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-shell {
  width: min(520px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(4, 14, 20, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-card {
  display: grid;
  gap: 18px;
}

.auth-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-feedback {
  min-height: 24px;
  color: #ffd28d;
}

.auth-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.optimizer-banner-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(1640px, calc(100% - 32px));
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
}

.optimizer-banner-on {
  background: linear-gradient(135deg, rgba(7, 64, 59, 0.98), rgba(6, 47, 44, 0.96));
  border-color: rgba(54, 211, 196, 0.32);
}

.optimizer-banner-off {
  background: linear-gradient(135deg, rgba(86, 26, 20, 0.98), rgba(68, 18, 14, 0.96));
  border-color: rgba(255, 111, 97, 0.34);
}

.optimizer-banner-copy {
  display: grid;
  gap: 4px;
}

.optimizer-banner-copy strong {
  font-size: 1rem;
}

.optimizer-banner-copy span {
  color: var(--muted);
  line-height: 1.5;
}

.optimizer-banner-toggle {
  width: auto;
  min-width: 180px;
}

.auth-grid {
  margin-top: 16px;
}

.sync-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.sync-form.is-disabled {
  opacity: 0.38;
  pointer-events: none;
}

.sync-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.sync-entry .busbar-card-header {
  align-items: start;
}

.sync-remove-button {
  width: auto;
  min-width: 88px;
}

@media (max-width: 1080px) {
  .hero,
  .api-hero,
  .overview-grid,
  .busbar-layout,
  .intake-layout,
  .setup-layout,
  .api-grid,
  .api-docs-grid {
    grid-template-columns: 1fr;
  }

  .hero-meta,
  .api-metrics,
  .dashboard-metric-grid,
  .dashboard-value-grid,
  .form-grid,
  .check-grid,
  .trace-grid,
  .lookup-grid {
    grid-template-columns: 1fr;
  }

  .tab-row {
    flex-direction: column;
    align-items: stretch;
    border-radius: 28px;
  }

  .tab-group,
  .utility-nav {
    justify-content: center;
    flex-wrap: wrap;
  }

  .dashboard-hero-card {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-hero-actions {
    width: 100%;
  }

  .dashboard-summary-grid {
    grid-template-columns: 1fr;
  }

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

  .intake-form-grid {
    grid-template-columns: 1fr;
  }

  .optimizer-steps {
    grid-template-columns: 1fr;
  }

  .optimizer-step-arrow {
    display: none;
  }

  .optimizer-banner-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .optimizer-banner-toggle {
    width: 100%;
  }

  .optimizer-card {
    position: relative;
    top: auto;
    max-height: none;
    overflow: visible;
  }

  .optimizer-mini-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell,
  .api-shell {
    width: min(100% - 20px, 100%);
    margin: 10px auto;
    padding: 18px 18px 126px;
    border-radius: 24px;
  }

  .section-heading,
  .data-boundary-header,
  .location-header,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .busbar-grid,
  .rack-slots,
  .intake-slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .data-boundary-grid {
    grid-template-columns: 1fr;
  }

  .optimizer-banner-bar {
    width: calc(100% - 20px);
    bottom: 10px;
  }
}
