/* ==========================================================================
 * Eight Gates Grading — "KABOOM!" comic-book pop theme.
 *
 * Shonen Jump cover energy: Ben-Day dots, bold ink outlines, saturated
 * brand colors, action bursts, springy tactile buttons. LIGHT and COLOURFUL.
 * No dark gradients, no glassmorphism, no neon. Hard offset shadows, ink.
 * ========================================================================== */
/* Logo palette: black / chrome silver / emerald green / gold. Dark comic KABOOM. */
:root {
  --paper: #0c0c10;
  --paper-2: #121218;
  --panel: #16161d;
  --ink: #f0ede6;
  --ink-soft: #a9a9b6;
  --sh: #000000;
  --blue: #1b1b23;
  --blue-deep: #0e0e13;
  --blue-soft: #1e1e28;
  --red: #00e065;
  --red-deep: #00913f;
  --red-soft: #0a2e1a;
  --yellow: #d8dbe2;
  --yellow-soft: #26262e;
  --green: #00c864;
  --green-deep: #00913f;
  --amber: #f59e0b;
  --platinum: #e9e7e2;
  --purple: #7c5cff;
  --gold: var(--yellow);
  --blue-soft: #dbe9ff;
  --yellow-soft: var(--yellow-soft);
  --radius: 14px;
  --font-display: "Bangers", "Arial Black", cursive;
  --font-punch: "Bangers", "Arial Black", cursive;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --bg: var(--paper);
  --ink2: var(--ink);
  --muted: var(--ink-soft);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(0, 224, 101, 0.10) 2px, transparent 2.6px);
  background-size: 16px 16px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.04em; }
h1 { }
h2 { font-size: 2em; margin: 1.4em 0 0.5em; }
h2:first-child { margin-top: 0; }
h3 { font-size: 1.45em; }

/* ---------- ben-day dot utilities ---------- */
.halftone {
  background-image: radial-gradient(rgba(0, 224, 101, 0.20) 2.2px, transparent 2.8px);
  background-size: 13px 13px;
}
.halftone-light {
  background-image: radial-gradient(rgba(255, 255, 255, 0.35) 2px, transparent 2.6px);
  background-size: 13px 13px;
}
.deco-rule {
  border: 0;
  border-top: 4px solid var(--ink);
  margin: 1.6em 0;
  position: relative;
}
.deco-rule::after {
  content: "";
  position: absolute;
  left: 0; top: -4px;
  width: 120px; height: 4px;
  background: var(--red);
}
/* jagged comic action burst — POW! */
.burst {
  clip-path: polygon(50% 0%, 58% 10%, 70% 4%, 70% 16%, 84% 12%, 80% 25%, 94% 25%, 86% 36%, 99% 40%, 88% 48%, 98% 58%, 85% 60%, 90% 73%, 77% 71%, 78% 85%, 66% 79%, 62% 93%, 53% 81%, 44% 92%, 40% 79%, 27% 86%, 28% 72%, 14% 76%, 19% 63%, 6% 62%, 15% 52%, 4% 45%, 17% 40%, 11% 27%, 24% 29%, 24% 15%, 37% 20%, 41% 7%, 50% 15%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ---------- masthead ---------- */
#topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: var(--blue);
  color: #fff;
  border-bottom: 4px solid var(--ink);
  box-shadow: 0 4px 0 rgba(23, 26, 38, 0.25);
}

.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 40px; }
.eyebrow {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 2px 2px 0 var(--sh);
}
.eyebrow .egg-red { color: var(--red); }
.tagline { font-size: 12px; color: var(--yellow-soft); font-weight: 700; letter-spacing: 1px; }

.top-actions { display: flex; align-items: center; gap: 10px; }
.badge {
  font-size: 11px;
  color: #0c0c10;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
  font-family: var(--font-punch);
  letter-spacing: 2px;
  box-shadow: 3px 3px 0 var(--sh);
}
.who { font-size: 13px; color: #fff; font-weight: 700; }
.who em { font-style: normal; color: var(--yellow); }

/* ---------- shell layout ---------- */
#layout { display: flex; align-items: flex-start; min-height: calc(100vh - 65px); }
#shell { flex: 1; min-width: 0; position: relative; z-index: 2; }

#sideNav {
  width: 248px;
  flex: 0 0 248px;
  position: sticky;
  top: 65px;
  max-height: calc(100vh - 65px);
  overflow-y: auto;
  padding: 20px 14px 36px;
  background: var(--blue-soft);
  border-right: 4px solid var(--ink);
}
.nav-label {
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink);
  font-family: var(--font-punch);
  margin: 20px 10px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-label::after { content: ""; flex: 1; height: 3px; background: var(--ink); border-radius: 2px; }
.nav-label:first-child { margin-top: 0; }

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 3px solid var(--ink);
  color: var(--ink);
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14.5px;
  font-family: var(--font-body);
  font-weight: 800;
  margin-bottom: 6px;
  box-shadow: 3px 3px 0 var(--sh);
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s;
}
.nav-item:hover { transform: translate(-1px, -1px) rotate(-0.5deg); box-shadow: 4px 4px 0 var(--sh); background: var(--yellow-soft); }
.nav-item.active {
  background: var(--yellow);
  color: #0c0c10;
  box-shadow: 3px 3px 0 var(--sh);
}

main { flex: 1; min-width: 0; padding: 24px 28px 80px; max-width: 1200px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0 0 4px; font-size: 34px; }
.page-head p { margin: 0; }

