:root {
  --bg: #07100d;
  --panel: #0b1713;
  --panel-2: #0e1d18;
  --line: #25372f;
  --ink: #e8f2ec;
  --muted: #82968c;
  --green: #5ef2a4;
  --amber: #ffc857;
  --red: #ff5f56;
  --blue: #73b7ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 78% -10%, #173128 0, transparent 32rem), var(--bg); }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .035; z-index: 9; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E"); }
.masthead { height: 108px; padding: 24px clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.eyebrow, .status-copy p, .node-type, footer, .status-meta span { margin: 0; color: var(--muted); font: 600 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em; }
h1 { margin: 3px 0 0; font: 800 32px/.9 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.08em; }
h1 span { color: var(--green); }
.live-block { display: flex; align-items: center; gap: 12px; text-align: right; }
.live-block strong, .live-block small { display: block; font: 700 11px/1.5 ui-monospace, monospace; letter-spacing: .09em; }
.live-block small { color: var(--muted); }
.pulse { width: 9px; height: 9px; background: var(--amber); border-radius: 50%; box-shadow: 0 0 0 5px #ffc85718; }
.live-block.connected .pulse { background: var(--green); box-shadow: 0 0 0 5px #5ef2a418; animation: pulse 1.8s infinite; }
main { width: min(1500px, 100%); margin: 0 auto; padding: clamp(18px, 3vw, 42px); }
.status-strip { min-height: 138px; display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 24px; padding: 24px 30px; border: 1px solid var(--line); background: linear-gradient(110deg, #10251d, #0a1512); }
.status-mark { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid var(--muted); color: var(--muted); font: 800 19px ui-monospace, monospace; transform: rotate(45deg); }
.status-mark span { transform: rotate(-45deg); }
.status-copy h2 { margin: 3px 0 7px; font-size: clamp(21px, 2.5vw, 34px); letter-spacing: -.04em; }
.status-copy > span { color: var(--muted); font-size: 13px; }
.status-meta { min-width: 185px; display: grid; grid-template-columns: auto auto; gap: 7px 16px; font: 700 11px ui-monospace, monospace; }
.status-strip[data-status="up"] .status-mark { color: var(--green); border-color: var(--green); box-shadow: 0 0 24px #5ef2a425; }
.status-strip[data-status="degraded"] .status-mark { color: var(--amber); border-color: var(--amber); }
.status-strip[data-status="down"] .status-mark { color: var(--red); border-color: var(--red); box-shadow: 0 0 24px #ff5f5625; }
.panel { margin-top: 18px; border: 1px solid var(--line); background: #08120fbc; }
.section-head { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.section-head div { display: flex; align-items: center; gap: 12px; }
.section-head span { color: var(--green); font: 700 10px ui-monospace, monospace; }
.section-head h3 { margin: 0; font: 700 12px ui-monospace, monospace; letter-spacing: .13em; }
.section-head p { margin: 0; color: var(--muted); font-size: 11px; }
.topology { min-height: 620px; position: relative; display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(5, 92px); gap: 22px 16px; align-content: center; padding: 38px clamp(20px, 4vw, 60px); overflow: hidden; }
#links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.flow-line { fill: none; stroke: #34483e; stroke-width: 2; vector-effect: non-scaling-stroke; }
.flow-line.up { stroke: var(--green); stroke-dasharray: 3 10; animation: flow 1.2s linear infinite; filter: drop-shadow(0 0 4px #5ef2a455); }
.flow-line.degraded { stroke: var(--amber); stroke-dasharray: 3 10; animation: flow 2s linear infinite; }
.flow-line.down { stroke: var(--red); stroke-dasharray: 2 7; opacity: .75; }
.node { z-index: 1; min-width: 0; padding: 13px 15px; border: 1px solid #2a3f35; background: #0d1b16f2; box-shadow: 0 12px 35px #0003; }
.node strong, .node small, .node b { display: block; }
.node strong { margin-top: 6px; font-size: 16px; letter-spacing: -.02em; }
.node small { margin-top: 2px; color: var(--muted); font: 11px ui-monospace, monospace; }
.node b { position: absolute; right: 10px; bottom: 9px; color: var(--muted); font: 700 11px ui-monospace, monospace; }
.node[data-status="up"] { border-color: #2d674c; }
.node[data-status="up"] b { color: var(--green); }
.node[data-status="degraded"] { border-color: #765f2c; }
.node[data-status="degraded"] b { color: var(--amber); }
.node[data-status="down"] { border-color: #7d3733; }
.node[data-status="down"] b { color: var(--red); }
.observer { grid-column: 1 / span 3; grid-row: 1; border-left: 3px solid var(--blue); }
.control { grid-column: 1 / span 3; grid-row: 3; position: relative; }
.router { grid-column: 5 / span 4; grid-row: 1; position: relative; border-left: 3px solid var(--green); }
.gateway { grid-column: 5 / span 4; grid-row: 2; position: relative; }
.appliance { grid-column: 5 / span 4; grid-row: 3; border-left: 3px solid var(--amber); }
.fabric { grid-column: 5 / span 4; grid-row: 4; }
.witness { grid-row: 5; position: relative; }
#node-witness_150 { grid-column: 1 / span 3; }
#node-witness_24 { grid-column: 5 / span 4; }
#node-witness_63 { grid-column: 10 / span 3; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.metric-card { min-height: 190px; padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric-card:nth-child(3n) { border-right: 0; }
.metric-title { display: flex; justify-content: space-between; align-items: start; }
.metric-title strong { display: block; font-size: 14px; }
.metric-title small { color: var(--muted); font: 10px ui-monospace, monospace; }
.badge { padding: 4px 7px; border: 1px solid currentColor; color: var(--muted); font: 700 9px ui-monospace, monospace; letter-spacing: .08em; }
.badge.up { color: var(--green); }.badge.degraded { color: var(--amber); }.badge.down { color: var(--red); }
.numbers { display: flex; gap: 25px; margin: 18px 0 12px; }
.numbers span { display: block; color: var(--muted); font: 9px ui-monospace, monospace; letter-spacing: .12em; }
.numbers b { display: block; margin-top: 3px; font: 700 19px ui-monospace, monospace; }
.spark { width: 100%; height: 48px; overflow: visible; }
.spark path { fill: none; stroke: var(--green); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.metric-card[data-status="degraded"] .spark path { stroke: var(--amber); }
.metric-card[data-status="down"] .spark path { stroke: var(--red); }
.spark .baseline { stroke: #263830; stroke-width: 1; stroke-dasharray: 2 4; }
footer { display: flex; justify-content: space-between; padding: 19px 2px 5px; }
@keyframes flow { to { stroke-dashoffset: -26; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px #5ef2a400; } }

@media (max-width: 760px) {
  .masthead { height: 88px; padding: 18px 20px; }
  main { padding: 14px; }
  .status-strip { grid-template-columns: 48px 1fr; padding: 19px; gap: 16px; }
  .status-mark { width: 42px; height: 42px; }
  .status-meta { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; }
  .section-head p { display: none; }
  .topology { min-height: auto; display: flex; flex-direction: column; padding: 22px; gap: 12px; }
  #links { display: none; }
  .node { width: 100%; position: relative; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card, .metric-card:nth-child(3n) { border-right: 0; }
  footer { gap: 15px; flex-direction: column; }
}
