/* stock.fun — the whole visual system, in Meteora's language: near-black ground, Inter,
   tinted-orange actions, dense 44px data rows, 8–12px radii. */
:root {
  color-scheme: dark;
  --ground: #0d0d13;
  --panel: #12121c;
  --panel-2: #181825;
  --raised: #202031;
  --line: #262636;
  --line-soft: #1e1e2d;
  --ink: #f9f9fb;
  --ink-2: #e5e7eb;
  --muted: #9595b2;
  --dim: #6c6c89;
  --orange: #f54b00;
  --orange-ink: #f76727;
  --orange-tint: rgba(245, 75, 0, .16);
  --purple: #8664ff;
  --purple-soft: #9e83ff;
  --purple-tint: rgba(134, 100, 255, .16);
  --up: #24c98d;
  --down: #f04438;
  --amber: #f79009;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --r: 8px;
  --r-lg: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font: 400 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
p { margin: 0; }
::selection { background: var(--orange-tint); color: var(--orange-ink); }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- shell */
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(13, 13, 19, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
/* three tracks: brand + links, the search dead centre, actions — so the search stays
   centred on the page no matter how wide the two sides get */
.topbar .wrap { display: grid; grid-template-columns: 1fr minmax(240px, 400px) 1fr; align-items: center; gap: 16px; height: 64px; }
.topbar .left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar .right { display: flex; align-items: center; gap: 9px; justify-content: flex-end; }
.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand .mark { width: 38px; height: 38px; flex: 0 0 38px; display: block; }
.topnav { display: flex; align-items: center; gap: 2px; }
.topnav a { padding: 7px 11px; border-radius: var(--r); font-size: 13px; font-weight: 500; color: var(--muted); }
.topnav a:hover { color: var(--ink); background: var(--panel-2); }
.topnav a[aria-current="page"] { color: var(--ink); background: var(--raised); }
.search {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 0 11px;
}
.search svg { width: 13px; height: 13px; color: var(--dim); flex: 0 0 13px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; padding: 8px 0; font-size: 13px; }
.search input::placeholder { color: var(--dim); }
.search input:focus { outline: none; }
.x-link { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r); color: var(--muted); }
.x-link:hover { color: var(--ink); background: var(--panel-2); }
.x-link svg { width: 15px; height: 15px; display: block; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 7px 12px; border-radius: var(--r); border: 1px solid transparent;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.btn-primary { background: var(--orange-tint); color: var(--orange-ink); }
.btn-primary:hover { background: rgba(245, 75, 0, .26); }
.btn-solid { background: var(--orange); color: #fff; }
.btn-solid:hover { background: #ff5f14; }
.btn-ghost { background: var(--panel); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--raised); }
.btn-lg { padding: 11px 18px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------------------------------------------------------- hero band */
.band { position: relative; overflow: hidden; border-bottom: 1px solid var(--line-soft); }
.band:before {
  content: ''; position: absolute; inset: -60% 40% 20% -20%; pointer-events: none;
  background: radial-gradient(ellipse at 30% 50%, rgba(245, 75, 0, .20), transparent 62%),
              radial-gradient(ellipse at 70% 20%, rgba(134, 100, 255, .16), transparent 60%);
  filter: blur(6px);
}
.band .wrap { position: relative; display: flex; align-items: flex-end; gap: 32px; flex-wrap: wrap; padding-top: 42px; padding-bottom: 30px; }
.band h1 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.1; }
.band .lede { color: var(--muted); font-size: 14px; margin-top: 9px; max-width: 540px; }
.band .grow { flex: 1 1 380px; }
.stats { display: flex; gap: 30px; flex-wrap: wrap; }
.stats div span { display: block; font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }
.stats div b { display: block; font-size: 19px; font-weight: 600; margin-top: 5px; letter-spacing: -.02em; }

/* ---------------------------------------------------------------- tabs + panels */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 18px 0 12px; }
.tabs { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tabs button {
  padding: 6px 12px; border: 0; border-radius: 7px; background: none;
  font-size: 12px; font-weight: 500; color: var(--dim);
}
.tabs button:hover { color: var(--ink-2); }
.tabs button.on { background: var(--raised); color: var(--ink); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { font-size: 14px; font-weight: 600; }
.panel-head .tag { margin-left: auto; font-size: 11px; color: var(--dim); }
.panel-body { padding: 16px; }

/* ---------------------------------------------------------------- data table */
.table { width: 100%; border-collapse: collapse; }
.table th {
  position: sticky; top: 64px; z-index: 5; background: var(--ground);
  text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .03em; text-transform: uppercase;
  color: var(--dim); padding: 10px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap;
}
.table td { padding: 0 12px; height: 56px; border-bottom: 1px solid var(--line-soft); font-size: 13px; vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: var(--panel); }
.table .r { text-align: right; }
.rank { color: var(--dim); font-size: 12px; width: 44px; }

.tok { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tok img { width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px; object-fit: cover; background: var(--raised); }
.tok b { display: block; font-size: 13px; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.tok small { display: block; font-size: 11px; color: var(--dim); margin-top: 2px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 500; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
}
.pill img { width: 13px; height: 13px; border-radius: 3px; }
.pill.live { background: rgba(36, 201, 141, .12); color: var(--up); border-color: rgba(36, 201, 141, .22); }
.pill.grad { background: var(--purple-tint); color: var(--purple-soft); border-color: rgba(134, 100, 255, .28); }
.pill.warn { background: rgba(247, 144, 9, .12); color: var(--amber); border-color: rgba(247, 144, 9, .25); }

.bar { width: 96px; height: 5px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--orange), #ff9548); }
.bar.done i { background: linear-gradient(90deg, var(--purple), var(--purple-soft)); }
.barwrap { display: flex; align-items: center; gap: 9px; }
.barwrap span { font-size: 11px; color: var(--muted); min-width: 34px; }

.pill.demo { background: rgba(134, 100, 255, .10); color: var(--purple-soft); border-color: rgba(134, 100, 255, .22); }
tr.is-demo td { opacity: .78; }
tr.is-demo:hover td { opacity: 1; }
.demo-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 0 0 2px; border: 1px dashed var(--raised); border-radius: var(--r); font-size: 12px; color: var(--dim); }

.empty { padding: 56px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty a { color: var(--orange-ink); }

/* ---------------------------------------------------------------- forms */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.field > span em { font-style: normal; color: var(--dim); font-weight: 400; }
.input, input[type=text], input[type=url], input[type=number], input[type=search], textarea, select {
  width: 100%; background: var(--ground); border: 1px solid var(--line); border-radius: var(--r);
  padding: 9px 11px; font-size: 13px; color: var(--ink);
}
.input:focus, input:focus, textarea:focus, select:focus { outline: none; border-color: var(--raised); background: #0a0a10; }
input::placeholder, textarea::placeholder { color: var(--dim); }
textarea { resize: vertical; min-height: 72px; }
.hint { font-size: 11px; color: var(--dim); line-height: 1.6; margin-top: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.amount { display: flex; align-items: center; gap: 8px; background: var(--ground); border: 1px solid var(--line); border-radius: var(--r); padding: 0 11px; }
.amount input { background: none; border: 0; padding: 9px 0; flex: 1; min-width: 0; }
.amount .unit { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }

.art-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 104px; height: 104px; flex: 0 0 104px; cursor: pointer; text-align: center;
  background: var(--ground); border: 1px dashed var(--raised); border-radius: var(--r-lg);
  color: var(--dim); font-size: 11px; overflow: hidden; position: relative;
}
.art-drop:hover { border-color: var(--orange); color: var(--orange-ink); }
.art-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.pick { max-height: 316px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
.pick table { width: 100%; border-collapse: collapse; }
.pick th { position: sticky; top: 0; background: var(--panel-2); z-index: 2; font-size: 10px; padding: 9px 12px; }
.pick td { height: 48px; padding: 0 12px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.pick tr { cursor: pointer; }
.pick tr:hover td { background: var(--panel-2); }
.pick tr.on td { background: var(--orange-tint); }
.pick tr.on td:first-child { box-shadow: inset 2px 0 0 var(--orange); }
.pick .nope td { opacity: .45; }
.pick input[type=radio] { accent-color: var(--orange); }

.notice { padding: 11px 13px; border-radius: var(--r); font-size: 12px; line-height: 1.6; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); }
.notice.bad { border-color: rgba(240, 68, 56, .3); background: rgba(240, 68, 56, .09); color: #ffb4ad; }
.notice.ok { border-color: rgba(36, 201, 141, .28); background: rgba(36, 201, 141, .09); color: #8ef0c8; }
.notice a { color: var(--orange-ink); text-decoration: underline; text-underline-offset: 2px; }

dl.kv { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 0; }
dl.kv > div { display: contents; }
dl.kv dt, dl.kv dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { text-align: right; font-weight: 500; }
dl.kv > div:last-child dt, dl.kv > div:last-child dd { border-bottom: 0; }

.code { font: 11px/1.5 var(--mono); color: var(--muted); word-break: break-all; }

dialog { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 14px; padding: 0; max-width: 460px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(5, 5, 9, .72); backdrop-filter: blur(3px); }

/* ---------------------------------------------------------------- layouts */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 16px; align-items: start; padding-bottom: 60px; }
.token-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; padding-bottom: 60px; }
.stack { display: grid; gap: 16px; }

.tk-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 22px 0 16px; }
.tk-head > img { width: 52px; height: 52px; border-radius: 12px; background: var(--raised); object-fit: cover; }
.tk-head h1 { font-size: 22px; }
.tk-head .sub { font-size: 12px; color: var(--dim); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tk-head .sub a { color: var(--muted); }
.tk-head .sub a:hover { color: var(--orange-ink); }
.tk-price { margin-left: auto; text-align: right; }
.tk-price b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.tk-price span { font-size: 12px; color: var(--muted); }

.chart-host { height: 384px; }
.chart-empty { height: 100%; display: grid; place-items: center; color: var(--dim); font-size: 13px; }

.swapbox .seg { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.swapbox .seg button { border: 0; background: none; border-radius: 7px; padding: 8px; font-size: 13px; font-weight: 600; color: var(--dim); }
.swapbox .seg button.on { background: var(--raised); color: var(--ink); }
.swapbox .seg button.on.sell { color: var(--down); }
.swapbox .seg button.on.buy { color: var(--up); }
.swapbox .out { display: flex; align-items: baseline; gap: 8px; padding: 11px; background: var(--ground); border: 1px solid var(--line); border-radius: var(--r); }
.swapbox .out b { font-size: 17px; font-weight: 600; }
.swapbox .out span { font-size: 12px; color: var(--muted); }

.tape { width: 100%; border-collapse: collapse; }
.tape th { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); text-align: left; font-weight: 500; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
.tape td { padding: 7px 12px; font-size: 12px; border-bottom: 1px solid var(--line-soft); }
.tape td:last-child, .tape th:last-child { text-align: right; }
.tape a { color: var(--dim); font-family: var(--mono); font-size: 11px; }
.tape a:hover { color: var(--orange-ink); }

footer { border-top: 1px solid var(--line-soft); margin-top: auto; }
footer .wrap { display: flex; align-items: center; justify-content: center; padding: 20px; }
footer .x-link { width: 38px; height: 38px; }
footer .x-link svg { width: 17px; height: 17px; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  padding: 11px 16px; border-radius: 10px; font-size: 13px; z-index: 90;
  opacity: 0; pointer-events: none; transition: all .18s; box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(240, 68, 56, .4); }

/* ---------------------------------------------------------------- docs */
.doc { max-width: 760px; padding: 34px 0 70px; }
.doc h1 { font-size: 30px; margin-bottom: 10px; }
.doc h2 { font-size: 17px; margin: 34px 0 10px; }
.doc p { color: var(--muted); font-size: 14px; line-height: 1.75; margin: 10px 0; }
.doc li { color: var(--muted); font-size: 14px; line-height: 1.75; margin: 6px 0; }
.doc strong { color: var(--ink-2); font-weight: 600; }
.doc code { font: 12px var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--ink-2); }
.doc a { color: var(--orange-ink); }

@media (max-width: 1000px) {
  .cols, .token-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .topbar .wrap { grid-template-columns: auto 1fr auto; }
  .topnav { display: none; }
}
@media (max-width: 720px) {
  .search { display: none; }
  .topbar .wrap { grid-template-columns: auto 1fr; height: 58px; }
  .band .wrap { padding-top: 28px; }
  .stats { gap: 18px; }
  .stats div b { font-size: 16px; }
  .table .hide-s, .tape .hide-s { display: none; }
  .tok b { max-width: 130px; }
}

/* ---------------------------------------------------------------- chart */
/* no height here: .chart-host sets it, and a percentage against an auto-height panel
   feeds the canvas resize observer into a growth loop */
.fc { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chart-host.fc { height: 384px; }
.fc-bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.fc-pair { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.fc-pair img { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; }
.fc-pair b { font-weight: 600; }
.fc-pair span { color: var(--dim); }
.fc-px { margin-left: auto; display: flex; align-items: baseline; gap: 8px; }
.fc-px b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fc-chg { font-size: 12px; font-variant-numeric: tabular-nums; }
.fc-tf { display: flex; gap: 2px; background: var(--ground); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.fc-tf button { border: 0; background: none; border-radius: 6px; padding: 4px 8px; font-size: 11px; color: var(--dim); }
.fc-tf button.on { background: var(--raised); color: var(--ink); }
.fc-cv { position: relative; flex: 1; min-height: 0; }
.fc-cv canvas { display: block; width: 100%; height: 100%; }
.fc-tip {
  position: absolute; top: 8px; pointer-events: none; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 11px;
  line-height: 1.7; color: var(--muted); min-width: 150px; box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
.fc-tip b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 500; }

/* the pad token's contract address, under the hero */
.ca-chip { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding: 8px 10px 8px 8px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-size: 13px; max-width: 100%; }
.ca-chip img { width: 28px; height: 28px; border-radius: 8px; }
.ca-chip b { font-weight: 600; }
.ca-chip code { font-family: var(--mono); font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.ca-chip button { font: inherit; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 7px; border: 0; cursor: pointer;
  background: var(--raised); color: var(--ink-2); }
.ca-chip button:hover { color: var(--orange-ink); }
.ca-chip a.trade { color: var(--orange-ink); font-weight: 600; }
.pill.migrated { background: rgba(36, 201, 141, .14); color: var(--up); }
.tok small .ca { font-family: var(--mono); color: var(--dim); }

/* the Zcash receipt link on a token page */
.pill.zec { background: rgba(244, 183, 40, .14); color: #f4b728; border-color: rgba(244, 183, 40, .3); }

/* the hidden attribute wins over any display rule (the X links and the CA chip rely on it) */
[hidden] { display: none !important; }