section.page { display: none; }
section.page.active { display: block; animation: pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pop-in { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- cards, grids ---------- */
.card {
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: 7px 7px 0 var(--sh);
  position: relative;
}
.card h2, .card h3 { margin-top: 0; }
.card.error { border-color: var(--red); box-shadow: 7px 7px 0 var(--red); }

.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 800;
  margin-bottom: 8px;
  font-family: var(--font-punch);
}
.kicker::before {
  content: "POW";
  font-family: var(--font-punch);
  font-size: 11px;
  letter-spacing: 1px;
  background: var(--red);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 2px 8px;
  transform: rotate(-4deg);
  box-shadow: 2px 2px 0 var(--sh);
}
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.gold { color: var(--amber); }
.green { color: var(--green-deep); }
.red { color: var(--red); }
.amber { color: var(--amber); }

/* ---------- metrics ---------- */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.metric {
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 5px 5px 0 var(--sh);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.metric:hover { transform: translateY(-3px) rotate(-0.5deg); }
.metric .num { font-size: 30px; color: var(--red); font-family: var(--font-punch); letter-spacing: 1px; }
.metric .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }

/* ---------- tables ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 2px solid var(--ink); }
.tbl th {
  color: #fff;
  background: var(--blue);
  font-size: 14px;
  letter-spacing: 2px;
  font-family: var(--font-punch);
  font-weight: 400;
}
.tbl tr:hover td { background: var(--blue-soft); }

/* ---------- forms & springy comic buttons ---------- */
label.f { display: block; margin: 10px 0 4px; font-size: 13px; color: var(--muted); font-weight: 800; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
select, textarea {
  width: 100%;
  background: var(--panel);
  border: 3px solid var(--ink);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: var(--font-body);
  font-weight: 600;
  box-shadow: inset 3px 3px 0 rgba(23, 26, 38, 0.08);
}
/* (focus glow defined with the lab form rules below) */
input[type="checkbox"] { width: auto; accent-color: var(--red); }
textarea { min-height: 80px; resize: vertical; }

/* Comic buttons: springy press-and-pop. */
.btn {
  display: inline-block;
  font-family: var(--font-punch);
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  background: var(--blue);
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 10px 24px;
  cursor: pointer;
  margin: 6px 6px 6px 0;
  box-shadow: 0 5px 0 var(--sh);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s;
}
.btn:hover { transform: translateY(-2px) rotate(-1deg) scale(1.03); box-shadow: 0 7px 0 var(--sh); filter: brightness(1.05); }
.btn:active { transform: translateY(4px) scale(0.98); box-shadow: 0 1px 0 var(--sh); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 0 5px 0 var(--sh); }
.btn.primary {
  background: var(--red);
  color: #fff;
}
.btn.ghost {
  background: var(--panel);
  color: var(--ink);
  text-shadow: none;
}
.btn.warn {
  background: var(--yellow);
  color: #0c0c10;
  color: var(--ink);
  text-shadow: none;
}
.btn.danger {
  background: var(--panel);
  color: var(--red);
  text-shadow: none;
  box-shadow: 0 5px 0 var(--red-deep);
}
.btn.danger:active { box-shadow: 0 1px 0 var(--red-deep); }
.btn.small { padding: 6px 14px; font-size: 13px; }

/* ---------- pills & notices ---------- */
.pill {
  display: inline-block;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  color: var(--ink);
  background: var(--panel);
  white-space: nowrap;
  font-family: var(--font-punch);
  font-size: 12px;
  box-shadow: 3px 3px 0 var(--sh);
}
.pill.ok { color: #fff; background: var(--green); }
.pill.bad { color: #fff; background: var(--red); }
.pill.warn { color: #0c0c10; background: var(--yellow); }
.pill.info { color: #fff; background: var(--blue); }
.pill.gold { color: #0c0c10; background: var(--yellow); }

.notice {
  border: 3px solid var(--ink);
  border-left: 10px solid var(--red);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 12px 0;
  background: var(--panel);
  font-size: 14px;
  box-shadow: 5px 5px 0 var(--sh);
  font-weight: 600;
}
.notice.green { border-left-color: var(--green); }
.notice.red { border-left-color: var(--red); }
.notice.amber { border-left-color: var(--amber); }

/* ---------- the seal: EGG comic badge ---------- */
.seal {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 132px;
  height: 132px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  color: #fff;
  font-family: var(--font-display);
  text-align: center;
  transform: rotate(-8deg);
  background: var(--red);
  box-shadow: 5px 5px 0 var(--sh);
  user-select: none;
  flex: 0 0 auto;
  text-shadow: 2px 2px 0 var(--sh);
}
.seal .seal-top { font-size: 12px; letter-spacing: 3px; font-family: var(--font-punch); }
.seal .seal-mid { font-size: 30px; line-height: 1; letter-spacing: 1px; }
.seal .seal-bot { font-size: 11px; letter-spacing: 2px; font-family: var(--font-punch); opacity: 0.9; }
.seal-mini {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #0c0c10;
  background: var(--yellow);
  border: 3px solid var(--yellow);
  border-radius: 8px;
  padding: 4px 10px;
  transform: rotate(-2deg);
  white-space: nowrap;
  background: var(--yellow);
  font-family: var(--font-punch);
  box-shadow: 3px 3px 0 var(--sh);
}
/* comic divider: a bold rule with a red POW star */
.gate-rule { display: flex; align-items: center; gap: 12px; margin: 2.2em 0 1.4em; }
.gate-rule::before, .gate-rule::after { content: ""; flex: 1; height: 4px; background: var(--ink); border-radius: 2px; }
.gate-rule i {
  font-style: normal;
  font-family: var(--font-punch);
  font-size: 14px;
  color: #fff;
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  box-shadow: 3px 3px 0 var(--sh);
}

/* ---------- hero ---------- */
.hero { padding: 48px 0 26px; position: relative; }
.hero-seal { position: absolute; right: 4%; top: 34px; opacity: 0.95; animation: float-burst 5s ease-in-out infinite; }
@keyframes float-burst { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-10px) rotate(-4deg); } }
@media (max-width: 900px) { .hero-seal { display: none; } }
.hero h1 { font-size: 60px; line-height: 1; margin: 12px 0 16px; text-shadow: 3px 3px 0 var(--yellow); }
.hero h1 .accent { color: var(--red); }
.hero p.lead, .hero p.lede { font-size: 18.5px; color: var(--ink-soft); max-width: 620px; font-weight: 600; }
.trustbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0;
}
.trust {
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 5px 5px 0 var(--sh);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.trust:hover { transform: translateY(-3px) rotate(0.5deg); }
.trust strong { display: block; color: var(--red); font-family: var(--font-punch); font-size: 14px; letter-spacing: 2px; }

/* ---------- grading lab ---------- */
.lab-cols { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.stepper { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 20px; }
.step {
  padding: 5px 12px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  color: var(--ink);
  background: var(--panel);
  font-family: var(--font-punch);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 var(--sh);
}
.step.done { background: var(--green); color: #fff; }
.scoreline { display: grid; grid-template-columns: 150px 1fr 110px; gap: 10px; align-items: center; margin: 8px 0; font-weight: 700; }
.scoreline .bar { height: 12px; background: var(--blue-soft); border: 3px solid var(--ink); border-radius: 8px; overflow: hidden; }
.scoreline .bar i { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--red) 0 10px, var(--red-deep) 10px 20px); }
.grade-hero {
  background: var(--blue);
  color: #fff;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: center;
  box-shadow: 7px 7px 0 var(--sh);
  position: relative;
  overflow: hidden;
}
.grade-hero::before {
  content: "";
  position: absolute;
  inset: -60%;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 210, 63, 0.22) 0 8deg, transparent 8deg 16deg);
  animation: spin-rays 40s linear infinite;
  pointer-events: none;
}
@keyframes spin-rays { to { transform: rotate(360deg); } }
.grade-hero > * { position: relative; }
.grade-hero .biggrade { font-family: var(--font-punch); font-size: 76px; color: #fff; line-height: 1; text-shadow: 4px 4px 0 var(--sh); }
.grade-hero .tierline { color: var(--yellow); letter-spacing: 4px; font-size: 14px; text-transform: uppercase; margin-top: 6px; font-family: var(--font-punch); text-shadow: 2px 2px 0 var(--sh); }
.biggrade { font-family: var(--font-punch); font-size: 58px; color: var(--red); line-height: 1; text-shadow: 3px 3px 0 var(--yellow-soft); }
.price { font-family: var(--font-punch); font-size: 40px; color: var(--ink); letter-spacing: 1px; }
.price span { font-family: var(--font-body); font-size: 15px; font-weight: 700; color: var(--muted); }
.metric .num, .metric-v { font-family: var(--font-punch); }
.vault-grade { font-family: var(--font-punch); }
.evrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0; }
.blockers { list-style: none; padding: 0; margin: 8px 0; }
.blockers li { color: var(--red); font-size: 13px; padding: 3px 0; font-weight: 800; }
.blockers li::before { content: "\2716  "; }

/* ---------- report cards ---------- */
.report { display: grid; grid-template-columns: 230px 1fr; gap: 20px; }
.cardmock {
  aspect-ratio: 3 / 4;
  background: var(--blue-soft);
  border: 3px dashed var(--ink);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
}
.cardmock img { width: 100%; height: 100%; object-fit: cover; }
.catgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0; }
.catgrid .c {
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  box-shadow: 4px 4px 0 var(--sh);
}
.catgrid .c b { display: block; font-size: 20px; color: var(--red); font-family: var(--font-punch); }
.catgrid .c span { font-size: 11px; color: var(--muted); font-weight: 700; }
.report-foot { font-size: 12px; color: var(--muted); border-top: 3px solid var(--ink); padding-top: 10px; font-weight: 600; }

/* ---------- verify / QR ---------- */
.qrbox {
  width: 132px;
  height: 132px;
  border: 4px solid var(--ink);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  overflow: hidden;
  font-size: 11px;
  color: #333;
  text-align: center;
  padding: 6px;
  box-shadow: 5px 5px 0 var(--sh);
}
.qrbox img, .qrbox canvas { max-width: 100%; max-height: 100%; }
.verify-form { display: flex; gap: 10px; max-width: 520px; }
.verify-form input { flex: 1; }

/* ---------- lock screen / misc ---------- */
.lock { text-align: center; padding: 60px 20px; }
.lock-badge { font-size: 44px; }
details.policy { background: var(--panel); border: 3px solid var(--ink); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; box-shadow: 5px 5px 0 var(--sh); }
details.policy summary { cursor: pointer; font-weight: 800; font-family: var(--font-punch); font-size: 14px; letter-spacing: 2px; }
.status-track { display: flex; gap: 4px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.status-track .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--platinum); border: 3px solid var(--ink); }
.status-track .dot.on { background: var(--green); }
.status-track .lbl { font-size: 11px; color: var(--muted); margin-right: 6px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.footer-note { margin-top: 40px; padding-top: 16px; border-top: 3px solid var(--ink); color: var(--muted); font-size: 12.5px; font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .lab-cols { grid-template-columns: 1fr; }
  .grid.c4, .metrics, .trustbar { grid-template-columns: repeat(2, 1fr); }
  .grid.c3 { grid-template-columns: repeat(2, 1fr); }
  .report { grid-template-columns: 1fr; }
  .cardmock { max-width: 230px; }
}
@media (max-width: 760px) {
  #layout { display: block; }
  #sideNav {
    width: 100%; flex: none; position: static;
    max-height: none; border-right: 0; border-bottom: 4px solid var(--ink);
    display: flex; flex-wrap: wrap; gap: 6px; padding: 10px;
  }
  .nav-label { width: 100%; margin: 8px 4px 2px; }
  .nav-item { width: auto; margin-bottom: 0; }
  main { padding: 16px 14px 60px; }
  .grid.c2, .grid.c3, .grid.c4, .metrics, .trustbar { grid-template-columns: 1fr; }
  .hero h1 { font-size: 40px; }
  .catgrid { grid-template-columns: repeat(3, 1fr); }
  .scoreline { grid-template-columns: 110px 1fr 90px; }
  #topbar { flex-wrap: wrap; }
}

/* ============ supplement: classes used by page/lab/report modules ============ */
.sub { color: var(--muted); margin: 0 0 18px; font-weight: 600; }
.lede { font-size: 17px; color: var(--ink); max-width: 60ch; font-weight: 600; }
.fineprint { font-size: 12px; color: var(--muted); font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.total { font-weight: 800; }
.primary { color: var(--green-deep); }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cardrow { display: flex; gap: 16px; flex-wrap: wrap; }

.form { display: grid; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.form-row { display: grid; gap: 6px; }
.form-row label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }
.field { display: grid; gap: 6px; }
.field label, label.field { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  background: var(--panel); border: 3px solid var(--ink); color: var(--ink);
  border-radius: 10px; padding: 10px 12px; font-size: 15px; width: 100%; box-sizing: border-box;
  box-shadow: inset 3px 3px 0 rgba(23, 26, 38, 0.08);
  font-family: var(--font-body); font-weight: 600;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: inset 3px 3px 0 rgba(0,0,0,.25), 0 0 0 4px rgba(0,224,101,.30), 0 0 14px rgba(0,224,101,.45); }
label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 700; }
label.check input { width: auto; }
.locks { display: flex; gap: 14px; flex-wrap: wrap; }

.table-wrap, .tablewrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
table.table th, table.table td { text-align: left; padding: 9px 10px; border-bottom: 2px solid var(--ink); }
table.table th {
  color: #fff; background: var(--blue);
  font-size: 13px; letter-spacing: 2px;
  font-family: var(--font-punch); font-weight: 400;
}
table.table tr:hover td { background: var(--blue-soft); }

.btn-primary { background: var(--red); color: #fff; font-family: var(--font-punch); font-size: 16px; letter-spacing: 2px; text-transform: uppercase; border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 5px 0 var(--sh); padding: 10px 24px; cursor: pointer; text-shadow: 2px 2px 0 rgba(0,0,0,.35); transition: transform .12s cubic-bezier(.34,1.56,.64,1), box-shadow .12s; }
.btn-primary:hover { transform: translateY(-2px) rotate(-1deg) scale(1.03); box-shadow: 0 7px 0 var(--sh); }
.btn-primary:active { transform: translateY(4px) scale(.98); box-shadow: 0 1px 0 var(--sh); }
.btn-danger { background: var(--panel); border: 3px solid var(--red); color: var(--red); font-family: var(--font-punch); font-size: 14px; letter-spacing: 2px; text-transform: uppercase; border-radius: 12px; padding: 10px 18px; cursor: pointer; box-shadow: 0 5px 0 var(--red-deep); }
.btn-sm, .sm { font-size: 12px; padding: 6px 12px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.pill-gold { background: var(--yellow); border: 3px solid var(--ink); color: #0c0c10; box-shadow: 3px 3px 0 var(--sh); }
.pill-red { background: var(--red); border: 3px solid var(--ink); color: #fff; box-shadow: 3px 3px 0 var(--sh); }

.notice ul { margin: 8px 0 0; padding-left: 20px; }
.notice-green { border-left-color: var(--green); }
.notice-red { border-left-color: var(--red); }
.notice-amber { border-left-color: var(--amber); }

.card.mission { border-left: 10px solid var(--red); }
.card.mission .kicker { margin-bottom: 8px; }

.metric-v { font-size: 30px; color: var(--red); font-family: var(--font-punch); }

.gradeHero { text-align: center; padding: 18px; }
.biggrade { font-size: 58px; color: var(--red); line-height: 1; font-family: var(--font-punch); text-shadow: 3px 3px 0 var(--yellow-soft); }

.steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.stepnum { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink); border: 3px solid var(--ink); background: var(--panel); border-radius: 999px; padding: 6px 12px; font-weight: 800; box-shadow: 2px 2px 0 var(--sh); }
.stagelabel { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }
.statusTrack { display: flex; gap: 4px; align-items: center; margin: 8px 0; }
.statusTrack .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--platinum); border: 3px solid var(--ink); }
.statusTrack .dot.done { background: var(--green); }
.statusTrack .dot.cur { background: var(--yellow); box-shadow: 0 0 0 4px rgba(255, 210, 63, 0.4); }

.chain { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chain-arrow { color: var(--red); font-weight: 800; font-size: 18px; }
.gate-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gate { border: 3px solid var(--ink); border-radius: 12px; padding: 12px; text-align: center; background: var(--panel); box-shadow: 5px 5px 0 var(--sh); }
.gate b { display: block; font-size: 22px; color: var(--red); font-family: var(--font-punch); }

.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.cat-cell { border: 3px solid var(--ink); border-radius: 10px; padding: 10px; text-align: center; background: var(--panel); box-shadow: 4px 4px 0 var(--sh); font-weight: 700; }

.bar { height: 12px; background: var(--blue-soft); border: 3px solid var(--ink); border-radius: 8px; overflow: hidden; margin: 6px 0 12px; }
.bar-fill { height: 100%; background: repeating-linear-gradient(45deg, var(--blue) 0 10px, var(--blue-deep) 10px 20px); border-radius: 4px; transition: width .25s; }

.subcat-group { border: 3px solid var(--ink); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: var(--panel); box-shadow: 5px 5px 0 var(--sh); }
.subcat-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; font-weight: 800; }
.subcat-score { margin-left: auto; font-size: 13px; font-weight: 800; }
.subcat-row { display: grid; grid-template-columns: 1fr 110px 150px 1fr; gap: 10px; align-items: center; padding: 6px 0; border-top: 2px dashed rgba(23,26,38,.25); }
.subcat-label { font-size: 14px; font-weight: 700; }
.na-note { font-size: 13px; }

.thumb-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--sh); }
.capture-checklist { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.cap-item { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; border: 2px solid var(--ink); background: var(--panel); color: var(--ink-soft); }
.cap-item.req { border-color: var(--red); }
.cap-item.done { background: var(--green); border-color: var(--green); color: #0c0c10; }
.conveyor-panel { border-color: var(--red); box-shadow: 6px 6px 0 var(--red-deep); }
.analyzing-card { text-align: center; padding: 36px 20px; }
.analyzing-spin { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; border: 7px solid var(--blue-soft); border-top-color: var(--red); animation: eggSpin 0.9s linear infinite; }
@keyframes eggSpin { to { transform: rotate(360deg); } }
.analyzing-log { text-align: left; max-width: 640px; margin: 18px auto 0; }
.report-preview-card { border-color: var(--yellow); }
.conveyor-log { font-family: monospace; font-size: 13px; line-height: 1.7; margin: 10px 0; }
.conveyor-log div { padding: 2px 0; border-bottom: 1px dashed var(--blue-soft); }
.defect-form { border: 3px dashed var(--ink); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: var(--panel); }

.lab-session-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.doctrine { border-left: 8px solid var(--green); padding: 4px 0 4px 14px; margin: 14px 0; color: var(--muted); font-weight: 600; }

.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.vault-card { border: 3px solid var(--ink); border-radius: 14px; padding: 14px; background: var(--panel); box-shadow: 5px 5px 0 var(--sh); transition: transform .15s cubic-bezier(.34,1.56,.64,1); }
.vault-card:hover { transform: translateY(-3px) rotate(.5deg); }
.vault-grade { font-size: 32px; color: var(--red); float: right; font-family: var(--font-punch); }

.price-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.price { font-size: 36px; color: var(--ink); font-family: var(--font-punch); }

.report-wrap { display: grid; gap: 16px; }
.report-admin { border: 3px solid var(--ink); border-radius: 14px; padding: 6px; background: var(--paper-2); }
.internal summary { cursor: pointer; color: var(--amber); font-weight: 800; }
.notif { border: 3px solid var(--ink); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--panel); box-shadow: 5px 5px 0 var(--sh); font-weight: 600; }
.orderdetail, .orderhead { border: 3px solid var(--ink); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: var(--panel); }
.qr-note { font-size: 12px; color: var(--muted); font-weight: 600; }
.crossover { border: 4px solid var(--amber); border-radius: 12px; padding: 12px; margin: 12px 0; background: var(--yellow-soft); box-shadow: 5px 5px 0 var(--sh); }
.footer-commercial { margin-top: 34px; padding-top: 18px; border-top: 3px solid var(--ink); color: var(--muted); font-size: 12.5px; font-weight: 600; }

.modalbox { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(23, 26, 38, 0.55); z-index: 50; }
.modalbox > div { background: var(--panel); border: 4px solid var(--ink); border-radius: 16px; padding: 22px; max-width: 560px; width: 92%; max-height: 84vh; overflow: auto; box-shadow: 8px 8px 0 var(--sh); }
.egg-toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--panel); border: 3px solid var(--red); color: var(--ink); border-radius: 12px; padding: 10px 18px; z-index: 60; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; font-family: var(--font-punch); font-size: 14px; letter-spacing: 2px; box-shadow: 4px 4px 0 var(--sh), 0 0 18px rgba(0,224,101,.35); }
.egg-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .grid2, .form-grid, .price-cards, .gate-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .subcat-row { grid-template-columns: 1fr 90px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- crew: agents, conveyor, defect map ---------- */
.agent-chip { display: inline-flex; align-items: center; gap: .4em; border: 3px solid var(--ink); border-radius: 999px; padding: .15em .7em .15em .4em; font-size: .85em; background: var(--panel); font-weight: 700; box-shadow: 2px 2px 0 var(--sh); }
.agent-chip .agent-ico { font-size: 1.1em; }
.agent-chip .agent-nm { font-weight: 800; color: var(--ac, var(--red)); }
.agent-chip .agent-role { color: var(--muted); font-size: .85em; }
.agent-panel { border: 3px solid var(--ink); border-left: 8px solid var(--ac, var(--red)); border-radius: var(--radius); padding: .8em 1em; margin: .8em 0; background: var(--panel); box-shadow: 5px 5px 0 var(--sh); }
.agent-head { display: flex; align-items: flex-start; gap: .7em; }
.agent-ico.big { font-size: 1.8em; }
.agent-name { font-weight: 400; font-size: 1.3em; font-family: var(--font-punch); letter-spacing: 2px; }
.agent-mandate { color: var(--muted); font-size: .9em; margin-top: .15em; font-weight: 600; }
.agent-check { margin: .6em 0 .2em 1.1em; padding: 0; color: var(--muted); font-size: .9em; font-weight: 600; }
.agent-check li { margin: .15em 0; }
.agent-check li::marker { content: "\25B8  "; color: var(--ac, var(--red)); }
.agent-signrow { display: flex; align-items: center; gap: .6em; margin-top: .6em; flex-wrap: wrap; }
.gate-agents { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1em; }
@media (max-width: 700px) { .gate-agents { grid-template-columns: 1fr; } }

/* conveyor belt */
.conv-card { overflow-x: auto; }
.conveyor { display: flex; align-items: center; min-width: 900px; padding: .4em 0; }
.conv-station { display: flex; flex-direction: column; align-items: center; gap: .15em; min-width: 62px; }
.conv-ico { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2em; border: 3px solid var(--ink); background: var(--panel); box-shadow: 3px 3px 0 var(--sh); }
.conv-station.done .conv-ico { background: var(--green); color: #fff; }
.conv-station.active .conv-ico { background: var(--yellow); animation: bounce-ico 0.8s ease-in-out infinite; }
@keyframes bounce-ico { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.conv-lb { font-size: .68em; color: var(--muted); text-align: center; line-height: 1.25; font-weight: 800; }
.conv-station.done .conv-lb { color: var(--ink); }
.conv-station.active .conv-lb { color: var(--red); }
.conv-link { flex: 1; height: 4px; background: var(--ink); opacity: 0.2; min-width: 8px; margin: 0 2px 18px; border-radius: 2px; }
.conv-link.done { background: var(--green); opacity: 1; }
.conv-tick { font-size: .7em; color: var(--green-deep); font-weight: 800; }

/* defect map */
.defectmap { width: 100%; max-width: 300px; aspect-ratio: 250 / 350; display: block; margin: 0 auto; }
.defectmap.picker { cursor: crosshair; }
.defectmap.locked { cursor: default; }
.dm-card { fill: #ffffff; stroke: var(--ink); stroke-width: 2; }
.dm-zone { fill: none; stroke: #9aa0b8; stroke-width: 1; stroke-dasharray: 3 3; }
.dm-side { fill: var(--red); font-size: 22px; font-weight: 800; text-anchor: middle; letter-spacing: 6px; font-family: var(--font-punch); }
.dm-pin-n { fill: #ffffff; font-size: 11px; font-weight: 800; }
.dm-picker { display: flex; flex-direction: column; align-items: center; gap: .5em; margin: .8em 0; }
.dm-tabs { display: flex; gap: .5em; align-items: center; flex-wrap: wrap; justify-content: center; }
.dm-legend { width: 100%; border-collapse: collapse; font-size: .85em; margin: .5em 0; }
.dm-legend th, .dm-legend td { border-bottom: 2px solid var(--ink); padding: .3em .5em; text-align: left; }
.dm-dot { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-weight: 800; font-size: .75em; align-items: center; justify-content: center; border: 3px solid var(--ink); }
.dm-pair { display: flex; gap: 1em; justify-content: center; flex-wrap: wrap; }
.dm-pair > div { flex: 0 1 260px; }
.dm-report { margin-top: 1em; border-top: 3px solid var(--ink); padding-top: .8em; }
.dm-report h4 { margin: .4em 0; }

/* crew HQ */
.crew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8em; }
.crew-card { border: 3px solid var(--ink); border-left: 8px solid var(--ac, var(--red)); border-radius: var(--radius); padding: .8em 1em; background: var(--panel); box-shadow: 5px 5px 0 var(--sh); }

/* finisher overlay */
.finisher-overlay { position: fixed; inset: 0; background: rgba(23, 26, 38, 0.6); z-index: 200; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 2em 1em; }
.finisher-card { background: var(--panel); border: 4px solid var(--ink); border-radius: var(--radius); max-width: 720px; width: 100%; padding: 1.4em; box-shadow: 8px 8px 0 var(--sh); }
.finisher-card h4 { margin: 1em 0 .4em; }
.attach-list { list-style: none; padding: 0; margin: .4em 0; }
.attach-list li { padding: .25em 0; border-bottom: 2px dashed rgba(23,26,38,.25); font-weight: 600; }
.narrative { white-space: pre-wrap; background: var(--paper-2); border: 3px solid var(--ink); border-radius: var(--radius); padding: .8em 1em; font-size: .9em; font-weight: 600; }
.check { display: block; margin: .3em 0; font-weight: 600; }

/* ---------- perfected grading report ---------- */
.pill-amber { background: var(--amber); border: 3px solid var(--ink); color: #fff; }
.subcat-note { grid-column: 1 / -1; font-size: 13px; }
.report-full { max-width: 960px; margin: 0 auto 2em; }
.rf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1em; border-bottom: 4px solid var(--ink); padding-bottom: .8em; margin-bottom: 1em; }
.rf-cert { font-size: 1.5em; letter-spacing: .06em; color: var(--ink); font-family: var(--font-punch); }
.qr-slot { min-width: 96px; min-height: 96px; display: flex; align-items: center; justify-content: center; border: 4px solid var(--ink); border-radius: var(--radius); padding: 6px; background: var(--panel); box-shadow: 5px 5px 0 var(--sh); }
.qr-slot img, .qr-slot canvas { width: 96px; height: 96px; }
.rf-hero { display: grid; grid-template-columns: 240px 1fr; gap: 1.5em; align-items: start; margin-bottom: 1.2em; }
.rf-hero .gradeHero { margin: 0; text-align: center; }
.rf-cardinfo h2 { margin: 0 0 .4em; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: .3em 1.2em; margin: 0; }
.spec { display: flex; gap: .6em; font-size: .92em; font-weight: 600; }
.spec dt { color: var(--muted); min-width: 110px; font-weight: 800; }
.spec dd { margin: 0; font-weight: 700; }
.gates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7em; margin-bottom: 1.2em; }
.gate-cell { border: 3px solid var(--ink); border-radius: var(--radius); padding: .7em .9em; background: var(--panel); box-shadow: 4px 4px 0 var(--sh); }
.gate-cell.gate-pass { border-left: 8px solid var(--green); }
.gate-name { font-weight: 400; margin: .15em 0; font-family: var(--font-punch); font-size: 14px; letter-spacing: 2px; }
.gate-score { font-size: 1.7em; color: var(--red); font-family: var(--font-punch); }
.gate-verdict { font-weight: 800; color: var(--green-deep); }
.cat-detail { border: 3px solid var(--ink); border-radius: var(--radius); padding: .9em 1.1em; margin-bottom: 1em; background: var(--panel); box-shadow: 5px 5px 0 var(--sh); }
details.cat-detail summary.cat-detail-head { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: baseline; gap: 1em; flex-wrap: wrap; margin-bottom: .3em; font-weight: 800; }
details.cat-detail summary.cat-detail-head::-webkit-details-marker { display: none; }
details.cat-detail summary.cat-detail-head::before { content: '\25B8'; color: var(--red); font-weight: 800; margin-right: .4em; font-size: 1.2em; }
details.cat-detail[open] summary.cat-detail-head::before { content: '\25BE'; }
details.cat-detail summary.cat-detail-head:hover { color: var(--red); }
.cat-detail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; flex-wrap: wrap; margin-bottom: .3em; font-weight: 800; }
.sub-what { margin-top: .25em; line-height: 1.45; font-weight: 600; }
.cat-why { margin-bottom: .6em; font-weight: 600; }
.subcat-table td.note-cell { font-size: .88em; max-width: 340px; }
.expert-opinion { border-left: 8px solid var(--amber); padding: .2em 0 .2em 1em; margin: .4em 0 1.2em; }
.expert-opinion .narrative { background: transparent; border: none; padding: 0; font-size: .95em; line-height: 1.6; box-shadow: none; }
.report-full.elite-black { border: 4px solid var(--amber); }
.report-full h3 { margin: 1.4em 0 .6em; }
.report-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1em; }
.report-summary { text-align: center; }
.report-summary .vault-grade { font-size: 2.8em; color: var(--red); font-family: var(--font-punch); }

/* ---------- customer journey tracking ---------- */
.trackrow { margin-bottom: .6em; }
.track-stepper { display: flex; align-items: flex-start; margin: .9em 0 .4em; flex-wrap: wrap; row-gap: .8em; }
.ts-step { display: flex; flex-direction: column; align-items: center; min-width: 96px; flex: 1 1 96px; text-align: center; }
.ts-dot { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; font-size: .8em; font-weight: 800; color: var(--muted); background: var(--panel); box-shadow: 2px 2px 0 var(--sh); }
.ts-step.done .ts-dot { background: var(--green); color: #fff; }
.ts-step.now .ts-dot { background: var(--yellow); color: var(--ink); animation: bounce-ico 0.8s ease-in-out infinite; }
.ts-label { font-size: .78em; font-weight: 800; margin-top: .35em; }
.ts-step.todo .ts-label { color: var(--muted); font-weight: 600; }
.ts-when { font-size: .72em; color: var(--muted); font-weight: 600; }
.ts-when.pending { font-style: italic; opacity: .7; }
.ts-step.now .ts-when { color: var(--amber); font-weight: 800; }
.ts-link { flex: 0 0 18px; height: 4px; background: var(--ink); opacity: 0.2; margin-top: 15px; border-radius: 2px; }
.ts-link.done { background: var(--green); opacity: 1; }
@media (max-width: 640px) {
  .rf-hero { grid-template-columns: 1fr; }
  .specs { grid-template-columns: 1fr; }
  .ts-step { min-width: 76px; flex-basis: 76px; }
  .ts-link { display: none; }
}
.public-card { text-align: center; max-width: 420px; }
.public-card .gradeHero { margin: 0; }
.public-card .biggrade { font-size: 3.4em; }

/* ---------- phone-first grading lab ---------- */
@media (max-width: 760px) {
  table.table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.table th, table.table td { white-space: nowrap; }
  table.table td.note-cell, table.table td.wrap { white-space: normal; }
  .agent-head > div { min-width: 0; flex: 1; }
  .agent-signrow input { max-width: none !important; flex: 1 1 140px; }
  .seal-mini { display: none; }
  #topbar { padding: 8px 12px; gap: 8px; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .eyebrow { font-size: 16px; letter-spacing: 1px; }
  #topbar .tagline { display: none; }
  .logo { width: 32px; height: 32px; }
  .lab-session-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  #lab input, #lab select, #lab textarea { font-size: 16px; }
  #lab input[type="number"] { min-height: 44px; }
  #lab select { min-height: 44px; }
  #lab .btn, #lab button.btn { min-height: 44px; }
  #lab .btn-sm { min-height: 40px; padding: 8px 12px; }
  #lab .subcat-row { grid-template-columns: 1fr 84px; gap: 8px; padding: 10px 0; }
  #lab .subcat-label { font-size: 15px; }
  #lab .defectmap { touch-action: manipulation; max-width: 340px; }
  #lab .dm-pair > div { flex: 1 1 100%; }
  #lab .form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
  #lab .form-row input { width: 100%; }
  #lab .card { padding: 14px 12px; }
  main { padding: 14px 12px 80px; }
}

/* ---- Forensic observation editor ---- */
.obs-editor { margin: 4px 0 10px 0; padding: 10px 12px; border: 3px solid var(--ink); border-left: 8px solid var(--red); border-radius: 10px; background: var(--panel); }
.obs-head { margin-bottom: 8px; font-size: 13px; font-weight: 800; }
.obs-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-top: 2px dashed rgba(23,26,38,.25); }
.obs-row select, .obs-row input[type="number"], .obs-row input[type="text"] { min-height: 38px; }
.obs-f { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 800; }
.obs-f input { width: 64px; }
.obs-note { flex: 2 1 180px; }
.obs-eid { flex: 1 1 110px; }
.obs-ded { font-weight: 800; color: var(--red); min-width: 52px; text-align: right; font-family: var(--font-punch); font-size: 16px; }
.obs-total { margin-top: 8px; font-weight: 800; }
.subcat-computed { font-size: 18px; color: var(--red); font-family: var(--font-punch); letter-spacing: 1px; }
@media (max-width: 720px) {
  .obs-row { gap: 6px; }
  .obs-note, .obs-eid { flex: 1 1 100%; }
}

/* ---- lead graders (about page) ---- */
.card.grader { text-align: center; }
.grader-photo {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--ink);
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
  margin: 4px auto 10px; display: block;
  background: var(--blue-soft);
  box-shadow: 5px 5px 0 var(--sh);
}
.grader-title { color: var(--red); font-weight: 400; margin: 2px 0; font-family: var(--font-punch); font-size: 15px; letter-spacing: 2px; }
.grader-sys { font-size: .85em; color: var(--blue-deep); margin-bottom: 10px; font-weight: 800; }
.card.grader p { text-align: left; }

/* ==========================================================================
 * GLOBAL AMBIENT WALLPAPER — the animated Eight Gates logo canvas.
 * Dark cinematic emblem layer behind the whole site; the cream veil keeps
 * light comic panels crisp while the red glow breathes through the margins.
 * ========================================================================== */
#bgWallpaper {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
#bgWallpaper.bg-off { display: none; }
/* Comic halftone blend over the wallpaper. */
#bgHalftone {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(0, 224, 101, 0.16) 1.2px, transparent 1.6px);
  background-size: 14px 14px;
  mix-blend-mode: screen;
}
body.bg-off #bgHalftone, body.bg-off #bgBursts { display: none; }
/* Floating comic bursts, very low-key, behind content. */
#bgBursts { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.wp-burst {
  position: absolute;
  font-family: 'Bangers', 'Arial Black', sans-serif;
  color: rgba(255, 210, 63, 0.20);
  -webkit-text-stroke: 1px rgba(20, 8, 4, 0.35);
  letter-spacing: 2px;
  animation: wpFloat 11s ease-in-out infinite;
}
.wp-burst.b1 { top: 12%; left: 6%; font-size: 54px; transform: rotate(-8deg); }
.wp-burst.b2 { top: 58%; right: 5%; font-size: 44px; transform: rotate(6deg); animation-delay: -4s; }
.wp-burst.b3 { bottom: 10%; left: 12%; font-size: 40px; transform: rotate(-4deg); animation-delay: -7s; }
@keyframes wpFloat {
  0%, 100% { translate: 0 0; opacity: 0.7; }
  50% { translate: 0 -18px; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .wp-burst { animation: none; }
}
#bgVeil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(10, 10, 14, 0.42);
}
/* content above the veil (#topbar is already sticky at z-index 50) */

