/* Arc Farm — bright neo-brutalist light theme */
:root {
  --bg: #f2f3ff;
  --surface: #ffffff;
  --surface-2: #eceeff;
  --surface-3: #dfe3ff;
  --ink: #0b0b14;
  --ink-2: #3a3b52;
  --muted: #6e7090;
  --line: #0b0b14;
  --hair: #cfd3f0;
  --blue: #2f5bff;
  --pink: #ff6fb5;
  --yellow: #ffd23f;
  --mint: #3ddcab;
  --orange: #ff8a3d;
  --violet: #9b6bff;
  /* semantic aliases used by JS/HTML */
  --accent: var(--blue);
  --accent-ink: #1c3fd6;
  --accent-soft: #dce4ff;
  --sage: #0e9e72;
  --sage-soft: #d4f7eb;
  --sky: var(--blue);
  --sky-soft: #dce4ff;
  --sun: var(--yellow);
  --sun-soft: #fff4c7;
  --plum: var(--violet);
  --plum-soft: #ece2ff;
  --danger: #ff3b5c;
  --bw: 2px;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-lg: 8px 8px 0 var(--ink);
  --serif: "Bricolage Grotesque", "Space Grotesk", system-ui, sans-serif;
  --display: "Bricolage Grotesque", "Space Grotesk", system-ui, sans-serif;
  --sans: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(#c9cdf3 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img, svg { display: block; }
.mono { font-family: var(--mono); font-size: .85em; }
.muted { color: var(--muted); }
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: var(--r-sm); border: var(--bw) solid var(--ink);
  font-weight: 700; font-size: 15px; cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s;
  white-space: nowrap; box-shadow: var(--shadow-sm); background: var(--surface);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-accent { background: var(--blue); color: #fff; }
.btn-ghost { background: var(--surface); }
.btn-soft { background: var(--yellow); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-block { width: 100%; height: 56px; font-size: 17px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm); border: var(--bw) solid var(--ink); background: var(--surface);
  display: inline-grid; place-items: center; cursor: pointer; color: var(--ink); transition: .12s; flex-shrink: 0;
}
.icon-btn:hover { background: var(--yellow); }

/* ---------- Chips / tags ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-sm);
  background: var(--surface); border: var(--bw) solid var(--ink); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); border: 2px solid var(--ink); flex-shrink: 0; }
.dot.off { background: var(--muted); }
.dot.warn { background: var(--orange); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 12px; font-weight: 700; border: 1.5px solid var(--ink); white-space: nowrap; }
.tag.accent { background: var(--blue); color: #fff; }
.tag.sage { background: var(--mint); color: var(--ink); }
.tag.sky { background: var(--accent-soft); color: var(--ink); }
.tag.sun { background: var(--yellow); color: var(--ink); }
.tag.plum { background: var(--pink); color: var(--ink); }
.tag.gray { background: var(--surface); color: var(--ink-2); border-color: var(--hair); }

/* ---------- Header ---------- */
.ticker { background: var(--ink); color: #fff; overflow: hidden; border-bottom: var(--bw) solid var(--ink); font-family: var(--mono); font-size: 13px; }
.ticker-track { display: flex; gap: 48px; padding: 9px 0; width: max-content; animation: marquee 32s linear infinite; }
.ticker-track span { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.ticker-track b { color: var(--yellow); font-weight: 500; }
@keyframes marquee { to { transform: translateX(-50%); } }
.header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: var(--bw) solid var(--ink); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.nav { display: flex; gap: 2px; }
.nav a { padding: 8px 14px; font-size: 15px; font-weight: 600; border-radius: var(--r-sm); border: var(--bw) solid transparent; }
.nav a:hover { border-color: var(--ink); background: var(--yellow); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.mobile-nav { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 0; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero h1 {
  font-family: var(--display); font-weight: 800; font-size: clamp(48px, 9.5vw, 136px); line-height: .92;
  letter-spacing: -.05em; margin: 28px 0 28px; text-transform: uppercase;
}
.hero h1 .hl { display: inline-block; padding: 0 .12em; border: 3px solid var(--ink); border-radius: 12px; box-shadow: 6px 6px 0 var(--ink); line-height: 1; margin: .04em 0; }
.hero h1 .hl.b { background: var(--blue); color: #fff; transform: rotate(-1.5deg); }
.hero h1 .hl.p { background: var(--pink); transform: rotate(1.2deg); }
.hero-row { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: end; }
.hero p.lead { font-size: clamp(17px, 1.8vw, 21px); color: var(--ink-2); margin: 0; max-width: 560px; font-weight: 500; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.hero-actions .btn { height: 56px; padding: 0 26px; font-size: 16px; }
.ca-chip { display: inline-flex; align-items: center; gap: 10px; padding: 5px 5px 5px 12px; background: var(--yellow); border: var(--bw) solid var(--ink); border-radius: var(--r-sm); box-shadow: var(--shadow-sm); max-width: 100%; }
.ca-chip .label { font-size: 12px; font-weight: 800; }
.ca-chip .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Router diagram */
.diagram { margin-top: 56px; display: grid; grid-template-columns: 1fr auto 1.2fr auto 1fr; gap: 0; align-items: center; }
.d-col { display: grid; gap: 10px; }
.d-chip { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow-sm); font-weight: 700; }
.d-chip small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; }
.d-sq { width: 30px; height: 30px; border-radius: 6px; border: var(--bw) solid var(--ink); flex-shrink: 0; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.d-wire { width: 56px; height: 3px; background: repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 14px); animation: wire 1s linear infinite; background-size: 14px 3px; }
@keyframes wire { to { background-position: 14px 0; } }
.d-core { background: var(--blue); color: #fff; border: 3px solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 26px 22px; text-align: center; }
.d-core b { display: block; font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.d-core small { display: block; margin-top: 8px; opacity: .9; font-weight: 500; }
.d-core .mini { display: flex; justify-content: center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.d-core .mini span { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 56px; border: var(--bw) solid var(--ink); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.stat { padding: 20px 22px; border-right: var(--bw) solid var(--ink); }
.stat:last-child { border-right: 0; }
.stat:nth-child(1) { background: var(--yellow); }
.stat .k { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 8px; }
.stat .v { font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin-top: 2px; }

/* ---------- Sections ---------- */
section.block { padding: 110px 0; }
.sec-head { display: grid; grid-template-columns: auto 1fr; gap: 12px 28px; align-items: end; margin-bottom: 48px; }
.sec-num { font-family: var(--display); font-weight: 800; font-size: 88px; line-height: .8; color: transparent; -webkit-text-stroke: 2.5px var(--ink); grid-row: span 2; }
.kicker { font-family: var(--mono); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.sec-head h2 { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 5vw, 60px); line-height: .98; letter-spacing: -.04em; margin: 0; }
.sec-head h2 mark { background: var(--yellow); padding: 0 .12em; border-radius: 6px; color: inherit; }
.sec-head p { grid-column: 2; color: var(--ink-2); font-size: 18px; margin: 4px 0 0; max-width: 640px; }
.alt { background: var(--surface); border-block: var(--bw) solid var(--ink); }

/* Market tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card { background: var(--surface); border: var(--bw) solid var(--ink); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.card:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--ink); }
.tiles .card:nth-child(1) { background: var(--blue); color: #fff; }
.tiles .card:nth-child(2) { background: var(--pink); }
.tiles .card:nth-child(3) { background: var(--yellow); }
.tiles .card:nth-child(4) { background: var(--mint); }
.card .num { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.card h3 { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -.03em; line-height: 1; margin: 44px 0 12px; }
.card p { margin: 0 0 20px; font-size: 15.5px; opacity: .9; }
.card .feat { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.card .feat span { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 4px; background: rgba(255, 255, 255, .85); color: var(--ink); border: 1.5px solid var(--ink); }
.card .arrow-link { display: inline-flex; margin-top: 18px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

/* Steps strip */
.strip { display: grid; grid-template-columns: repeat(4, 1fr); border: var(--bw) solid var(--ink); border-radius: var(--r-lg); overflow: hidden; background: var(--bg); box-shadow: var(--shadow); }
.strip > div { padding: 28px 24px; border-right: var(--bw) solid var(--ink); }
.strip > div:last-child { border-right: 0; }
.strip .big { font-family: var(--display); font-weight: 800; font-size: 56px; line-height: 1; letter-spacing: -.04em; }
.strip h4 { margin: 14px 0 6px; font-size: 19px; }
.strip p { margin: 0; color: var(--ink-2); font-size: 15px; }

/* Route demo */
.route-demo { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
.route-list { background: var(--surface); border: var(--bw) solid var(--ink); border-radius: var(--r-lg); padding: 8px; box-shadow: var(--shadow); }
.route-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-sm); }
.route-row + .route-row { border-top: 1.5px dashed var(--hair); }
.route-row.best { background: var(--mint); border: var(--bw) solid var(--ink); }
.route-row.best + .route-row { border-top-color: transparent; }
.route-row b { display: block; font-size: 15.5px; }
.route-row small { color: var(--ink-2); font-size: 13px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 14px; align-items: flex-start; font-size: 16px; padding: 14px 16px; background: var(--surface); border: var(--bw) solid var(--ink); border-radius: var(--r); }
.checklist li .ck { width: 26px; height: 26px; border-radius: 6px; background: var(--yellow); border: var(--bw) solid var(--ink); display: grid; place-items: center; flex-shrink: 0; font-weight: 800; font-size: 13px; }

/* Stack bars */
.stackviz { display: grid; gap: 12px; }
.bar-layer { border: var(--bw) solid var(--ink); border-radius: var(--r); padding: 18px 22px; box-shadow: var(--shadow-sm); display: flex; justify-content: space-between; align-items: center; gap: 16px; font-weight: 700; }
.bar-layer small { font-weight: 500; opacity: .85; display: block; font-size: 14px; }
.bar-layer .mono { font-size: 12px; opacity: .8; }
.bar-layer:nth-child(1) { background: var(--surface); }
.bar-layer:nth-child(2) { background: var(--blue); color: #fff; margin-inline: 24px; }
.bar-layer:nth-child(3) { background: var(--pink); margin-inline: 48px; }
.bar-layer:nth-child(4) { background: var(--yellow); margin-inline: 72px; }
.layer-list { display: grid; gap: 10px; }
.layer { display: flex; gap: 14px; padding: 16px 18px; background: var(--surface); border: var(--bw) solid var(--ink); border-radius: var(--r); align-items: flex-start; }
.layer .sw { width: 16px; height: 16px; border-radius: 4px; margin-top: 3px; flex-shrink: 0; border: var(--bw) solid var(--ink); }
.layer b { display: block; }
.layer span { color: var(--ink-2); font-size: 15px; }

/* Toolbar / table */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { border: var(--bw) solid var(--ink); background: var(--surface); padding: 6px 13px; border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; font-weight: 700; transition: .1s; white-space: nowrap; }
.seg button:hover { background: var(--surface-2); }
.seg button.on { background: var(--ink); color: #fff; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: var(--bw) solid var(--ink); border-radius: var(--r-sm); padding: 0 14px; height: 42px; min-width: 260px; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 14.5px; }
.table-wrap { background: var(--surface); border: var(--bw) solid var(--ink); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 20px; border-bottom: 1.5px solid var(--hair); font-size: 14.5px; vertical-align: middle; }
th { font-family: var(--mono); font-size: 12px; font-weight: 500; background: var(--ink); color: #fff; text-transform: uppercase; letter-spacing: .06em; border-bottom: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--sun-soft); }
.addr-cell { display: flex; align-items: center; gap: 8px; }

/* FAQ */
.faq { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.faq details { background: var(--surface); border: var(--bw) solid var(--ink); border-radius: var(--r); padding: 2px 20px; box-shadow: var(--shadow-sm); align-self: start; }
.faq details[open] { background: var(--sun-soft); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 700; font-size: 17px; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-size: 20px; line-height: 1; width: 26px; height: 26px; border: var(--bw) solid var(--ink); border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 18px; color: var(--ink-2); }

/* CTA / footer */
.cta { background: var(--blue); color: #fff; border: 3px solid var(--ink); border-radius: 20px; padding: 64px 48px; box-shadow: 10px 10px 0 var(--ink); display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center; }
.cta h2 { font-family: var(--display); font-weight: 800; font-size: clamp(36px, 5.5vw, 68px); margin: 0; letter-spacing: -.045em; line-height: .95; text-transform: uppercase; }
.cta p { margin: 0 0 22px; font-size: 18px; opacity: .92; }
.cta .btn-primary { background: var(--yellow); color: var(--ink); }
.cta .btn-ghost { background: #fff; color: var(--ink); }
.cta .hero-actions { justify-content: flex-start; }
.footer { padding: 56px 0 36px; background: var(--surface); border-top: var(--bw) solid var(--ink); font-size: 14.5px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer h5 { font-family: var(--mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-weight: 600; }
.footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.bigword { font-family: var(--display); font-weight: 800; font-size: clamp(56px, 15vw, 220px); letter-spacing: -.06em; line-height: .8; margin: 48px 0 0; color: var(--blue); -webkit-text-stroke: 3px var(--ink); text-transform: uppercase; white-space: nowrap; overflow: hidden; }
.disclaimer { border-top: 1.5px solid var(--hair); margin-top: 32px; padding-top: 20px; font-size: 13px; color: var(--muted); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Toast */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: grid; gap: 10px; max-width: calc(100vw - 40px); }
.toast { background: var(--surface); color: var(--ink); border: var(--bw) solid var(--ink); padding: 12px 16px; border-radius: var(--r); box-shadow: var(--shadow); font-size: 14.5px; font-weight: 600; animation: pop .2s ease; max-width: 380px; }
.toast.ok { background: var(--mint); }
.toast.err { background: var(--pink); }
.toast a { text-decoration: underline; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(11, 11, 20, .45); z-index: 100; display: none; place-items: center; padding: 16px; }
.modal-back.open { display: grid; }
.modal { background: var(--surface); border: 3px solid var(--ink); border-radius: var(--r-lg); width: min(440px, 100%); max-height: 86vh; overflow: auto; box-shadow: 10px 10px 0 var(--ink); padding: 22px; animation: pop .15s ease; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -.02em; }
.list-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 13px; border: var(--bw) solid var(--ink); background: var(--surface); border-radius: var(--r); cursor: pointer; margin-bottom: 8px; text-align: left; transition: .1s; }
.list-btn:hover { background: var(--sun-soft); transform: translate(-1px, -1px); box-shadow: var(--shadow-sm); }
.list-btn img { width: 32px; height: 32px; border-radius: 6px; }
.list-btn .grow { flex: 1; min-width: 0; }
.list-btn small { color: var(--muted); display: block; font-size: 12.5px; }

/* ================= APP ================= */
.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: var(--bw) solid var(--ink); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; }
.side-nav { display: grid; gap: 6px; }
.side-nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: var(--bw) solid transparent; border-radius: var(--r-sm); background: transparent; cursor: pointer; font-weight: 700; font-size: 15px; text-align: left; transition: .1s; }
.side-nav button:hover { border-color: var(--ink); }
.side-nav button.on { background: var(--yellow); border-color: var(--ink); box-shadow: var(--shadow-sm); }
.side-foot { margin-top: auto; background: var(--ink); color: #fff; border-radius: var(--r); padding: 14px; font-size: 13px; font-family: var(--mono); }
.side-foot .row { display: flex; justify-content: space-between; padding: 3px 0; }
.side-foot .muted { color: #a9abc9; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 32px; border-bottom: var(--bw) solid var(--ink); background: var(--surface); position: sticky; top: 0; z-index: 40; }
.topbar h1 { font-family: var(--display); font-weight: 800; font-size: 28px; margin: 0; letter-spacing: -.03em; text-transform: uppercase; }
.topbar .right { display: flex; gap: 10px; align-items: center; }
.page { padding: 32px; max-width: 1200px; }
.view { display: none; }
.view.on { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.grid-2 { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 24px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.panel { background: var(--surface); border: var(--bw) solid var(--ink); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.panel .sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-head h3 { margin: 0; }

.kpi { background: var(--surface); border: var(--bw) solid var(--ink); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.grid-3 > .kpi:nth-child(1), .grid-4 > .kpi:nth-child(1) { background: var(--yellow); }
.grid-3 > .kpi:nth-child(2), .grid-4 > .kpi:nth-child(2) { background: var(--accent-soft); }
.grid-3 > .kpi:nth-child(3), .grid-4 > .kpi:nth-child(3) { background: var(--sage-soft); }
.grid-4 > .kpi:nth-child(4) { background: #ffe0ef; }
.kpi .k { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; display: flex; gap: 8px; align-items: center; }
.kpi .v { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Swap */
.swap-box { background: var(--bg); border-radius: var(--r); padding: 14px 16px; border: var(--bw) solid var(--ink); }
.swap-box:focus-within { background: var(--sun-soft); }
.swap-box .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.swap-box label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.swap-box input { border: 0; outline: 0; background: transparent; font-family: var(--display); font-weight: 700; font-size: 36px; width: 100%; min-width: 0; padding: 4px 0; letter-spacing: -.03em; }
.swap-box input::placeholder { color: #b5b8d8; }
.token-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 10px 0 5px; border-radius: var(--r-sm); background: var(--surface); border: var(--bw) solid var(--ink); cursor: pointer; font-weight: 800; flex-shrink: 0; box-shadow: var(--shadow-sm); transition: .1s; }
.token-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.tok-ico { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; flex-shrink: 0; border: 1.5px solid var(--ink); }
.pcts { display: flex; gap: 5px; }
.pcts button { border: 1.5px solid var(--ink); background: var(--surface); border-radius: 4px; padding: 1px 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.pcts button:hover { background: var(--yellow); }
.flip { display: grid; place-items: center; height: 0; position: relative; z-index: 2; }
.flip button { width: 42px; height: 42px; border-radius: var(--r-sm); background: var(--yellow); border: var(--bw) solid var(--ink); box-shadow: var(--shadow-sm); cursor: pointer; display: grid; place-items: center; transition: .2s; }
.flip button:hover { transform: rotate(180deg); }
.details { margin-top: 14px; border: var(--bw) solid var(--ink); border-radius: var(--r); padding: 4px 14px; font-size: 14px; }
.details .row { display: flex; justify-content: space-between; padding: 8px 0; gap: 12px; }
.details .row + .row { border-top: 1.5px dashed var(--hair); }
.details .row span:first-child { color: var(--muted); font-weight: 500; }
.details .row span:last-child { font-weight: 700; }
.slip { display: flex; gap: 5px; }
.slip button { border: 1.5px solid var(--ink); background: var(--surface); border-radius: 4px; padding: 1px 9px; cursor: pointer; font-size: 13px; font-weight: 700; }
.slip button.on { background: var(--ink); color: #fff; }
.notice { padding: 11px 14px; border-radius: var(--r); font-size: 14px; margin-top: 12px; border: var(--bw) solid var(--ink); font-weight: 500; }
.notice.info { background: var(--accent-soft); }
.notice.warn { background: var(--sun-soft); }
.notice.ok { background: var(--sage-soft); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.input { height: 46px; border-radius: var(--r-sm); border: var(--bw) solid var(--ink); background: var(--surface); padding: 0 14px; outline: 0; width: 100%; transition: .1s; }
.input:focus { background: var(--sun-soft); box-shadow: var(--shadow-sm); }
.input.mono { font-size: 13.5px; }

.bal-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1.5px dashed var(--hair); }
.bal-row:last-child { border-bottom: 0; }
.bal-row .grow { flex: 1; min-width: 0; }
.bal-row b { display: block; }
.bal-row small { color: var(--muted); }
.bal-row .amt { font-family: var(--display); font-weight: 800; font-size: 20px; text-align: right; }

.empty { text-align: center; padding: 32px 16px; color: var(--ink-2); }
.empty svg { margin: 0 auto 12px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 4px; height: 14px; }
@keyframes sh { to { background-position: -200% 0; } }

.wallet-btn .addr { font-family: var(--mono); font-size: 13px; }
.net-btn { display: inline-flex; align-items: center; gap: 8px; }
.mobile-tabs { display: none; }

.pool-card { display: grid; gap: 14px; }
.pool-pair { display: flex; align-items: center; gap: 10px; }
.pool-pair .stack { display: flex; }
.pool-pair .stack .tok-ico + .tok-ico { margin-left: -8px; }
.pool-pair b { font-size: 18px; font-family: var(--display); font-weight: 800; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kv div { background: var(--bg); border: 1.5px solid var(--ink); border-radius: var(--r-sm); padding: 9px 11px; min-width: 0; }
.kv small { color: var(--muted); display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kv span { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }

.bars { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding-top: 8px; border-bottom: var(--bw) solid var(--ink); }
.bars div { flex: 1; background: var(--blue); border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 3px 3px 0 0; min-height: 4px; position: relative; }
.bars div:hover { background: var(--pink); }
.bars div[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 11.5px; padding: 4px 8px; border-radius: 4px; white-space: nowrap; z-index: 3; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .nav { display: none; }
  .menu-btn { display: inline-grid; }
  .mobile-nav.open { display: grid; gap: 4px; padding: 8px 16px 16px; border-top: var(--bw) solid var(--ink); background: var(--surface); }
  .mobile-nav a { padding: 12px 8px; font-weight: 700; border-radius: var(--r-sm); }
  .hero-row, .route-demo, .cta { grid-template-columns: 1fr; }
  .hero-actions { justify-content: flex-start; }
  .diagram { grid-template-columns: 1fr; gap: 0; }
  .d-wire { width: 3px; height: 32px; margin: 0 auto; background: repeating-linear-gradient(180deg, var(--ink) 0 8px, transparent 8px 14px); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: var(--bw) solid var(--ink); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip > div:nth-child(2) { border-right: 0; }
  .strip > div:nth-child(-n+2) { border-bottom: var(--bw) solid var(--ink); }
  .faq { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .mobile-tabs { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: var(--surface); border-top: var(--bw) solid var(--ink); overflow-x: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 4px; }
  .mobile-tabs button { flex: 1 0 auto; border: var(--bw) solid transparent; background: transparent; display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 700; padding: 5px 9px; border-radius: var(--r-sm); cursor: pointer; }
  .mobile-tabs button.on { background: var(--yellow); border-color: var(--ink); }
  .page { padding: 20px 16px 110px; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 22px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr) !important; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 4px; }
}
@media (max-width: 600px) {
  section.block { padding: 72px 0; }
  .hero { padding-top: 36px; }
  .hero h1 .hl { box-shadow: 4px 4px 0 var(--ink); border-width: 2px; }
  .header-actions .btn-ghost { display: none; }
  .sec-head { grid-template-columns: 1fr; }
  .sec-num { font-size: 56px; grid-row: auto; }
  .sec-head p { grid-column: 1; }
  .tiles, .strip { grid-template-columns: 1fr; }
  .strip > div { border-right: 0 !important; border-bottom: var(--bw) solid var(--ink); }
  .strip > div:last-child { border-bottom: 0; }
  .card h3 { margin-top: 24px; }
  .stat .v { font-size: 24px; }
  .bar-layer:nth-child(n) { margin-inline: 0; }
  .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr) !important; }
  .footer-grid { grid-template-columns: 1fr; }
  .search { min-width: 0; width: 100%; }
  th:nth-child(3), td:nth-child(3) { display: none; }
  th, td { padding: 12px 14px; }
  .cta { padding: 40px 22px; box-shadow: 6px 6px 0 var(--ink); }
  .wallet-btn { max-width: 150px; overflow: hidden; }
  .topbar .btn-sm { padding: 0 11px; }
  .net-btn .lbl { display: none; }
}
