:root {
  --bg: #0a0e14;
  --bg2: #0e141d;
  --panel: #111824;
  --panel2: #0c121b;
  --line: #1d2937;
  --line2: #2a3a4d;
  --ink: #e7eef7;
  --dim: #7d8da0;
  --muted: #58697d;
  --teal: #2ee6c4;
  --teal-d: #18a98f;
  --violet: #8b7dff;
  --amber: #ffce6b;
  --red: #ff5d6c;
  --green: #38e08a;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1100px 600px at 75% -10%, rgba(46,230,196,0.10), transparent 60%),
    radial-gradient(900px 500px at 10% 0%, rgba(139,125,255,0.10), transparent 55%),
    linear-gradient(var(--bg), var(--bg));
}
.bg-grid::after {
  content: ""; position: absolute; inset: 0; opacity: 0.4;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(var(--bg), transparent 70%);
}
main, header, footer { position: relative; z-index: 1; }
main { max-width: 1180px; margin: 0 auto; padding: 0 22px 60px; }
code, .mono, pre { font-family: var(--mono); }
h1, h2, h3, h4 { font-weight: 650; letter-spacing: -0.01em; }
.dim { color: var(--dim); }

/* topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1180px; margin: 0 auto; padding: 18px 22px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  font-size: 26px; color: var(--teal);
  filter: drop-shadow(0 0 10px rgba(46,230,196,0.5));
}
.brand strong { font-size: 17px; letter-spacing: 0.02em; }
.brand .dim { font-weight: 400; }
.brand .tag { display: block; font-size: 12px; color: var(--muted); }
.status-pill {
  font-family: var(--mono); font-size: 12px; color: var(--teal);
  border: 1px solid var(--line2); border-radius: 999px; padding: 5px 12px;
  background: rgba(46,230,196,0.06);
}
.status-pill.err { color: var(--red); border-color: rgba(255,93,108,0.4); background: rgba(255,93,108,0.07); }

/* panels */
h2 { font-size: 20px; margin: 34px 0 14px; }
.builder { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.panel h2 { margin: 0 0 14px; }

/* parties */
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
/* The regenerate button sits on its own line below the From/To cards: span both
   columns and center it as a compact pill (not a stretched full-width bar). */
.parties > .ghost#regen { grid-column: 1 / -1; justify-self: center; white-space: nowrap;
                          padding: 6px 14px; font-size: 12.5px; }
