:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --ink: #15171a;
  --muted: #5c6570;
  --line: #d9dfdf;
  --teal: #0f766e;
  --teal-strong: #0b4f4a;
  --amber: #b7791f;
  --rose: #a43b4f;
  --charcoal: #20252b;
  --shadow: 0 14px 40px rgba(25, 31, 36, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, .05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(32, 37, 43, .05) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
}

a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(21, 23, 26, .10);
  background: rgba(246, 247, 244, .92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--charcoal);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}
.brand strong, .brand small { display: block; white-space: nowrap; }
.brand small { color: var(--muted); margin-top: 2px; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .70);
}
.nav a {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 650;
}
.nav a:hover { background: #fff; color: var(--ink); }

.live-pill, .status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, .25);
  background: rgba(15, 118, 110, .10);
  color: var(--teal-strong);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 24px;
  align-items: stretch;
}

.summary, .section, .topology {
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.summary { padding: clamp(24px, 4vw, 44px); }
.eyebrow {
  margin: 0 0 10px;
  color: var(--teal-strong);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
}
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { max-width: 760px; font-size: 42px; line-height: 1.06; }
h2 { font-size: 24px; }
.lead {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.button:hover { border-color: var(--charcoal); }
.button.primary { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.icon-button { min-width: 112px; }

.topology {
  position: relative;
  min-height: 360px;
  padding: 24px;
  overflow: hidden;
}
.rail {
  position: absolute;
  inset: 64px 70px auto 70px;
  height: 170px;
  border: 1px solid rgba(15, 118, 110, .35);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}
.node {
  position: absolute;
  display: grid;
  place-items: center;
  gap: 4px;
  width: 92px;
  height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(25,31,36,.09);
}
.node:nth-of-type(1) { left: 26px; top: 36px; }
.node:nth-of-type(2) { right: 26px; top: 36px; }
.node:nth-of-type(3) { left: 26px; top: 176px; }
.node:nth-of-type(4) { right: 26px; top: 176px; }
.node.active { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,118,110,.16), 0 10px 24px rgba(25,31,36,.09); }
.node-key { color: var(--teal-strong); font-size: 18px; }
.node-detail {
  position: absolute;
  left: 134px;
  right: 134px;
  bottom: 24px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}
.node-detail p { margin: 8px 0 0; color: var(--muted); line-height: 1.45; }

.section {
  margin-top: 24px;
  padding: 24px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
time { color: var(--muted); font-weight: 750; }

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.service-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 12px;
  row-gap: 4px;
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.service-card:hover { border-color: var(--teal); }
.service-code {
  grid-row: 1 / 4;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #eef8f6;
  color: var(--teal-strong);
  font-weight: 850;
}
.service-card strong, .service-card small { overflow-wrap: anywhere; }
.service-card small { color: var(--muted); }
.service-card .status { justify-self: start; margin-top: 6px; }

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9faf9;
}
.tab {
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.tab.active { background: var(--charcoal); color: #fff; }
.panel { border-top: 1px solid var(--line); padding-top: 18px; }
.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.metric {
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.metric span { display: block; color: var(--muted); font-size: 13px; font-weight: 750; }
.metric strong { display: block; margin-top: 8px; overflow-wrap: anywhere; }
.route-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.route-list li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.route-list span { color: var(--amber); font-weight: 850; }
.route-list a { color: var(--teal-strong); font-weight: 750; overflow-wrap: anywhere; }
.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; }
  .nav { grid-column: 1 / -1; justify-content: space-between; }
  .workspace { grid-template-columns: 1fr; }
  .service-grid, .metric-row { grid-template-columns: 1fr; }
  h1 { font-size: 34px; }
}

@media (max-width: 560px) {
  main, .footer { width: min(100% - 24px, 1180px); }
  .topbar { padding: 12px; }
  .brand small { display: none; }
  .nav { overflow-x: auto; }
  .topology { min-height: 430px; }
  .rail { display: none; }
  .node { position: relative; left: auto !important; right: auto !important; top: auto !important; width: 100%; height: 62px; margin-bottom: 10px; grid-template-columns: 56px 1fr; justify-items: start; padding: 0 12px; }
  .node-detail { position: relative; left: auto; right: auto; bottom: auto; margin-top: 14px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .tabs { width: 100%; }
  .tab { flex: 1; }
  h1 { font-size: 30px; }
}
