/* =====================================================================
   sparehash website: page layer. Tokens and shared components live in
   theme.css (packages/ui/theme.css, copied here by scripts/build-pages.mjs).
   ===================================================================== */

.wrap { width: min(1600px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.stack { display: grid; gap: 16px; }
.stack > *, .duo > * { min-width: 0; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: var(--bg); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.nav__links { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); font-size: 14px; font-weight: 500; }
.nav__links a { color: var(--soft); }
.nav__links a:hover { color: var(--text); }
.nav__links a[aria-current="page"]:not(.pill-link) { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); padding-block: 6px; }
.nav__links .pill-link { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; background: var(--primary-bg); color: var(--primary-ink); font-weight: 600; }
.nav__links .pill-link:hover { background: var(--primary-hover); color: var(--primary-ink); }
.nav__toggle { display: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.nav__toggle span, .nav__toggle span::before, .nav__toggle span::after { display: block; width: 16px; height: 2px; margin-inline: auto; border-radius: 2px; background: var(--text); }
.nav__toggle span { position: relative; }
.nav__toggle span::before, .nav__toggle span::after { content: ""; position: absolute; left: 0; }
.nav__toggle span::before { top: -5px; }
.nav__toggle span::after { top: 5px; }
.nav.is-open .nav__toggle span { background: transparent; }
.nav.is-open .nav__toggle span::before { top: 0; transform: rotate(45deg); }
.nav.is-open .nav__toggle span::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 760px) {
  .nav__toggle { display: grid; place-items: center; }
  .nav__links { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px var(--gutter) 16px; border-bottom: 1px solid var(--line); background: var(--bg); display: none; }
  .nav.is-open .nav__links { display: flex; }
  .nav__links a { padding: 10px 4px; }
  .nav__links a[aria-current="page"]:not(.pill-link) { box-shadow: none; color: var(--accent-text); }
  .nav__links .pill-link { justify-content: center; margin-top: 8px; }
}

/* ---------- Hero ---------- */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(56px, 12vh, 128px) 0 clamp(48px, 9vh, 96px); }
.beta-chip { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; padding: 5px 14px 5px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--soft); }
.beta-chip b { padding: 2px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
a.beta-chip:hover { border-color: var(--line-strong); color: var(--text); }
.headline { font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 7vw, 104px); letter-spacing: -0.04em; line-height: 1.04; margin-bottom: 22px; }
.hl-line { display: block; }
.subhead { max-width: 640px; margin: 0 auto 32px; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6; color: var(--soft); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.cta-row .btn-primary, .cta-row .btn-glass { height: 48px; padding: 0 24px; font-size: 15px; }
.hero__note { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 10vh, 112px) 0; }
.section--tight { padding: clamp(36px, 7vh, 72px) 0; }
.section--flush { padding: 0 0 clamp(36px, 7vh, 72px); }
.section__head { max-width: 760px; margin: 0 auto clamp(28px, 5vh, 48px); text-align: center; }
.eyebrow { display: inline-block; margin-bottom: 14px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.section__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(32px, 4.6vw, 60px); letter-spacing: -0.04em; line-height: 1.06; margin-bottom: 14px; }
.section__lede { font-size: clamp(15px, 1.4vw, 17.5px); line-height: 1.65; color: var(--soft); }
.section__more { margin-top: 24px; text-align: center; font-size: 14.5px; }
.section__more a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.section__more a:hover { color: var(--accent-text); }

.page-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(48px, 10vh, 104px) 0 clamp(28px, 5vh, 52px); }
.page-hero__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(36px, 5.6vw, 76px); letter-spacing: -0.04em; line-height: 1.05; margin-bottom: 16px; }
.page-hero .section__lede { max-width: 680px; }
.page-hero--app { align-items: flex-start; text-align: left; padding: 36px 0 24px; }
.page-hero--app .page-hero__title { font-size: clamp(30px, 3.4vw, 48px); margin-bottom: 8px; }
.page-hero--center { min-height: calc(100dvh - 300px); justify-content: center; }
.page-hero--center .cta-row { margin-top: 24px; }

