:root {
  --bg: #0f0d08;
  --panel: #17140c;
  --card: #1e1a10;
  --line: #3a321c;
  --ink: #f6efd9;
  --muted: #a99f80;
  --honey: #f5b700;
  --amber: #f59e0b;
  --good: #34d399;
  --bad: #f87171;
  --info: #60a5fa;
  --violet: #a78bfa;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.5; }
a { color: var(--honey); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .6rem; }
h2 small, .muted { color: var(--muted); font-weight: 400; }
h2 small { font-size: .85rem; margin-left: .5rem; }
.small { font-size: .8rem; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: .7rem 1.2rem; background: rgba(15, 13, 8, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.hex { width: 20px; height: 22px; background: var(--honey); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); display: inline-block; }
nav { display: flex; gap: .9rem; flex: 1; overflow-x: auto; }
nav a { color: var(--muted); text-decoration: none; font-size: .9rem; white-space: nowrap; }
nav a:hover { color: var(--ink); }
.right { display: flex; gap: .6rem; align-items: center; }
.pill { font-family: var(--mono); font-size: .75rem; padding: .2rem .55rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.live.on { color: var(--good); border-color: #1f5e48; }
.btn { font: inherit; font-size: .9rem; background: var(--card); color: var(--ink); border: 1px solid var(--line); padding: .5rem .9rem; border-radius: 10px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--honey); }
.btn.primary { background: var(--honey); color: #1a1405; border-color: var(--honey); font-weight: 700; }
.btn.sm { padding: .25rem .6rem; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; padding: 2.5rem 1.2rem 1.5rem; max-width: 1280px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
.hero em { color: var(--honey); font-style: normal; }
.lede { color: #d9cfb0; font-size: 1.05rem; max-width: 60ch; }
.cta { display: flex; gap: .7rem; margin-top: 1rem; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; align-content: start; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; }
.kpi b { display: block; font-family: var(--mono); font-size: 1.45rem; color: var(--ink); }
.kpi span { color: var(--muted); font-size: .8rem; }
.panel { max-width: 1280px; margin: 0 auto; padding: 1.6rem 1.2rem; border-top: 1px solid var(--line); }
.city-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.city-grid { display: grid; grid-template-columns: 1fr 360px; gap: 1rem; }
#city-canvas { width: 100%; height: 440px; background: radial-gradient(ellipse at center, #1d180c 0%, #0f0d08 75%); border: 1px solid var(--line); border-radius: 16px; display: block; }
.feed { height: 440px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: .6rem; font-size: .82rem; }
.ev { padding: .45rem .5rem; border-bottom: 1px dashed var(--line); animation: fadein .6s ease; }
.ev .k { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.ev time { color: var(--muted); font-family: var(--mono); font-size: .7rem; float: right; }
@keyframes fadein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; }
.play-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
form label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .6rem; }
input, textarea, select { width: 100%; margin-top: .25rem; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.agent img { width: 100%; aspect-ratio: 1; border-radius: 12px; display: block; background: #14110a; }
.agent h3 { margin: .6rem 0 .2rem; display: flex; justify-content: space-between; align-items: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .15rem .7rem; font-size: .78rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: .4rem 0; }
.bar i { display: block; height: 100%; background: var(--honey); }
.chip { font-family: var(--mono); font-size: .68rem; padding: .1rem .45rem; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.s-Open { color: var(--info); border-color: #1e3a5f; }
.s-Flagged { color: var(--bad); border-color: #5f1e1e; }
.s-Assigned, .s-Submitted { color: var(--amber); border-color: #5f431e; }
.s-Completed { color: var(--good); border-color: #1f5e48; }
.s-Disputed, .s-Refunded { color: var(--violet); border-color: #3f2f6b; }
.s-Cancelled { color: var(--muted); }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.jobs { display: grid; gap: .5rem; }
.job { display: grid; grid-template-columns: 54px 1fr auto auto; gap: .8rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; cursor: pointer; }
.job:hover { border-color: var(--honey); }
.job .id { font-family: var(--mono); color: var(--muted); }
.job .t { font-weight: 500; }
.job .sub { color: var(--muted); font-size: .78rem; }
.job .amt { font-family: var(--mono); font-size: .85rem; text-align: right; }
.econ { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.big { font-family: var(--mono); font-size: 1.6rem; }
.list { font-size: .82rem; display: grid; gap: .35rem; max-height: 260px; overflow-y: auto; }
.list > div { border-bottom: 1px dashed var(--line); padding-bottom: .35rem; }
.mono { font-family: var(--mono); }
dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; max-width: 760px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
pre.deliv { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .8rem; font-family: var(--mono); font-size: .8rem; max-height: 340px; overflow: auto; }
.thesis { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1rem; }
.thesis .claims li { margin-bottom: .5rem; }
.chart { width: 100%; height: 170px; }
.slider { display: grid; grid-template-columns: 1fr 70px; gap: .5rem; align-items: center; font-size: .8rem; color: var(--muted); }
.slider output { font-family: var(--mono); color: var(--ink); text-align: right; }
.tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.track h3 { font-size: 1rem; display: flex; gap: .5rem; align-items: center; }
.track p { font-size: .83rem; color: #d9cfb0; margin: 0; }
.track .where { font-family: var(--mono); font-size: .7rem; color: var(--muted); margin-top: .4rem; }
.foot { max-width: 1280px; margin: 0 auto; padding: 2rem 1.2rem 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.foot a { font-family: var(--mono); }
.stars button { background: none; border: none; color: var(--honey); font-size: 1.2rem; cursor: pointer; padding: 0 .1rem; }
@media (max-width: 900px) {
  .hero, .city-grid, .play-grid, .econ, .thesis { grid-template-columns: 1fr; }
  nav { display: none; }
  .feed { height: 260px; }
  #city-canvas { height: 320px; }
  .job { grid-template-columns: 40px 1fr auto; }
  .job .amt { display: none; }
}

/* ── round 2 polish ── */
.how { padding-top: .6rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .7rem; counter-reset: s; }
.steps li { background: linear-gradient(180deg, #1e1a10, #17140c); border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; position: relative; }
.steps li::after { content: '→'; position: absolute; right: -.62rem; top: 42%; color: var(--honey); font-weight: 700; }
.steps li:last-child::after { display: none; }
.steps b { display: block; color: var(--honey); font-size: .92rem; margin-bottom: .25rem; }
.steps span { font-size: .8rem; color: #d9cfb0; }
.proof { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; align-items: center; }
.proof .lbl { color: var(--muted); font-size: .8rem; margin-right: .2rem; }
.proof a { font-family: var(--mono); font-size: .75rem; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: .2rem .65rem; color: var(--ink); background: var(--panel); }
.proof a:hover { border-color: var(--honey); color: var(--honey); }
.txl { font-family: var(--mono); font-size: .68rem; color: var(--honey); text-decoration: none; border: 1px solid #5f431e; border-radius: 6px; padding: 0 .3rem; margin-right: .3rem; }
.txl:hover { background: var(--honey); color: #1a1405; }
.pager { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; margin-top: .8rem; }
.pager .muted { margin-left: .5rem; }
.cnt { font-family: var(--mono); font-size: .7rem; opacity: .7; margin-left: .15rem; }
.agent { position: relative; }
.agent .rank { position: absolute; top: .7rem; left: .7rem; z-index: 1; background: rgba(15, 13, 8, .85); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .5rem; font-family: var(--mono); font-size: .8rem; }
.agent.leader { border-color: var(--honey); box-shadow: 0 0 0 1px rgba(245, 183, 0, .25), 0 10px 30px rgba(245, 183, 0, .08); }
.route-row { padding: .45rem 0; }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-bottom: .25rem; }
.route .node { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .15rem .5rem; font-family: var(--mono); font-size: .78rem; }
.route .node i { color: var(--info); font-style: normal; font-size: .7rem; }
.route .node.addr { color: var(--good); }
.route .arrow { color: var(--muted); font-size: .72rem; font-family: var(--mono); }
.legend { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: .4rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: middle; }
.legend b { color: var(--ink); font-family: var(--mono); }
svg.gdp { width: 100%; height: 190px; display: block; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.kpi { position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--honey); opacity: .7; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } .steps li::after { display: none; } }

/* ── round 3: agent addresses, DAO ── */
.agent .money { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .55rem 0 .4rem; }
.agent .money div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .4rem .5rem; }
.agent .money span { display: block; font-size: .68rem; color: var(--muted); }
.agent .money b { display: block; font-family: var(--mono); font-size: .8rem; font-weight: 600; }
.agent .pol { font-size: .7rem; color: var(--muted); margin-bottom: .45rem; }
.agent .addrs { display: grid; gap: .3rem; }
.agent .addrs a { display: block; text-decoration: none; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .3rem .5rem;
  font-family: var(--mono); font-size: .66rem; word-break: break-all; line-height: 1.35; }
.agent .addrs a:hover { border-color: var(--honey); color: var(--honey); }
.agent .addrs a span { display: block; font-family: var(--sans); font-size: .64rem; color: var(--muted); }
.kv dd a { text-decoration: none; }
.prop { padding: .45rem 0; }
.prop .txl { margin-left: .3rem; }

/* ── quest guidance ── */
.examples { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .2rem 0 .7rem; }
.chip-btn { font: inherit; font-size: .78rem; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .65rem; cursor: pointer; }
.chip-btn:hover { border-color: var(--honey); color: var(--honey); }
.guide { margin-top: .8rem; border-top: 1px dashed var(--line); padding-top: .6rem; }
.guide summary { cursor: pointer; font-weight: 600; color: var(--honey); }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: .5rem 0; font-size: .8rem; }
.guide-grid ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.guide .ok { color: var(--good); } .guide .no { color: var(--bad); }
.flow { font-size: .8rem; padding-left: 1.2rem; margin: .4rem 0; }
.flow li { margin: .15rem 0; }
.next { display: grid; gap: .2rem; background: rgba(245, 183, 0, .08); border: 1px solid #5f431e; border-radius: 10px; padding: .55rem .7rem; margin: .4rem 0 .6rem; font-size: .85rem; }
.next b { color: var(--honey); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 900px) { .guide-grid { grid-template-columns: 1fr; } }

.post-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.btn.guest { border-color: var(--honey); color: var(--honey); }
.btn.guest:hover { background: var(--honey); color: #1a1405; }
#toasts { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 50; display: grid; gap: .5rem; width: min(560px, calc(100% - 32px)); }
.toast { background: #1e1a10; color: var(--ink); border: 1px solid var(--honey); border-radius: 12px; padding: .7rem 1rem; font-size: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: fadein .3s ease; transition: opacity .5s; }
.toast.out { opacity: 0; }

/* ── job on-chain history ── */
.timeline { list-style: none; margin: .3rem 0 .4rem; padding: 0 0 0 .9rem; border-left: 2px solid var(--line); display: grid; gap: .35rem; }
.timeline li { position: relative; display: grid; grid-template-columns: 74px 170px 1fr auto; gap: .6rem; align-items: baseline; font-size: .8rem; }
.timeline li::before { content: ''; position: absolute; left: -1.27rem; top: .35rem; width: 8px; height: 8px; border-radius: 50%; background: var(--honey); }
.timeline time { font-family: var(--mono); color: var(--muted); font-size: .72rem; }
.timeline b { color: var(--ink); font-weight: 600; }
.timeline span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .timeline li { grid-template-columns: 1fr auto; } .timeline time, .timeline li > span.muted { display: none; } }

.txl.soft { color: var(--muted); border-color: var(--line); }
.txl.soft:hover { background: var(--line); color: var(--ink); }
