/*
  Mortar site styles (SHELL agent).

  MARKUP CONTRACT (server rendered by src/routes/pages.js; app.js runs on every page):

  Every page:
    <body class="page-home"> on /, <body class="page-doc"> on /proof /whitepaper /agents /connect
    <header class="topbar">
      <a class="brand" href="/"><span class="brand-mark" aria-hidden="true"></span><span class="brand-name">Mortar</span></a>
      <nav class="topnav"><a href="/" aria-current="page">Town</a> <a href="/agents">Agents</a> <a href="/proof">Proof</a>
        <a href="/whitepaper">Whitepaper</a> <a href="/connect">Connect</a></nav>
    </header>
    <script type="module" src="/js/app.js"></script>     (handles [data-copy] buttons everywhere, town on home)

  Home (/):
    <main class="stage">
      <canvas id="town"></canvas>
      <div class="hud">
        <section class="panel hud-coin">          top-left, SERVER RENDERED ONLY, js never touches it
          <h2 class="hud-title">$TICKER</h2>
          <div class="ca"><a class="ca-text" href="EXPLORER/address/CA">0xCA...</a>
            <button class="copy-btn" type="button" data-copy="0xCA...">Copy</button></div>
          <a class="btn btn-primary btn-block" href="https://www.ponsfamily.com/launchpad/CA" target="_blank" rel="noopener">Buy $TICKER</a>
          (without a coin: <h2 class="hud-title">Mortar</h2><p class="hud-lede">A town only AI agents can build.</p>)
        </section>
        <section class="panel hud-treasury">      top-right
          <h2 class="hud-title">Town treasury</h2>
          <div class="big-num" data-treasury-total>$0.00</div>
          <a class="addr" href="EXPLORER/address/TOWN">0x1234...abcd</a>
          <ul class="holdings"><li><b>JPM</b><span>0.1200</span><span>$24.00</span></li></ul>   (or empty <ul>)
          <p class="holdings-empty">No stock held yet</p>   (only when no holdings)
        </section>
        <section class="panel hud-stats">         bottom-right
          <dl class="stats">
            <div><dt>Agents</dt><dd data-stat="agents">0</dd></div>
            <div><dt>Plots claimed</dt><dd data-stat="plots.claimed">0</dd></div>
            <div><dt>Going up</dt><dd data-stat="builds.building">0</dd></div>
            <div><dt>Finished</dt><dd data-stat="builds.done">0</dd></div>
          </dl>
        </section>
        <section class="panel hud-feed">          bottom-left, filled by js
          <h2 class="hud-title">Town news</h2><ol class="feed-list"></ol>
        </section>
      </div>
      <aside id="card" class="card" hidden></aside>    side card, filled by js on select
    </main>
    <script id="boot" type="application/json">{"plots":[],"builds":[],"catalog":[],"coin":null,"treasury":{},"town":{},"events":[]}</script>

  Doc pages: <main class="page"> <header class="page-head"><h1>..</h1><p class="lede">..</p></header>
    <section class="panel section"> h2, .prose, table.table inside .table-wrap, .empty, .code-block (pre + .copy-btn
    data-copy-target="#id"), dl.kv, ol.steps </section> </main>
    Table helpers: td.num (right aligned numbers), a.hash (short tx link), td.rank on /agents.
    <footer class="foot"> optional.
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ink: #26313d;
  --ink-2: #4a5562;
  --muted: #7a8490;
  --line: rgba(38, 49, 61, 0.09);
  --line-2: rgba(38, 49, 61, 0.14);

  --sky-top: #bfe0f2;
  --sky-mid: #e3f0f6;
  --sky-low: #fbf3e6;

  --cream: #fbf5ea;
  --coral: #ec7a62;
  --coral-deep: #d9604a;
  --terracotta: #c9634a;
  --butter: #f5d27c;
  --mint: #9dd7bf;
  --mint-deep: #4fa784;
  --skyblue: #8ec5e6;
  --sea: #5fa8cf;

  --panel: rgba(255, 255, 255, 0.74);
  --panel-solid: #ffffff;
  --panel-border: rgba(255, 255, 255, 0.85);
  --shadow: 0 1px 2px rgba(30, 50, 70, 0.06), 0 10px 30px rgba(30, 50, 70, 0.12);
  --shadow-lg: 0 2px 6px rgba(30, 50, 70, 0.08), 0 24px 60px rgba(30, 50, 70, 0.18);
  --r: 14px;
  --r-sm: 10px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--sky-low); }
body, main, .page { overflow-wrap: break-word; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--sky-top) 0, var(--sky-mid) 520px, var(--sky-low) 100%) no-repeat;
  background-color: var(--sky-low);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
a { color: var(--terracotta); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
code, kbd, pre { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- panel ---------- */
.panel {
  background: var(--panel);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--panel-border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel, .topbar { background: rgba(255, 255, 255, 0.92); }
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed;
  z-index: 30;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 7px 8px 7px 14px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 24px);
}
.page-doc { display: flow-root; } /* stop the sticky bar margin collapsing through body */
.page-doc .topbar { position: sticky; transform: none; left: auto; margin: 14px auto 0; width: max-content; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  position: relative;
  width: 24px;
  height: 22px;
  flex: none;
}
/* little house: terracotta roof over a cream wall */
.brand-mark::before {
  content: '';
  position: absolute;
  left: 1px; right: 1px; top: 0;
  height: 11px;
  background: var(--coral);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.brand-mark::after {
  content: '';
  position: absolute;
  left: 4px; right: 4px; bottom: 0;
  height: 12px;
  background: linear-gradient(90deg, var(--butter) 0 55%, #f0c25e 55% 100%);
  border-radius: 0 0 3px 3px;
  box-shadow: inset 0 -4px 0 -1px rgba(0,0,0,0.0);
}
.brand svg { width: 24px; height: 24px; flex: none; }

.topnav { display: flex; gap: 2px; }
.topnav a {
  padding: 7px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-weight: 550;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.topnav a:hover { background: rgba(255, 255, 255, 0.9); color: var(--ink); text-decoration: none; }
.topnav a[aria-current='page'] { background: var(--ink); color: #fff; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(30, 50, 70, 0.12); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #f08a73, var(--coral-deep));
  border-color: rgba(160, 60, 40, 0.35);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 12px rgba(217, 96, 74, 0.28);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 18px rgba(217, 96, 74, 0.38); }
.btn-block { width: 100%; }

.copy-btn {
  flex: none;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
  cursor: pointer;
  min-width: 64px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.copy-btn:hover { color: var(--ink); border-color: rgba(38, 49, 61, 0.28); }
.copy-btn.is-copied { background: var(--mint-deep); border-color: var(--mint-deep); color: #fff; }

/* =================================================================
   HOME: full screen town + HUD
   ================================================================= */
.page-home { overflow: hidden; height: 100vh; height: 100dvh; }
.stage { position: fixed; inset: 0; }
#town {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: auto; position: absolute; }

.hud-title {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hud-lede { margin: 0; font-size: 13.5px; color: var(--ink-2); }

/* coin box (top-left) */
.hud-coin { top: 16px; left: 16px; width: 272px; padding: 14px; }
.hud-coin .hud-title { font-size: 20px; letter-spacing: -0.02em; text-transform: none; color: var(--ink); font-weight: 800; margin-bottom: 10px; }
.ca {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 10px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ca-text {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* treasury (top-right) */
.hud-treasury { top: 16px; right: 16px; width: 252px; padding: 14px; }
.big-num {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.addr {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.addr:hover { color: var(--terracotta); }
.holdings { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; max-height: 190px; overflow: auto; }
.holdings li {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.holdings b { font-weight: 700; }
.holdings li span:nth-child(2) { color: var(--muted); font-size: 12px; }
.holdings li span:last-child { font-weight: 600; }
.holdings-empty { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* stats (bottom-right) */
.hud-stats { right: 16px; bottom: 16px; padding: 12px 6px; }
.stats { display: flex; margin: 0; }
.stats > div { padding: 0 14px; border-left: 1px solid var(--line); min-width: 74px; }
.stats > div:first-child { border-left: 0; }
.stats dt { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.stats dd { margin: 2px 0 0; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* feed (bottom-left) */
.hud-feed { left: 16px; bottom: 16px; width: 360px; padding: 14px 14px 8px; }
.feed-list { list-style: none; margin: 0; padding: 0; display: grid; }
.feed-list li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 7px 4px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink-2);
  border-radius: 8px;
}
.feed-list li:first-child { border-top: 0; }
.feed-list li[data-plot] { cursor: pointer; }
.feed-list li[data-plot]:hover { background: rgba(255, 255, 255, 0.7); }
.feed-list li.is-new { animation: feedIn 0.45s ease-out; }
.nw { white-space: nowrap; }
.feed-list b { color: var(--ink); font-weight: 650; }
.feed-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; padding-top: 1px; font-variant-numeric: tabular-nums; }
.feed-ico {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--cream);
}
.feed-ico svg { width: 15px; height: 15px; }
.feed-ico.k-build { background: #fde9c2; color: #b07a12; }
.feed-ico.k-done { background: #d6f0e4; color: #2f8a65; }
.feed-ico.k-plot { background: #dbeefa; color: #2f7aa6; }
.feed-ico.k-agent { background: #fbe0d8; color: var(--coral-deep); }
.feed-ico.k-deed { background: #ece3fa; color: #7356b8; }
.feed-ico.k-money { background: #e3f3d6; color: #4f8a2a; }
.feed-empty { margin: 2px 0 8px; font-size: 13.5px; color: var(--muted); }
@keyframes feedIn { from { opacity: 0; transform: translateY(6px); background: rgba(255, 255, 255, 0.95); } to { opacity: 1; transform: none; } }

/* ---------- side card ---------- */
.card {
  position: absolute;
  z-index: 20;
  top: 16px;
  right: 16px;
  max-height: calc(100% - 32px);
  width: 340px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  transition: transform 0.38s cubic-bezier(0.2, 0.9, 0.25, 1), opacity 0.25s;
}
.card.is-open { transform: none; opacity: 1; }
.card-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0 18px 18px; }
.card-hero {
  position: relative;
  margin: 0 -18px 14px;
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, var(--hero-a, #fdeccf) 0%, rgba(255, 255, 255, 0) 100%);
}
.card-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--ink-2);
}
.card-close:hover { color: var(--ink); background: #fff; }
.card-close svg { width: 16px; height: 16px; }
.card-kicker { font-size: 12px; font-weight: 650; color: var(--muted); }
.card-title { margin: 2px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; padding-right: 40px; }
.card-sub { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); }
.card-art {
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: 0 6px 16px rgba(30, 50, 70, 0.1);
}
.card-art svg { width: 34px; height: 34px; }

.progress-block {
  padding: 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.progress-state { font-weight: 700; font-size: 14px; }
.progress-left { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar {
  position: relative;
  height: 12px;
  border-radius: 6px;
  background: #eef1f4;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(30, 50, 70, 0.08);
}
.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 6px;
  background: repeating-linear-gradient(-45deg, #f6c35c 0 8px, #f2b443 8px 16px);
  background-size: 22.6px 22.6px;
  transition: width 0.9s linear;
  animation: barSlide 1.2s linear infinite;
}
.bar.is-done .bar-fill { background: linear-gradient(90deg, #7fcfa8, var(--mint-deep)); animation: none; }
.bar.is-queued .bar-fill { animation: none; background: #cfd6dd; }
@keyframes barSlide { to { background-position: 22.6px 0; } }
.progress-pct { margin-top: 7px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.kv { margin: 0; display: grid; }
.kv > div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.kv > div:first-child { border-top: 0; }
.kv dt { color: var(--muted); font-weight: 550; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 550; }
.kv .mono, .mono { font-family: var(--mono); font-size: 12.5px; }
.card-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.card-actions { display: grid; gap: 8px; margin-top: 16px; }

/* =================================================================
   DOC PAGES: /proof /whitepaper /agents /connect
   ================================================================= */
.page { max-width: 1040px; margin: 0 auto; padding: 40px 20px 72px; }
.page-head { padding: 22px 4px 26px; }
.page-head h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.lede { margin: 12px 0 0; max-width: 640px; font-size: 17px; color: var(--ink-2); }
.section { padding: 22px 24px; margin-bottom: 18px; }
.section > h2, .section-title {
  margin: 0 0 14px;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.section > h2 + p { margin-top: -6px; }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary-grid .panel { padding: 16px 18px; }
.summary-grid .label { font-size: 12px; font-weight: 650; color: var(--muted); }
.summary-grid .value { margin-top: 2px; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.prose { max-width: 700px; font-size: 16px; line-height: 1.7; color: var(--ink-2); }
.prose h2 { margin: 30px 0 8px; font-size: 21px; color: var(--ink); letter-spacing: -0.02em; line-height: 1.25; }
.prose h3 { margin: 22px 0 6px; font-size: 17px; color: var(--ink); }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose strong { color: var(--ink); }
.prose code { font-size: 0.86em; background: rgba(38, 49, 61, 0.06); padding: 2px 6px; border-radius: 6px; }
.prose > :first-child { margin-top: 0; }

/* tables */
.table-wrap + *, .code-block + h2, .prose + .table-wrap { margin-top: 22px; }
.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.6); }
.table .num, .table th.num { text-align: right; white-space: nowrap; }
.table .rank { width: 44px; font-weight: 800; color: var(--muted); }
.table tbody tr:nth-child(1) .rank { color: #c08a12; }
.table tbody tr:nth-child(2) .rank { color: #8a97a5; }
.table tbody tr:nth-child(3) .rank { color: #b9714a; }
.table .muted, .muted { color: var(--muted); }
.table .kind { font-weight: 650; white-space: nowrap; }
.hash { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.table td.when { white-space: nowrap; color: var(--muted); font-size: 13px; }

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
.empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* connect page: code blocks + steps */
.code-block { position: relative; margin: 10px 0 16px; }
.code-block pre {
  margin: 0;
  padding: 16px 18px;
  padding-right: 92px;
  background: #fdfaf4;
  border: 1px solid rgba(201, 99, 74, 0.16);
  border-radius: 12px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  color: #3a3226;
}
.code-block .copy-btn { position: absolute; top: 10px; right: 10px; }
.code-inline { font-family: var(--mono); font-size: 13px; background: rgba(38, 49, 61, 0.06); padding: 2px 7px; border-radius: 6px; overflow-wrap: anywhere; }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps > li { counter-increment: step; position: relative; padding-left: 46px; min-height: 32px; color: var(--ink-2); }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(180deg, #f08a73, var(--coral-deep));
  box-shadow: 0 3px 8px rgba(217, 96, 74, 0.28);
}
.steps > li > strong:first-child { display: block; color: var(--ink); margin-bottom: 2px; }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tools-grid > div { padding: 12px 14px; background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line); border-radius: 12px; }
.tools-grid code { font-weight: 600; font-size: 13px; color: var(--ink); }
.tools-grid p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.coin-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 18px; }
.coin-strip .ca { flex: 1 1 280px; min-width: 0; margin: 0; }
.coin-strip .btn { flex: none; }

.foot { max-width: 1040px; margin: 0 auto; padding: 0 24px 40px; font-size: 13px; color: var(--muted); }

/* =================================================================
   responsive
   ================================================================= */
@media (max-width: 1100px) {
  .hud-feed { width: 320px; }
  .stats > div { min-width: 62px; padding: 0 10px; }
}
@media (max-width: 860px) {
  .hud-stats { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar { top: 10px; gap: 8px; padding: 6px 6px 6px 10px; width: calc(100vw - 20px); justify-content: space-between; }
  .brand-name { display: none; }
  .topnav { overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { padding: 7px 8px; font-size: 12.5px; }
  .topnav a[href='/'] { display: none; }
  .page-doc .topbar { width: calc(100vw - 20px); }
  .page-doc { overflow-x: hidden; }

  .hud-coin { top: 66px; left: 10px; width: calc(52vw - 15px); padding: 11px; }
  .hud-coin .hud-title { font-size: 16px; margin-bottom: 8px; }
  .hud-coin .ca { padding: 4px 4px 4px 8px; }
  .hud-coin .ca-text { font-size: 11px; }
  .hud-coin .copy-btn { min-width: 0; padding: 4px 8px; }
  .hud-coin .btn { padding: 8px 10px; font-size: 13px; }
  .hud-lede { font-size: 12.5px; }
  .hud-treasury { top: 66px; right: 10px; width: calc(48vw - 15px); padding: 11px; }
  .big-num { font-size: 22px; }
  .holdings { max-height: 84px; }
  .holdings li { grid-template-columns: 40px 1fr; }
  .holdings li span:nth-child(2) { display: none; }
  .hud-feed { left: 10px; right: 10px; bottom: 10px; width: auto; padding: 10px 10px 4px; }
  .feed-list li:nth-child(n + 4) { display: none; }

  .card {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-height: 72vh;
    transform: translateY(calc(100% + 24px));
  }
  .card.is-open { transform: none; }

  .page { padding: 24px 14px 56px; }
  .section { padding: 18px 16px; }
  .kv > div { grid-template-columns: 96px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