/* ==========================================================================
 * THE AUTH GATE — comic-book KABOOM! sign-in screen. Bursts, tilted panels,
 * springy buttons. The ambient video shows through from the global layer.
 * ========================================================================== */
body.gated #sideNav, body.gated .page-head { display: none; }
body.gated main { max-width: none; padding: 0; }
body.gated #shell { min-height: calc(100vh - 65px); }

.gate-screen {
  position: relative;
  min-height: calc(100vh - 69px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 40px;
}
.gate-content { position: relative; z-index: 2; width: 100%; max-width: 1060px; text-align: center; }

/* the "8" insignia: yellow action burst, slowly spinning */
.gate-insignia {
  width: 130px; height: 130px; margin: 0 auto 6px; position: relative;
  display: flex; align-items: center; justify-content: center;
  animation: float-burst 5s ease-in-out infinite;
}
.gate-insignia .burst {
  position: absolute; inset: 0;
  background: var(--yellow);
  filter: drop-shadow(4px 4px 0 var(--sh));
  animation: spin-rays 36s linear infinite;
}
.gate-insignia .eight {
  position: relative;
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--red);
  border: 4px solid var(--ink);
  color: #fff;
  font-family: var(--font-punch);
  font-size: 46px;
  display: flex; align-items: center; justify-content: center;
  text-shadow: 3px 3px 0 var(--sh);
}

