/* BePay AI — governance operating layer. Dark institutional fintech. */
:root {
  --bg: #05070c;
  --bg2: #070b13;
  --bg3: #0a101c;
  --panel: rgba(15, 21, 33, 0.72);
  --panel-solid: #0d1420;
  --line: rgba(148, 178, 215, 0.10);
  --line-soft: rgba(148, 178, 215, 0.06);
  --ink: #e9eef6;
  --ink-mid: #a7b2c5;
  --ink-faint: #5f6b7e;
  --green: #16a34a;
  --green-br: #22c55e;
  --green-glow: rgba(34, 197, 94, 0.35);
  --cyan: #38bdf8;
  --amber: #f59e0b;
  --red: #ef4444;
  --font-d: 'Montserrat', system-ui, sans-serif;
  --font-m: 'JetBrains Mono', ui-monospace, monospace;
  --r: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-d);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.mono { font-family: var(--font-m); }
.muted { color: var(--ink-mid); }
.small { font-size: 12px; }
::selection { background: rgba(34, 197, 94, 0.35); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1a2434; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #243044; }

/* ===================== NAV ===================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  background: rgba(5, 7, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.3s;
}
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; flex-direction: column; text-decoration: none; }
.logo { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--ink); }
.logo-dot { color: var(--green-br); }
.logo-ai { color: var(--green-br); font-weight: 800; font-size: 13px; vertical-align: super; margin-left: 2px; letter-spacing: 0.04em; }
.brand-sub { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin-top: -3px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-links a {
  color: var(--ink-mid); text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 7px 12px; border-radius: 8px; transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--ink); background: rgba(148, 178, 215, 0.07); }
.nav-links a.nav-cta { color: var(--green-br); border: 1px solid rgba(34, 197, 94, 0.3); }
.nav-links a.nav-cta:hover { background: rgba(34, 197, 94, 0.1); }
.nav-status { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-mid); white-space: nowrap; }
.ns-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: blink 1.6s infinite; }
.nav-status.ok .ns-dot { background: var(--green-br); box-shadow: 0 0 10px var(--green-glow); animation: none; }

/* ===================== HERO ===================== */
.hero {
  position: relative; min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; overflow: hidden;
  background: radial-gradient(1200px 700px at 70% 20%, #0b1524 0%, var(--bg) 60%);
}
#sceneCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; }
.hero-fallback { position: absolute; inset: 0; z-index: 0; display: none;
  background: radial-gradient(600px 400px at 50% 45%, rgba(34,197,94,0.08), transparent 70%); }
.hero.no-webgl .hero-fallback { display: block; }
.hero-vignette {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5,7,12,0.82) 0%, rgba(5,7,12,0.55) 26%, rgba(5,7,12,0.08) 52%, rgba(5,7,12,0.12) 100%),
    linear-gradient(180deg, rgba(5,7,12,0.35) 0%, transparent 25%, transparent 55%, var(--bg) 96%);
}
@media (max-width: 900px) {
  .hero-vignette {
    background:
      radial-gradient(140% 90% at 50% 42%, rgba(5,7,12,0.28) 0%, rgba(5,7,12,0.66) 82%),
      linear-gradient(180deg, rgba(5,7,12,0.35) 0%, transparent 22%, transparent 58%, var(--bg) 96%);
  }
  .stage-labels { opacity: 0.55; }
}
.stage-labels { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.stage-label {
  position: absolute; transform: translate(-50%, -50%);
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
  color: var(--ink-faint); white-space: nowrap; text-align: center;
  transition: color 0.4s, opacity 0.4s; pointer-events: auto; cursor: pointer;
  padding: 4px 8px;
}
.stage-label .sl-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #233042; margin-right: 5px; vertical-align: middle; transition: background 0.4s, box-shadow 0.4s; }
.stage-label .sl-status { display: block; font-size: 8.5px; letter-spacing: 0.08em; color: var(--ink-faint); font-weight: 600; }
.stage-label.is-running { color: var(--cyan); }
.stage-label.is-running .sl-dot { background: var(--cyan); box-shadow: 0 0 9px var(--cyan); animation: blink 1.2s infinite; }
.stage-label.is-done { color: var(--green-br); }
.stage-label.is-done .sl-dot { background: var(--green-br); box-shadow: 0 0 8px var(--green-glow); }
.stage-label.is-blocked { color: var(--red); }
.stage-label.is-blocked .sl-dot { background: var(--red); box-shadow: 0 0 9px var(--red); }
.stage-label.is-awaiting { color: var(--amber); }
.stage-label.is-awaiting .sl-dot { background: var(--amber); box-shadow: 0 0 9px var(--amber); animation: blink 1.2s infinite; }
.stage-label:hover { color: var(--ink); }

.hero-content {
  position: relative; z-index: 4; max-width: 1280px; width: 100%;
  margin: 0 auto; padding: 120px 24px 40px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 11px; letter-spacing: 0.18em; font-weight: 700; color: var(--green-br);
  padding: 7px 14px; border: 1px solid rgba(34, 197, 94, 0.25); border-radius: 100px;
  background: rgba(34, 197, 94, 0.06); margin-bottom: 26px;
}
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-br); box-shadow: 0 0 10px var(--green-glow); animation: blink 1.8s infinite; }
.pulse-dot.amber { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero-title {
  font-size: clamp(34px, 10vw, 88px); font-weight: 900; line-height: 1.04;
  letter-spacing: -0.03em; max-width: 720px; margin-bottom: 24px;
  text-shadow: 0 4px 40px rgba(0,0,0,0.5);
  overflow-wrap: break-word;
}
.grad-text {
  background: linear-gradient(92deg, #4ade80 0%, #22c55e 45%, #38bdf8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { max-width: 560px; color: var(--ink-mid); font-size: 16.5px; margin-bottom: 34px; }
.hero-sub b { color: var(--ink); font-weight: 700; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #1fbf62, #16a34a);
  color: #04120a; font-family: var(--font-d); font-weight: 800; font-size: 15px;
  border: none; border-radius: 12px; padding: 14px 26px; cursor: pointer;
  box-shadow: 0 8px 28px rgba(22, 163, 74, 0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(22, 163, 74, 0.45), inset 0 1px 0 rgba(255,255,255,0.25); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary .play { font-size: 12px; }
.btn-primary.sm { padding: 9px 18px; font-size: 13px; border-radius: 9px; }
.btn-ghost2 {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(148, 178, 215, 0.06); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 24px;
  font-family: var(--font-d); font-weight: 700; font-size: 15px; cursor: pointer;
  text-decoration: none; transition: border-color 0.2s, background 0.2s;
}
.btn-ghost2:hover { border-color: rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.06); }

.hero-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.hchip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-faint);
  border: 1px solid var(--line-soft); border-radius: 100px; padding: 7px 14px;
  background: rgba(10, 15, 24, 0.55); backdrop-filter: blur(6px);
  transition: color 0.3s, border-color 0.3s;
}
.hchip .dot { width: 6px; height: 6px; border-radius: 50%; background: #2a3850; transition: background 0.3s, box-shadow 0.3s; }
.hchip.ok { color: var(--ink-mid); border-color: var(--line); }
.hchip.ok .dot { background: var(--green-br); box-shadow: 0 0 8px var(--green-glow); }
.hchip.bad { color: var(--ink-mid); border-color: rgba(239, 68, 68, 0.25); }
.hchip.bad .dot { background: var(--red); box-shadow: 0 0 8px rgba(239,68,68,0.5); }

.hero-stats {
  position: relative; z-index: 4; max-width: 1280px; width: 100%; margin: 30px auto 0;
  padding: 0 24px 26px;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px;
  background: var(--line-soft); border-top: 1px solid var(--line-soft);
}
.hstat { background: rgba(5, 7, 12, 0.75); backdrop-filter: blur(8px); padding: 16px 18px 12px; }
.hs-v { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.hs-v.mono { font-size: 22px; }
.hs-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); font-weight: 700; margin-top: 2px; }
.hs-note { text-transform: none; letter-spacing: 0.02em; }

.hero-scroll {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 4;
  width: 22px; height: 36px; border: 2px solid var(--ink-faint); border-radius: 12px; opacity: 0.5;
}
.hero-scroll span { position: absolute; top: 6px; left: 50%; width: 3px; height: 7px; margin-left: -1.5px; background: var(--ink-faint); border-radius: 2px; animation: scrolldot 1.8s infinite; }
@keyframes scrolldot { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* ===================== SECTIONS ===================== */
.section { max-width: 1280px; margin: 0 auto; padding: 96px 24px; position: relative; }
.section-alt { max-width: none; background: linear-gradient(180deg, var(--bg2), var(--bg)); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.section-alt > * { max-width: 1280px; margin-left: auto; margin-right: auto; }
.section-head { max-width: 760px; margin-bottom: 54px; }
.section-eyebrow { font-size: 11px; letter-spacing: 0.2em; font-weight: 800; color: var(--green-br); margin-bottom: 14px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; margin-bottom: 18px; }
.section-sub { color: var(--ink-mid); font-size: 15.5px; }
.section-sub .mono { font-size: 13px; color: var(--cyan); background: rgba(56, 189, 248, 0.08); padding: 1px 6px; border-radius: 5px; }
.section-sub b { color: var(--ink); }

/* ---- loop grid (7 stages) ---- */
.loop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.loop-card {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 22px 22px 18px; overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}
.loop-card:hover { border-color: rgba(56, 189, 248, 0.35); transform: translateY(-3px); }
.loop-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(56,189,248,0.6), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.loop-card:hover::before { opacity: 1; }
.lc-num {
  position: absolute; top: 14px; right: 18px; font-family: var(--font-m);
  font-size: 30px; font-weight: 600; color: rgba(148, 178, 215, 0.13);
}
.lc-title { font-size: 17px; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; gap: 9px; }
.lc-glyph { color: var(--cyan); font-family: var(--font-m); font-size: 13px; }
.lc-body { color: var(--ink-mid); font-size: 13.5px; margin-bottom: 14px; min-height: 84px; }
.lc-meta { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.lc-row { display: flex; gap: 8px; font-size: 11.5px; align-items: baseline; }
.lc-k { color: var(--ink-faint); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; font-size: 9.5px; min-width: 58px; }
.lc-v { color: var(--ink-mid); }
.lc-v .mono { font-size: 10.5px; color: var(--green-br); }
.loop-note { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.loop-note-card {
  background: linear-gradient(140deg, rgba(34, 197, 94, 0.05), transparent 60%), var(--panel);
  border: 1px solid var(--line); border-radius: var(--r); padding: 22px;
}
.lnc-title { font-weight: 800; font-size: 15px; margin-bottom: 8px; color: var(--ink); }
.loop-note-card p { color: var(--ink-mid); font-size: 13.5px; }
.loop-note-card b { color: var(--ink); }

/* ---- transparency ---- */
.trans-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.trans-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.trans-card.live { border-color: rgba(34, 197, 94, 0.22); }
.trans-card.ref { border-color: rgba(245, 158, 11, 0.22); }
.tc-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); font-weight: 700; font-size: 13.5px; color: var(--ink-mid); }
.tc-badge { font-size: 9.5px; font-weight: 800; letter-spacing: 0.12em; padding: 4px 9px; border-radius: 5px; }
.tc-badge.live { background: rgba(34, 197, 94, 0.14); color: var(--green-br); border: 1px solid rgba(34,197,94,0.3); }
.tc-badge.ref { background: rgba(245, 158, 11, 0.12); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
.tc-list { list-style: none; padding: 14px 20px 18px; }
.tc-list li { padding: 9px 0 9px 24px; position: relative; color: var(--ink-mid); font-size: 13.5px; border-bottom: 1px dashed var(--line-soft); }
.tc-list li:last-child { border-bottom: none; }
.tc-list li b { color: var(--ink); }
.tc-list .mono { font-size: 11.5px; color: var(--cyan); }
.trans-card.live .tc-list li::before { content: '●'; position: absolute; left: 2px; color: var(--green-br); font-size: 8px; top: 13px; }
.trans-card.ref .tc-list li::before { content: '◇'; position: absolute; left: 2px; color: var(--amber); font-size: 10px; top: 12px; }

/* ---- policy table ---- */
.policy-wrap { margin-top: 44px; }
.policy-head h3 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.policy-head { margin-bottom: 16px; }
.policy-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pol-trow { display: grid; grid-template-columns: 88px 1.4fr 2.6fr 110px; gap: 16px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); align-items: center; background: var(--panel); transition: background 0.2s; }
.pol-trow:hover { background: rgba(15, 21, 33, 0.95); }
.pol-trow:last-child { border-bottom: none; }
.pol-trow.head { background: rgba(10, 16, 28, 0.9); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); font-weight: 800; }
.pt-id { font-family: var(--font-m); font-size: 12px; color: var(--cyan); }
.pt-name { font-weight: 700; font-size: 13.5px; }
.pt-text { color: var(--ink-mid); font-size: 12.5px; }
.pt-action { text-align: right; }
.pt-action span { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; padding: 4px 9px; border-radius: 5px; }
.pt-action .hold { background: rgba(245, 158, 11, 0.12); color: var(--amber); border: 1px solid rgba(245,158,11,0.28); }
.pt-action .block { background: rgba(239, 68, 68, 0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.28); }
.pt-action .flag { background: rgba(56, 189, 248, 0.1); color: var(--cyan); border: 1px solid rgba(56,189,248,0.28); }

/* ===================== LIVE PROOF ===================== */
.proof-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.proof-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px 14px; position: relative; overflow: hidden;
}
.proof-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(34,197,94,0.5), transparent);
}
.proof-card.wide { grid-column: span 2; }
.pc-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-faint); font-weight: 800; margin-bottom: 6px; }
.pc-value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.pc-value.mono { font-size: 24px; }
.pc-value.sm { font-size: 15px; word-break: break-all; color: var(--green-br); }
.pc-value.ok { color: var(--green-br); text-shadow: 0 0 24px var(--green-glow); }
.pc-value.bad { color: var(--red); }
.pc-sub { font-size: 11px; color: var(--ink-faint); margin-top: 3px; }
.runs-ticker { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; padding-right: 4px; }
.ticker-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 14px;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px;
  font-size: 12px; animation: slidein 0.35s ease;
}
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tk-id { font-family: var(--font-m); color: var(--ink-faint); font-size: 11px; }
.tk-sc { color: var(--ink); font-weight: 700; }
.tk-state { margin-left: auto; font-weight: 800; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.tk-state.completed { color: var(--green-br); }
.tk-state.blocked, .tk-state.rejected, .tk-state.failed { color: var(--red); }
.tk-state.awaiting_approval { color: var(--amber); }
.tk-state.running { color: var(--cyan); }
.tk-time { color: var(--ink-faint); font-size: 11px; }

/* ===================== FOR AGENTS ===================== */
.agent-endpoints { display: flex; flex-direction: column; gap: 1px; background: var(--line-soft); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 26px; }
.ae-row { display: grid; grid-template-columns: 150px 1fr 70px; gap: 14px; align-items: center; background: var(--panel-solid); padding: 13px 18px; }
.ae-k { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); }
.ae-v { font-family: var(--font-m); font-size: 13px; color: var(--green-br); word-break: break-all; }
.copy-btn {
  font-family: var(--font-d); font-size: 11px; font-weight: 800; letter-spacing: 0.05em;
  background: rgba(148, 178, 215, 0.08); color: var(--ink-mid); border: 1px solid var(--line);
  border-radius: 7px; padding: 6px 10px; cursor: pointer; transition: all 0.2s; justify-self: end;
}
.copy-btn:hover { color: var(--ink); border-color: rgba(56, 189, 248, 0.4); }
.copy-btn.copied { color: var(--green-br); border-color: rgba(34, 197, 94, 0.4); }

