:root {
  --bg: #0b0b0c;
  --panel: #131315;
  --panel-2: #1a1a1d;
  --line: #2a2a2f;
  --ink: #f2f2ef;
  --muted: #8d8d93;
  --accent: #c8ff3c;     /* acid — bonds, POL */
  --accent-ink: #0b0b0c;
  --burn: #ff6b3d;       /* burns */
  --friends: #7ab8ff;    /* flows to active Friends */
  --warn: #ffcc4d;
  --bad: #ff5a6e;
  --radius: 10px;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
  --pixel: "Silkscreen", var(--mono);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: var(--accent); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
h2 { font: 600 16px/1.2 var(--sans); margin: 0; letter-spacing: .01em; display: flex; gap: 8px; align-items: center; }
h3 { font: 600 14px/1.2 var(--sans); margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.logo { font: 22px/1 var(--pixel); letter-spacing: .04em; }
.logo::before { content: ""; display: inline-block; width: 14px; height: 14px; background: var(--accent); margin-right: 10px; vertical-align: -1px; box-shadow: 4px 4px 0 var(--ink); }
.tag { color: var(--muted); font-size: 13px; }
.wallet { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.notice { padding: 10px 24px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); background: #0f0f11; }
.chip { display: inline-block; font: 600 10.5px/1 var(--mono); letter-spacing: .08em; padding: 4px 6px; border-radius: 4px; vertical-align: 1px; }
.chip.live { background: #1c2a10; color: var(--accent); border: 1px solid #3a5a14; }
.chip.sim { background: #2a2210; color: var(--warn); border: 1px solid #5a4614; }
.chip.demo { background: #1c1c22; color: var(--muted); border: 1px solid var(--line); }

main { max-width: 1180px; margin: 0 auto; padding: 20px 24px 40px; display: grid; gap: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.skeleton { color: var(--muted); padding: 20px 0; }

.market-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.stat .k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font: 600 18px/1.25 var(--mono); margin-top: 4px; overflow-wrap: anywhere; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.accent .v { color: var(--accent); }
.stat.friends .v { color: var(--friends); }
.stat.burn .v { color: var(--burn); }
.finding { margin-top: 12px; font-size: 13px; color: var(--muted); border-left: 3px solid var(--accent); padding: 6px 0 6px 12px; }
.finding b { color: var(--ink); }

.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font: 10.5px var(--mono); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; }
.chart .line.accent { stroke: var(--accent); }
.chart .line.friends { stroke: var(--friends); }
.chart .line.dash { stroke-dasharray: 5 4; }
.chart .area { fill: rgba(200,255,60,.08); }
.chart .dot { fill: var(--accent); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 6px; background: var(--ink); }
.legend i.accent { background: var(--accent); } .legend i.friends { background: var(--friends); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--muted); font: 600 14px var(--sans); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab { display: grid; gap: 18px; }
.tab[hidden] { display: none; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

button.btn, .btn { font: 600 14px var(--sans); border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); padding: 9px 14px; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: #45454d; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.ghost { background: none; }

input[type="number"], input[type="text"], select { background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font: 15px var(--mono); width: 100%; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button { text-align: left; padding: 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); cursor: pointer; font: 14px var(--sans); }
.seg button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.seg b { display: block; margin-bottom: 4px; }
.seg span { color: var(--muted); font-size: 12.5px; }

table.kv { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.kv td { padding: 7px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
table.kv td:last-child { text-align: right; font-family: var(--mono); }
table.kv tr.hl td { color: var(--accent); font-weight: 600; }
table.kv tr.friends td:last-child { color: var(--friends); }
table.kv tr.burn td:last-child { color: var(--burn); }

.meter { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.meter > i { display: block; height: 100%; background: var(--accent); }
.errors { color: var(--bad); font-size: 13px; }
.ok { color: var(--accent); }

.picker { width: 100%; justify-self: stretch; display: grid; gap: 10px; }
.picker-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.picker-bar input { width: 150px; }
.picker-bar select { width: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chipbtn { background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); border-radius: 99px; padding: 5px 11px; font: 600 12.5px var(--sans); cursor: pointer; }
.chipbtn span { color: var(--muted); font-weight: 400; margin-left: 3px; }
.chipbtn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.friends-list { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.friends-list.scroll { max-height: 440px; overflow-y: auto; padding-right: 4px; }
.friend { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; cursor: pointer; text-align: left; color: var(--ink); font: 13px var(--sans); display: grid; gap: 4px; justify-items: start; }
.friend:hover { border-color: #45454d; }
.friend .fid { font-weight: 700; font-family: var(--mono); font-size: 12.5px; }
.friend[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.friend canvas { width: 48px; height: 48px; image-rendering: pixelated; background: #fff; border-radius: 4px; }
.sprite { width: 64px; height: 64px; image-rendering: pixelated; background: #fff; border-radius: 4px; }
.friend .meta { color: var(--muted); font-size: 12px; }

.bond-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 8px; }
.bond-card .row.between > span:first-child { font-weight: 600; }

.feed { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 320px; overflow: auto; font-size: 13px; }
.feed li { border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.feed time { color: var(--muted); font-family: var(--mono); font-size: 11.5px; margin-right: 8px; }

details.calldata summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.calldata pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 11.5px/1.45 var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: var(--muted); }

.gate { display: grid; gap: 12px; justify-items: start; }
.gate p { margin: 0; color: var(--muted); max-width: 640px; }
.prose { max-width: 820px; }
.prose p, .prose li { color: #cfcfcb; }
.prose h3 { margin-top: 18px; }
.flywheel { width: 100%; max-width: 820px; height: auto; }
.flywheel text { font: 12px var(--sans); fill: var(--ink); }
.flywheel .sub { fill: var(--muted); font-size: 10.5px; }
.flywheel rect { fill: var(--panel-2); stroke: var(--line); }
.flywheel .edge { fill: none; stroke-width: 2; }
.flywheel .edge.a { stroke: var(--accent); } .flywheel .edge.f { stroke: var(--friends); } .flywheel .edge.b { stroke: var(--burn); }
.flywheel .edge.dash { stroke-dasharray: 5 4; }

.foot { max-width: 1180px; margin: 0 auto; padding: 0 24px 30px; font-size: 12.5px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; z-index: 10; max-width: calc(100% - 32px); }

@media (max-width: 860px) {
  .market-body, .cols, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  main { padding: 16px; }
  .top, .notice { padding-left: 16px; padding-right: 16px; }
  .seg { grid-template-columns: 1fr; }
}

/* ---- Bond street scene ---- */
.scene { display: grid; gap: 10px; }
.scene-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.scene-caption { font-size: 14px; color: #cfcfcb; min-height: 42px; }
.scene-caption b { color: var(--accent); }
.scene-stage { position: relative; background: radial-gradient(ellipse at 50% 0%, #17171b 0%, #0b0b0c 70%); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.scene-svg { display: block; width: 100%; height: auto; }
.scene-svg .s-label { font: 6px var(--mono); fill: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.scene-svg .s-value { font: 600 7px var(--mono); fill: var(--ink); }
.scene-svg .s-value.friends { fill: var(--friends); }
.scene-svg .s-sub { font: 5.5px var(--sans); fill: var(--muted); }
.scene-svg .s-sign { font: 6.5px var(--pixel); fill: var(--accent); letter-spacing: .06em; }
.scene-svg .s-tag { font: 600 6px var(--mono); fill: var(--ink); }
.scene-svg .s-float { font: 700 7px var(--mono); fill: var(--ink); paint-order: stroke; stroke: #0b0b0c; stroke-width: 2px; }
.scene-svg .s-float.accent { fill: var(--accent); }
.scene-svg .s-float.friends { fill: var(--friends); }
.scene-guide { position: absolute; transform: translate(-50%, 0); width: min(320px, 80%); background: var(--ink); color: var(--bg); border-radius: 10px; padding: 12px 14px; box-shadow: 0 8px 30px rgba(0,0,0,.5); z-index: 2; }
.scene-guide p { margin: 6px 0 10px; font-size: 13px; line-height: 1.45; color: #2a2a2f; }
.scene-guide .btn.ghost { color: var(--bg); border-color: #bdbdb8; }
.scene-guide .muted { color: #6a6a70; }
@media (max-width: 860px) { .scene-guide { position: static; transform: none; width: auto; margin: 8px; } }
@media (prefers-reduced-motion: reduce) { .scene-svg * { transition: none !important; } }
.scene[hidden] { display: none; }