.gate-kicker {
  font-family: var(--font-punch);
  font-size: 16px; letter-spacing: 5px; text-transform: uppercase;
  color: var(--blue-deep);
  margin-bottom: 2px;
}
.gate-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 10vw, 110px);
  line-height: 0.95;
  color: var(--ink);
  margin: 0 0 4px;
  text-shadow: 4px 4px 0 var(--yellow);
  letter-spacing: 3px;
}
.gate-title .eight-word { color: var(--red); }
.gate-tag {
  font-family: var(--font-punch);
  font-size: clamp(14px, 2.4vw, 19px);
  letter-spacing: 4px; text-transform: uppercase;
  color: var(--ink);
  margin: 8px 0 26px;
}
.gate-tag b { color: var(--red); font-weight: 400; text-shadow: 0 0 12px rgba(0,224,101,.6); }

.gate-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  max-width: 900px; margin: 0 auto; text-align: left;
}
.gate-card {
  background: var(--panel);
  border: 4px solid var(--ink);
  border-radius: 16px;
  padding: 26px 28px;
  box-shadow: 8px 8px 0 var(--sh);
  position: relative;
  animation: pop-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.gate-card:first-child { transform: rotate(-0.8deg); }
.gate-card:last-child { transform: rotate(0.8deg); }
.gate-card::before {
  content: "WOW";
  position: absolute;
  top: -20px; right: 18px;
  font-family: var(--font-punch);
  font-size: 15px;
  letter-spacing: 2px;
  background: var(--yellow);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 3px 10px;
  transform: rotate(6deg);
  box-shadow: 3px 3px 0 var(--sh);
}
.gate-card:last-child::before { content: "FREE"; background: var(--blue); color: #fff; transform: rotate(-6deg); }
.gate-card h3 {
  font-family: var(--font-punch); font-size: 20px;
  letter-spacing: 3px; text-transform: uppercase; margin: 0 0 4px;
  display: flex; align-items: center; gap: 10px;
}
.gate-card h3 .n8 {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--red); color: #fff;
  border: 3px solid var(--ink); font-size: 18px;
  text-shadow: 2px 2px 0 var(--sh);
  box-shadow: 2px 2px 0 var(--sh);
}
.gate-card .fineprint { margin-top: 10px; }
.gate-card .btn { width: 100%; margin: 12px 0 0; }

.gate-why {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin: 30px 0 8px;
}
.gate-why .pill:nth-child(odd) { transform: rotate(-1.5deg); }
.gate-why .pill:nth-child(even) { transform: rotate(1.5deg); background: var(--yellow-soft); }

@media (max-width: 760px) {
  .gate-cards { grid-template-columns: 1fr; }
  .gate-card:first-child, .gate-card:last-child { transform: none; }
  .gate-screen { padding: 34px 14px 30px; }
  .gate-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  #bgVideo { display: none; }
  .gate-insignia, .gate-insignia .burst, .grade-hero::before,
  .hero-seal, .conv-station.active .conv-ico, .ts-step.now .ts-dot,
  section.page.active, .gate-card { animation: none !important; }
  .btn, .btn:hover, .nav-item, .nav-item:hover, .metric, .metric:hover,
  .trust, .trust:hover, .vault-card, .vault-card:hover { transition: none; transform: none; }
}

/* ==========================================================================
 * EIGHT GATES LOGO SYSTEM — emblem badge, boot splash, auth insignia.
 * ========================================================================== */
/* Circular emblem badge (topbar). The emblem JPG is cropped to a medallion. */
.emblem-badge {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #1a1a1e;
  box-shadow: 2px 2px 0 rgba(3, 12, 6, 0.9), 0 0 12px rgba(0, 224, 101, 0.35);
  background: #0b0b0e;
  flex: none;
}

/* ---- Boot splash: the egg cracks, the eighth gate opens ---- */
#bootSplash {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #060607;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: splashOut 0.55s ease 1.45s forwards;
}
#bootSplash.splash-gone { animation: splashOut 0.55s ease forwards; }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }
#bootSplash img {
  position: absolute;
  width: min(72vw, 380px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #1a1a1e;
}
#bootSplash .splash-egg { animation: eggShake 0.7s ease 0.15s; }
@keyframes eggShake {
  0% { transform: scale(0.92); }
  30% { transform: scale(1) rotate(-2deg); }
  55% { transform: scale(1.02) rotate(2deg); }
  75% { transform: scale(1) rotate(-1deg); }
  100% { transform: scale(1); }
}
#bootSplash .splash-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,240,220,0.95) 0%, rgba(0,224,101,0.55) 45%, transparent 75%);
  opacity: 0;
  animation: splashFlash 0.5s ease 0.72s;
}
@keyframes splashFlash {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}
#bootSplash .splash-emblem {
  opacity: 0;
  transform: scale(0.6);
  box-shadow: 0 0 90px rgba(0, 224, 101, 0.75), 0 0 200px rgba(0, 224, 101, 0.35);
  animation: emblemPop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) 0.78s forwards;
}
@keyframes emblemPop {
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  #bootSplash { display: none; }
}