.code-tabs { background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 30px; }
.ct-head { display: flex; border-bottom: 1px solid var(--line-soft); background: rgba(10, 16, 28, 0.9); }
.ct-tab { padding: 11px 18px; font-size: 12.5px; font-weight: 700; color: var(--ink-faint); cursor: pointer; border-bottom: 2px solid transparent; transition: color 0.2s; }
.ct-tab:hover { color: var(--ink-mid); }
.ct-tab.active { color: var(--green-br); border-bottom-color: var(--green-br); }
.ct-pane { display: none; position: relative; }
.ct-pane.active { display: block; }
.code-block { padding: 18px 20px; overflow-x: auto; }
.code-block code { font-family: var(--font-m); font-size: 12.5px; line-height: 1.7; color: #c4d3e6; white-space: pre; }
.ct-pane .copy-btn { position: absolute; top: 10px; right: 12px; }

.tools-wrap { margin-bottom: 30px; }
.tools-head h3 { font-size: 19px; font-weight: 800; }
.tools-head { margin-bottom: 14px; }
.tools-table { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tool-row { display: grid; grid-template-columns: 240px 1fr 130px; gap: 16px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); background: var(--panel); align-items: baseline; transition: background 0.2s; }
.tool-row:hover { background: rgba(15, 21, 33, 0.95); }
.tool-row:last-child { border-bottom: none; }
.tool-row.head { background: rgba(10, 16, 28, 0.9); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); font-weight: 800; }
.tl-name { font-family: var(--font-m); font-size: 12.5px; color: var(--cyan); }
.tl-desc { color: var(--ink-mid); font-size: 12.5px; }
.tl-io { text-align: right; font-family: var(--font-m); font-size: 10.5px; color: var(--ink-faint); }
.tl-io .ro { color: var(--green-br); }
.tl-io .wo { color: var(--amber); }
.tl-io .rl { color: var(--red); }
.tools-more { display: inline-block; margin-top: 14px; color: var(--green-br); font-weight: 700; text-decoration: none; font-size: 14px; }
.tools-more:hover { text-decoration: underline; }