.party { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
/* Wrap the role label to a second line when tight instead of crushing the name into
   one-word-per-line; the dot + name stay together and never shrink below their content. */
.phead { font-size: 13px; font-weight: 600; display: flex; align-items: center;
         flex-wrap: wrap; column-gap: 7px; row-gap: 2px; white-space: nowrap; }
/* Role label always drops to its own line under the name (a consistent subtitle), instead
   of sometimes sitting inline and sometimes wrapping depending on the name's width. */
.phead .role { color: var(--muted); font-weight: 400; font-size: 11px;
               flex-basis: 100%; margin-left: 0; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.a { background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.dot.b { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.addr { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 5px; word-break: break-all; }

/* groups / rows */
.group { margin-top: 16px; }
.group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.group-head h3 { font-size: 13px; margin: 0; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: grid; align-items: center; gap: 8px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
}
.row.input { grid-template-columns: auto 1fr auto; }
.row.output { grid-template-columns: auto 1fr auto; }
.row .ix { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.row input[type="number"], .row input[type="text"] { width: 100%; }
.group.inline { display: flex; gap: 14px; }
.group.inline label { flex: 1; }

label { font-size: 12px; color: var(--dim); display: block; }
input[type="number"], input[type="text"], select {
  margin-top: 4px; width: 100%; background: var(--bg2); color: var(--ink);
  border: 1px solid var(--line2); border-radius: 8px; padding: 7px 9px;
  font-family: var(--mono); font-size: 13px;
}
input[type="number"]:focus, input[type="text"]:focus, select:focus { outline: none; border-color: var(--teal-d); }
.row select { margin-top: 0; }

/* buttons */
button { cursor: pointer; font-family: var(--sans); }
.ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--line2);
  border-radius: 8px; padding: 7px 11px; font-size: 13px; transition: 0.15s;
}
.ghost:hover { border-color: var(--teal-d); color: var(--teal); }
.ghost.sm { padding: 3px 9px; font-size: 12px; }
.x { background: transparent; border: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 2px 4px; }
.x:hover { color: var(--red); }

/* verdict */
.verdict { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.vbadge {
  font-weight: 700; font-size: 14px; padding: 9px 16px; border-radius: 10px;
  letter-spacing: 0.04em; white-space: nowrap;
}
.vbadge.ok { background: rgba(56,224,138,0.13); color: var(--green); border: 1px solid rgba(56,224,138,0.4); }
.vbadge.bad { background: rgba(255,93,108,0.13); color: var(--red); border: 1px solid rgba(255,93,108,0.4); }
.vmsg { font-size: 13px; color: var(--dim); }
.vmsg code { color: var(--amber); }

/* balance bar */
.balance {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 16px;
}
.bcol { display: flex; flex-direction: column; }
.blabel { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.bval { font-family: var(--mono); font-size: 18px; font-weight: 600; }
.bop { font-size: 18px; color: var(--muted); }
.bcheck { margin-left: auto; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 8px; }
.bcheck.ok { color: var(--green); background: rgba(56,224,138,0.12); }
.bcheck.bad { color: var(--red); background: rgba(255,93,108,0.12); }

/* joinsplit */
.joinsplit { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; margin-bottom: 18px; }
.js-col { display: flex; flex-direction: column; gap: 8px; }
.note-card {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  position: relative; transition: 0.15s;
}
.note-card.a { border-left: 3px solid var(--teal); }
.note-card.b { border-left: 3px solid var(--violet); }
.note-card .nv { font-family: var(--mono); font-size: 16px; font-weight: 600; }
.note-card .nmeta { font-size: 10px; color: var(--muted); font-family: var(--mono); margin-top: 2px; word-break: break-all; }
.note-card .nowner { font-size: 11px; color: var(--dim); }
.js-core { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hex { width: 64px; height: 72px; }
.hex polygon { fill: rgba(46,230,196,0.07); stroke: var(--teal); stroke-width: 1.5; filter: drop-shadow(0 0 12px rgba(46,230,196,0.35)); }
.js-core-label { font-size: 11px; color: var(--teal); font-family: var(--mono); }

/* tree */
.tree { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.tree-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.tree-head h3 { font-size: 13px; margin: 0; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); }
.root { font-size: 12px; color: var(--dim); }
.root code { color: var(--teal); font-size: 12px; }
.leaves { display: flex; flex-wrap: wrap; gap: 6px; }
.leaf {
  font-family: var(--mono); font-size: 11px; padding: 5px 8px; border-radius: 7px;
  border: 1px solid var(--line); color: var(--muted); background: var(--bg2); min-width: 34px; text-align: center;
}
.leaf.input { color: var(--teal); border-color: rgba(46,230,196,0.45); background: rgba(46,230,196,0.07); font-weight: 600; }
.leaf .li { font-size: 9px; color: var(--muted); display: block; }

/* publics */
.publics { margin-bottom: 12px; }
.publics h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); margin: 0 0 8px; }
.publics .kv { display: flex; gap: 10px; font-size: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.publics .kv .k { color: var(--muted); min-width: 130px; }
.publics .kv .v { color: var(--ink); word-break: break-all; }

/* witness */
.witness { margin-top: 6px; }
.witness summary { cursor: pointer; font-size: 13px; color: var(--dim); }
.witness summary:hover { color: var(--teal); }
.witness pre {
  margin-top: 10px; max-height: 280px; overflow: auto; font-size: 11px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: #9fb0c4;
}

/* deposit dapp */
.prove-btn {
  width: 100%; background: linear-gradient(90deg, var(--teal-d), var(--teal));
  color: #04231d; border: none; border-radius: 12px; padding: 14px; font-size: 15px; font-weight: 700;
  letter-spacing: 0.02em; transition: 0.15s; box-shadow: 0 10px 30px -12px rgba(46,230,196,0.6); margin-top: 8px;
}
.prove-btn:hover { filter: brightness(1.08); }
.prove-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.prove-status { margin-top: 12px; font-size: 13px; font-family: var(--mono); word-break: normal; overflow-wrap: break-word; }
.prove-status code, .prove-status a { color: var(--teal); }
.prove-status.ok { color: var(--green); }
.prove-status.bad { color: var(--red); }
.prove-status.busy { color: var(--teal); }

.vault-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 8, 14, .78);
}
.vault-dialog {
  width: min(440px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
.vault-dialog h2 { margin: 0 0 8px; font-size: 20px; }
.vault-form { display: grid; gap: 12px; margin-top: 16px; }
.vault-form label { display: grid; gap: 6px; font-size: 13px; }
.vault-form input { width: 100%; }
.vault-error { min-height: 18px; margin: 0; color: var(--red); font-size: 12px; }
.vault-actions { display: flex; justify-content: flex-end; gap: 8px; }
.vault-warning { color: var(--amber); }
.wallet-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.wallet-btn { display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line2); color: var(--ink); border-radius: 10px; padding: 9px 14px; font-size: 13px; cursor: pointer; transition: 0.15s; }
.wallet-btn:hover { border-color: var(--teal-d); }
.wallet-btn.known { border-color: rgba(46,230,196,0.4); }
.wallet-btn img { width: 18px; height: 18px; border-radius: 4px; }
.netrow { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; }
.hint a { color: var(--teal); }
.note-box { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 12px; }
.note-box .kv { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.note-box .kv .k { color: var(--muted); min-width: 130px; }
.note-box .kv .v { color: var(--ink); font-family: var(--mono); word-break: break-all; }
.note-box .kv .v.teal { color: var(--teal); }
.steps { display: flex; flex-direction: column; gap: 6px; color: #9fb0c4; }
.steps code { color: var(--teal); }

/* footer */
footer { max-width: 1180px; margin: 40px auto 30px; padding: 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); display: flex; flex-direction: column; gap: 6px; }
footer code, footer a { color: var(--teal); }

/* ===================== tabs ===================== */
.tabs {
  position: relative; z-index: 1; max-width: 1180px; margin: 6px auto 0; padding: 0 22px;
  display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line);
}
.tab {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--dim); padding: 12px 14px 11px; font-size: 14px; font-weight: 600;
  display: flex; flex-direction: column; gap: 2px; transition: 0.15s; margin-bottom: -1px;
}
.tab .tdesc { font-size: 10px; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.tab.active .tdesc { color: var(--teal-d); }

.tabpanel { display: none; }
.tabpanel.active { display: block; }
.lede { max-width: 880px; margin: 22px 0 18px; font-size: 14px; color: var(--dim); }
.lede b { color: var(--ink); font-weight: 600; }

/* plain-English tab intro + inline note hints (Advanced mode) */
.tab-desc { max-width: 880px; margin: 20px 0 2px; font-size: 14.5px; font-weight: 550; color: var(--ink); }
.tab-desc + .lede { margin-top: 6px; }
.hint { max-width: 660px; margin: 0 0 9px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.hint b { color: var(--dim); font-weight: 600; }

/* "Generate proof" action + build -> prove -> verify flow */
.runbar { display: flex; align-items: center; gap: 13px; margin: 14px 0 16px; flex-wrap: wrap; }
.run { font: 600 13px var(--sans); color: #04110d; background: var(--teal); border: none; border-radius: 9px; padding: 9px 18px; cursor: pointer; transition: filter .12s ease, transform .05s ease, box-shadow .12s ease; }
.run:hover { filter: brightness(1.07); box-shadow: 0 0 0 1px rgba(46,230,196,0.4), 0 6px 18px rgba(46,230,196,0.18); }
.run:active { transform: translateY(1px); }
.run:disabled, .run.busy { opacity: .7; cursor: default; box-shadow: none; }
.proofflow { display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--mono); color: var(--muted); opacity: 0; transition: opacity .2s ease; }
.proofflow.on { opacity: 1; color: var(--teal); }
.proofflow.done { color: var(--teal); font-weight: 600; }
.pf-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 9px var(--teal); animation: pf-pulse .7s ease-in-out infinite; }
.proofflow.done .pf-dot { animation: none; }
@keyframes pf-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

main h2 { margin-top: 4px; }
.parties.two { grid-template-columns: 1fr 1fr; }
.asset { font-size: 11px; color: var(--muted); font-weight: 400; }
.note-card.change { opacity: 0.82; border-style: dashed; }

/* compact balance bar used by dark-pool tabs */
.balance.compact { padding: 9px 14px; margin-bottom: 10px; gap: 10px; }
.balance.compact .bval { font-size: 15px; }
.balance .pstar { margin-left: 14px; font-size: 12px; color: var(--dim); }
.balance .pstar b { color: var(--teal); font-family: var(--mono); }

/* two-stage verdict (place / cancel) */
.stages { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stage { display: flex; gap: 10px; align-items: flex-start; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.stage.ok { border-color: rgba(56,224,138,0.35); }
.stage.bad { border-color: rgba(255,93,108,0.35); }
.stage-badge { font-size: 16px; font-weight: 700; width: 24px; height: 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex: none; }
.stage.ok .stage-badge { color: var(--green); background: rgba(56,224,138,0.13); }
.stage.bad .stage-badge { color: var(--red); background: rgba(255,93,108,0.13); }
.stage-label { font-size: 12px; font-weight: 600; }
.stage-msg { font-size: 11px; color: var(--dim); font-family: var(--mono); margin-top: 2px; }
.stage-msg code { color: var(--amber); }

/* order card */
.ordercard { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; margin-bottom: 14px; }
.ordercard.mini { padding: 10px 12px; font-size: 13px; }
.oc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.oc-terms { font-size: 12px; color: var(--dim); font-family: var(--mono); }
.badge { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 7px; }
.badge.sell { color: var(--amber); background: rgba(255,206,107,0.13); }
.badge.buy { color: var(--violet); background: rgba(139,125,255,0.16); }
.kvgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.kvgrid .kv { display: flex; gap: 8px; font-size: 11px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.kvgrid .k { color: var(--muted); min-width: 78px; }
.kvgrid .v { color: var(--ink); font-family: var(--mono); }

.keymodel { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 11px; color: var(--teal); line-height: 1.9; margin-bottom: 14px; }

/* match */
.crossbar, .orderrow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.orderrow { gap: 10px; }
.orderrow .ordercard { flex: 1; margin-bottom: 0; }
.pill { font-size: 12px; font-family: var(--mono); padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line2); color: var(--dim); }
.pill.ok { color: var(--green); border-color: rgba(56,224,138,0.4); background: rgba(56,224,138,0.07); }
.pill.bad { color: var(--red); border-color: rgba(255,93,108,0.4); background: rgba(255,93,108,0.07); }
.rh { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); margin: 4px 0 8px; }
.settle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.remainder { background: rgba(139,125,255,0.08); border: 1px solid rgba(139,125,255,0.3); border-radius: 10px; padding: 10px 13px; font-size: 12px; color: var(--ink); margin-bottom: 14px; }
.remainder.none { background: var(--panel2); border-color: var(--line); color: var(--muted); }
.remainder b { color: var(--violet); }

/* batch table */
.batchtable { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 13px; }
.batchtable th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line2); }
.batchtable td { padding: 8px; border-bottom: 1px solid var(--line); font-family: var(--mono); }
.batchtable td.mono { font-size: 11px; }
.batchtable tr.sell td:first-child, .batchtable tr.buy td:first-child { border-left: 2px solid transparent; }
.rationed { font-size: 10px; color: var(--amber); background: rgba(255,206,107,0.13); padding: 1px 6px; border-radius: 5px; font-family: var(--sans); }

@media (max-width: 880px) {
  .builder { grid-template-columns: 1fr; }
  .joinsplit { grid-template-columns: 1fr; }
  .js-core { transform: rotate(90deg); margin: 6px 0; }
  .stages, .settle-grid, .kvgrid { grid-template-columns: 1fr; }
}

/* =====================================================================
   DESIGN REFINEMENT PASS — depth · motion · signature ZK moment
   Appended layer: enhances the base styles via the cascade. Non-destructive;
   every original class hook the JS relies on is preserved.
   ===================================================================== */
:root {
  /* nudged for AA legibility on the dark ground */
  --dim: #93a3b8;
  --muted: #6f8298;
  --shadow-lg: 0 26px 64px -30px rgba(0,0,0,0.8), 0 10px 26px -18px rgba(0,0,0,0.6);
  --hi: inset 0 1px 0 rgba(255,255,255,0.05);
}

/* boot fade-in — kills the empty-content flash before the wasm populates */
body { opacity: 0; transition: opacity .55s ease; }
body.loaded { opacity: 1; }

/* living ground: a slow aurora drifting behind the static grid */
.bg-grid::before {
  content: ""; position: absolute; inset: -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 52% at 80% 6%, rgba(46,230,196,0.11), transparent 70%),
    radial-gradient(40% 50% at 10% 2%, rgba(139,125,255,0.11), transparent 70%);
  filter: blur(34px); animation: drift 30s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate3d(-2%,-1%,0) scale(1); } to { transform: translate3d(3%,2%,0) scale(1.09); } }

/* brand: a touch larger, with a soft live heartbeat on the mark + a status dot */
.brand strong { font-size: 18px; }
.brand .logo { animation: logoPulse 4.6s ease-in-out infinite; }
@keyframes logoPulse {
  0%,100% { filter: drop-shadow(0 0 8px rgba(46,230,196,0.45)); }
  50%     { filter: drop-shadow(0 0 17px rgba(46,230,196,0.85)); }
}
.status-pill { backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(46,230,196,0.07); }
.status-pill::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px;
  border-radius: 50%; background: var(--teal); box-shadow: 0 0 8px var(--teal);
  vertical-align: 1px; animation: blink 2.6s ease-in-out infinite;
}
.status-pill.err::before { background: var(--red); box-shadow: 0 0 8px var(--red); }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* tabs: a soft active glow rising from the underline */
.tab { border-radius: 9px 9px 0 0; }
.tab.active { background: linear-gradient(180deg, rgba(46,230,196,0.10), transparent 85%); }