/* ---------- Cards, steps, lists ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
a.card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.card__icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.card__icon svg { width: 20px; height: 20px; }
.card--flame .card__icon { border-color: transparent; background: var(--accent-bg); color: var(--accent-text); }
.card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.card p { color: var(--soft); line-height: 1.6; }
.card code { padding: 1px 6px; border-radius: 6px; background: var(--surface-3); font-size: 13px; }
.card__more { margin-top: auto; padding-top: 16px; font-size: 14px; font-weight: 600; color: var(--accent-text); }

.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.points { list-style: none; display: grid; gap: 10px; margin-top: 4px; }
.points li { position: relative; padding-left: 20px; color: var(--soft); line-height: 1.55; }
.points li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.points code, .panel p code { padding: 1px 6px; border-radius: 6px; background: var(--surface-3); font-size: 12.5px; color: var(--text); word-break: break-word; }

.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.step { counter-increment: step; padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.step::before { content: counter(step, decimal-leading-zero); display: block; margin-bottom: 14px; font-family: var(--font-display); font-size: 30px; letter-spacing: -0.04em; color: var(--accent-text); }
.step h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.step p { color: var(--soft); line-height: 1.6; font-size: 14.5px; }

/* ---------- Pricing / tier rows ---------- */
.release-table { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.release-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--soft); font-variant-numeric: tabular-nums; }
.release-row--head { border-top: 0; padding-block: 11px; background: var(--surface-2); font-size: 11.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.release-row__version { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 20px; letter-spacing: -0.03em; color: var(--text); }
.release-row__version b { padding: 2px 8px; border-radius: 999px; background: var(--surface-3); font-family: var(--font-sans); font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--soft); }
.release-row.is-latest .release-row__version b { background: var(--accent); color: var(--accent-ink); }
.price-row { grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.6fr) minmax(0, 0.8fr) minmax(0, 0.8fr) minmax(0, 1fr); }
.price-row .release-row__version { font-family: var(--font-sans); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.release-note { margin-top: 12px; font-size: 13px; color: var(--muted); }
@media (max-width: 680px) {
  .release-row, .price-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .release-row--head { display: none; }
}

/* ---------- FAQ ---------- */
.faq { max-width: 900px; margin-inline: auto; display: grid; gap: 8px; }
.faq__group { margin: 18px 0 4px 2px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.faq details { border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.faq details[open] { border-color: var(--line-strong); }
.faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 16px 20px; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 20px 18px; color: var(--soft); line-height: 1.65; }

/* ---------- CTA band ---------- */
.cta-band { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: clamp(24px, 4vw, 40px); border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.cta-band h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -0.04em; line-height: 1.08; margin-bottom: 6px; }
.cta-band p { color: var(--soft); }
@media (max-width: 760px) { .cta-band { grid-template-columns: 1fr; } .cta-band .cta-row { justify-content: flex-start; } }

/* ---------- Footer ---------- */
.footer { margin-top: clamp(40px, 8vh, 80px); padding: 44px 0 28px; border-top: 1px solid var(--line); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px 48px; }
.footer__brand p { margin-top: 10px; max-width: 320px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.footer__cols { display: flex; flex-wrap: wrap; gap: 32px clamp(32px, 6vw, 80px); }
.footer__cols div { display: grid; align-content: start; gap: 10px; font-size: 14px; color: var(--soft); }
.footer__cols h4 { margin-bottom: 2px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.footer__cols a:hover { color: var(--text); }
.footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ---------- Dashboard ---------- */
.account-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.account-bar .who { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.signin { max-width: 560px; margin-inline: auto; text-align: center; }
.signin h3 { font-size: 20px; }
.wallets { display: grid; gap: 8px; margin-top: 18px; }
.wallet { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); font-weight: 500; text-align: left; }
.wallet:hover { border-color: var(--accent); }
.wallet img { width: 28px; height: 28px; border-radius: 7px; }
.status-msg { min-height: 20px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.status-msg.error { color: var(--red); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form .input { flex: 1; min-width: 200px; }
.input--sm { height: 34px; padding-top: 0; padding-bottom: 0; font-size: 13px; }
.reveal { margin-top: 14px; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent-bg); }
.reveal p { margin-bottom: 10px; font-size: 14px; }
.reveal__row { display: flex; gap: 8px; align-items: center; }
.reveal code { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; overflow-x: auto; white-space: nowrap; }
.off-cell { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.off-num { width: 84px; height: 34px; padding: 0 10px; }
.off-price { display: grid; gap: 2px; font-size: 13px; white-space: nowrap; }
.off-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--soft); cursor: pointer; }
.off-toggle input { accent-color: var(--green); }
.off-note { display: block; margin-top: 4px; font-size: 12px; white-space: normal; }
.name-form { display: inline-flex; gap: 6px; align-items: center; }
.name-form .input { width: 200px; height: 34px; }

.device { display: grid; gap: 1px; margin: 16px 0 20px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); text-align: left; }
.device div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 14px; background: var(--surface-2); font-size: 14px; }
.device dt { flex-shrink: 0; color: var(--muted); }
.device dd { text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.device dd code { word-break: break-all; }
.code-big { font-family: var(--font-display); font-size: clamp(36px, 6vw, 56px); letter-spacing: 0.02em; color: var(--accent-text); }

/* =====================================================================
   Markets catalog
   ===================================================================== */
.mk-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.mk-stats div { display: grid; gap: 2px; min-width: 150px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.mk-stats b { font-family: var(--font-display); font-size: 26px; font-weight: 400; letter-spacing: -0.03em; }
.mk-stats span { font-size: 12.5px; color: var(--muted); }

.mk-toolbar { display: flex; gap: 10px; margin-bottom: 10px; }
.mk-search { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; height: 48px; padding: 0 12px 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.mk-search:focus-within { border-color: var(--accent); }
.mk-search svg { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; }
.mk-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; }
.mk-search input::-webkit-search-cancel-button { display: none; }
.mk-search kbd { padding: 1px 8px; border-radius: 6px; border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.mk-select { display: grid; gap: 1px; padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.mk-select span { font-size: 11px; color: var(--muted); }
.mk-select select { border: 0; outline: 0; background: transparent; font-size: 14px; font-weight: 600; cursor: pointer; }
.mk-select option { background: var(--surface); }
.mk-select--sm { padding: 4px 10px; }
.mk-select--sm select { font-size: 13px; }

.mk-tabs { display: flex; gap: 2px; margin-bottom: 8px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.mk-tabs button { padding: 12px 16px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.mk-tabs button span { margin-left: 4px; font-weight: 500; }
.mk-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

.mk-head, .mk-row {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(170px, 1fr) 132px minmax(110px, 0.8fr) minmax(110px, 0.8fr) minmax(110px, 0.8fr) 70px 20px;
  align-items: center; gap: 16px;
}
.mk-head { padding: 10px 18px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.mk-head .r, .mk-row .r { text-align: right; justify-self: end; }
.mk-head .c, .mk-row .c { text-align: center; justify-self: center; }
.mk-list { display: grid; gap: 8px; }
.mk-item { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.mk-item:hover, .mk-item.is-open { border-color: var(--line-strong); }
.mk-row { width: 100%; padding: 16px 18px; text-align: left; }
.mk-model { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mk-model > span { display: grid; gap: 4px; min-width: 0; }
.mk-model b { font-size: 16.5px; font-weight: 600; }
.mk-logo { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; background: var(--c); font-family: var(--font-display); font-size: 22px; color: #fff; }
.mk-id { display: inline-flex; align-items: center; gap: 4px; }
.mk-id code { padding: 1px 7px; border-radius: 6px; background: var(--surface-3); font-size: 12px; color: var(--soft); }
.mk-copy { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--muted); }
.mk-copy svg { width: 13px; height: 13px; }
.mk-copy:hover { color: var(--text); background: var(--surface-3); }
.mk-copy.ok { color: var(--green); }
.mk-meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-price, .mk-liq, .mk-act, .mk-perf { display: grid; gap: 2px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mk-price span { white-space: nowrap; }
.mk-price b, .mk-liq b, .mk-act b, .mk-offers b, .mk-perf b { font-size: 14.5px; font-weight: 600; color: var(--text); }
.mk-offers { font-size: 13px; color: var(--muted); }
.mk-disc { display: grid; gap: 4px; justify-items: center; }
.mk-disc b, .mk-green { color: var(--green); }
.mk-disc b { font-family: var(--font-display); font-size: 24px; font-weight: 400; letter-spacing: -0.03em; }
.mk-spark { width: 112px; height: 24px; }
.mk-spark rect { fill: var(--blue); }
.mk-spark rect.e { fill: var(--surface-3); }
.mk-blue { color: var(--blue); }
.mk-chev::before { content: ""; display: block; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); }
.mk-item.is-open .mk-chev::before { transform: rotate(45deg); }

.mk-book { display: grid; gap: 22px; padding: 18px; border-top: 1px solid var(--line); }
.mk-book > *, .mk-offers-panel, .mk-proj { min-width: 0; }
.mk-offers-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.mk-offers-head h3, .mk-proj h3, .mk-trades h3 { font-size: 16px; font-weight: 600; }
.mk-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.mk-controls > label { display: grid; gap: 4px; font-size: 11px; color: var(--muted); }
.mk-seg { display: inline-flex; padding: 3px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); }
.mk-seg button { padding: 4px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.mk-seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.mk-table tr.mk-off td { opacity: 0.5; }
.mk-sub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.mk-mono { font-family: var(--font-mono); font-size: 12.5px; }
.mk-seller { display: inline-flex; align-items: center; gap: 6px; }

.mk-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-content: start; }
.mk-side-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
@media (max-width: 1000px) { .mk-side { grid-template-columns: 1fr; } }
.mk-proj { display: grid; gap: 8px; align-content: start; }
.mk-proj-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.mk-proj-head h3 { white-space: nowrap; }
.mk-range { flex: 1; min-width: 60px; }
.mk-dollar { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.mk-num { flex: none; width: 104px; height: 34px; }
.mk-proj p { font-size: 14.5px; color: var(--soft); }
.mk-proj p b { color: var(--text); }
.mk-fills { display: grid; gap: 6px; margin-top: 6px; }
.mk-fill { display: grid; grid-template-columns: 12px 64px 1fr 1fr 1.2fr; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mk-fill b { font-weight: 600; }
.mk-fill--head { padding-block: 0; border: 0; background: none; font-size: 11.5px; color: var(--muted); }
.mk-more { text-align: center; font-size: 13px; }
.mk-depth { padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); }
.mk-depth-svg { width: 100%; height: auto; overflow: visible; }
.mk-depth-svg text { fill: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.mk-depth-svg .g { stroke: var(--line); }
.mk-depth-svg .a { fill: var(--green-bg); }
.mk-depth-svg .l { fill: none; stroke: var(--green); stroke-width: 2; }
.mk-depth-svg .p { fill: var(--green); }
.mk-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted); }
.mk-trades { display: grid; gap: 2px; }
.mk-trade { display: grid; grid-template-columns: 44px 1fr auto 52px; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.mk-trade span:nth-child(3), .mk-trade span:nth-child(4) { text-align: right; }

@media (max-width: 1100px) {
  .mk-head, .mk-row { grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr) 120px minmax(100px, 0.8fr) 64px 20px; }
  .mk-act, .mk-perf, .mk-head .h-act, .mk-head .h-perf { display: none; }
}
@media (max-width: 760px) {
  .mk-head { display: none; }
  .mk-row { grid-template-columns: minmax(0, 1fr) auto 20px; grid-template-areas: "model disc chev" "price liq offers"; row-gap: 12px; }
  .mk-model { grid-area: model; }
  .mk-disc { grid-area: disc; }
  .mk-chev { grid-area: chev; }
  .mk-price { grid-area: price; justify-self: start; text-align: left; }
  .mk-liq { grid-area: liq; }
  .mk-offers { grid-area: offers; }
  .mk-toolbar { flex-direction: column; }
  .mk-book { padding: 12px; }
  .mk-spark { width: 72px; }
  .mk-fill { grid-template-columns: 10px 48px 1fr 1fr; }
  .mk-fill > :last-child { display: none; }
  .mk-proj-head { flex-wrap: wrap; }
}

/* ---------- Dashboard tabs + Sell ---------- */
.dash-tabs { position: sticky; top: 65px; z-index: 5; background: var(--bg); }
[data-tabpanel] [id] { scroll-margin-top: 130px; }
.sell-intro { display: grid; gap: 8px; padding-top: 6px; }
.sell-intro .section__title { text-align: left; font-size: clamp(28px, 4vw, 40px); }
.sell-intro .section__lede { text-align: left; margin: 0; max-width: 760px; }
.sell-group { display: grid; gap: 4px; padding-top: 10px; }
.sell-group__title { font-size: 20px; }
.spacer { flex: 1; }
.btn-block { width: 100%; justify-content: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--soft); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.p-mark {
  flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--surface-3); color: var(--soft); font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
}
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); font-size: 18px; line-height: 1; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn--danger:hover { color: var(--red); }

.sell-top { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }
.sell-earn__body { display: grid; grid-template-columns: minmax(180px, 0.8fr) minmax(0, 2fr); gap: 20px; align-items: end; margin: 6px 0 18px; }
.sell-big { font-family: var(--font-display); font-size: clamp(40px, 6vw, 64px); line-height: 1; color: var(--green); letter-spacing: -0.02em; }
.sell-earn__body p { margin-top: 8px; }
.sell-last { font-size: 15px; }
.sell-chart svg { width: 100%; height: 170px; display: block; }
.sell-chart .bar, .spark .bar { fill: var(--green); }
.sell-chart .bar--zero { fill: var(--line); }
.sell-chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--font-mono); }
.sell-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); padding-top: 14px; margin-bottom: 10px; }
.kpi { display: grid; gap: 2px; text-align: center; padding: 0 6px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi strong { font-size: 20px; }
.kpi span { font-size: 13px; color: var(--soft); }
.kpi small { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sell-live { display: flex; flex-direction: column; gap: 14px; }
.live-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.eyebrow-sm { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.live-row { display: flex; align-items: center; gap: 10px; font-size: 14px; min-width: 0; }
.live-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-row__v { font-weight: 600; white-space: nowrap; }
.spark { width: 72px; height: 18px; flex: none; }
.sell-live__totals { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); text-align: center; }

.cred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cred-card {
  display: grid; gap: 14px; text-align: left; padding: 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2); transition: border-color 0.15s ease;
}
.cred-card:hover { border-color: var(--line-strong); }
.cred-card.is-current { border-color: var(--accent); }
.cred-card__top { display: flex; gap: 12px; align-items: center; }
.cred-card__top > div { flex: 1; min-width: 0; }
.cred-card__top strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cred-card__foot { display: flex; justify-content: space-between; gap: 8px; }

.offer-step { display: grid; gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); }
.offer-step:first-of-type { border-top: 0; padding-top: 4px; }
.offer-step__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.offer-step__head h4 { font-size: 16px; }
.offer-step__n {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent-text); font-size: 12px; font-weight: 700;
}
.offer-step > select.input { max-width: 420px; }
.provider-row { display: grid; grid-template-columns: minmax(200px, 0.9fr) minmax(0, 2fr) auto; gap: 10px; }
.key-field .input { width: 100%; font-family: var(--font-mono); }
.key-saved {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2); font-size: 14px;
}
.key-saved > span:nth-child(2) { flex: 1; }
.key-saved__x { width: 28px; height: 28px; border-radius: 6px; color: var(--muted); font-size: 18px; }
.key-saved__x:hover { background: var(--surface-3); color: var(--text); }

.model-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.model-card {
  display: grid; gap: 8px; align-content: start; text-align: left; padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); min-width: 0;
}
.model-card:hover:not(:disabled) { border-color: var(--line-strong); }
.model-card.is-picked { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.model-card.is-off { opacity: 0.55; cursor: default; }
.model-card.is-ok { border-color: var(--green); }
.model-card.is-fail { border-color: var(--red); }
.model-card__top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.model-card__name { display: grid; min-width: 0; }
.model-card__name > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-card--more { place-items: center; color: var(--accent-text); font-weight: 600; border-style: dashed; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pricing-grid .input { width: 100%; }
.offer-ready { display: grid; gap: 10px; justify-items: center; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; }
.offer-ready .btn-lg { min-width: min(100%, 420px); justify-content: center; }

.demand { display: grid; gap: 18px; }
.demand-row { display: grid; gap: 8px; }
.demand-row__top { display: flex; align-items: center; gap: 10px; }
.demand-row__sub { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--blue); }
.pager { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.pager:empty { display: none; }
.table.sales td { vertical-align: top; }

dialog.sheet {
  width: min(860px, calc(100% - 32px)); max-height: min(88vh, 960px); margin: auto; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text);
}
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet::backdrop { background: rgba(10, 10, 12, 0.55); }
dialog.sheet--side { width: min(560px, 100%); max-height: 100vh; height: 100vh; margin: 0 0 0 auto; border-radius: 0; border-width: 0 0 0 1px; }
.sheet__head { display: flex; justify-content: space-between; gap: 16px; padding: 20px 22px 12px; }
.sheet__tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 0 22px 12px; }
.sheet--side .sheet__tools { grid-template-columns: minmax(0, 1fr); }
.sheet__bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 22px; border-block: 1px solid var(--line); }
.sheet__bulk .input--sm { width: 110px; }
.sheet__body { flex: 1; overflow-y: auto; padding: 14px 22px; display: grid; gap: 10px; align-content: start; }
.sheet__foot { display: flex; gap: 10px; align-items: center; padding: 14px 22px; border-top: 1px solid var(--line); }