/* ---- playground ---- */
.playground { background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pg-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); gap: 16px; flex-wrap: wrap; }
.pg-head h3 { font-size: 19px; font-weight: 800; margin-bottom: 3px; }
.pg-head .muted { font-size: 12.5px; }
.pg-head .mono { font-size: 11px; color: var(--cyan); }
.pg-status { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-mid); }
.pg-status .ns-dot { background: var(--ink-faint); box-shadow: none; animation: none; }
.pg-status.busy .ns-dot { background: var(--cyan); box-shadow: 0 0 9px var(--cyan); animation: blink 1s infinite; }
.pg-status.ok .ns-dot { background: var(--green-br); box-shadow: 0 0 9px var(--green-glow); animation: none; }
.pg-status.err .ns-dot { background: var(--red); box-shadow: 0 0 9px var(--red); animation: none; }
.pg-body { display: grid; grid-template-columns: 1fr 1.15fr; gap: 0; }
.pg-left { padding: 18px 22px; border-right: 1px solid var(--line-soft); }
.pg-right { padding: 18px 22px; background: rgba(7, 11, 19, 0.5); }
.pg-label { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-faint); margin: 14px 0 7px; }
.pg-label:first-child { margin-top: 0; }
.pg-select {
  width: 100%; background: var(--bg3); color: var(--ink); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 12px; font-family: var(--font-m); font-size: 13px; cursor: pointer;
}
.pg-req {
  width: 100%; background: var(--bg3); color: #c4d3e6; border: 1px solid var(--line);
  border-radius: 9px; padding: 12px 14px; font-size: 12px; line-height: 1.6; resize: vertical; outline: none;
}
.pg-req:focus { border-color: rgba(56, 189, 248, 0.45); }
.pg-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.pg-hint { font-size: 11px; color: var(--ink-faint); }
.pg-res {
  min-height: 260px; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  background: var(--bg3); border: 1px solid var(--line); border-radius: 9px; padding: 14px;
  font-size: 11.5px; line-height: 1.65; color: #9fb3c8;
}
.pg-res.ok { color: #b7e8c9; border-color: rgba(34, 197, 94, 0.25); }
.pg-res.err { color: #f3b0b0; border-color: rgba(239, 68, 68, 0.25); }

/* ===================== CONTROL ROOM ===================== */
#control { padding-top: 30px; }
.layout { display: grid; grid-template-columns: 300px 1fr 320px; gap: 16px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.panel-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; color: var(--ink-faint); margin-bottom: 14px; }
.col-left, .col-right { position: sticky; top: 76px; }
.col-left { display: flex; flex-direction: column; }
.col-left .panel { margin-bottom: 16px; }

.scenario-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.sc-card {
  position: relative; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px;
  cursor: pointer; transition: border-color 0.2s, background 0.2s; background: rgba(10, 15, 24, 0.5);
}
.sc-card:hover { border-color: rgba(56, 189, 248, 0.3); }
.sc-card.selected { border-color: var(--green-br); background: rgba(34, 197, 94, 0.06); box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25), 0 4px 20px rgba(34, 197, 94, 0.08); }
.sc-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; padding-right: 60px; }
.sc-sub { color: var(--ink-mid); font-size: 11.5px; line-height: 1.5; }
.sc-badge { position: absolute; top: 11px; right: 12px; font-size: 8.5px; font-weight: 800; letter-spacing: 0.09em; padding: 3px 7px; border-radius: 5px; }
.sc-badge.hold { background: rgba(245, 158, 11, 0.14); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
.sc-badge.auto { background: rgba(34, 197, 94, 0.12); color: var(--green-br); border: 1px solid rgba(34,197,94,0.3); }
.sc-badge.block { background: rgba(239, 68, 68, 0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }

.btn-run {
  width: 100%; background: linear-gradient(180deg, #1fbf62, #16a34a); color: #04120a;
  font-family: var(--font-d); font-weight: 800; font-size: 14px; border: none; border-radius: 10px;
  padding: 13px; cursor: pointer; transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 6px 22px rgba(22, 163, 74, 0.3);
}
.btn-run:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 9px 30px rgba(22, 163, 74, 0.4); }
.btn-run:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-run.busy { animation: pulsebtn 1.2s infinite; }
@keyframes pulsebtn { 0%, 100% { box-shadow: 0 6px 22px rgba(22, 163, 74, 0.3); } 50% { box-shadow: 0 6px 34px rgba(22, 163, 74, 0.6); } }
.run-meta { font-size: 10.5px; color: var(--ink-faint); margin-top: 10px; min-height: 14px; word-break: break-all; }

.run-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; max-height: 300px; overflow-y: auto; }
.run-item { border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px 12px; cursor: pointer; transition: border-color 0.2s, background 0.2s; background: rgba(10, 15, 24, 0.4); animation: slidein 0.3s ease; }
.run-item:hover { border-color: rgba(56, 189, 248, 0.3); }
.run-item.active { border-color: var(--green-br); background: rgba(34, 197, 94, 0.05); }
.ri-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.ri-id { font-family: var(--font-m); font-size: 10.5px; color: var(--ink-mid); }

.btn-ghost {
  width: 100%; background: transparent; color: var(--ink-mid); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px; font-family: var(--font-d); font-weight: 700; font-size: 12px;
  cursor: pointer; transition: all 0.2s;
}
.btn-ghost:hover { color: var(--ink); border-color: rgba(148, 178, 215, 0.3); }

/* pipeline */
.pipeline { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.pipe-step {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; overflow: hidden; transition: border-color 0.3s, box-shadow 0.3s;
}
.ps-name { font-size: 11px; font-weight: 800; letter-spacing: 0.03em; }
.ps-stat { font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); margin-top: 2px; font-weight: 700; }
.ps-bar { position: absolute; bottom: 0; left: 0; height: 2px; width: 100%; background: transparent; transition: background 0.3s; }
.pipe-step.pending { opacity: 0.55; }
.pipe-step.running { border-color: rgba(56, 189, 248, 0.5); box-shadow: 0 0 24px rgba(56, 189, 248, 0.15); }
.pipe-step.running .ps-name { color: var(--cyan); }
.pipe-step.running .ps-stat { color: var(--cyan); }
.pipe-step.running .ps-bar { background: var(--cyan); animation: barflow 1.4s linear infinite; background: linear-gradient(90deg, transparent, var(--cyan), transparent); background-size: 200% 100%; }
@keyframes barflow { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.pipe-step.done { border-color: rgba(34, 197, 94, 0.35); }
.pipe-step.done .ps-name { color: var(--green-br); }
.pipe-step.done .ps-stat { color: var(--green-br); }
.pipe-step.done .ps-bar { background: var(--green); }
.pipe-step.blocked { border-color: rgba(239, 68, 68, 0.5); box-shadow: 0 0 20px rgba(239, 68, 68, 0.12); }
.pipe-step.blocked .ps-name, .pipe-step.blocked .ps-stat { color: var(--red); }
.pipe-step.blocked .ps-bar { background: var(--red); }
.pipe-step.awaiting { border-color: rgba(245, 158, 11, 0.55); box-shadow: 0 0 24px rgba(245, 158, 11, 0.18); }
.pipe-step.awaiting .ps-name, .pipe-step.awaiting .ps-stat { color: var(--amber); }
.pipe-step.awaiting .ps-bar { background: var(--amber); animation: blink 1.2s infinite; }
.pipe-step.skipped { opacity: 0.4; }
.pipe-step.skipped .ps-stat { color: var(--ink-faint); }

/* stage panel */
.stage-panel { min-height: 420px; }
.stage-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.stage-title { font-size: 19px; font-weight: 800; }
.stage-sub { color: var(--ink-mid); font-size: 13px; }
.stage-body { font-size: 13.5px; }
.hero-empty { padding: 40px 20px; text-align: center; }
.hero-empty-title { font-size: 15px; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.hero-empty p { color: var(--ink-mid); max-width: 420px; margin: 0 auto 6px; font-size: 13px; }

.subhead { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; color: var(--ink-faint); margin: 18px 0 8px; }
.subhead:first-child { margin-top: 0; }
.mono-block {
  font-family: var(--font-m); font-size: 11px; line-height: 1.6; color: #9fb3c8;
  background: rgba(7, 11, 19, 0.65); border: 1px solid var(--line-soft); border-radius: 9px;
  padding: 12px 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow-y: auto;
}
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 100px; background: rgba(148, 178, 215, 0.08); border: 1px solid var(--line); color: var(--ink-mid); }
.pill.ok { border-color: rgba(34, 197, 94, 0.25); color: #86efac; background: rgba(34, 197, 94, 0.06); }
.pill.risk { border-color: rgba(245, 158, 11, 0.25); color: #fcd34d; background: rgba(245, 158, 11, 0.06); }
.steps-list { display: flex; flex-direction: column; gap: 8px; }
.step-row { display: flex; gap: 12px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 9px; background: rgba(10, 15, 24, 0.4); }
.step-id { font-family: var(--font-m); font-size: 11px; color: var(--cyan); min-width: 26px; padding-top: 2px; }
.step-action { font-weight: 700; font-size: 12.5px; }
.step-meta { font-family: var(--font-m); font-size: 10.5px; color: var(--ink-faint); margin-top: 2px; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.kv { background: rgba(10, 15, 24, 0.5); border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px 12px; }
.kv .k { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); font-weight: 800; margin-bottom: 3px; }
.kv .v { font-size: 14px; font-weight: 700; }
.fmt-money { color: #86efac; font-family: var(--font-m); font-size: 13px; }
.verdict-banner { border-radius: 9px; padding: 10px 14px; font-weight: 700; font-size: 12.5px; margin: 8px 0; border: 1px solid; }
.verdict-banner.PASS { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.3); color: #86efac; }
.verdict-banner.HOLD { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.3); color: #fcd34d; }
.verdict-banner.BLOCK { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.verdict-banner.FLAG { background: rgba(56, 189, 248, 0.08); border-color: rgba(56, 189, 248, 0.3); color: #7dd3fc; }
.pol-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); align-items: baseline; }
.pol-row:last-child { border-bottom: none; }
.pol-id { font-family: var(--font-m); font-size: 10.5px; color: var(--cyan); min-width: 52px; }
.pol-main { flex: 1; }
.pol-name { font-weight: 700; font-size: 11.5px; }
.pol-text { color: var(--ink-faint); font-size: 10.5px; margin-top: 1px; }
.pol-verdict { font-size: 9px; font-weight: 800; letter-spacing: 0.07em; padding: 3px 8px; border-radius: 5px; }
.pol-verdict.pass { background: rgba(34, 197, 94, 0.12); color: var(--green-br); }
.pol-verdict.hold { background: rgba(245, 158, 11, 0.12); color: var(--amber); }
.pol-verdict.block { background: rgba(239, 68, 68, 0.1); color: var(--red); }
.pol-verdict.flag { background: rgba(56, 189, 248, 0.1); color: var(--cyan); }
.pol-verdict.deferred { background: rgba(148, 178, 215, 0.1); color: var(--ink-faint); }
.actions-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.actions-table th { text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); padding: 5px 8px; border-bottom: 1px solid var(--line-soft); }
.actions-table td { padding: 6px 8px; border-bottom: 1px dashed var(--line-soft); color: var(--ink-mid); font-family: var(--font-m); font-size: 10.5px; }
.actions-table .http-2xx { color: var(--green-br); }
.actions-table .http-err { color: var(--red); }
.report-card { margin-top: 14px; background: linear-gradient(140deg, rgba(34, 197, 94, 0.05), transparent 60%), rgba(10, 15, 24, 0.5); border: 1px solid rgba(34, 197, 94, 0.2); border-radius: 11px; padding: 14px 16px; }
.rc-eyebrow { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--green-br); font-weight: 800; margin-bottom: 6px; }
.report-card div { font-size: 12.5px; color: var(--ink); line-height: 1.65; }
.mission-id { font-family: var(--font-m); font-size: 11px; color: var(--cyan); word-break: break-all; }

/* event feed */
.event-feed { display: flex; flex-direction: column; gap: 5px; max-height: 420px; overflow-y: auto; }
.ev { display: flex; gap: 9px; padding: 7px 10px; background: rgba(10, 15, 24, 0.5); border: 1px solid var(--line-soft); border-radius: 8px; font-size: 10.5px; animation: slidein 0.3s ease; }
.ev-type { font-family: var(--font-m); color: var(--cyan); font-size: 9.5px; min-width: 86px; padding-top: 1px; }
.ev-line { color: var(--ink-faint); }
.ev-hash { font-family: var(--font-m); color: var(--ink-faint); font-size: 9px; }

/* approval gate */
.approval-gate {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(3, 5, 9, 0.8); backdrop-filter: blur(8px); animation: fadein 0.25s;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.hidden { display: none !important; }
.gate-card {
  width: min(600px, calc(100vw - 40px)); background: linear-gradient(160deg, #0e1522, #0a0f18);
  border: 1px solid rgba(245, 158, 11, 0.35); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), 0 0 60px rgba(245, 158, 11, 0.08);
  animation: gatepop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes gatepop { from { opacity: 0; transform: scale(0.92) translateY(14px); } to { opacity: 1; transform: none; } }
.gate-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line-soft); background: rgba(245, 158, 11, 0.04); }
.gate-eyebrow { display: flex; align-items: center; gap: 9px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; color: var(--amber); margin-bottom: 6px; }
.gate-title { font-size: 20px; font-weight: 800; }
.gate-body { padding: 20px 24px 22px; }
.gate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.gate-reason { font-size: 12.5px; color: #fcd34d; background: rgba(245, 158, 11, 0.07); border: 1px solid rgba(245, 158, 11, 0.25); border-radius: 9px; padding: 10px 14px; margin-bottom: 14px; }
.gate-layers { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.layer-row { display: flex; gap: 10px; align-items: baseline; font-size: 12px; color: var(--ink-mid); }
.layer-badge { font-family: var(--font-m); font-size: 9.5px; font-weight: 700; color: var(--cyan); background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.25); padding: 2px 8px; border-radius: 5px; white-space: nowrap; }
.gate-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; margin-bottom: 12px; }
.approver-input {
  background: var(--bg3); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; font-family: var(--font-d); font-size: 13px; font-weight: 600; outline: none;
}
.approver-input:focus { border-color: rgba(56, 189, 248, 0.45); }
.btn-approve {
  background: linear-gradient(180deg, #1fbf62, #16a34a); color: #04120a; font-weight: 800; font-size: 13px;
  border: none; border-radius: 10px; padding: 11px 20px; cursor: pointer; font-family: var(--font-d);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.3); transition: transform 0.15s;
}
.btn-approve:hover:not(:disabled) { transform: translateY(-1px); }
.btn-approve:disabled, .btn-reject:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-reject {
  background: rgba(239, 68, 68, 0.1); color: #fca5a5; font-weight: 800; font-size: 13px;
  border: 1px solid rgba(239, 68, 68, 0.35); border-radius: 10px; padding: 11px 18px; cursor: pointer; font-family: var(--font-d);
  transition: background 0.2s;
}
.btn-reject:hover:not(:disabled) { background: rgba(239, 68, 68, 0.18); }
.gate-note { text-align: center; }
.gate-note b { color: var(--ink-mid); }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 300;
  background: #0e1522; border: 1px solid rgba(34, 197, 94, 0.35); color: var(--ink);
  padding: 12px 22px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5); animation: toastin 0.3s;
}
@keyframes toastin { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%); } }