/* ---- Auth gate insignia: the real emblem replaces the CSS "8" ---- */
.gate-insignia .eight { display: none; }
.gate-insignia .burst { display: none; }
.gate-insignia {
  width: 150px;
  height: 150px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: url('assets/logos/egg-emblem-green.jpg') center / cover no-repeat #0b0b0e;
  border: 3px solid #1a1a1e;
  box-shadow: 4px 4px 0 rgba(3, 12, 6, 0.9), 0 0 34px rgba(0, 224, 101, 0.5);
  animation: insigniaGlow 3.2s ease-in-out infinite;
}
@keyframes insigniaGlow {
  0%, 100% { box-shadow: 4px 4px 0 rgba(3,12,6,0.9), 0 0 22px rgba(0,224,101,0.35); }
  50% { box-shadow: 4px 4px 0 rgba(3,12,6,0.9), 0 0 46px rgba(0,224,101,0.65); }
}

/* ---- Brand egg: the "Why Eight Gates" story visual ---- */
.brand-egg { text-align: center; margin: 6px auto 18px; }
.brand-egg img {
  width: min(88vw, 560px);
  height: auto;
  border-radius: 14px;
  border: 3px solid #1a1a1e;
  box-shadow: 4px 4px 0 rgba(3, 12, 6, 0.9), 0 0 30px rgba(0, 224, 101, 0.35);
  background: #0b0b0e;
}
.brand-egg .kicker { margin-top: 10px; }

