:root {
  color-scheme: dark;
  --bg: #101113;
  --ink: #f7f8fb;
  --soft: #d6dbe0;
  --muted: #8e98a1;
  --line: rgba(236, 240, 244, 0.13);
  --line-strong: rgba(236, 240, 244, 0.25);
  --panel: rgba(22, 24, 27, 0.78);
  --panel-strong: rgba(29, 31, 34, 0.94);
  --ok: #39d98a;
  --info: #42c6ff;
  --warn: #f5b84b;
  --bad: #ff6d7a;
  --violet: #ad8cff;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 22% 12%, rgba(57, 217, 138, 0.1), transparent 30rem),
    radial-gradient(circle at 82% 6%, rgba(245, 184, 75, 0.12), transparent 28rem),
    linear-gradient(145deg, #101113 0%, #17181a 54%, #111315 100%);
}

body.is-loading #refreshBtn .refresh {
  animation: turn 900ms linear infinite;
}

button,
input,
select {
  font: inherit;
}

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

a {
  text-decoration: none;
}

.field-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  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: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.74), transparent 82%);
}

.shell {
  position: relative;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 24px;
  width: min(1540px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  align-content: start;
  gap: 16px;
  height: calc(100vh - 36px);
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(17, 18, 20, 0.82);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(57, 217, 138, 0.42);
  border-radius: 8px;
  color: var(--ok);
  background:
    linear-gradient(140deg, rgba(57, 217, 138, 0.14), rgba(245, 184, 75, 0.12)),
    rgba(255, 255, 255, 0.04);
  font-weight: 900;
}

.brand strong,
.brand small,
.side-panel span,
.side-panel strong,
.side-panel small,
.interval-select span {
  display: block;
}

.brand small,
.side-panel small,
.section-head p,
.hero-copy p,
.hero-readout small,
.metric small,
.service-card p,
.kv span,
.notice-item p,
.incident-item p,
.certificate-row small,
.container-row small {
  color: var(--muted);
}

.brand strong {
  line-height: 1;
}

.brand small {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 750;
}

.eyebrow,
.interval-select span,
.kv span,
.service-type,
.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 7px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.side-nav button,
.icon-button,
.filters button,
.console-link,
.launch-link,
.detail-link,
.switch span,
.interval-select select,
.search-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.side-nav button,
.filters button,
.icon-button {
  cursor: pointer;
}

.side-nav button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--soft);
  text-align: left;
  font-weight: 820;
}

.side-nav button:hover,
.side-nav button.is-active,
.filters button:hover,
.filters button.is-active,
.icon-button:hover,
.console-link:hover,
.launch-link:hover,
.detail-link:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.075);
}

.side-panel {
  display: grid;
  gap: 7px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.side-panel strong {
  font-size: 22px;
}

.side-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 54px;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  min-width: 40px;
  min-height: 40px;
  place-items: center;
  color: var(--soft);
}

.icon {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
}

.icon.refresh::before,
.icon.refresh::after {
  position: absolute;
  content: "";
  border: 2px solid currentColor;
}

.icon.refresh::before {
  inset: 2px;
  border-left-color: transparent;
  border-radius: 50%;
}

.icon.refresh::after {
  right: 0;
  top: 2px;
  width: 6px;
  height: 6px;
  border-bottom: 0;
  border-left: 0;
  transform: rotate(22deg);
}

.icon.pulse::before,
.icon.pulse::after {
  position: absolute;
  content: "";
}

.icon.pulse::before {
  inset: 7px 2px;
  border-top: 2px solid currentColor;
}

.icon.pulse::after {
  left: 2px;
  top: 4px;
  width: 14px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: skewX(-28deg);
}

.icon.search::before {
  position: absolute;
  inset: 2px 5px 5px 2px;
  content: "";
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon.search::after {
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 7px;
  height: 2px;
  content: "";
  background: currentColor;
  transform: rotate(45deg);
}

.icon.close::before,
.icon.close::after {
  position: absolute;
  left: 2px;
  top: 8px;
  width: 14px;
  height: 2px;
  content: "";
  background: currentColor;
}

.icon.close::before {
  transform: rotate(45deg);
}

.icon.close::after {
  transform: rotate(-45deg);
}

.switch {
  position: relative;
  display: block;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  display: block;
  width: 54px;
  height: 40px;
  cursor: pointer;
}

.switch span::before {
  position: absolute;
  left: 8px;
  top: 10px;
  width: 20px;
  height: 20px;
  content: "";
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.switch input:checked + span::before {
  background: var(--ok);
  transform: translateX(18px);
}

.interval-select {
  display: grid;
  gap: 8px;
}

.interval-select select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: var(--soft);
}

.console-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: auto;
  color: var(--soft);
  font-weight: 820;
}

