:root {
  color-scheme: dark;
  --bg: #101419;
  --ink: #f2f7f5;
  --soft: #c8d5d2;
  --muted: #87979a;
  --line: rgba(218, 234, 232, 0.14);
  --line-strong: rgba(218, 234, 232, 0.26);
  --surface: rgba(18, 25, 31, 0.78);
  --surface-strong: rgba(22, 31, 38, 0.92);
  --ok: #36d399;
  --cyan: #5eead4;
  --warn: #f6b44b;
  --bad: #ff6b6b;
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(94, 234, 212, 0.08), transparent 420px),
    linear-gradient(135deg, #101419 0%, #151a1f 42%, #0e1217 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.82), transparent 78%);
}

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

button {
  font: inherit;
}

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

.page-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(94, 234, 212, 0.055) 18.1% 18.2%, transparent 18.3% 100%),
    linear-gradient(90deg, transparent 0 72%, rgba(246, 180, 75, 0.05) 72.1% 72.2%, transparent 72.3% 100%);
}

.shell {
  position: relative;
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 52px;
}

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

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(94, 234, 212, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(94, 234, 212, 0.16), rgba(246, 180, 75, 0.11)),
    rgba(255, 255, 255, 0.04);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-links a,
.launch,
.icon-button,
.toggle-button,
.segmented button,
.view-switcher button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--soft);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    color 160ms ease;
}

.nav-links a {
  padding: 0 12px;
  font-size: 13px;
}

.nav-links a:hover,
.launch:hover,
.icon-button:hover,
.toggle-button:hover,
.segmented button:hover,
.view-switcher button:hover {
  border-color: rgba(94, 234, 212, 0.42);
  background: rgba(94, 234, 212, 0.11);
  color: var(--ink);
  transform: translateY(-1px);
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
}

.icon-button.is-loading svg {
  animation: spin 900ms linear infinite;
}

.toggle-button {
  padding: 0 13px;
  font-size: 13px;
  font-weight: 800;
}

.toggle-button.is-on {
  border-color: rgba(54, 211, 153, 0.36);
  color: var(--ok);
  background: rgba(54, 211, 153, 0.11);
}

.command-center {
  position: relative;
  min-height: 650px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #11171d;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.34);
  isolation: isolate;
}

.command-center::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    linear-gradient(90deg, rgba(14, 18, 23, 0.95) 0%, rgba(14, 18, 23, 0.86) 35%, rgba(14, 18, 23, 0.46) 68%, rgba(14, 18, 23, 0.76) 100%),
    linear-gradient(180deg, rgba(14, 18, 23, 0.22), rgba(14, 18, 23, 0.88));
}

.command-center::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, transparent 0 26%, rgba(255, 255, 255, 0.08) 26.1% 26.2%, transparent 26.3% 100%),
    linear-gradient(180deg, transparent 0 70%, rgba(255, 255, 255, 0.08) 70.1% 70.2%, transparent 70.3% 100%);
}

.command-image,
#telemetryCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.command-image {
  object-fit: cover;
  filter: saturate(1.05) contrast(1.04);
}

#telemetryCanvas {
  z-index: 3;
}

.command-grid {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.52fr);
  grid-template-rows: minmax(290px, auto) auto;
  gap: 18px;
  min-height: 470px;
  padding: clamp(24px, 4vw, 58px);
}

.hero-copy {
  align-self: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 12ch;
  margin-bottom: 22px;
  font-size: clamp(46px, 6.5vw, 92px);
  line-height: 0.92;
  letter-spacing: 0;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill,
.state,
.list-row em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

button.status-pill {
  cursor: pointer;
}

.ok {
  color: var(--ok);
  background: rgba(54, 211, 153, 0.1);
}

.warn {
  color: var(--warn);
  background: rgba(246, 180, 75, 0.1);
}

.bad {
  color: var(--bad);
  background: rgba(255, 107, 107, 0.1);
}

.muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.system-snapshot {
  align-self: center;
  min-height: 254px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045), transparent),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.18));
}

.panel-head,
.section-head,
.service-top,
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1;
}

.panel-kicker,
.section-meta,
.service-top span:first-child,
.detail-card span,
.host-lines small,
.policy-list span,
.trace-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.host-lines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 14px;
  margin-top: 34px;
}

.host-lines small,
.host-lines strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-lines strong {
  margin-top: 6px;
  color: var(--soft);
  font-size: 13px;
}

.control-cluster {
  display: grid;
  grid-column: 2;
  gap: 12px;
  align-self: end;
  justify-items: end;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.segmented,
.view-switcher {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.segmented button,
.view-switcher button {
  min-height: 30px;
  border-color: transparent;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  background: transparent;
}

.segmented button.is-active,
.view-switcher button.is-active {
  border-color: rgba(94, 234, 212, 0.34);
  color: var(--cyan);
  background: rgba(94, 234, 212, 0.1);
}

.service-dock {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  border-top: 1px solid var(--line);
  padding: 18px clamp(24px, 4vw, 58px) clamp(22px, 3vw, 34px);
  background: rgba(11, 15, 20, 0.62);
  backdrop-filter: blur(20px);
}

.section-head {
  margin: 0;
}

.section-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.service-dock .section-head {
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
}

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

.service-card,
.metric-panel,
.detail-card,
.trace-card,
.list-row,
.activity-item,
.inspector-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 25, 31, 0.72);
  backdrop-filter: blur(18px);
}

.service-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 38px;
  gap: 14px;
  min-height: 142px;
  overflow: hidden;
  padding: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%),
    rgba(18, 25, 31, 0.78);
}

.service-card::after {
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 56%, transparent), transparent);
  transform: scaleX(0.34);
  transform-origin: left;
  transition: transform 180ms ease;
}