/* ---- Brand plate: full lockup as a dark comic panel on the homepage ---- */
.brand-plate {
  position: relative;
  margin: 26px auto;
  max-width: 640px;
  border: 3px solid #1a1a1e;
  box-shadow: 6px 6px 0 rgba(3, 12, 6, 0.9);
  transform: rotate(-1deg);
  background: #0b0b0e;
}
.brand-plate img { display: block; width: 100%; height: auto; }
.plate-burst {
  position: absolute !important;
  top: -24px;
  right: -14px;
  font-size: 34px !important;
  color: #ffd23f !important;
  -webkit-text-stroke: 1px #1a1a1e;
  transform: rotate(8deg);
}

/* ---- Cinematic dim: on the auth gate the wallpaper goes full dark ---- */
#bgDim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: #060608;
  opacity: 0;
  transition: opacity 0.9s ease;
}
body.gated #bgDim { opacity: 0.45; }
body.bg-off #bgDim { display: none; }
/* Cream veil normally; dark veil when the gate goes cinematic. */
body.gated #bgVeil { background: rgba(6, 6, 10, 0.30); }
/* Halftone stays subtle on paper, stronger in cinematic mode. */
body.gated #bgHalftone {
  background-image: radial-gradient(rgba(0, 224, 101, 0.22) 1.2px, transparent 1.6px);
  mix-blend-mode: normal;
}
/* Lighten gate text when the cinematic dim is up. */
body.gated .gate-kicker { color: #9db8ff; }
body.gated .gate-title { color: #f4f1ea; text-shadow: 4px 4px 0 #04512b, 0 0 26px rgba(0,224,101,0.45); }
body.gated .gate-title .eight-word { color: #00e065; }
body.gated .gate-tag { color: #d8d2c4; }
body.gated .gate-why .pill { background: rgba(255,253,247,0.08); color: #e9e4d6; border-color: rgba(255,210,63,0.5); }

/* ---- Mobile drawer nav + compressed topbar ---- */
#navToggle { display: none; }
#navScrim { display: none; }
@media (max-width: 760px) {
  #navToggle { display: inline-flex; flex: none; }
  #navScrim {
    display: none;
    position: fixed; inset: 0; z-index: 90;
    background: rgba(10, 6, 4, 0.55);
  }
  body.nav-open #navScrim { display: block; }
  #sideNav {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(320px, 86vw); z-index: 100;
    flex: none; max-height: none;
    display: block;
    transform: translateX(-106%);
    transition: transform 0.24s ease;
    border-right: 4px solid var(--ink); border-bottom: 0;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 14px 12px 60px;
    background: var(--paper);
    box-shadow: none;
  }
  body.nav-open #sideNav {
    transform: none;
    box-shadow: 10px 0 0 rgba(23, 26, 38, 0.30);
  }
  body.nav-open { overflow: hidden; }
  #sideNav .nav-label { width: 100%; margin: 10px 4px 4px; }
  #sideNav .nav-item { width: 100%; text-align: left; margin-bottom: 6px; }
  /* Compress the topbar: smaller brand, tighter actions. */
  #topbar { padding: 8px 10px; gap: 8px; }
  .brand { gap: 8px; min-width: 0; }
  .emblem-badge { width: 34px; height: 34px; }
  .eyebrow { font-size: 16px; letter-spacing: 1px; white-space: nowrap; }
  .top-actions { gap: 6px; }
  .top-actions .btn { padding: 6px 10px; font-size: 12px; }
  #topUser { display: inline-flex; align-items: center; gap: 6px; max-width: 46vw; font-size: 12px; }
  #topUser .who { display: inline-block; min-width: 0; flex: 0 1 auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  #sideNav { transition: none; }
}

/* ---- Akatsuki cloud menu button ---- */
.cloud-btn { padding: 6px 10px !important; line-height: 0; }
.cloud-btn svg { display: block; filter: drop-shadow(0 0 6px rgba(0,224,101,.55)); }
.cloud-btn:hover svg { filter: drop-shadow(0 0 10px rgba(0,224,101,.9)); }

/* ---- New brand lockups (Oct 2026 green identity) ---- */
.gate-banner {
  display: block;
  width: min(92vw, 560px);
  height: auto;
  margin: 0 auto 14px;
  border-radius: 10px;
}
.brand-poster { text-align: center; margin: 30px auto 6px; }
.brand-poster img {
  width: min(78vw, 400px);
  height: auto;
  border-radius: 14px;
  border: 3px solid #1a1a1e;
  box-shadow: 6px 6px 0 rgba(3, 12, 6, 0.9), 0 0 40px rgba(0, 224, 101, 0.30);
}
