@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap");

:root {
  --bg: #10140f;
  --bg-2: #171c15;
  --panel: #1c2319;
  --panel-2: #232b1f;
  --line: rgba(201, 162, 74, 0.28);
  --line-strong: rgba(201, 162, 74, 0.55);
  --brass: #c9a24a;
  --brass-2: #e3c57a;
  --ink: #f3eee2;
  --muted: #9b9688;
  --heat: #e25b2a;
  --cool: #6ec4c8;
  --ok: #8fbf6a;
  --warn: #e0a44a;
  --danger: #d4654a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(201, 162, 74, 0.08), transparent 50%),
    radial-gradient(900px 500px at 110% 10%, rgba(110, 196, 200, 0.06), transparent 45%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(201, 162, 74, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 162, 74, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 78%);
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 16, 11, 0.92);
  backdrop-filter: blur(12px);
}
body:not(.is-locked) .gate { display: none; }
body.is-locked { overflow: hidden; }

.gate-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 28px 26px 24px;
}
.gate-card h2 {
  font-family: Syne, sans-serif;
  font-size: 28px;
  margin: 0 0 8px;
}
.gate-lede {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 18px;
}
.gate-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.gate-field span {
  font-size: 12px;
  color: var(--muted);
}
.gate-field input {
  width: 100%;
  background: #10150e;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink);
  font: 500 16px/1.4 "IBM Plex Mono", monospace;
  padding: 10px 4px;
  outline: none;
  letter-spacing: 0.2em;
}
.gate-field input:focus { border-bottom-color: var(--brass-2); }
.gate-err {
  min-height: 18px;
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 13px;
}
.gate-card .btn { width: 100%; }

.wrap {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
  position: relative;
  z-index: 1;
}

.mast {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 8px;
}

h1 {
  font-family: Syne, "IBM Plex Sans", sans-serif;
  font-weight: 800;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 0.95;
  margin: 0;
  letter-spacing: -0.03em;
}
h1 span { color: var(--brass-2); }

.lede {
  max-width: 46ch;
  color: var(--muted);
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.55;
}

.stamp {
  border: 1px solid var(--line-strong);
  padding: 10px 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--brass-2);
  text-align: right;
  line-height: 1.6;
  transform: rotate(-2deg);
}

.layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 12px 12px 0;
  flex-wrap: wrap;
}

.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 500 12px/1 "IBM Plex Sans", sans-serif;
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.tab.active {
  color: var(--bg);
  background: var(--brass);
}

form { padding: 8px 14px 16px; }
.pane { display: none; }
.pane.active { display: grid; gap: 10px; }

.field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: center;
}
.field label {
  font-size: 12px;
  color: var(--muted);
}
.unit {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--brass);
}
.field input, .field select {
  grid-column: 1 / -1;
  width: 100%;
  background: #10150e;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink);
  font: 500 14px/1.4 "IBM Plex Mono", monospace;
  padding: 8px 4px;
  outline: none;
}
.field input:focus, .field select:focus {
  border-bottom-color: var(--brass-2);
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 16px;
  flex-wrap: wrap;
}
button.btn {
  border: 0;
  cursor: pointer;
  font: 700 13px/1 Syne, sans-serif;
  letter-spacing: 0.04em;
  padding: 11px 14px;
  border-radius: 999px;
}
.btn-primary { background: var(--brass); color: #1a160c; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-print { background: #2a3326; color: var(--brass-2); }

.stage {
  padding: 8px 8px 16px;
  min-height: 520px;
}
.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 10px 4px;
}
.chip {
  background: #141a12;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
.chip b {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 18px;
  color: var(--brass-2);
}
.chip span {
  color: var(--muted);
  font-size: 11px;
}

svg.tank {
  width: 100%;
  height: auto;
  display: block;
}

.report {
  margin-top: 18px;
  overflow: hidden;
}
.report h2 {
  margin: 0;
  padding: 16px 18px 0;
  font-family: Syne, sans-serif;
  font-size: 22px;
}
.report-meta {
  padding: 4px 18px 10px;
  color: var(--muted);
  font-size: 12px;
}

table.sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.sheet th {
  text-align: left;
  font-weight: 600;
  color: var(--brass);
  padding: 10px 18px;
  background: #151b13;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
table.sheet td {
  padding: 8px 18px;
  border-top: 1px solid rgba(201, 162, 74, 0.12);
  vertical-align: top;
}
table.sheet td:first-child {
  color: var(--muted);
  width: 44px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}
table.sheet td.val {
  font-family: "IBM Plex Mono", monospace;
  text-align: right;
  white-space: nowrap;
  color: var(--ink);
}
table.sheet td.sym {
  color: var(--brass-2);
  font-family: "IBM Plex Mono", monospace;
  width: 70px;
}

.alerts { padding: 0 18px 16px; display: grid; gap: 8px; }
.note, .warn {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.note { background: rgba(110, 196, 200, 0.08); color: #cfe9ea; }
.warn { background: rgba(224, 164, 74, 0.12); color: #f0d2a0; }

.methods {
  margin-top: 18px;
  padding: 16px 18px 20px;
}
.methods h2 {
  font-family: Syne, sans-serif;
  font-size: 20px;
  margin: 0 0 10px;
}
.methods p, .methods li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.methods code {
  font-family: "IBM Plex Mono", monospace;
  color: var(--brass-2);
  font-size: 12px;
}

footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

@media (max-width: 980px) {
  .layout, .chips, .mast { grid-template-columns: 1fr; }
  .stamp { display: none; }
}

@media print {
  body { background: white; color: #111; }
  body::before, .actions, .tabs, .mast, footer, .gate { display: none !important; }
  .wrap { width: 100%; }
  .layout { display: block; }
  .panel { box-shadow: none; border-color: #ccc; background: white; }
  .chip b, h1, table.sheet td.val, table.sheet td.sym { color: #111; }
}
