/* ============================================================
   Comopair - the visual system.

   Warm paper, ink and gold: a commodity desk's palette. Hairline rules
   separate sections; large numbers carry the page. Two families only:
   sans for numbers and headings, mono for labels and addresses.
   ============================================================ */

:root {
  color-scheme: light;
  --paper: #f3f0ea;
  --surface: #f8f6f2;
  --raised: #ffffff;
  --sunken: #ebe7df;
  --ink: #0f0f0e;
  --ink-soft: #55524c;
  --muted: #8b877f;
  --faint: #b6b0a6;
  --line: #dad5cb;
  --line-soft: #e6e1d8;
  --gold: #a8801f;
  --gold-soft: #f1e6c8;
  --gold-ink: #6b4f0e;
  --err: #a8322a;
  --ok: #2f6b3f;
  --on-ink: #ffffff;
  --shadow: 0 1px 0 rgba(15, 15, 14, .04);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --pad: clamp(16px, 4vw, 44px);
  --wrap: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #121210;
    --surface: #191916;
    --raised: #1f1f1b;
    --sunken: #25241f;
    --ink: #f1ede4;
    --ink-soft: #c2bdb2;
    --muted: #8f8a80;
    --faint: #5d5951;
    --line: #34322c;
    --line-soft: #2a2924;
    --gold: #d6a93a;
    --gold-soft: #3a3020;
    --gold-ink: #f0cf7a;
    --err: #e0705f;
    --ok: #6cc085;
    --on-ink: #121210;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--sans);
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
::selection { background: var(--gold); color: #fff; }
code { font-family: var(--mono); font-size: .92em; background: var(--sunken); padding: 1px 5px; }
p { margin: 0 0 12px; }

.wrap        { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 var(--pad); }
.section { padding: 34px 0; }
.pt-0 { padding-top: 0; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; } .mt-3 { margin-top: 34px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 10px; } .mb-2 { margin-bottom: 20px; }
.ml-1 { margin-left: 10px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.nowrap, .nowrap { flex-wrap: nowrap; }
.row.between, .between { justify-content: space-between; }
.row-between { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.min0 { min-width: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.gold { color: var(--gold); }
.err-text { color: var(--err); }
.warn-text { color: var(--gold); }

.eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.eyebrow-rule { display: flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.eyebrow-rule::before, .eyebrow-rule::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.eyebrow-rule.left::before { display: none; }
.eyebrow-rule.left::after { max-width: 120px; }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; margin: 0 0 12px; }
h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.08; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.display { font-size: clamp(52px, 12vw, 128px); font-weight: 500; letter-spacing: -0.045em; line-height: .95; margin: 0; }
.display .frac { color: var(--faint); }
.display-unit { font-size: .28em; letter-spacing: .02em; margin-left: .25em; color: var(--gold); font-family: var(--mono); vertical-align: .9em; }
.display-muted { color: var(--faint); font-size: clamp(40px, 7vw, 72px); }
.display-page { font-size: clamp(38px, 8vw, 72px); margin-top: 14px; }
.lede { color: var(--ink-soft); max-width: 66ch; font-size: 15px; }

/* ---------- navigation ---------- */
.nav { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 40; }
.nav-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); height: 60px; display: flex; align-items: center; gap: 24px; }
.nav-brand { font-weight: 650; letter-spacing: -0.02em; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.nav-brand:hover { text-decoration: none; }
.nav-chain { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line); padding-left: 24px; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.nav-links a { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.nav-links a:hover, .nav-links a.on { color: var(--ink); }
.nav-links a.nav-agent { color: var(--gold); }
.banner { background: var(--gold-soft); color: var(--gold-ink); text-align: center; font-size: 12.5px; padding: 8px var(--pad); border-bottom: 1px solid var(--line); }
@media (max-width: 820px) {
  .nav-inner { height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; gap: 12px; }
  .nav-chain { display: none; }
  .nav-links { width: 100%; margin-left: 0; gap: 16px; overflow-x: auto; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--sans);
  font-size: 13.5px; font-weight: 500; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); cursor: pointer; transition: background .12s, border-color .12s, opacity .12s; white-space: nowrap;
}
.btn:hover { background: var(--sunken); text-decoration: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink-soft); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-ink); border-color: var(--gold-ink); }
.btn-ghost { border-color: transparent; color: var(--ink-soft); }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-row.end { justify-content: flex-end; }
.btn-row.between { justify-content: space-between; }

/* ---------- panels, stats, cells ---------- */
.panel { border: 1px solid var(--line); background: var(--surface); padding: 20px; margin-bottom: 16px; }
.panel-title { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
details.panel > summary { list-style: none; cursor: pointer; font-weight: 500; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: " +"; font-family: var(--mono); color: var(--muted); }
details.panel[open] > summary::after { content: " -"; }
.empty { text-align: center; padding: 56px 24px; }
.empty h2 { margin-bottom: 8px; }
.empty-sm { padding: 18px 20px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--line); background: var(--surface); }
.stat { padding: 16px 20px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat-k { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.stat-v { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.stat-v .unit { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--muted); margin-left: 6px; text-transform: uppercase; }
.stat-split { display: flex; gap: 8px; font-family: var(--mono); }
.stat-split span::after { content: "%"; font-size: 11px; color: var(--muted); }
@media (max-width: 640px) { .stat { border-left: 0; border-top: 1px solid var(--line); } .stat:first-child { border-top: 0; } }

.cells { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); background: var(--surface); }
.cell { padding: 14px 18px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); min-width: 0; }
.cell:nth-child(-n+2) { border-top: 0; }
.cell:nth-child(odd) { border-left: 0; }
.cell-k { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.cell-v { font-family: var(--mono); font-size: 13.5px; word-break: break-word; }
@media (max-width: 560px) { .cells { grid-template-columns: 1fr; } .cell { border-left: 0; border-top: 1px solid var(--line); } .cell:first-child { border-top: 0; } }
.soon { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 2px 7px; white-space: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--line); padding: 3px 8px; color: var(--muted); }
.badge-live { border-color: var(--ok); color: var(--ok); }
.badge-gold { border-color: var(--gold); color: var(--gold); }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 54px 0 30px; }
.hero .eyebrow-rule { justify-content: center; margin-bottom: 22px; }
.hero .eyebrow-rule::before, .hero .eyebrow-rule::after { max-width: 90px; }
.hero-sub { margin-top: 16px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.hero-sub b { color: var(--ink-soft); font-weight: 500; }
.hero-lede { margin: 22px auto 0; text-align: center; }
.hero-cta { justify-content: center; margin-top: 22px; }

.deck { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
@media (max-width: 980px) { .deck { grid-template-columns: 1fr; } }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.sec-head h2 { margin: 0; font-size: 21px; }
.sec-head .links { display: flex; gap: 18px; font-size: 13px; color: var(--ink-soft); }

/* ---------- podium ---------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); background: var(--surface); }
.podium-step { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-left: 1px solid var(--line); min-width: 0; }
.podium-step:first-child { border-left: 0; }
.podium-step:hover { background: var(--raised); text-decoration: none; }
.podium-1 { background: var(--gold-soft); }
.podium-rank { font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--gold); }
.podium-logo { width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--line); margin: 4px 0; }
.podium-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-sym, .podium-share { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.podium-score { font-family: var(--mono); font-size: 13px; }
@media (max-width: 640px) { .podium { grid-template-columns: 1fr; } .podium-step { border-left: 0; border-top: 1px solid var(--line); } .podium-step:first-child { border-top: 0; } }

.steps4 { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); background: var(--surface); }
.step4 { padding: 18px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.step4:nth-child(-n+2) { border-top: 0; }
.step4:nth-child(odd) { border-left: 0; }
.step4-no { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: var(--gold); margin-bottom: 10px; }
.step4-t { font-size: 15px; font-weight: 550; margin-bottom: 6px; }
.step4-d { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
@media (max-width: 640px) { .steps4 { grid-template-columns: 1fr; } .step4 { border-left: 0; border-top: 1px solid var(--line); } .step4:first-child { border-top: 0; } }

/* ---------- pairs ---------- */
.pairs { border: 1px solid var(--line); background: var(--surface); }
.pairs-row { display: grid; grid-template-columns: 140px 1fr; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line-soft); align-items: center; }
.pairs-row:first-child { border-top: 0; }
.pairs-k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pairs-v { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-static, .pair-tag { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); padding: 3px 8px; background: var(--raised); }
.pair-tag { font-size: 9.5px; padding: 1px 6px; color: var(--gold); border-color: var(--gold); background: transparent; margin-left: 6px; }
@media (max-width: 560px) { .pairs-row { grid-template-columns: 1fr; } }

.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.chips-k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.chip { font-family: var(--mono); font-size: 11.5px; color: var(--ink); border: 1px solid var(--line); background: transparent; padding: 5px 11px; cursor: pointer; }
.chip:hover, .chip-on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); text-decoration: none; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- token cards ---------- */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tcard { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); min-width: 0; }
.tcard:hover { background: var(--raised); text-decoration: none; }
.tcard-top { display: flex; gap: 12px; align-items: center; }
.tcard-logo { width: 42px; height: 42px; object-fit: cover; background: var(--sunken); border: 1px solid var(--line); flex: 0 0 auto; }
.tcard-logo-blank { display: grid; place-items: center; font-family: var(--mono); font-size: 12px; color: var(--muted); width: 42px; height: 42px; background: var(--sunken); border: 1px solid var(--line); }
.tcard-id { min-width: 0; }
.tcard-name { font-size: 15px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard-sym { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tcard-desc { font-size: 13px; color: var(--ink-soft); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard-agent { font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.tcard-foot { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 9px; margin-top: auto; }
.agent-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--gold); display: inline-block; flex: 0 0 auto; box-shadow: 0 0 0 3px var(--gold-soft); }

/* ---------- activity feed ---------- */
.feed { border: 1px solid var(--line); background: var(--surface); }
.feed-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line-soft); align-items: center; font-size: 13px; }
.feed-row:first-child { border-top: 0; }
.feed-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--line); padding: 2px 6px; text-align: center; color: var(--muted); }
.feed-burn, .feed-prize { color: var(--gold); border-color: var(--gold); }
.feed-launch { color: var(--ok); border-color: var(--ok); }
.feed-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-time { font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }

/* ---------- leaderboard & tables ---------- */
.lb { border: 1px solid var(--line); background: var(--surface); }
.lb-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 90px 160px 80px; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line-soft); align-items: center; font-size: 13.5px; }
.lb-5 { grid-template-columns: 90px repeat(4, minmax(0, 1fr)); }
.lb-row:first-child { border-top: 0; }
a.lb-row:hover { background: var(--raised); text-decoration: none; }
.lb-head { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lb-rank { font-family: var(--mono); color: var(--muted); }
.lb-agent { display: flex; gap: 10px; align-items: center; min-width: 0; }
.lb-agent img, .lb-blank { width: 28px; height: 28px; object-fit: cover; border: 1px solid var(--line); background: var(--sunken); flex: 0 0 auto; }
.lb-agent > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-top { background: var(--gold-soft); }
.lb-top .lb-rank { color: var(--gold); font-weight: 600; }
.r { text-align: right; }
@media (max-width: 700px) { .lb-row { grid-template-columns: 34px minmax(0, 1fr) 110px; } .lb-row > :nth-child(3), .lb-row > :nth-child(5) { display: none; } .lb-5 { grid-template-columns: 70px 1fr 1fr; } .lb-5 > :nth-child(4), .lb-5 > :nth-child(5) { display: none; } }

.evrow { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.evrow:first-child { border-top: 0; }
.evrow .k { font-size: 13px; }
.evrow .t { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.ev-glyph { color: var(--gold); text-align: center; }
.ev-amt { color: var(--gold-ink); font-size: 12.5px; }

/* ---------- chat ---------- */
.chat-card { border: 1px solid var(--line); background: var(--raised); display: flex; flex-direction: column; min-height: 520px; position: sticky; top: 76px; }
.chat-card-head { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-card-head > div { flex: 1; min-width: 0; }
.chat-card-t { font-weight: 600; }
.chat-card-d { font-size: 12px; color: var(--muted); }
.chat { display: flex; flex-direction: column; min-height: 0; }
.chat-compact { height: 520px; }
.chat-full { height: calc(100vh - 230px); min-height: 520px; border: 1px solid var(--line); background: var(--raised); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 13px; font-size: 13.5px; line-height: 1.55; word-wrap: break-word; }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: 4px 0 8px; padding-left: 20px; } .msg li { margin: 2px 0; }
.msg a { text-decoration: underline; text-underline-offset: 2px; }
.msg code { font-size: .9em; }
.msg .addr { font-size: .88em; word-break: break-all; }
.md-pre { background: var(--sunken); padding: 8px 10px; overflow-x: auto; font-size: 12px; margin: 6px 0; white-space: pre-wrap; }
.md-table { border-collapse: collapse; font-size: 12.5px; margin: 6px 0; width: 100%; }
.md-table th, .md-table td { border: 1px solid var(--line); padding: 4px 7px; text-align: left; }
.msg-user { align-self: flex-end; background: var(--ink); color: var(--on-ink); }
.msg-agent { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }
.msg-event { align-self: center; font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: center; max-width: 95%; padding: 2px 8px; }
.msg-tools { align-self: flex-start; font-family: var(--mono); font-size: 10.5px; color: var(--gold); padding: 0 4px; }
.msg-tools::before { content: "\2699  "; }
.msg-action { align-self: stretch; max-width: 100%; border: 1px solid var(--gold); background: var(--gold-soft); }
.action-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.action-kind { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; }
.action-status { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.action-sum { margin-bottom: 10px; font-weight: 500; }
.action-confirmed { border-color: var(--ok); background: transparent; }
.action-confirmed .action-status { color: var(--ok); }
.action-failed { border-color: var(--err); background: transparent; }
.action-failed .action-status { color: var(--err); }
.action-cancelled { border-color: var(--line); background: transparent; opacity: .75; }
.action-file { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 10px; }
.action-file input { display: block; margin-top: 4px; font-size: 12px; }
.action-log { font-family: var(--mono); font-size: 11px; white-space: pre-wrap; margin: 10px 0 0; color: var(--ink-soft); max-height: 180px; overflow: auto; }
.action-tx { font-family: var(--mono); font-size: 11px; margin-top: 6px; }
.chat-typing { display: flex; gap: 8px; align-items: center; padding: 4px 16px 8px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 999px; background: var(--gold); animation: blink 1.2s infinite both; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 160px; font-family: var(--sans); font-size: 14px; }
.chat-foot { font-size: 11px; color: var(--muted); padding: 0 12px 10px; }
.chat-foot a { text-decoration: underline; }

.agent-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; padding-top: 24px; padding-bottom: 24px; }
@media (max-width: 980px) { .agent-page { grid-template-columns: 1fr; } }
.agent-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.agent-title { margin: 0; font-size: 26px; }
.agent-sub { font-size: 12.5px; color: var(--muted); }
.agent-avatar { width: 52px; height: 52px; object-fit: cover; border: 1px solid var(--line); }
.agent-avatar-mark { display: inline-flex; gap: 3px; align-items: center; justify-content: center; background: var(--surface); }
.agent-avatar-sm { width: 34px; height: 34px; object-fit: cover; border: 1px solid var(--line); }
.agent-side .panel { margin-bottom: 14px; }
.prompts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.prompt { font-size: 12px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); padding: 6px 10px; cursor: pointer; text-align: left; font-family: var(--sans); }
.prompt:hover { border-color: var(--gold); color: var(--gold-ink); }
.memories { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.memory { display: flex; gap: 8px; justify-content: space-between; font-size: 12.5px; border-bottom: 1px solid var(--line-soft); padding-bottom: 6px; }
.memory-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; }
.memory-x:hover { color: var(--err); }
.agent-list { display: flex; flex-direction: column; }
.agent-list a { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.agent-list a:first-child { border-top: 0; }
.agent-list a.on { font-weight: 600; }
.agent-list .muted { margin-left: auto; font-family: var(--mono); font-size: 11px; }

/* ---------- token page ---------- */
.token-head { display: flex; gap: 18px; align-items: center; }
.token-logo { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--line); flex: 0 0 auto; }
.token-agent-line { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 13.5px; flex-wrap: wrap; }
.split-bar { display: flex; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; border: 1px solid var(--line); }
.split-bar span { padding: 8px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--sunken); }
.split-bar .gold-bg { background: var(--gold); color: #fff; }
.split-bar .ink-bg { background: var(--ink); color: var(--on-ink); }
.addr-list { display: flex; flex-direction: column; gap: 8px; }
.addr-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.addr-row code { background: transparent; padding: 0; font-size: 12px; word-break: break-all; }
.addr-k { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- trade widget ---------- */
.swap { border: 1px solid var(--line); background: var(--raised); padding: 18px; }
.swap-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.swap-head h3 { margin: 0; font-size: 15px; }
.swap-head .rsv { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); padding: 3px; gap: 3px; border-radius: 999px; background: var(--sunken); margin-bottom: 14px; }
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.seg button { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 8px 0; border: 0; background: transparent; color: var(--ink-soft); border-radius: 999px; cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--ink); color: var(--on-ink); }
.swap-field { border-top: 1px solid var(--line-soft); padding: 12px 0; }
.swap-field:first-of-type { border-top: 0; }
.swap-label { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.swap-amount { width: 100%; border: 0; background: transparent; padding: 0; font-family: var(--mono); font-size: 26px; color: var(--ink); }
.swap-amount:focus { outline: none; }
.swap-amount::placeholder { color: var(--faint); }
.swap-out { font-family: var(--mono); font-size: 15px; }
.swap-bal { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.swap-bal strong { color: var(--ink-soft); letter-spacing: 0; text-transform: none; }
.swap-bal .btn { margin-left: auto; }
.swap-cta { width: 100%; margin-top: 6px; }
.swap-note { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 12px; line-height: 1.6; }

/* ---------- wizard ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--ink); margin-bottom: 30px; }
.step { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 0; border-left: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; text-align: left; font-family: var(--sans); width: 100%; }
.step:first-child { border-left: 0; }
.step[aria-selected="true"] { background: var(--ink); color: var(--on-ink); }
.step-no { font-family: var(--mono); font-size: 11px; color: var(--gold); align-self: flex-start; padding-top: 3px; }
.step-body { flex: 1; min-width: 0; }
.step-t { display: block; font-size: 15px; font-weight: 550; }
.step-d { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 3px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr 1fr; } .step:nth-child(3) { border-left: 0; } .step:nth-child(n+3) { border-top: 1px solid var(--ink); } }

.field { margin-bottom: 18px; }
.field > label, .field-label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 7px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
input[type="text"], input[type="number"], input[type="password"], textarea, select {
  width: 100%; font-family: var(--sans); font-size: 14px; color: var(--ink); background: var(--sunken);
  border: 1px solid var(--line); padding: 11px 13px; border-radius: 0; -webkit-appearance: none; appearance: none;
}
input.mono, textarea.mono { font-family: var(--mono); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); background: var(--raised); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; }
.search { max-width: 360px; }
.inline-input { width: 220px !important; padding: 6px 10px !important; font-size: 12px !important; }
.prefixed { display: flex; border: 1px solid var(--line); background: var(--sunken); }
.prefixed:focus-within { border-color: var(--ink); background: var(--raised); }
.prefixed-tag { font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding: 11px 0 11px 13px; white-space: nowrap; user-select: none; }
.prefixed input { border: 0; background: transparent; padding-left: 2px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.6; }
.hint code { background: transparent; padding: 0; color: var(--ink-soft); }
.drop { border: 1px dashed var(--line); min-height: 110px; display: grid; place-items: center; cursor: pointer; font-size: 13px; color: var(--ink-soft); text-align: center; padding: 16px; }
.drop:hover { border-color: var(--ink-soft); }
.drop input[type="file"] { display: none; }
.drop-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 16px; }
.drop-prev { border: 1px dashed var(--line); display: grid; place-items: center; font-family: var(--mono); font-size: 10.5px; color: var(--faint); background-size: cover; background-position: center; min-height: 110px; }
.pair-picker { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.pair-group-k { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.pair-group-v { display: flex; flex-wrap: wrap; gap: 6px; }
.pair-opt { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); padding: 6px 10px; cursor: pointer; }
.pair-opt:hover { border-color: var(--gold); }
.pair-opt.on { background: var(--gold); border-color: var(--gold); color: #fff; }
.review-dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 16px; margin: 0; }
.review-dl dt { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.review-dl dd { margin: 0; font-size: 13.5px; }
.costbar { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cost-k { font-size: 18px; font-weight: 550; }
.cost-d { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.explain { border: 1px solid var(--line); border-left: 2px solid var(--gold); background: var(--surface); padding: 18px 20px; margin-bottom: 18px; }
.explain h3 { font-size: 15px; margin: 0 0 8px; }
.explain p { font-size: 13.5px; color: var(--ink-soft); margin: 0; line-height: 1.65; }
.tcheck { margin-top: 8px; }
.tcheck-line { font-family: var(--mono); font-size: 11.5px; line-height: 1.6; }
.tcheck-ok { color: var(--ok); } .tcheck-warn { color: var(--gold); } .tcheck-idle { color: var(--muted); } .tcheck-err { color: var(--err); }

/* ---------- earnings ---------- */
.earn-head { display: flex; gap: 12px; align-items: center; }
.earn-head img { width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--line); }
.earn-head > .min0 { flex: 1; }
.earn-name { font-size: 15px; }

/* ---------- messages, logs, modal, footer ---------- */
.flash { border: 1px solid var(--line); border-left: 2px solid var(--ink-soft); background: var(--surface); padding: 13px 16px; margin: 0 0 16px; font-size: 13.5px; }
.flash-ok { border-left-color: var(--ok); } .flash-err { border-left-color: var(--err); } .flash-warn { border-left-color: var(--gold); }
.logbox { font-family: var(--mono); font-size: 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; margin: 0; color: var(--ink-soft); max-height: 320px; overflow: auto; }
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(15, 15, 14, .42); display: grid; place-items: center; padding: 20px; }
.modal-box { background: var(--paper); border: 1px solid var(--ink); max-width: 580px; width: 100%; max-height: 86vh; overflow: auto; padding: 28px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.modal-x { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.flow { border-top: 1px solid var(--line); }
.flow-step { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.flow-no { font-family: var(--mono); font-size: 11px; color: var(--gold); padding-top: 3px; }
.flow-t { font-size: 15px; font-weight: 550; margin-bottom: 4px; }
.flow-d { font-size: 13px; color: var(--ink-soft); }
.foot { border-top: 1px solid var(--line); margin-top: 56px; padding: 24px var(--pad) 44px; max-width: var(--wrap); margin-left: auto; margin-right: auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- wallet ---------- */
.wallet-wrap { position: relative; display: inline-block; }
.wallet-btn { gap: 8px; }
.wallet-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--ok); display: inline-block; }
.wallet-dot-warn { background: var(--gold); }
.wallet-net-warn { color: var(--gold); }
.wallet-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; display: grid; gap: 4px; min-width: 270px; padding: 16px; border: 1px solid var(--ink); background: var(--paper); text-align: left; }
.wallet-menu-k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.wallet-addr { font-size: 11.5px; word-break: break-all; margin-bottom: 8px; }
.wallet-net { font-size: 13px; margin-bottom: 12px; }
.wallet-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.wallet-acts .btn { flex: 1; }
@media (max-width: 820px) { .wallet-menu { right: auto; left: 0; } }
.wallet-picker { position: fixed; inset: 0; z-index: 95; background: rgba(15, 15, 14, .42); display: grid; place-items: center; padding: 20px; }
.wp-box { background: var(--paper); border: 1px solid var(--ink); max-width: 440px; width: 100%; max-height: 86vh; overflow: auto; padding: 26px; }
.wp-list { display: grid; border: 1px solid var(--line); }
.wp-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 14px; align-items: center; padding: 13px 15px; border: 0; border-top: 1px solid var(--line-soft); background: transparent; cursor: pointer; width: 100%; text-align: left; font-family: var(--sans); color: var(--ink); }
.wp-item:first-child { border-top: 0; }
.wp-item:hover { background: var(--ink); color: var(--on-ink); }
.wp-icon { width: 28px; height: 28px; object-fit: contain; }
.wp-icon-blank { background: var(--sunken); border: 1px solid var(--line); }
.wp-name { font-size: 14.5px; font-weight: 500; }
.wp-rdns { font-size: 10.5px; color: var(--muted); text-align: right; }
.wp-empty { font-size: 14px; margin: 0 0 10px; }
.wp-err { font-size: 13px; color: var(--err); margin: 0 0 14px; border-left: 2px solid var(--err); padding-left: 12px; }
.wp-note { font-size: 12px; color: var(--muted); line-height: 1.65; margin: 16px 0 0; }

/* ---------- Solana additions: the flow, live pair prices, curve progress ---------- */
.flowline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 6px; }
.flowline-branches { display: grid; gap: 4px; margin-bottom: 10px; padding-left: 18px; }
.flowline-branch { margin: 0; }
.flow-node { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--line); background: var(--raised); padding: 5px 9px; }
.flow-node-end { border-color: var(--gold); color: var(--gold-ink); background: var(--gold-soft); }
.flow-arrow { color: var(--muted); font-size: 13px; }

