:root {
  color-scheme: dark;
  --bg: #070b12;
  --surface: #0c1420;
  --surface-2: #101c2b;
  --line: rgba(132, 169, 204, .18);
  --line-strong: rgba(132, 169, 204, .34);
  --text: #f1f6fb;
  --muted: #8ea3ba;
  --soft: #c6d5e5;
  --cyan: #66d7ff;
  --mint: #6fe3b5;
  --amber: #ffc861;
  --red: #ff7b87;
  --violet: #b79cff;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(102, 215, 255, .12), transparent 60%),
    radial-gradient(700px 420px at 5% 5%, rgba(111, 227, 181, .07), transparent 62%),
    var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }

body.locked { overflow: hidden; }
body.locked > .topbar,
body.locked > main { filter: blur(7px); pointer-events: none; user-select: none; }

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 7, 12, .72);
  backdrop-filter: blur(8px);
}
.access-gate[hidden] { display: none; }
.access-card {
  display: grid;
  gap: 13px;
  width: min(380px, 100%);
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(160deg, #0f1d2d, #08121e);
  box-shadow: var(--shadow);
}
.access-card .mark { margin-bottom: 2px; }
.access-card h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.03em; }
.access-card p { margin: 0; color: var(--muted); font-size: .84rem; }
.access-card .button { width: 100%; }
.access-error { min-height: 1.2em; color: var(--red) !important; font-size: .8rem !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 66px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 18, .82);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--mint));
  color: #052331;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: -.04em;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy small { color: #7690ad; font-size: .64rem; font-weight: 800; letter-spacing: .16em; }
