:root {
  color-scheme: dark;
  --ink: #f4f1e8;
  --muted: #9d9b95;
  --paper: #0d0f0f;
  --surface: #151818;
  --surface-2: #1d2020;
  --line: #343938;
  --acid: #c6ff4a;
  --cyan: #48d9d1;
  --warning: #ffbc54;
  --danger: #ff6b62;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
}
button, input, select { font: inherit; }
button, .button-link {
  border: 1px solid var(--acid);
  border-radius: 2px;
  padding: .72rem 1rem;
  color: #111;
  background: var(--acid);
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button-link:hover { filter: brightness(1.08); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(72,217,209,.5);
  outline-offset: 2px;
}
.secondary, .quiet-button {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}
.masthead {
  height: 76px;
  padding: 0 clamp(1rem,4vw,4rem);
  display: flex;
  align-items: center;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(13,15,15,.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  margin-right: auto;
}
.brand b { display: block; letter-spacing: -.03em; font-size: 1.08rem; }
.brand small { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: .61rem; }
.brand-mark { display: grid; grid-template-columns: repeat(3, 7px); gap: 3px; transform: skew(-8deg); }
.brand-mark i { width: 7px; height: 31px; background: var(--acid); }
.brand-mark i:nth-child(2) { height: 22px; margin-top: 9px; background: var(--cyan); }
.brand-mark i:nth-child(3) { height: 14px; margin-top: 17px; }
.environment { display: flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 14px var(--acid); }
main { width: min(1280px, calc(100% - 2rem)); margin: 0 auto; }
.hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0,1.25fr) minmax(300px,.75fr);
  gap: clamp(2rem,6vw,6rem);
  align-items: center;
  padding: 4.5rem 0 3rem;
}
.eyebrow, .step { color: var(--acid); letter-spacing: .18em; font-size: .68rem; font-weight: 800; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 1.25rem; font-size: clamp(2.6rem,6vw,5.8rem); line-height: .9; letter-spacing: -.065em; }
h2 { margin-bottom: .8rem; font-size: clamp(1.9rem,3vw,3rem); line-height: .98; letter-spacing: -.045em; }
.lede { max-width: 690px; color: #bebdb7; font-size: clamp(1rem,1.5vw,1.22rem); line-height: 1.6; }
.hero-part {
  border: 1px solid var(--line);
  border-top: 3px solid var(--cyan);
  padding: 1.5rem;
  background: linear-gradient(145deg, rgba(72,217,209,.08), rgba(255,255,255,.01));
}
.hero-part span, .policy span { display:block; color: var(--cyan); font-size: .64rem; letter-spacing: .18em; }
.hero-part strong { display: block; margin: .45rem 0; font-family: "Cascadia Mono", Consolas, monospace; font-size: 1.15rem; }
.hero-part small { color: var(--muted); }
.battery { display: grid; grid-template-columns: repeat(6,1fr); gap: 7px; margin-top: 2rem; }
.battery i { height: 84px; border: 1px solid #4a5553; background: linear-gradient(to top, rgba(198,255,74,.8) 58%, transparent 58%); position: relative; }
.battery i::after { content:""; position:absolute; width:40%; height:4px; left:30%; top:-5px; background:#4a5553; }
.status-strip { display: grid; grid-template-columns: repeat(5,1fr); border: 1px solid var(--line); background: var(--surface); }
.status-strip > div { display: grid; grid-template-columns: 11px 1fr; gap: .2rem .6rem; padding: 1.1rem; border-right: 1px solid var(--line); }
.status-strip > div:last-child { border-right: 0; }
.status-strip b { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.status-strip small { grid-column: 2; color: var(--muted); font-size: .72rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #59605f; margin-top: .25rem; }
.status-dot.ok { background: var(--acid); box-shadow: 0 0 10px rgba(198,255,74,.7); }
.status-dot.warn { background: var(--warning); }
.status-dot.bad { background: var(--danger); }
.tabs { display: flex; gap: .25rem; margin-top: 2.5rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 1rem 1.2rem; white-space: nowrap; }
.tab.active { color: var(--ink); border-bottom-color: var(--acid); }
.panel { display: none; grid-template-columns: minmax(240px,.65fr) minmax(0,1.35fr); gap: clamp(2rem,5vw,5rem); padding: 3.5rem 0 5rem; }
.panel.active { display: grid; }
.panel-copy p:not(.step) { color: var(--muted); line-height: 1.6; }
.work-card { border: 1px solid var(--line); background: rgba(21,24,24,.94); padding: clamp(1.25rem,3vw,2.2rem); }
label { display: grid; gap: .5rem; color: #c9c8c1; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
input, select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: .78rem .85rem;
  color: var(--ink);
  background: #0f1111;
}
.input-row { display: grid; grid-template-columns: 1fr auto; gap: .65rem; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.dfm-grid { margin-top: 1.25rem; }
.action-row { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.suggestions { display: flex; gap: .4rem; flex-wrap: wrap; margin: .8rem 0 1.2rem; }
.suggestions button { padding: .4rem .65rem; font-size: .72rem; color: var(--muted); background: transparent; border-color: var(--line); }
.guardrail { margin: 1rem 0; color: var(--muted); font-size: .75rem; }
.output {
  min-height: 210px;
  max-height: 420px;
  overflow: auto;
  margin: 1rem 0 0;
  padding: 1rem;
  border: 1px solid #2e3433;
  color: #c9f5e7;
  background: #090b0b;
  font: .75rem/1.55 "Cascadia Mono", Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.policy { display: grid; gap: .5rem; padding: 1rem; border-left: 3px solid var(--warning); background: rgba(255,188,84,.06); }
.policy small { color: var(--muted); }
dialog { width: min(520px,calc(100% - 2rem)); border: 1px solid var(--line); color: var(--ink); background: var(--surface); padding: 0; }
dialog::backdrop { background: rgba(0,0,0,.74); backdrop-filter: blur(3px); }
dialog form { display: grid; gap: 1rem; padding: 1.5rem; }
dialog p { color: var(--muted); line-height: 1.5; }
.dialog-title { display: flex; align-items: start; justify-content: space-between; }
.dialog-title h2 { font-size: 2rem; }
.close-button { padding: .1rem .55rem; color: var(--muted); background: transparent; border-color: transparent; font-size: 1.7rem; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 2rem clamp(1rem,4vw,4rem); border-top: 1px solid var(--line); color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }

@media (max-width: 850px) {
  .environment { display: none; }
  .hero, .panel { grid-template-columns: 1fr; }
  .hero { padding-top: 3rem; }
  .status-strip { grid-template-columns: repeat(2,1fr); }
  .status-strip > div { border-bottom: 1px solid var(--line); }
}
@media (max-width: 540px) {
  .masthead { height: 68px; padding: 0 1rem; }
  .brand small { display: none; }
  main { width: min(100% - 1.2rem,1280px); }
  .input-row, .form-grid { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: 1fr; }
  .status-strip > div { border-right: 0; }
  footer { flex-direction: column; }
}