.chip-price { font-size: 10px; margin-left: 4px; }
.chip-price.up, .tcard-pair-price.up, .pair-card-d.up { color: var(--ok); }
.chip-price.down, .tcard-pair-price.down, .pair-card-d.down { color: var(--err); }
.tcard-pair-price { font-family: var(--mono); font-size: 10px; margin-left: auto; white-space: nowrap; }
.tcard-agent { display: flex; align-items: center; gap: 6px; }

.pair-card { margin-left: auto; border: 1px solid var(--gold); background: var(--gold-soft); padding: 10px 14px; min-width: 150px; text-align: right; }
.pair-card-k { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
.pair-card-v { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.pair-card-d { font-family: var(--mono); font-size: 11px; }
@media (max-width: 720px) { .token-head { flex-wrap: wrap; } .pair-card { margin-left: 0; text-align: left; } }

.curve-progress { margin-top: 14px; }
.curve-progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 8px; }
.progress { height: 8px; background: var(--sunken); border: 1px solid var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--gold); }
.stat-sub { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.wallet-icon { width: 14px; height: 14px; border-radius: 4px; }

/* ---------- launch: quote token picker ---------- */
.quote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 4px; }
.quote-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; border: 1px solid var(--line); background: var(--raised); color: var(--ink); padding: 11px 13px; cursor: pointer; text-align: left; font-family: var(--sans); }
.quote-opt:hover { border-color: var(--gold); }
.quote-opt.on { border-color: var(--gold); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }
.quote-opt-s { font-family: var(--mono); font-size: 13.5px; font-weight: 600; }
.quote-opt.on .quote-opt-s { color: var(--gold-ink); }
.quote-opt-n { font-size: 12px; color: var(--ink-soft); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-opt-m { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.quote-new { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
@media (max-width: 480px) { .quote-grid { grid-template-columns: 1fr 1fr; } }

.brand-symbol { position: relative; display: inline-block; width: 36px; height: 36px; overflow: hidden; flex-shrink: 0; }
.brand-symbol img { position: absolute; width: 62px; height: 62px; max-width: none; left: -13px; top: -13px; }

.brand-symbol { position: relative; display: inline-block; width: 36px; height: 36px; overflow: hidden; flex-shrink: 0; }
.brand-symbol img { position: absolute; width: 62px; height: 62px; max-width: none; left: -13px; top: -13px; }