.brand-copy strong { font-size: 1rem; letter-spacing: -.02em; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--soft);
  font-size: .75rem;
  font-weight: 700;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.good { color: var(--mint); border-color: #275849; }
.pill.good i { background: var(--mint); box-shadow: 0 0 10px rgba(111, 227, 181, .55); }
.pill.bad { color: var(--red); border-color: #64313c; }
.pill.bad i { background: var(--red); }

main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(36px, 6vw, 68px) 24px 64px;
}
.hero { max-width: 820px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
h1 { margin: 0; font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1; letter-spacing: -.055em; }
.lede { max-width: 740px; margin: 16px 0 0; color: var(--muted); font-size: clamp(.95rem, 1.5vw, 1.06rem); }

.lookup {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, .7fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 32px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(16, 28, 43, .96), rgba(8, 15, 25, .98));
  box-shadow: var(--shadow);
}
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field span { color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.field em { color: #647a92; font-style: normal; font-weight: 700; text-transform: none; letter-spacing: 0; }
input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #07111c;
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  outline: none;
}
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(102, 215, 255, .1); }
.button {
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--soft);
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.button:hover { border-color: var(--cyan); color: #fff; }
.button.primary { background: linear-gradient(135deg, var(--cyan), var(--mint)); border-color: transparent; color: #052331; }
.button:disabled { opacity: .55; cursor: wait; }
.button:focus-visible, summary:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.status {
  margin-top: 18px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(12, 20, 32, .8);
  color: var(--muted);
  font-size: .85rem;
}
.status.good { border-color: #275849; color: var(--mint); }
.status.bad { border-color: #64313c; color: var(--red); }
.status.busy { border-color: #2c4d68; color: var(--cyan); }

.results { display: grid; gap: 16px; margin-top: 22px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.summary-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(155deg, rgba(16, 28, 43, .96), rgba(8, 15, 25, .98));
  min-width: 0;
}
.summary-card.accent { border-color: rgba(102, 215, 255, .45); box-shadow: inset 0 0 0 1px rgba(102, 215, 255, .08); }
.summary-label { display: block; color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.summary-card strong { display: block; margin-top: 9px; font-size: 1.35rem; letter-spacing: -.03em; overflow-wrap: anywhere; }
.summary-card small { display: block; margin-top: 5px; color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(14, 25, 40, .96), rgba(8, 14, 24, .98));
  min-width: 0;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel h2 { margin: 0; font-size: 1rem; letter-spacing: -.02em; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.decision-panel { border-color: rgba(102, 215, 255, .35); }
.decision-text { margin: 0 0 14px; color: var(--soft); font-size: .9rem; }
.gate-list { display: grid; gap: 8px; }
.gate { border: 1px solid var(--line); border-radius: 10px; background: #08131f; overflow: hidden; }
.gate summary {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}
.gate summary::-webkit-details-marker { display: none; }
.gate summary b { font-size: .82rem; }
.gate summary small { grid-column: 2; display: block; margin-top: 2px; color: var(--muted); font-size: .73rem; }
.gate-state {
  grid-row: span 2;
  display: grid;
  place-items: center;
  padding: 4px 0;
  border-radius: 6px;
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .06em;
}
.gate.pass .gate-state { background: rgba(111, 227, 181, .12); color: var(--mint); }
.gate.fail .gate-state { background: rgba(255, 123, 135, .12); color: var(--red); }
.gate-conditions { margin: 0; padding: 2px 12px 12px 76px; list-style: none; display: grid; gap: 5px; }
.gate-conditions li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: baseline;
  font-size: .74rem;
}
.gate-conditions li span { color: var(--soft); }
.gate-conditions li b { font-variant-numeric: tabular-nums; }
.gate-conditions li.pass b { color: var(--mint); }
.gate-conditions li.fail b { color: var(--red); }
.gate-conditions li small { color: var(--muted); }

.score-grid { display: grid; gap: 10px; }
.score-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 46px; gap: 12px; align-items: center; }
.score-row span { color: var(--soft); font-size: .8rem; font-weight: 700; }
.score-row b { text-align: right; font-size: .86rem; font-variant-numeric: tabular-nums; }
.bar { height: 10px; border: 1px solid var(--line); border-radius: 999px; background: #06101a; overflow: hidden; }
.bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--mint)); transition: width .35s ease; }
.score-row:nth-child(3) .bar i { background: linear-gradient(90deg, var(--amber), var(--red)); }

.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; }
.category-card { padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #08131f; }
.category-card b { display: block; font-size: .86rem; }
.category-card small { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; }
.category-meter { height: 6px; margin-top: 8px; border-radius: 999px; background: #06101a; overflow: hidden; }
.category-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--mint)); }
.category-card.primary { border-color: var(--cyan); background: rgba(102, 215, 255, .07); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #08131f; min-width: 0; }
.stat span { display: block; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.stat strong { display: block; margin-top: 5px; font-size: .95rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.reasons { display: grid; gap: 9px; }
.reason {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #08131f;
}
.reason .sign { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 900; font-size: .8rem; }
.reason.positive .sign { background: rgba(111, 227, 181, .12); color: var(--mint); }
.reason.negative .sign { background: rgba(255, 123, 135, .12); color: var(--red); }
.reason b { font-size: .82rem; }
.reason small { display: block; margin-top: 3px; color: var(--muted); font-size: .76rem; }
.reason p { margin: 5px 0 0; color: var(--soft); font-size: .78rem; }

.gaps-panel { border-color: rgba(255, 200, 97, .28); }
.gaps-list { margin: 0; padding-left: 18px; color: var(--amber); font-size: .82rem; }
.gaps-list li + li { margin-top: 5px; }

.raw { border: 1px solid var(--line); border-radius: 12px; background: #08131f; }
.raw summary { padding: 13px 15px; color: var(--soft); font-size: .82rem; font-weight: 700; cursor: pointer; }
.raw pre { margin: 0; padding: 0 15px 15px; color: #a9bfd5; font-size: .72rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .topbar { padding: 0 14px; }
  .brand-copy small { display: none; }
  main { padding: 30px 14px 48px; }
  .lookup { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .score-row { grid-template-columns: 92px minmax(0, 1fr) 42px; }
  .gate-conditions { padding-left: 12px; }
  .gate-conditions li { grid-template-columns: minmax(0, 1fr) auto; }
  .gate-conditions li small { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
