*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0c1018;
  color: #a8b0c0;
  line-height: 1.65;
  min-height: 100vh;
  padding-top: 72px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

:root {
  --bg: #0c1018;
  --panel: #141a24;
  --ink: #e8ecf2;
  --muted: #7a8494;
  --live: #3dd68c;
  --line: #1e2634;
  --mono: ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace;
}

.breakers {
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 100;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: calc(100vw - 140px);
}
.breakers a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 48px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px 4px 2px 2px;
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  transition: all 0.12s;
}
.breakers a::before {
  content: '';
  width: 18px;
  height: 8px;
  background: #2a3344;
  border-radius: 2px;
  margin-bottom: 4px;
}
.breakers a:hover { border-color: var(--live); color: var(--ink); }
.breakers a.on {
  border-color: var(--live);
  color: var(--live);
  box-shadow: 0 0 12px rgba(61,214,140,0.2);
}
.breakers a.on::before { background: var(--live); }

.brand {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 90;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand strong {
  display: block;
  font-size: 0.85rem;
  color: var(--ink);
  letter-spacing: 0.04em;
  margin-bottom: 1px;
}

.grid-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.grid-page .k {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--live);
  margin-bottom: 10px;
}
.grid-page h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 14px;
}
.grid-page .lead {
  color: var(--muted);
  font-size: 1.02rem;
  margin-bottom: 28px;
  max-width: 520px;
}
.meters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.meter {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px 14px;
  text-align: center;
}
.meter .val {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--live);
  line-height: 1;
  margin-bottom: 6px;
}
.meter .lbl {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.grid-fig {
  border: 1px solid var(--line);
  overflow: hidden;
}
.grid-fig img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: saturate(0.85) brightness(0.9);
}

.load-page {
  max-width: 520px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.load-page .k {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--live);
  margin-bottom: 8px;
}
.load-page h1 {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 28px;
}
.flow {
  position: relative;
  padding-left: 28px;
}
.flow::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
}
.flow .node {
  position: relative;
  margin-bottom: 24px;
}
.flow .node::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--live);
}
.flow .node h2 {
  font-size: 1.05rem;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 4px;
}
.flow .node p {
  font-size: 0.92rem;
  color: var(--muted);
}

.panel-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.panel-page .k {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--live);
  margin-bottom: 8px;
}
.panel-page h1 {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 24px;
}
.spec {
  background: var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 80px 1fr;
}
.spec .code {
  background: #0e1420;
  padding: 16px 10px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--live);
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
}
.spec .body { padding: 14px 16px; }
.spec .body h2 {
  font-size: 0.98rem;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 3px;
}
.spec .body p {
  font-size: 0.88rem;
  color: var(--muted);
}

.bill-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.bill-page .k {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--live);
  margin-bottom: 8px;
}
.bill-page h1 {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 24px;
}
.rate {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.rate:first-of-type { border-top: 1px solid var(--line); }
.rate h2 {
  font-size: 1rem;
  color: var(--ink);
  font-weight: 600;
}
.rate p {
  font-size: 0.85rem;
  color: var(--muted);
  grid-column: 1;
}
.rate .amt {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--live);
  grid-row: 1 / 3;
  align-self: center;
}
.bill-note {
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--muted);
}

.wire-wrap {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 48px;
}
.term {
  width: 100%;
  max-width: 440px;
  background: #0a0e14;
  border: 1px solid var(--line);
  font-family: var(--mono);
}
.term .bar {
  background: #121820;
  padding: 10px 14px;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
}
.term .bar span:first-child { color: var(--live); }
.term .body { padding: 24px 18px; }
.term h1 {
  font-size: 1.1rem;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 12px;
  font-family: inherit;
}
.term .meta {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 18px;
}
.term .meta a { color: var(--live); }
.term label {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.term input,
.term textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.term input:focus,
.term textarea:focus {
  outline: none;
  border-color: var(--live);
}
.term textarea { min-height: 80px; resize: vertical; }
.term button {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--live);
  color: var(--live);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.term button:hover {
  background: var(--live);
  color: #0c1018;
}

.ft {
  padding: 16px 24px;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  text-align: center;
}
.ft strong { color: var(--ink); }

@media (max-width: 600px) {
  .meters { grid-template-columns: 1fr; }
  .breakers a { width: 44px; height: 42px; font-size: 0.48rem; }
}
