:root {
  --bg: #0b1117;
  --panel: rgba(17, 27, 37, 0.92);
  --panel-2: #101923;
  --line: rgba(145, 170, 190, 0.24);
  --text: #e9f2f7;
  --muted: #9fb1bf;
  --accent: #3bd6a4;
  --accent-2: #71a7ff;
  --fail: #ff6868;
  --warn: #f2c15f;
  --none: #798899;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(59, 214, 164, 0.18), transparent 34rem),
    radial-gradient(circle at 80% 0%, rgba(113, 167, 255, 0.16), transparent 30rem),
    linear-gradient(135deg, #071018 0%, #101923 48%, #0d141b 100%);
  color: var(--text);
  font-family: "Aptos", "Segoe UI", sans-serif;
}

a { color: inherit; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: end;
  padding: 3rem clamp(1rem, 3vw, 3rem) 1rem;
}

.eyebrow, .mini-label {
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin: 0 0 0.5rem;
}

h1, h2 { margin: 0; line-height: 1; }
h1 { font-size: clamp(2.3rem, 5vw, 5rem); max-width: 980px; }
h2 { font-size: clamp(1.25rem, 2vw, 1.8rem); }

.lede {
  color: var(--muted);
  max-width: 850px;
  font-size: 1.05rem;
  line-height: 1.55;
}

main {
  padding: 1rem clamp(1rem, 3vw, 3rem) 4rem;
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 1rem;
  backdrop-filter: blur(14px);
}

.panel-title-row, .hero-actions, .control-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, rgba(59, 214, 164, 0.18), rgba(113, 167, 255, 0.16));
  color: var(--text);
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
  cursor: pointer;
  text-decoration: none;
  font-weight: 650;
}

.button:hover { border-color: rgba(255, 255, 255, 0.38); }
.button.muted { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.button.ghost { background: rgba(255, 255, 255, 0.08); white-space: nowrap; }

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px;
  gap: 0.75rem;
  margin: 1rem 0;
}

label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem;
  background: rgba(5, 10, 15, 0.72);
  color: var(--text);
}

.pillbox {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-weight: 650;
}

.pill.active {
  color: #06120f;
  background: var(--accent);
  border-color: var(--accent);
}

.pill.live:not(.active) { border-color: rgba(59, 214, 164, 0.55); color: #c9fff0; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.stat-card, .proof-card {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  color: var(--accent);
}

.matrix-wrap {
  overflow: auto;
  max-height: 68vh;
  border: 1px solid var(--line);
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1060px;
}

th, td {
  border-bottom: 1px solid rgba(145, 170, 190, 0.14);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #0f1924;
  z-index: 2;
}

.book-name { font-weight: 800; }
.subtle { color: var(--muted); font-size: 0.85rem; }

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
}

.status.PASS { color: #052015; background: var(--accent); }
.status.FAIL { color: #2b0505; background: var(--fail); }
.status.NO_PROOF, .status.NOT_DEPLOYED { color: #0e131a; background: #9aa7b4; }
.status.PARTIAL { color: #271b00; background: var(--warn); }

.cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.mini-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 10px;
  padding: 0.35rem 0.48rem;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.78rem;
}

details {
  margin-top: 0.55rem;
  color: var(--muted);
}

summary { cursor: pointer; }

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #061018;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  color: #d8f5ff;
  max-height: 50vh;
  overflow: auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.proof-card a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.row-between {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.source-grid,
.generic-layout {
  display: grid;
  gap: 0.9rem;
}

.source-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.generic-layout {
  grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr);
}

.terminal {
  min-height: 280px;
  max-height: 520px;
  overflow: auto;
  background: #061018;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.85rem;
}

.term-line {
  margin-bottom: 0.3rem;
  word-break: break-word;
}

.term-line span {
  color: var(--muted);
}

.term-line.ok {
  color: var(--accent);
}

.term-line.warn {
  color: var(--warn);
}

.term-line.error {
  color: var(--fail);
}

.term-line.cmd {
  color: var(--accent-2);
}

.subpanel {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.matrix-wrap.compact {
  max-height: 560px;
}

.table-search {
  max-width: 320px;
}

.proof-link-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .filters, .stats, .generic-layout { grid-template-columns: 1fr; }
}
