:root {
  --ink: #edf5f1;
  --muted: #9aada6;
  --panel: #13231f;
  --panel-2: #182c27;
  --line: #2b443d;
  --lime: #b8ee74;
  --amber: #f6be69;
  --navy: #07110f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% -10%, rgba(88, 139, 114, .22), transparent 32rem),
    linear-gradient(180deg, #091613, var(--navy));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .05;
  background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 48px 48px;
}
main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 90px; position: relative; }
.hero { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; }
.eyebrow { color: var(--lime); text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 800; margin: 0 0 12px; }
h1 { font-size: clamp(2.8rem, 7vw, 6.5rem); letter-spacing: -.065em; line-height: .91; margin: 0; max-width: 950px; font-weight: 750; }
h1 span { color: var(--lime); }
.lede { color: var(--muted); max-width: 700px; font-size: 1.08rem; line-height: 1.65; margin-top: 28px; }
.status-card { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); background: rgba(19,35,31,.72); padding: 14px 18px; border-radius: 14px; min-width: 220px; }
.status-card small, .status-card strong { display: block; }
.status-card small { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }
.status-card strong { font-size: .82rem; margin-top: 3px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 6px rgba(184,238,116,.1); }
.pipeline { display: grid; grid-template-columns: repeat(6, 1fr); margin: 55px 0 26px; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.stage { padding: 16px; display: flex; gap: 9px; align-items: center; color: #657b73; background: rgba(10,26,22,.8); border-right: 1px solid var(--line); font-size: .76rem; }
.stage:last-child { border-right: 0; }
.stage b { color: #476057; font-size: .67rem; }
.stage.active { color: var(--ink); background: rgba(184,238,116,.07); }
.stage.active b { color: var(--lime); }
.panel { border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(24,44,39,.94), rgba(14,28,24,.96)); padding: 28px; }
.start-panel { display: flex; justify-content: space-between; gap: 30px; align-items: center; min-height: 180px; }
h2 { margin: 0 0 10px; letter-spacing: -.03em; font-size: 1.75rem; }
.panel p:not(.eyebrow) { color: var(--muted); max-width: 680px; line-height: 1.6; }
button { border: 0; border-radius: 11px; padding: 13px 16px; color: #102013; background: var(--lime); font-weight: 800; cursor: pointer; transition: transform .15s, filter .15s; }
button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.start-panel button { min-width: 245px; padding: 18px 20px; }
.start-panel button span { float: right; }
.start-actions { display: grid; gap: 8px; min-width: 245px; }
.start-actions button { width: 100%; }
button.secondary { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.loading { display: flex; gap: 20px; align-items: center; min-height: 160px; }
.spinner { width: 42px; height: 42px; border: 3px solid var(--line); border-top-color: var(--lime); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 54px 0 20px; }
.version { border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; color: var(--muted); font-size: .75rem; }
.version strong { color: var(--lime); padding-left: 6px; }
.capability-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.capability { border-left: 2px solid var(--lime); padding: 16px 18px; background: rgba(19,35,31,.78); border-radius: 0 12px 12px 0; }
.capability div { display: flex; justify-content: space-between; gap: 15px; }
.capability strong { text-transform: capitalize; }
.capability span { color: var(--lime); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.capability p { color: var(--muted); font-size: .8rem; line-height: 1.45; margin: 10px 0 0; }
.role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.role-card { border: 1px solid var(--line); border-radius: 17px; padding: 23px; background: var(--panel); position: relative; overflow: hidden; }
.role-card.decided { border-color: rgba(184,238,116,.55); }
.role-top { display: flex; justify-content: space-between; align-items: start; }
.rank { color: #557068; font-size: .75rem; font-weight: 800; }
.score { text-align: right; }
.score strong { display: block; color: var(--lime); font-size: 2rem; line-height: 1; }
.score small { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: .62rem; }
.occupation { color: var(--amber) !important; font-size: .72rem; letter-spacing: .1em; margin: 5px 0 8px !important; }
.role-card h3 { font-size: 1.55rem; letter-spacing: -.03em; margin: 0; max-width: 78%; }
.role-card > p { color: var(--muted); font-size: .86rem; line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.chips span { border: 1px solid var(--line); border-radius: 999px; color: #bad0c7; padding: 5px 8px; font-size: .67rem; }
details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
summary { cursor: pointer; color: #d9e8e2; font-size: .8rem; font-weight: 700; }
.details-body { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.details-body h4 { color: var(--ink); margin: 16px 0 5px; }
.details-body ul { padding-left: 18px; }
.details-body a { color: var(--lime); }
.decision { padding-top: 16px; }
.decision input { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #0b1a17; color: var(--ink); padding: 11px; margin-bottom: 8px; outline: none; }
.decision input:focus { border-color: var(--lime); }
.decision > div { display: flex; gap: 7px; }
.decision button { font-size: .72rem; padding: 9px 12px; }
.decision .ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.decision.complete { color: var(--lime); text-transform: capitalize; padding: 16px 0 3px; }
.state-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 15px; margin-top: 42px; }
pre { white-space: pre-wrap; color: #cbe0d6; font-size: .76rem; background: #091512; border-radius: 10px; padding: 15px; max-height: 280px; overflow: auto; }
#audit { list-style: none; padding: 0; margin: 18px 0 0; }
#audit li { display: grid; grid-template-columns: 145px 1fr; gap: 15px; padding: 12px 0; border-top: 1px solid var(--line); }
#audit b { color: var(--lime); text-transform: capitalize; font-size: .75rem; }
#audit span { color: var(--muted); font-size: .78rem; line-height: 1.45; }
#toast { position: fixed; right: 24px; bottom: 24px; background: var(--lime); color: #0a160f; padding: 14px 18px; border-radius: 11px; font-weight: 800; opacity: 0; transform: translateY(15px); transition: .2s; pointer-events: none; }
#toast.show { opacity: 1; transform: translateY(0); }
#toast.error { background: #ff8f7d; }

@media (max-width: 820px) {
  main { width: min(100% - 24px, 680px); padding-top: 30px; }
  .hero, .start-panel { display: flex; flex-direction: column; align-items: stretch; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .stage:nth-child(3) { border-right: 0; }
  .stage:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .capability-grid, .role-grid, .state-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
}