.content {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(20, 22, 24, 0.82);
}

#signalCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.72;
}

.hero-copy,
.hero-readout {
  position: relative;
  z-index: 1;
}

.hero-copy {
  align-self: end;
  max-width: 690px;
}

.hero-copy h1 {
  max-width: 660px;
  margin: 12px 0 12px;
  font-size: 50px;
  line-height: 1.02;
}

.hero-copy p {
  max-width: 560px;
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.hero-readout {
  display: grid;
  align-content: end;
  gap: 10px;
  justify-items: start;
  padding: 18px;
  border-left: 1px solid var(--line);
}

.hero-readout strong {
  font-size: 26px;
  line-height: 1.15;
}

.state-badge,
.pill,
.state {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.state-badge::before,
.state::before,
.pill::before {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  content: "";
  border-radius: 50%;
  background: currentColor;
}

.ok {
  color: var(--ok);
}

.info {
  color: var(--info);
}

.warn,
.planned {
  color: var(--warn);
}

.bad {
  color: var(--bad);
}

.muted {
  color: var(--muted);
}

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

.metric {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
}

.metric strong {
  display: block;
  margin: 10px 0 12px;
  font-size: 28px;
  line-height: 1;
}

.meter {
  position: relative;
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.meter span {
  display: block;
  width: var(--value, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent, var(--ok)), rgba(255, 255, 255, 0.76));
}

.metric small {
  display: block;
  margin-top: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.filters button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--soft);
  font-weight: 820;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(320px, 100%);
  min-height: 40px;
  padding: 0 12px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.section-block {
  display: grid;
  gap: 16px;
  padding-top: 4px;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: end;
}

.section-head h2 {
  margin: 0;
  font-size: 26px;
}

.section-head p {
  grid-row: span 2;
  align-self: end;
  margin: 0;
}

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

.service-card {
  position: relative;
  display: grid;
  min-height: 214px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 13%, transparent), transparent 48%),
    var(--panel);
  cursor: pointer;
  outline: none;
}

.service-card:hover,
.service-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  transform: translateY(-1px);
}

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

.service-card p {
  min-height: 48px;
  margin: 0;
  line-height: 1.55;
}

.service-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

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

.launch-link,
.detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  color: var(--soft);
  font-weight: 820;
}

.resource-layout,
.notice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 12px;
}

.resource-board,
.network-board,
.container-list,
.certificate-list,
.notice-list,
.incident-list {
  display: grid;
  gap: 10px;
}

.resource-row,
.container-row,
.certificate-row,
.notice-item,
.incident-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel);
}

.resource-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 108px;
  gap: 14px;
  align-items: center;
}

.resource-row strong,
.container-row strong,
.certificate-row strong,
.notice-item strong,
.incident-item strong {
  display: block;
}

.resource-row .value {
  font-size: 22px;
  font-weight: 880;
  text-align: right;
}

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

.kv {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.kv strong {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.container-row,
.certificate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.container-row small,
.certificate-row small {
  display: block;
  margin-top: 6px;
}

.notice-item,
.incident-item {
  display: grid;
  gap: 8px;
}

.notice-item p,
.incident-item p {
  margin: 0;
  line-height: 1.65;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.38);
}

.drawer {
  position: fixed;
  z-index: 21;
  top: 0;
  right: 0;
  display: grid;
  align-content: start;
  gap: 16px;
  width: min(440px, 100%);
  height: 100vh;
  padding: 18px;
  border-left: 1px solid var(--line);
  background: rgba(16, 17, 19, 0.96);
  transform: translateX(102%);
  transition: transform 180ms ease;
}

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

.drawer-close {
  justify-self: end;
}

.drawer h3 {
  margin: 0 0 8px;
  font-size: 28px;
}

.drawer p {
  color: var(--muted);
  line-height: 1.65;
}

.drawer .kv-grid {
  margin: 16px 0;
}

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

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

  .sidebar {
    position: relative;
    top: 0;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

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

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

@media (max-width: 780px) {
  .shell {
    width: min(100% - 20px, 1540px);
    padding-top: 10px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 420px;
    padding: 22px;
  }

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

  .hero-copy h1 {
    font-size: 38px;
  }

  .hero-readout {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 16px 0 0;
  }

  .summary-grid,
  .service-grid,
  .resource-layout,
  .notice-layout {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

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

  .resource-row .value {
    text-align: left;
  }

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