.service-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent, var(--cyan)) 48%, transparent);
  border-radius: 8px;
  color: var(--accent, var(--cyan));
  background: color-mix(in srgb, var(--accent, var(--cyan)) 12%, transparent);
}

.service-card h3 {
  margin: 12px 0 8px;
  font-size: 22px;
  letter-spacing: 0;
}

.service-card p {
  min-height: 34px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

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

.service-meta span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--soft);
  font-size: 12px;
}

.launch {
  width: 38px;
  height: 38px;
  align-self: start;
  padding: 0;
}

.interactive {
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.interactive:hover,
.interactive:focus-visible {
  border-color: rgba(94, 234, 212, 0.42);
  background: rgba(25, 35, 42, 0.92);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  outline: none;
  transform: translateY(-1px);
}

.service-card:hover::after,
.service-card:focus-visible::after {
  transform: scaleX(1);
}

.view-panel.is-hidden {
  display: none;
}

.telemetry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(380px, 0.82fr);
  gap: 18px;
  margin-top: 18px;
}

.signal-stage,
.resource-stage,
.ops-block {
  min-width: 0;
}

.signal-stage {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

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

.trace-card {
  display: grid;
  min-height: 168px;
  padding: 14px;
  text-align: left;
  color: var(--ink);
}

.trace-card strong {
  margin: 10px 0 6px;
  font-size: 24px;
  line-height: 1;
}

.trace-card svg {
  width: 100%;
  height: 66px;
  align-self: end;
}

.trace-card.is-active {
  border-color: rgba(94, 234, 212, 0.5);
  background:
    linear-gradient(180deg, rgba(94, 234, 212, 0.11), transparent),
    rgba(21, 30, 37, 0.9);
}

.resource-stage {
  display: grid;
  gap: 14px;
}

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

.metric-panel {
  min-height: 178px;
  padding: 16px;
}

.meter {
  height: 8px;
  margin: 22px 0 12px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ok), var(--cyan), var(--warn));
  transition: width 280ms ease;
}

.sparkline {
  width: 100%;
  height: 42px;
  margin-top: 2px;
  overflow: visible;
}

.spark-line {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.spark-fill {
  fill: rgba(94, 234, 212, 0.12);
  stroke: none;
}

.spark-empty {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 2;
}

.panel-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.resource-head {
  margin-top: 2px;
}

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

.detail-card {
  min-height: 112px;
  padding: 14px;
}

.detail-card strong {
  display: block;
  margin: 16px 0 6px;
  font-size: 22px;
  line-height: 1;
}

.detail-card small,
.list-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.operations-layout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.ops-block {
  display: grid;
  gap: 12px;
  align-content: start;
}

.compact-list,
.policy-list,
.activity-list {
  display: grid;
  gap: 10px;
}

.list-row {
  min-height: 56px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.list-row span {
  min-width: 0;
}

.list-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.policy-list p {
  display: grid;
  gap: 6px;
  margin: 0;
  border-left: 2px solid rgba(94, 234, 212, 0.34);
  padding: 0 0 0 10px;
}

.policy-list strong {
  color: var(--soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.activity-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 42px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.activity-item i {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted);
  box-shadow: 0 0 16px currentColor;
}

.activity-item i.ok {
  background: var(--ok);
  color: var(--ok);
}

.activity-item i.warn {
  background: var(--warn);
  color: var(--warn);
}

.activity-item i.bad {
  background: var(--bad);
  color: var(--bad);
}

.activity-item strong,
.activity-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item strong {
  font-size: 13px;
}

.activity-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.inspector {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  background: rgba(0, 0, 0, 0);
  transition: background 180ms ease;
}

.inspector.is-open {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.42);
}

.inspector-panel {
  width: min(440px, calc(100% - 28px));
  height: calc(100% - 28px);
  margin: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(17, 23, 30, 0.96);
  box-shadow: -28px 0 80px rgba(0, 0, 0, 0.34);
  transform: translateX(calc(100% + 28px));
  transition: transform 200ms ease;
}

.inspector.is-open .inspector-panel {
  transform: translateX(0);
}

.close-button {
  float: right;
}

.inspector-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 34px 0 18px;
}

.inspector-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.inspector-head h2 {
  margin: 3px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

.inspector-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.inspector-status a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.055);
}

.inspector-rows {
  display: grid;
  gap: 10px;
}

.inspector-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.inspector-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.inspector-row strong {
  overflow-wrap: anywhere;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.4;
}

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

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

  .control-cluster {
    grid-column: 1;
    justify-items: start;
  }

  .service-dock,
  .telemetry-layout,
  .operations-layout {
    grid-template-columns: 1fr;
  }

  .service-dock .section-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 18px, 640px);
    padding-top: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .command-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    grid-template-rows: auto;
    min-height: auto;
    padding: 24px 22px 18px;
  }

  .hero-copy {
    order: 1;
  }

  .control-cluster {
    order: 2;
  }

  h1 {
    margin-bottom: 18px;
    font-size: 40px;
  }

  .system-snapshot {
    order: 3;
    min-height: auto;
    padding: 18px 0;
  }

  .host-lines {
    grid-template-columns: 1fr 1fr;
    gap: 14px 10px;
    margin-top: 26px;
  }

  .host-lines strong {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .control-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented,
  .view-switcher {
    width: 100%;
  }

  .segmented button,
  .view-switcher button {
    flex: 1;
  }

  .service-dock {
    grid-template-columns: 1fr;
    padding: 16px 22px 20px;
  }

  .service-grid,
  .metric-pair,
  .detail-grid,
  .trace-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    grid-template-columns: 40px minmax(0, 1fr);
    min-height: 128px;
  }

  .service-card p {
    min-height: 0;
  }

  .launch {
    grid-column: 2;
    justify-self: start;
  }
}