/* panels: real depth — layered drop shadow + top inner highlight + gradient skin */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  box-shadow: var(--shadow-lg), var(--hi);
}
.panel.results { background: linear-gradient(180deg, #121c29, var(--panel2)); }

/* tactile surfaces: gentle hover lift on the interactive cards */
.party, .row, .note-card, .ordercard, .stage, .leaf, .wallet-btn {
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.row:hover, .note-card:hover, .ordercard:hover { transform: translateY(-1px); border-color: var(--line2); }
.ghost { background: rgba(255,255,255,0.018); }
.ghost:hover { background: rgba(46,230,196,0.07); box-shadow: 0 0 0 1px rgba(46,230,196,0.28); }

/* visible, on-brand focus ring (a11y) */
input[type="number"]:focus-visible, input[type="text"]:focus-visible, select:focus-visible,
button:focus-visible, .tab:focus-visible, a:focus-visible {
  outline: 2px solid rgba(46,230,196,0.6); outline-offset: 2px; border-color: var(--teal-d);
}
/* roomier touch targets */
.ghost.sm { padding: 5px 11px; }
.x { padding: 5px 8px; }

/* verdict: the emotional payoff — make "PROOF VALID" glow, with a single light sweep */
.vbadge { font-size: 15px; padding: 11px 18px; position: relative; overflow: hidden; }
.vbadge.ok {
  background: linear-gradient(180deg, rgba(56,224,138,0.20), rgba(56,224,138,0.07));
  box-shadow: 0 0 26px -6px rgba(56,224,138,0.55), inset 0 0 0 1px rgba(56,224,138,0.4);
  animation: verdictIn .42s cubic-bezier(.2,.8,.2,1);
}
.vbadge.ok::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 42%, rgba(255,255,255,0.22) 50%, transparent 58%);
  transform: translateX(-130%); animation: sweep 3.6s ease-in-out 0.5s infinite;
}
.vbadge.bad { box-shadow: 0 0 26px -10px rgba(255,93,108,0.5), inset 0 0 0 1px rgba(255,93,108,0.4); }
@keyframes verdictIn { from { transform: scale(.95); opacity: .35; } to { transform: scale(1); opacity: 1; } }
@keyframes sweep { to { transform: translateX(130%); } }

/* balance bar + values: a hint of depth, tighter numerals */
.balance { background: linear-gradient(180deg, #0f1622, var(--panel2)); box-shadow: var(--hi); }
.bval { letter-spacing: -0.02em; }
.bcheck.ok { box-shadow: inset 0 0 0 1px rgba(56,224,138,0.32); }

/* ===== the signature ZK moment: the joinsplit core ===== */
.joinsplit { gap: 18px; padding: 6px 0 2px; }
.js-core { position: relative; }
.js-core::before {  /* breathing halo behind the proof hex */
  content: ""; position: absolute; left: 50%; top: 46%; width: 128px; height: 128px;
  transform: translate(-50%,-50%); border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(46,230,196,0.24), transparent 64%);
  filter: blur(6px); animation: halo 3.8s ease-in-out infinite;
}
@keyframes halo { 0%,100% { opacity: .5; transform: translate(-50%,-50%) scale(1); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.14); } }
.hex { width: 84px; height: 94px; position: relative; z-index: 1; }
.hex polygon { stroke-width: 1.75; filter: drop-shadow(0 0 16px rgba(46,230,196,0.55)); animation: hexPulse 3.8s ease-in-out infinite; }
@keyframes hexPulse { 0%,100% { fill: rgba(46,230,196,0.06); } 50% { fill: rgba(46,230,196,0.14); } }
.js-core-label { position: relative; z-index: 1; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-size: 9.5px; }
/* note cards: depth tinted by owner, larger value */
.note-card { box-shadow: 0 8px 20px -14px rgba(0,0,0,0.75); }
.note-card.a { box-shadow: 0 8px 22px -14px rgba(46,230,196,0.3); }
.note-card.b { box-shadow: 0 8px 22px -14px rgba(139,125,255,0.3); }
.note-card .nv { font-size: 17px; letter-spacing: -0.02em; }

/* footer link: a real affordance */
footer a { text-decoration: none; border-bottom: 1px solid rgba(46,230,196,0.32); padding-bottom: 1px; }
footer a:hover { border-bottom-color: var(--teal); }

/* respect the user's motion preference — stillness, full legibility */
@media (prefers-reduced-motion: reduce) {
  body { opacity: 1; transition: none; }
  .bg-grid::before, .brand .logo, .status-pill::before,
  .vbadge.ok, .vbadge.ok::after, .js-core::before, .hex polygon { animation: none !important; }
}

/* ---- round 2: brand mark · number motion · proof-recompute pulse ---- */

/* custom brand mark: a hexagon proof shell over a joinsplit node */
.brand .logo { display: inline-flex; align-items: center; line-height: 0; }
.brand .logo svg, .brand .logo img { display: block; width: 30px; height: auto; }

/* balance values count up + pop on change (set by animateNumber in main.js) */
@keyframes pop { 0% { transform: scale(1); } 38% { transform: scale(1.16); color: var(--teal); } 100% { transform: scale(1); } }
.bval.pop { animation: pop .34s cubic-bezier(.2,.8,.2,1); display: inline-block; }

/* a ring of "freshly proven" emitted from the hex on every re-simulation */
.js-core.proving::after {
  content: ""; position: absolute; left: 50%; top: 46%; width: 58px; height: 58px;
  transform: translate(-50%,-50%); border: 1.5px solid var(--teal); border-radius: 50%;
  z-index: 2; pointer-events: none; animation: proofRing .58s ease-out;
}
@keyframes proofRing {
  0%   { opacity: .85; transform: translate(-50%,-50%) scale(.45); }
  100% { opacity: 0;   transform: translate(-50%,-50%) scale(2.3); }
}
.js-core.proving .hex polygon { filter: drop-shadow(0 0 22px rgba(46,230,196,0.9)); }

@media (prefers-reduced-motion: reduce) {
  .bval.pop, .js-core.proving::after { animation: none !important; }
}

/* ===================================================================
   COMPLIANCE-LED LANDING — hero · the three checks · supporting pillars
   =================================================================== */
.hero { position: relative; z-index: 1; max-width: 1180px; margin: 10px auto 0; padding: 22px 22px 6px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--teal); }
.hero-h { font-size: clamp(30px, 5vw, 50px); line-height: 1.04; letter-spacing: -0.022em; font-weight: 700; margin: 14px 0 0; }
.hero-h .grad { background: linear-gradient(100deg, #19FFE0 10%, #9D47FF 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 720px; margin: 16px 0 0; font-size: clamp(14px, 1.5vw, 16px); line-height: 1.6; color: var(--dim); }
.hero-sub b { color: var(--ink); font-weight: 600; }
.trust { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  font-family: var(--mono); font-size: 12px; color: var(--dim); padding: 5px 12px;
  border: 1px solid var(--line2); border-radius: 999px; background: rgba(255,255,255,0.02);
}
.chip.ok { color: var(--green); border-color: rgba(56,224,138,0.4); background: rgba(56,224,138,0.08); }

.compliance { position: relative; z-index: 1; max-width: 1180px; margin: 30px auto 0; padding: 0 22px; }
.comp-head h2 { font-size: 25px; margin: 0; letter-spacing: -0.01em; }
.comp-lede { max-width: 760px; margin: 11px 0 20px; font-size: 14px; line-height: 1.62; color: var(--dim); }
.comp-lede b { color: var(--ink); } .comp-lede i { color: var(--ink); font-style: normal; opacity: .85; }
.comp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.comp-card {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--line); border-radius: 16px; padding: 19px;
  box-shadow: var(--shadow-lg), var(--hi); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.comp-card:hover { transform: translateY(-2px); border-color: var(--line2); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(46,230,196,0.18); }
.comp-ic {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 13px;
  border-radius: 12px; background: rgba(46,230,196,0.07); border: 1px solid rgba(46,230,196,0.22);
}
.comp-ic svg { width: 21px; height: 21px; }
.comp-card h3 { font-size: 15px; margin: 0 0 8px; letter-spacing: -0.005em; }
.comp-card p { font-size: 13px; line-height: 1.58; color: var(--dim); margin: 0 0 13px; }
.comp-card p b { color: var(--ink); font-weight: 600; }
.comp-tag {
  font-family: var(--mono); font-size: 11px; color: var(--teal);
  background: var(--bg2); border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px;
}
.status-grid { grid-template-columns: 1.05fr 1fr 1fr; }
.state-label {
  display: inline-flex; align-items: center; width: fit-content; margin-bottom: 12px;
  font-family: var(--mono); font-size: 11px; border-radius: 999px; padding: 4px 9px;
  border: 1px solid var(--line2); color: var(--dim); background: rgba(255,255,255,0.02);
}
.state-label.live { color: var(--green); border-color: rgba(56,224,138,0.42); background: rgba(56,224,138,0.08); }
.state-label.demo { color: var(--teal); border-color: rgba(46,230,196,0.38); background: rgba(46,230,196,0.07); }
.state-label.testnet { color: var(--violet); border-color: rgba(139,125,255,0.42); background: rgba(139,125,255,0.09); }
.live-card { border-color: rgba(56,224,138,0.25); }
.demo-card { border-color: rgba(46,230,196,0.22); }
.testnet-card { border-color: rgba(139,125,255,0.25); }

.surveillance-panel {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr); gap: 22px; align-items: start;
  background: linear-gradient(180deg, rgba(46,230,196,0.07), var(--panel2));
  border: 1px solid rgba(46,230,196,0.22); border-radius: 16px; padding: 22px;
  box-shadow: var(--shadow-lg), var(--hi);
}
.surveillance-panel h2 { margin: 10px 0 0; font-size: 25px; letter-spacing: -0.01em; }
.surveillance-panel .comp-lede { margin-bottom: 0; }
.surveillance-list { display: grid; gap: 10px; }
.surveillance-list div {
  background: rgba(255,255,255,0.024); border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px;
}
.surveillance-list b { display: block; font-size: 13px; color: var(--ink); margin-bottom: 3px; }
.surveillance-list span { display: block; font-size: 12.5px; line-height: 1.48; color: var(--dim); }

.pillars { position: relative; z-index: 1; max-width: 1180px; margin: 22px auto 0; padding: 0 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.pillar { display: flex; gap: 10px; align-items: flex-start; }
.pillar .pn { font-family: var(--mono); font-size: 12px; color: var(--violet); border: 1px solid var(--line2); border-radius: 7px; padding: 2px 7px; flex: none; }
.pillar b { font-size: 13px; display: block; margin-bottom: 1px; }
.pillar span { font-size: 12px; color: var(--muted); line-height: 1.4; }

.try-divider { position: relative; z-index: 1; max-width: 1180px; margin: 34px auto 0; padding: 0 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.try-divider h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); margin: 0; }
.try-divider p { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.try-divider code { color: var(--teal); }

@media (max-width: 880px) {
  .comp-grid, .status-grid { grid-template-columns: 1fr; }
  .surveillance-panel { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr 1fr; }
}

/* ---- midpoint-peg + hidden-size order controls (Orders tab) ---- */
.refmid { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-top: 10px; padding: 8px 11px; border: 1px solid var(--line2); border-radius: 9px; background: rgba(139,125,255,0.06); }
.refmid b { color: var(--violet); }
.hbadge { font-family: var(--mono); font-size: 10px; color: var(--violet); border: 1px solid rgba(139,125,255,0.4); border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }
.badge.peg { color: var(--violet); background: rgba(139,125,255,0.16); margin-left: 6px; }
.pegbox { background: linear-gradient(180deg, rgba(139,125,255,0.08), var(--panel2)); border: 1px solid rgba(139,125,255,0.3); border-radius: 12px; padding: 13px 15px; margin-bottom: 14px; }
.pegbox.bad { background: linear-gradient(180deg, rgba(255,93,108,0.08), var(--panel2)); border-color: rgba(255,93,108,0.32); }
.pegrow { display: flex; gap: 12px; font-size: 12px; padding: 4px 0; align-items: baseline; }
.pegrow .pegk { font-family: var(--mono); color: var(--muted); min-width: 76px; text-transform: uppercase; letter-spacing: 0.04em; font-size: 10px; flex: none; }
.pegrow .pegv { color: var(--dim); line-height: 1.45; }
.pegrow .pegv b { color: var(--ink); }
.pegbox code { color: var(--teal); }
.pegnote { font-size: 11px; color: var(--muted); margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.pegnote code { color: var(--dim); }

/* ===================== live deployment panel ===================== */
.deployments { max-width: 1100px; margin: 52px auto 0; padding: 0 22px; }
.dep-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.dep-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.dep-net { font-family: var(--mono); font-size: 12px; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; background: var(--panel2); }
.dep-net.ok { color: var(--green); border-color: rgba(56,224,138,0.35); background: rgba(56,224,138,0.07); }
.dep-net.err { color: var(--amber); border-color: rgba(255,206,107,0.35); background: rgba(255,206,107,0.07); }

.dep-list { display: grid; gap: 10px; }
.dep-row {
  display: grid;
  grid-template-columns: 210px 1fr auto auto;
  grid-template-areas: "name addr copy go" "name note copy go";
  align-items: center; gap: 2px 16px;
  text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 18px;
  will-change: transform; /* own compositing layer → rows always paint (fixes invisible-until-hover) */
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.dep-row:hover { border-color: var(--line2); transform: translateY(-1px); background: linear-gradient(180deg, #131d2a, var(--panel)); }
.dep-name { grid-area: name; font-weight: 650; font-size: 15px; }
.dep-addr { grid-area: addr; font-size: 12px; color: var(--teal); word-break: break-all; }
.dep-note { grid-area: note; font-size: 12.5px; color: var(--dim); }
.dep-go { grid-area: go; color: var(--muted); font-size: 16px; }
.dep-row:hover .dep-go { color: var(--teal); }
.dep-copy {
  grid-area: copy; font-family: var(--mono); font-size: 11.5px;
  color: var(--dim); background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 8px; padding: 5px 10px; cursor: pointer; white-space: nowrap; user-select: none;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.dep-copy:hover { color: var(--teal); border-color: var(--teal-d); background: rgba(46,230,196,0.07); }
.dep-copy.copied { color: var(--green); border-color: rgba(56,224,138,0.45); }

.dep-status { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.dep-badge { font-family: var(--mono); font-size: 11.5px; border-radius: 999px; padding: 4px 10px; border: 1px solid var(--line); color: var(--dim); background: var(--panel2); }
.dep-badge.ok { color: var(--green); border-color: rgba(56,224,138,0.3); background: rgba(56,224,138,0.06); }
.dep-badge.warn { color: var(--amber); border-color: rgba(255,206,107,0.3); background: rgba(255,206,107,0.06); }
.dep-badge.info { color: var(--violet); border-color: rgba(139,125,255,0.3); background: rgba(139,125,255,0.06); }

@media (max-width: 640px) {
  .dep-row { grid-template-columns: 1fr auto; grid-template-areas: "name copy" "addr copy" "note copy"; }
  .dep-go { display: none; }
}

/* ===================== CTAs / landing nav ===================== */
.topnav { display: flex; align-items: center; gap: 10px; }
.cta {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 14px/1 var(--sans);
  color: #04110d; background: linear-gradient(135deg, var(--teal), #36d39b);
  border: 1px solid rgba(46,230,196,0.5); border-radius: 11px;
  padding: 12px 18px; text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 10px 26px -14px rgba(46,230,196,0.7), var(--hi);
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}
.cta:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 16px 34px -14px rgba(46,230,196,0.85); }
.cta.sm { padding: 8px 13px; font-size: 13px; border-radius: 9px; }
.cta.secondary { color: var(--ink); background: transparent; border-color: var(--line2); box-shadow: none; }
.cta.secondary:hover { border-color: var(--teal); background: rgba(46,230,196,0.07); filter: none; }

.hero-cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-cta.center { justify-content: center; }

.launch-band { position: relative; z-index: 1; max-width: 760px; margin: 60px auto 0; padding: 0 22px; text-align: center; }
.launch-band h2 { margin: 0 0 8px; font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.01em; }
.launch-band p { margin: 0 auto 22px; max-width: 580px; }

/* ===================== deposit: pool address + copy ===================== */
.copyrow { display: flex; gap: 8px; align-items: center; margin-top: 5px; }
.copyrow input[type="text"] {
  flex: 1; min-width: 0;
  background: var(--bg2); color: var(--ink);
  border: 1px solid var(--line2); border-radius: 8px; padding: 7px 9px;
  font-family: var(--mono); font-size: 12px;
}
.copyrow input[type="text"]:focus { outline: none; border-color: var(--teal-d); }
#copyPool { flex: none; white-space: nowrap; }
#copyPool.copied { color: var(--green); border-color: rgba(56,224,138,0.45); }

/* ===================== elegant selects ===================== */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2393a3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center;
}
select:hover { border-color: var(--line2); }
select:focus { border-color: var(--teal-d); }
select option { background: var(--panel); color: var(--ink); }

/* ===================== sandbox notice (demo app) ===================== */
.sandbox-note {
  position: relative; z-index: 1; /* sit above the fixed .bg-grid (which paints over static content) */
  max-width: 1180px; margin: 14px auto 0; padding: 12px 16px;
  display: flex; gap: 11px; align-items: flex-start;
  background: rgba(46,230,196,0.08);
  border: 1px solid rgba(46,230,196,0.42); border-left: 3px solid var(--teal);
  border-radius: 12px; font-size: 13px; line-height: 1.5; color: var(--ink);
}
.sandbox-note .sb-ic { color: var(--teal); font-size: 16px; font-weight: 700; flex: none; line-height: 1.35; }
.sandbox-note b { color: var(--ink); font-weight: 650; }
@media (min-width: 700px) { .sandbox-note { padding-left: 22px; padding-right: 22px; } }

/* hint that titled values are explained on hover */
.note-card[title], .balance[title], .js-core[title], .addr[title] { cursor: help; }

/* ===================== Guided / Advanced shell + portfolio ===================== */
.modebar { position: relative; z-index: 1; max-width: 1180px; margin: 10px auto 0; padding: 0 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.modeseg { display: inline-flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.modeseg button { font: 500 13px var(--sans); color: var(--dim); background: transparent; border: none; border-radius: 7px; padding: 6px 16px; cursor: pointer; transition: color .12s ease, background .12s ease; }
.modeseg button.on { background: var(--teal); color: #04110d; }
#modeSub { font-size: 12px; }

#simpleView, #proView { position: relative; z-index: 1; }
#simpleView { max-width: 1180px; margin: 18px auto 0; padding: 0 22px; }

.balcard { background: linear-gradient(180deg, rgba(46,230,196,0.06), var(--panel2)); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.balance-available { margin-top: 8px; color: var(--ink); }
.balance-available b { color: var(--teal); }
.association-approval { display: flex; align-items: flex-start; gap: 9px; margin-top: 11px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; background: rgba(255,255,255,0.018); }
.association-approval i { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--muted); flex: none; }
.association-approval span { min-width: 0; display: grid; gap: 2px; }
.association-approval b { color: var(--ink); font-size: 12.5px; }
.association-approval small { color: var(--dim); font-size: 11.5px; line-height: 1.4; overflow-wrap: anywhere; }
.association-approval.pending { border-color: rgba(255,206,107,0.28); background: rgba(255,206,107,0.045); }
.association-approval.pending i { background: var(--amber); box-shadow: 0 0 0 4px rgba(255,206,107,0.08); }
.association-approval.ok { border-color: rgba(56,224,138,0.3); background: rgba(56,224,138,0.045); }
.association-approval.ok i { background: var(--green); box-shadow: 0 0 0 4px rgba(56,224,138,0.08); }
.association-approval.bad { border-color: rgba(255,93,108,0.3); background: rgba(255,93,108,0.045); }
.association-approval.bad i { background: #ff5c7a; box-shadow: 0 0 0 4px rgba(255,93,108,0.08); }
.association-approval.compact { margin-top: 10px; padding: 8px 10px; }
.balance-explainer { margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line); line-height: 1.45; }

.actiongrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.actcard { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; color: var(--ink); transition: border-color .15s ease, background .15s ease; }
.actcard:hover { border-color: var(--line2); }
.actcard.on { border-color: var(--teal-d); background: linear-gradient(180deg, rgba(46,230,196,0.08), var(--panel)); }
.actcard b { font-size: 14px; font-weight: 600; }
.actcard span { font-size: 12px; color: var(--dim); }

.act-item { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 8px 0; border-top: 0.5px solid var(--line); }
.act-item .ai-ic { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--panel2); color: var(--teal); font-size: 13px; flex: none; }
.act-item .ai-t { margin-left: auto; color: var(--muted); font-size: 12px; }
.act-item.pending .ai-ic { color: var(--dim); }
.act-item.pending span:not(.ai-ic):not(.ai-t) { color: var(--dim); }
.act-item.failed .ai-ic { color: #ff5c7a; }
.act-item.failed span:not(.ai-ic):not(.ai-t) { color: #ff8ca0; }

.order-explainer { margin-top: 10px; line-height: 1.5; }
.guided-orders { margin-top: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,0.018); }
.guided-orders-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.guided-orders-head b { color: var(--ink); font-size: 12.5px; }
.guided-orders-head span { color: var(--dim); font-size: 11.5px; text-align: right; }
.guided-order-row { padding: 9px 0; border-top: 1px solid rgba(255,255,255,0.045); font-size: 12px; }
.guided-order-row:first-of-type { border-top: 0; }
.guided-order-row > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.guided-order-row b { color: var(--ink); font-family: var(--mono); font-size: 12px; }
.guided-order-state { flex: none; border: 1px solid var(--line2); border-radius: 999px; padding: 3px 8px; color: var(--dim); font-size: 10.5px; }
.guided-order-state.ready { color: var(--amber); border-color: rgba(255,206,107,0.38); background: rgba(255,206,107,0.07); }
.guided-order-state.warn { color: #ffb0bd; border-color: rgba(255,93,108,0.36); background: rgba(255,93,108,0.07); }
.guided-order-state.cancelled, .guided-order-state.settled { color: var(--green); border-color: rgba(56,224,138,0.34); background: rgba(56,224,138,0.06); }
.guided-order-links { margin-top: 5px; color: var(--dim); }
.guided-order-links a { color: var(--teal); }
.guided-order-note { margin-top: 7px; padding: 7px 8px; border-left: 2px solid #ff8ca0; background: rgba(255,93,108,0.06); color: #ffb0bd; line-height: 1.45; }
.guided-order-note.pending { border-left-color: var(--amber); background: rgba(255,206,107,0.06); color: var(--amber); }
.guided-settle-retry { display: block; margin-top: 7px; }

.rfq-box { margin-top: 12px; }
.rfq-empty { color: var(--dim); font-size: 12px; padding: 9px 0; }
.rfq-card {
  padding: 11px; border: 1px solid var(--line); border-radius: 11px;
  background: rgba(255,255,255,0.018); font-size: 12px;
}
.rfq-card.quoted, .rfq-card.matched, .rfq-card.accepted {
  border-color: rgba(46,230,196,0.42); background: rgba(46,230,196,0.06);
}
.rfq-card.no_quote, .rfq-card.unmatched, .rfq-card.cancelled { opacity: .76; }
.rfq-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.rfq-head b { color: var(--ink); font-size: 12.5px; }
.rfq-head span { color: var(--teal); text-transform: uppercase; letter-spacing: .05em; font-size: 10px; }
.rfq-detail { color: var(--dim); margin-top: 5px; overflow-wrap: anywhere; }
.rfq-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.rfq-actions .prove-btn.sm { width: auto; margin: 0; padding: 5px 11px; font-size: 12px; box-shadow: none; }
.rfq-disclosure { color: var(--muted); margin-top: 9px; line-height: 1.4; }

.chain-sync { display: flex; align-items: center; gap: 8px; margin-top: 12px; border-top: 1px solid var(--bg2); padding-top: 12px; color: var(--dim); font-size: 12px; line-height: 1.35; }
.chain-sync .sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.chain-sync.busy .sync-dot { background: var(--teal); box-shadow: 0 0 0 4px rgba(46,230,196,0.08); }
.chain-sync.ok .sync-dot { background: var(--green); }
.chain-sync.bad .sync-dot { background: #ff5c7a; }
.chain-sync .sync-label { color: var(--ink); font-weight: 650; }
.chain-sync .sync-meta { min-width: 0; overflow-wrap: anywhere; }

.proof-job {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 11px; border: 1px solid rgba(255,206,107,0.32);
  border-radius: 10px; background: rgba(255,206,107,0.08); font-size: 12px;
}
.proof-job > div { min-width: 180px; flex: 1; }
.proof-job b { display: block; color: var(--ink); }
.proof-job span { display: block; color: var(--dim); overflow-wrap: anywhere; }
.proof-job.ok { border-color: rgba(56,224,138,0.36); background: rgba(56,224,138,0.08); }
.proof-job.bad { border-color: rgba(255,93,108,0.36); background: rgba(255,93,108,0.08); }

.readiness-panel {
  margin: 12px 0 14px; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; background: rgba(255,255,255,0.018);
}
.ready-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 13px; }
.ready-head b { color: var(--ink); }
.ready-head a { color: var(--teal); font-size: 12px; white-space: nowrap; }
.ready-row { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; border-top: 1px solid rgba(255,255,255,0.035); }
.ready-row:first-child { border-top: 0; }
.ready-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.ready-row.ok .ready-dot { background: var(--green); }
.ready-row.warn .ready-dot { background: var(--amber); }
.ready-row.bad .ready-dot { background: var(--red); }
.ready-row.busy .ready-dot { background: var(--teal); box-shadow: 0 0 0 4px rgba(46,230,196,0.08); }
.ready-row b { display: block; font-size: 12.5px; color: var(--ink); }
.ready-row span { display: block; font-size: 12px; color: var(--dim); overflow-wrap: anywhere; }

.asp-config {
  display: flex; align-items: flex-end; gap: 10px; margin: 10px 0 12px;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2);
}
.asp-config label { flex: 1; min-width: 220px; margin: 0; }
.asp-config button { flex: none; margin-bottom: 1px; }

.tx-progress { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: rgba(255,255,255,0.018); }
.tx-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; }
.tx-step { min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 11.5px; line-height: 1.25; }
.tx-step i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--line2); background: var(--panel2); flex: none; }
.tx-step.done { color: var(--ink); }
.tx-step.done i { border-color: var(--green); background: var(--green); }
.tx-step.active { color: var(--teal); }
.tx-step.active i { border-color: var(--teal); background: var(--teal); box-shadow: 0 0 0 4px rgba(46,230,196,0.08); }
.tx-step.error { color: #ff8ca0; }
.tx-step.error i { border-color: #ff5c7a; background: #ff5c7a; }
.tx-progress-msg { margin-top: 8px; color: var(--dim); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.tx-progress.ok .tx-progress-msg { color: var(--green); }
.tx-progress.bad .tx-progress-msg { color: #ff8ca0; }

@media (max-width: 560px) {
  .actiongrid { grid-template-columns: 1fr; }
  .guided-orders-head, .guided-order-row > div:first-child { align-items: flex-start; flex-direction: column; }
  .guided-orders-head span { text-align: left; }
}
@media (max-width: 560px) {
  .asp-config { flex-direction: column; align-items: stretch; }
  .asp-config label { min-width: 0; }
  .asp-config button { width: 100%; }
}

/* ===================================================================
   MOBILE PASS — phone-first refinements
   Appended layer; non-destructive. Targets real handset widths so the
   shielded-pool + dark-pool UI is comfortable and tap-friendly on a phone:
   no horizontal overflow, no iOS focus-zoom, tables that scroll in place,
   and a topbar/forms that stack cleanly.
   =================================================================== */

/* never let a stray element (or the drifting aurora) create a sideways scroll */
html, body { max-width: 100%; }
body { overflow-x: hidden; }

@media (max-width: 640px) {
  /* tighten the 22px gutter on every full-width section to reclaim width */
  main, .topbar, .tabs, .hero, .compliance, .pillars, .try-divider,
  .deployments, .launch-band, .sandbox-note, .modebar, #simpleView {
    padding-left: 16px; padding-right: 16px;
  }
  main { padding-bottom: 48px; }

  /* topbar: brand on top, nav on its own full-width row, drop the long tagline */
  .topbar { flex-wrap: wrap; gap: 10px; padding-top: 14px; padding-bottom: 14px; }
  .brand .tag { display: none; }
  .topnav { width: 100%; flex-wrap: wrap; gap: 8px; align-items: center; }
  .topnav .status-pill { margin-left: auto; }

  /* headings scaled so they never crowd the gutter */
  h2 { font-size: 18px; }
  .comp-head h2 { font-size: 21px; }
  .dep-head h2 { font-size: 19px; }

  /* 16px inputs → iOS Safari won't auto-zoom the page when a field gains focus */
  input[type="number"], input[type="text"], select { font-size: 16px; }

  /* stack party cards (incl. the 3-up row with the Generate-Sample button) */
  .parties, .parties.two { grid-template-columns: 1fr; }
  .parties .ghost { width: 100%; }

  /* paired number fields stay side-by-side but wrap cleanly when too tight */
  .group.inline { flex-wrap: wrap; gap: 10px; }
  .group.inline label { min-width: 130px; }

  /* tabs: tighter so all five fit in two tidy rows */
  .tabs { gap: 4px; }
  .tab { padding: 10px 11px 9px; font-size: 13px; }

  /* the wide batch table scrolls inside its panel instead of breaking the page */
  #bResults { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .batchtable { min-width: 440px; }

  /* full-width, thumb-friendly hero CTAs */
  .hero-cta .cta { flex: 1 1 auto; justify-content: center; }

  footer { padding: 18px 16px; }
}

@media (max-width: 520px) {
  /* single-column supporting pillars on the smallest handsets */
  .pillars { grid-template-columns: 1fr; }
}


/* ===================================================================
   PM SIMPLIFICATION PASS — guided default, advanced details collapsed
   =================================================================== */
.first-run { max-width: 780px; margin: 0 auto; }
.hero-mark { display: inline-flex; color: var(--teal); font-size: 30px; margin-bottom: 4px; }
.first-copy { max-width: 620px; }
.first-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; margin-top: 18px; text-align: left; }
.first-grid h3, .setup-card h3 { font-size: 13px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.setup-card { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.setup-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.guided-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.guided-head h2 { margin: 0; }
.status-pill.compact { font-family: var(--sans); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.actiongrid .actcard b { font-size: 14px; }
.deposit-flow .panel.controls { position: sticky; top: 12px; }
.step-card { background: rgba(255,255,255,0.015); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.advanced-box { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); padding: 0; }
.advanced-box summary { cursor: pointer; padding: 11px 13px; color: var(--dim); font-size: 13px; font-weight: 600; }
.advanced-box summary:hover { color: var(--teal); }
.advanced-box[open] { padding: 0 13px 13px; }
.advanced-box[open] summary { margin: 0 -13px 12px; border-bottom: 1px solid var(--line); }
.real-deposit { margin-top: 18px; }
.comp-ic { color: var(--teal); font: 700 16px var(--mono); }
.doc .quickstart { background: linear-gradient(180deg, rgba(46,230,196,0.08), var(--panel2)); border: 1px solid rgba(46,230,196,0.25); border-radius: 14px; padding: 18px; margin: 20px 0 18px; }
.doc .quickstart h2 { margin: 0 0 14px; padding: 0; border: none; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-grid div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.quick-grid b { display: block; margin-bottom: 4px; }
.quick-grid span { display: block; color: var(--dim); font-size: 12.5px; line-height: 1.45; }

@media (max-width: 760px) {
  .first-grid, .quick-grid { grid-template-columns: 1fr; }
  .deposit-flow .panel.controls { position: static; }
}