/* ===================== FOOTER ===================== */
.footer { border-top: 1px solid var(--line-soft); background: var(--bg2); padding: 56px 24px 40px; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1.2fr 1.6fr 1fr; gap: 30px; align-items: start; }
.footer .logo { font-size: 24px; }
.footer-tag { color: var(--ink-mid); font-size: 13px; line-height: 1.7; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--ink-mid); text-decoration: none; font-size: 13px; font-weight: 600; }
.footer-links a:hover { color: var(--green-br); }
.footer-note { grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid var(--line-soft); font-size: 11.5px; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr 1fr; }
  .col-center { grid-column: 1 / -1; order: -1; }
  .col-left, .col-right { position: static; }
  .proof-grid { grid-template-columns: repeat(3, 1fr); }
  .proof-card.wide { grid-column: span 1; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .pg-body { grid-template-columns: 1fr; }
  .pg-left { border-right: none; border-bottom: 1px solid var(--line-soft); }
}
@media (max-width: 860px) {
  .trans-grid, .loop-note { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-inner { gap: 12px; }
  .layout { grid-template-columns: 1fr; }
  .pipeline { display: flex; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .pipe-step { min-width: 84px; flex: 0 0 auto; }
  .ps-name { font-size: 10px; }
  .ps-stat { font-size: 8px; }
  .proof-grid { grid-template-columns: 1fr 1fr; }
  .pol-trow { grid-template-columns: 70px 1fr 90px; }
  .pol-trow .pt-text { display: none; }
  .tool-row { grid-template-columns: 1fr; gap: 4px; }
  .tl-io { text-align: left; }
  .ae-row { grid-template-columns: 1fr; gap: 6px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  .gate-grid { grid-template-columns: 1fr; }
  .gate-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