.manage-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) 72px 84px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.manage-row.is-off { opacity: 0.55; }
.manage-row__name { display: grid; min-width: 0; }
.manage-row__name > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-row .input--sm { width: 100%; }

.offer-row {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.offer-row.is-bad { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.offer-row > input { margin-top: 10px; accent-color: var(--accent); }
.offer-row__main { display: grid; gap: 6px; min-width: 0; }
.offer-row__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.offer-row__err {
  display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 4px;
  padding: 10px 12px; border-radius: 8px; background: var(--red-bg); font-size: 13px;
}
.offer-row__actions { display: flex; gap: 2px; }
.offer-edit { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 6px; }
.offer-edit .field { width: 120px; }

@media (max-width: 960px) {
  .sell-top, .sell-earn__body { grid-template-columns: minmax(0, 1fr); }
  .sell-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { border-left: 0; }
  .provider-row, .pricing-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .offer-row { grid-template-columns: auto minmax(0, 1fr); }
  .offer-row > .p-mark { display: none; }
  .offer-row__actions { grid-column: 2; }
  .manage-row { grid-template-columns: auto minmax(0, 1fr) 64px 72px; }
  .manage-row > .p-mark { display: none; }
}

/* ---------- Download ---------- */
.dl-card { display: grid; gap: 18px; }
.dl-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dl-card__title { font-size: 22px; margin-bottom: 4px; }
.dl-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.dl-buttons .btn-lg { gap: 10px; max-width: 100%; white-space: normal; text-align: left; }
@media (max-width: 560px) { .dl-buttons .btn-lg { width: 100%; justify-content: center; text-align: center; } }
.dl-buttons .is-disabled { opacity: 0.5; pointer-events: none; }
.dl-size { font-size: 12px; opacity: 0.7; font-weight: 500; }
.dl-sums summary { cursor: pointer; color: var(--soft); font-size: 14px; }
.dl-sums .table-wrap { margin-top: 10px; }
.dl-sha { font-size: 11px; word-break: break-all; }
.dl-steps { display: grid; gap: 10px; padding-left: 20px; color: var(--soft); }
.dl-steps strong { color: var(--text); }
