/* Pennydrop: a vending machine on a shop wall. Structure first, then the machine and its parts, then pages, then
   phones. Every colour comes from tokens.css. */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); }
body { margin: 0; min-height: 100svh; background: var(--wall); color: var(--ink); font: 400 16px/1.55 var(--font-text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
::selection { background: var(--coin); color: var(--ink); }

/* ---------- type ---------- */
h1, h2, .display { font-family: var(--font-display); font-weight: 400; letter-spacing: 0; line-height: 1; text-wrap: balance; text-transform: uppercase; }
h1 { font-size: clamp(36px, 5vw, 64px); }
h2 { font-size: clamp(26px, 3.2vw, 40px); }
h3, .h3 { font: 700 19px/1.3 var(--font-text); letter-spacing: -0.01em; }
.lede { font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-2); max-width: 36em; }
.muted { color: var(--muted); }
.fine { font-size: 13.5px; color: var(--muted); }
.mono, .num, .label, .kicker, .chip, .tag { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.label { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.kicker-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--wall), 0 0 0 4px var(--red); }
.back-amt, .gold { color: var(--coin-ink); font-weight: 700; }
.red { color: var(--red); }
.up { color: var(--good); }
.down { color: var(--bad); }
b, strong { font-weight: 700; }

/* ---------- layout ---------- */
.wrap { width: min(var(--wrap), 100% - 2 * var(--gut)); margin-inline: auto; }
.section { padding-top: clamp(64px, 9vw, 112px); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head .lede { margin-top: 10px; }
.page-head { padding-top: clamp(36px, 6vw, 72px); padding-bottom: 30px; display: grid; gap: 14px; justify-items: start; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 18px; }
.stack { display: grid; gap: 12px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
main { padding-bottom: 120px; min-height: 60svh; }
main.enter { animation: page-in var(--t) var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- header ---------- */
#top { position: sticky; top: 0; z-index: 20; background: var(--wall); border-bottom: var(--border); }
.demo-strip { background: var(--ink); color: var(--seg); font: 13px/1.4 var(--font-mono); text-align: center; padding: 7px var(--gut); }
.demo-strip b { color: var(--coin); }
.top-bar { height: var(--top-h); display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand svg { height: 26px; width: auto; }
.nav { display: flex; gap: 2px; }
.nav a { padding: 8px 12px; border-radius: var(--r-pill); color: var(--ink-2); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--wall-2); }
.nav a[aria-current] { color: var(--ink); background: var(--wall-2); box-shadow: inset 0 0 0 2px var(--ink); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tabbar { display: none; }

/* ---------- buttons: machine keys ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r); border: var(--border); background: var(--panel); color: var(--ink); font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap; text-decoration: none; box-shadow: 3px 3px 0 var(--ink); transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast); }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--red); color: var(--on-red); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: var(--r-sm); box-shadow: 2px 2px 0 var(--ink); }
.btn.lg { height: 54px; padding: 0 24px; font-size: 16.5px; }
.btn.wide { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--ink); }
.btn.ghost { box-shadow: none; background: transparent; }
.btn.ghost:hover { background: var(--wall-2); transform: none; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r); border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { color: var(--ink); background: var(--wall-2); }
.link { background: none; border: 0; padding: 0; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.link-arrow { color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon { display: inline-flex; }

/* ---------- chips, banners ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); border: 1.5px solid var(--ink); background: var(--panel); font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.chip.gold { background: var(--coin); border-color: var(--ink); color: var(--ink); }
.chip.hit { background: var(--ink); color: var(--seg); }
.chip.demo { background: var(--wall-2); color: var(--warn); border-color: var(--warn); }
.chip.soft { border-color: var(--line-3); color: var(--ink-2); font-weight: 400; }
.chip.bad { color: var(--bad); border-color: var(--bad); }
.banner { margin-top: 20px; padding: 14px 18px; border-radius: var(--r); border: var(--border); background: var(--panel); box-shadow: var(--shadow); }
.banner.good { background: var(--coin); }
.banner.warn { border-color: var(--warn); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }

/* ---------- the CA box ---------- */
.ca { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border-radius: var(--r); border: 2px dashed var(--ink); background: var(--panel); max-width: 100%; }
.ca-addr { font-size: 13px; word-break: break-all; user-select: all; }
.ca-soon { color: var(--red); font-weight: 700; }
.ca-note { font-size: 13px; flex-basis: 100%; color: var(--muted); }
.ca.small { padding: 0 12px; height: 38px; flex-wrap: nowrap; border-width: 1.5px; }
.ca.small .label { font-size: 10.5px; }

/* ---------- 7-segment windows ---------- */
.screen { display: inline-flex; align-items: center; justify-content: center; background: var(--screen); border-radius: var(--r-sm); padding: 10px 14px; }
svg.seg { display: block; height: auto; max-width: 100%; }

/* ---------- THE MACHINE ---------- */
.hero { padding-top: clamp(22px, 4vw, 44px); }
.hero-kick { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.machine { position: relative; background: var(--red); border: var(--border); border-radius: var(--r-xl); padding: clamp(14px, 2vw, 24px); box-shadow: var(--shadow-red), 8px 8px 0 2px var(--ink); display: grid; gap: clamp(12px, 1.6vw, 18px); }
.marquee { background: var(--wall); border: var(--border); border-radius: var(--r-lg); padding: clamp(18px, 2.6vw, 30px) clamp(18px, 3vw, 36px); display: grid; grid-template-columns: 1.15fr 1fr; gap: 10px 36px; align-items: center; }
.marquee h1 { font-size: clamp(38px, 5.6vw, 76px); line-height: 0.95; }
.marquee h1 .two { color: var(--red); display: block; }
.marquee .lede { font-size: clamp(16px, 1.4vw, 18px); color: var(--ink-2); }
.marquee .lede b { color: var(--ink); }
.machine-mid { display: grid; grid-template-columns: 1fr minmax(280px, 330px); gap: clamp(12px, 1.6vw, 18px); }
.window { background: var(--wall-2); border: var(--border); border-radius: var(--r-lg); padding: clamp(10px, 1.4vw, 16px); display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 1.2vw, 14px); align-content: start; }
.slot { position: relative; display: grid; gap: 8px; justify-items: center; padding: 12px 8px 10px; border-radius: var(--r); border: 2px solid transparent; background: transparent; cursor: pointer; text-align: center; transition: background var(--t-fast), border-color var(--t-fast); }
.slot:hover { background: var(--wall-3); }
.slot[aria-pressed="true"] { border-color: var(--ink); background: var(--panel); box-shadow: 3px 3px 0 var(--ink); }
.slot .pack { width: min(96px, 70%); height: auto; transition: transform var(--t) var(--ease); }
.slot:hover .pack, .slot[aria-pressed="true"] .pack { transform: translateY(-3px) rotate(-1.5deg); }
.slot .tag { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; max-width: 150px; background: var(--screen); color: var(--seg); border-radius: 6px; padding: 5px 8px; font-size: 12.5px; font-weight: 700; }
.slot .tag svg.seg { height: 15px; width: auto; }
.slot .slot-name { font: 600 13.5px/1.2 var(--font-text); color: var(--ink-2); }
.slot.out { cursor: not-allowed; }
.slot.out .pack { opacity: 0.35; filter: grayscale(1); }
.slot .out-label { position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%) rotate(-8deg); background: var(--ink); color: var(--seg); font: 700 11px/1 var(--font-mono); letter-spacing: 0.1em; padding: 5px 8px; border-radius: 4px; white-space: nowrap; }
.panel-col { background: var(--red-deep); border: var(--border); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 14px; align-content: start; color: var(--on-red); }
.panel-col .label { color: var(--red-soft); }
.display { display: grid; gap: 6px; }
.display .screen { min-height: 78px; padding: 14px 16px; justify-content: flex-end; }
.display .screen svg.seg { height: 44px; width: auto; }
.readout { display: grid; gap: 6px; font: 14px/1.4 var(--font-mono); }
.readout div { display: flex; justify-content: space-between; gap: 10px; }
.readout b { color: var(--wall); }
.readout .gold { color: var(--coin); }
.key-buy { height: 58px; font-size: 17px; background: var(--wall); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.panel-col .fine { color: var(--red-soft); font-size: 12.5px; line-height: 1.45; }
.machine-low { display: grid; grid-template-columns: 1fr minmax(280px, 330px); gap: clamp(12px, 1.6vw, 18px); }
.flap { background: var(--ink); border: var(--border); border-radius: var(--r-lg); padding: 14px; display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; color: var(--seg); min-height: 150px; }
.flap .card-art { width: 86px; }
.flap .label { color: var(--muted); color: #B7A79C; }
.flap h3 { color: var(--wall); }
.flap .fine { color: #B7A79C; }
.card-art { position: relative; aspect-ratio: 120 / 194; border-radius: 8px; overflow: hidden; background: var(--panel); flex: none; }
.card-art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-art.photo { background: var(--wall-2); }
.flap .card-art.photo, .pull-stage .card-art.photo { background: transparent; }
.card-art svg { width: 100%; height: 100%; }
.card-art.thumb { width: 40px; aspect-ratio: 3 / 4; border-radius: 6px; }
.card-art.thumb img { object-fit: cover; object-position: center 30%; }
.with-thumb { display: flex; gap: 12px; align-items: center; min-width: 0; }
.with-thumb > div { min-width: 0; }
.flap-empty { color: #B7A79C; font: 14px var(--font-mono); grid-column: 1 / -1; text-align: center; }

/* the coin return: the one motion moment */
.tray { background: var(--ink); border: var(--border); border-radius: var(--r-lg); padding: 12px; display: grid; gap: 10px; align-content: start; }
.tray .screen { justify-content: center; min-height: 52px; }
.tray .screen svg.seg { height: 28px; width: auto; }
.cup { position: relative; height: 92px; border-radius: 0 0 26px 26px; background: var(--screen); overflow: hidden; }
.cup::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 66px; border: 12px solid var(--wall); border-top: 0; border-radius: 0 0 26px 26px; pointer-events: none; }
.cup .coin { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: var(--coin); box-shadow: inset 0 0 0 3px var(--coin), inset 0 0 0 6.5px var(--coin-deep); bottom: 14px; }
[data-motion="on"] .cup.drop .coin { animation: coin-drop 420ms var(--drop) both; }
@keyframes coin-drop { 0% { transform: translateY(-110px); opacity: 0; } 12% { opacity: 1; } 82% { transform: translateY(3px); } 100% { transform: translateY(0); } }
.tray-cap { display: flex; justify-content: space-between; font: 700 11px/1 var(--font-mono); letter-spacing: 0.1em; color: #B7A79C; }
.hit-lamp { color: var(--seg); }
.hero-under { display: flex; gap: 18px 28px; align-items: center; flex-wrap: wrap; margin-top: 26px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px 30px; }
.stat { display: grid; gap: 2px; }
.stat-value { font: 700 22px/1.2 var(--font-mono); font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 12.5px; color: var(--muted); }

/* ---------- shelf: pulls as small flaps ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pull-card { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px; border-radius: var(--r-lg); border: var(--border); background: var(--panel); box-shadow: var(--shadow); text-decoration: none; transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast); min-width: 0; }
a.pull-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.pull-card .card-art { width: 64px; }
.pull-card .meta { display: grid; gap: 4px; min-width: 0; align-content: start; }
.pull-card .name { font-weight: 700; font-size: 15px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pull-card .nums { font: 13px/1.4 var(--font-mono); color: var(--ink-2); }
.pull-card .row { gap: 6px; margin-top: 2px; }

/* ---------- tiers ---------- */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tier { position: relative; display: grid; gap: 10px; padding: 22px; border-radius: var(--r-lg); border: var(--border); background: var(--panel); box-shadow: var(--shadow); }
.tier.you { background: var(--wall-2); }
.tier .you-tag { position: absolute; top: -13px; right: 16px; }
.tier-head { display: flex; align-items: center; gap: 12px; }
.tier-name { font: 400 28px/1 var(--font-display); text-transform: uppercase; }
.tier-big { font: 400 52px/1 var(--font-display); }
.tier-big small { font: 600 16px/1.2 var(--font-text); display: block; margin-top: 6px; color: var(--ink-2); }

/* ---------- the instruction label ---------- */
.label-sticker { background: var(--panel); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: clamp(20px, 3vw, 34px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; position: relative; }
.label-sticker::before { content: 'HOW TO USE'; position: absolute; top: -13px; left: 22px; background: var(--ink); color: var(--seg); font: 700 12px/1 var(--font-mono); letter-spacing: 0.12em; padding: 6px 10px; border-radius: 6px; }
.step { display: grid; gap: 10px; align-content: start; }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: var(--on-red); font: 700 15px var(--font-mono); border: 2px solid var(--ink); }
.step-pic { height: 92px; display: flex; align-items: center; }
.step-pic svg { height: 100%; width: auto; }

/* ---------- bands ---------- */
.band { border: var(--border); border-radius: var(--r-xl); background: var(--ink); color: var(--wall); padding: clamp(26px, 4vw, 48px); display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; box-shadow: 8px 8px 0 var(--red); }
.band .lede { color: #D9CBBF; }
.band h2 .two { color: var(--coin); }
.band.red { background: var(--red); box-shadow: 8px 8px 0 var(--ink); }
.band.red .lede { color: var(--wall); }

/* ---------- the coin box gauge ---------- */
.gauge { height: 26px; border-radius: var(--r-pill); border: var(--border); background: var(--wall-2); overflow: hidden; position: relative; }
.gauge span { display: block; height: 100%; background: var(--coin); border-right: 2px solid var(--ink); }
.gauge.full span { border-right: 0; }
.box-numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile { padding: 16px; border-radius: var(--r-lg); border: var(--border); background: var(--panel); display: grid; gap: 4px; box-shadow: var(--shadow); min-width: 0; }
.tile .num { font: 700 clamp(19px, 2.2vw, 26px)/1.15 var(--font-mono); overflow-wrap: anywhere; }
.tile.big .num { font-size: clamp(30px, 4.4vw, 52px); }

/* ---------- feeds and tables ---------- */
.feed { display: grid; border-top: var(--border); }
.feed-row { display: grid; grid-template-columns: 1.4fr 1fr auto auto; gap: 14px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line-2); font-size: 14.5px; }
.feed-row .who { font: 13px var(--font-mono); color: var(--muted); }
.feed-row .amt { font: 700 15px var(--font-mono); text-align: right; }
.tx { display: inline-flex; gap: 4px; align-items: center; font: 12.5px var(--font-mono); color: var(--ink-2); text-decoration: none; }
a.tx:hover { color: var(--ink); text-decoration: underline; }
.when { font: 12.5px var(--font-mono); color: var(--muted); text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; border: var(--border); border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font: 700 11.5px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: var(--border); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.txs { display: flex; flex-wrap: wrap; gap: 6px 12px; }

/* ---------- segmented controls ---------- */
.seg-ctl { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r); border: var(--border); background: var(--panel); }
.seg-ctl button { height: 34px; padding: 0 14px; border-radius: var(--r-sm); border: 0; background: none; color: var(--ink-2); cursor: pointer; font-size: 14px; font-weight: 600; }
.seg-ctl button[aria-pressed="true"] { background: var(--ink); color: var(--wall); }

/* ---------- forms ---------- */
.input { width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r); border: var(--border); background: var(--panel); font-size: 16px; }
.input:focus { outline: none; box-shadow: 3px 3px 0 var(--red); }
.problem { color: var(--bad); font-size: 14px; }
.problem:empty { display: none; }

/* ---------- cards and panels ---------- */
.card { border-radius: var(--r-lg); border: var(--border); background: var(--panel); padding: 22px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 9px 0; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { text-align: right; padding-left: 18px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.facts .total { font-weight: 700; padding-top: 9px; border-top: var(--border); }
.facts dd.total { color: var(--ink); }
.notes { display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.notes li { display: flex; gap: 8px; align-items: flex-start; }
.notes .icon { color: var(--good); margin-top: 2px; flex: none; }

/* ---------- the pull page ---------- */
.pull-grid { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 26px; align-items: start; }
.pull-stage { background: var(--red); border: var(--border); border-radius: var(--r-xl); padding: 16px; box-shadow: var(--shadow-red), 8px 8px 0 2px var(--ink); display: grid; gap: 14px; }
.pull-stage .flap { grid-template-columns: 1fr; justify-items: center; }
.pull-stage .flap .card-art { width: min(220px, 70%); }
.mathbar { display: flex; height: 40px; border-radius: var(--r); border: var(--border); overflow: hidden; font: 700 12.5px var(--font-mono); }
.mathbar span { display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; padding: 0 6px; }
.mathbar .card-part { background: var(--panel); }
.mathbar .back-part { background: var(--coin); border-left: 2px solid var(--ink); }
.mathbar .gap-part { background: var(--wall-3); border-left: 2px dashed var(--ink); color: var(--ink-2); }

/* ---------- how it works ---------- */
.how-grid { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; }
.toc { position: sticky; top: calc(var(--top-h) + 24px); display: grid; gap: 4px; font: 13.5px var(--font-mono); }
.toc a { text-decoration: none; color: var(--ink-2); padding: 4px 8px; border-radius: 6px; }
.toc a:hover { background: var(--wall-2); color: var(--ink); }
.prose { display: grid; gap: 56px; max-width: 760px; }
.prose section { display: grid; gap: 14px; }
.prose h2 { font-size: clamp(24px, 2.8vw, 34px); }
.prose p, .prose li { color: var(--ink-2); }
.prose ul.list { display: grid; gap: 8px; padding-left: 20px; list-style: square; }
.formula { font: 700 clamp(15px, 1.8vw, 19px)/1.4 var(--font-mono); background: var(--screen); color: var(--seg); padding: 16px 18px; border-radius: var(--r); overflow-x: auto; }
.faq { display: grid; gap: 10px; }
.faq details { border-radius: var(--r); border: var(--border); background: var(--panel); padding: 14px 18px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin-top: 10px; }

/* ---------- empty, error, skeleton ---------- */
.empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 48px 16px; border: 2px dashed var(--line-3); border-radius: var(--r-lg); }
.empty svg { width: 120px; }
.sk { border-radius: 8px; background: var(--wall-2); animation: pulse 1.4s infinite ease-in-out; }
@keyframes pulse { 50% { opacity: 0.55; } }
.sk-card { height: 110px; border-radius: var(--r-lg); }

/* ---------- wallet ---------- */
.wallet-box { position: relative; }
.wallet-btn.on { gap: 9px; padding: 0 12px; }
.wallet-btn .bal { color: var(--muted); font-weight: 400; }
.menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 240px; padding: 8px; border-radius: var(--r); border: var(--border); background: var(--panel); box-shadow: var(--shadow); display: grid; gap: 2px; z-index: 30; }
.menu-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; color: var(--ink-2); gap: 8px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-sm); border: 0; background: none; text-align: left; cursor: pointer; text-decoration: none; font-size: 15px; }
.menu-item:hover { background: var(--wall-2); }
.wallet-list { display: grid; gap: 8px; }
.wallet-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: var(--border); background: var(--panel); cursor: pointer; text-align: left; }
.wallet-row:hover:not([disabled]) { background: var(--wall-2); }
.wallet-row[disabled] { opacity: 0.6; cursor: default; }
.wallet-row img { border-radius: 8px; }
.wallet-name { flex: 1; font-weight: 700; }
.wallet-tag { font: 12px var(--font-mono); color: var(--muted); }
.wallet-help { display: grid; gap: 10px; margin-top: 14px; }

/* ---------- modal, toasts ---------- */
.modal-veil { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgb(30 21 18 / 0.55); animation: fade var(--t) var(--ease); }
.modal-panel { width: min(500px, 100%); max-height: calc(100svh - 32px); overflow: auto; border-radius: var(--r-xl); border: var(--border); background: var(--wall); box-shadow: 8px 8px 0 var(--ink); padding: 22px; animation: pop var(--t) var(--ease); overflow-wrap: anywhere; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.modal-head h2 { font-size: 24px; }
.modal-panel.locked .modal-x { visibility: hidden; }
.modal-body { display: grid; gap: 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.flow-steps { display: grid; gap: 10px; margin: 2px 0 6px; }
.flow-steps li { display: flex; gap: 12px; align-items: center; color: var(--muted); font-weight: 500; }
.flow-steps li.now, .flow-steps li.done { color: var(--ink); }
.flow-steps li.bad { color: var(--bad); }
.flow-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-3); font: 700 12px var(--font-mono); flex: none; }
.flow-steps li.now .flow-mark { border-color: var(--red); color: var(--red); }
[data-motion="on"] .flow-steps li.now .flow-mark { animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { background: var(--red); color: var(--wall); } }
.flow-steps li.done .flow-mark { background: var(--ink); color: var(--wall); border-color: var(--ink); }
.big-line { font-size: 19px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; justify-items: center; }
.toast { padding: 10px 16px; border-radius: var(--r); border: var(--border); background: var(--ink); color: var(--wall); font-size: 14px; box-shadow: 3px 3px 0 var(--red); animation: pop var(--t) var(--ease); }
.toast.bad { background: var(--bad); }

/* ---------- footer ---------- */
#foot { border-top: var(--border); padding: 52px 0 calc(52px + env(safe-area-inset-bottom)); background: var(--wall-2); }
.foot { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 30px; }
.foot-brand svg { height: 30px; width: auto; }
.foot-brand p { margin-top: 12px; max-width: 30em; }
.foot-col { display: grid; gap: 8px; align-content: start; font-size: 15px; }
.foot-col a { text-decoration: none; color: var(--ink-2); }
.foot-col a:hover { color: var(--ink); text-decoration: underline; }
.foot-base { grid-column: 1 / -1; display: grid; gap: 8px; font-size: 13.5px; padding-top: 22px; border-top: 1px solid var(--line-3); color: var(--muted); }
.foot-base .row { justify-content: space-between; }

/* ---------- motion switch: when off, nothing moves (the visible switch decides, not the OS) ---------- */
[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after { animation: none !important; transition: none !important; }

/* ---------- smaller screens ---------- */
@media (max-width: 1020px) {
  .marquee { grid-template-columns: 1fr; }
  .machine-mid, .machine-low { grid-template-columns: 1fr minmax(240px, 290px); }
  .window { grid-template-columns: repeat(2, 1fr); }
  .how-grid { grid-template-columns: 1fr; }
  .toc { display: none; }
  .box-numbers { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .nav, .top-actions .ca, .top-cta { display: none; }
  .tabbar { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 25; display: flex; justify-content: space-around; padding: 6px; border-radius: var(--r-lg); border: var(--border); background: var(--wall); box-shadow: 3px 3px 0 var(--ink); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 6px; border-radius: var(--r); color: var(--ink-2); font: 700 11px/1.1 var(--font-mono); text-decoration: none; min-width: 56px; text-align: center; }
  .tabbar a svg { width: 20px; height: 20px; }
  .tabbar a[aria-current] { background: var(--ink); color: var(--wall); }
  main { padding-bottom: 140px; }
  .machine-mid, .machine-low, .pull-grid, .two-col, .band { grid-template-columns: 1fr; }
  .tiers, .label-sticker { grid-template-columns: 1fr; }
  .feed-row { grid-template-columns: 1fr auto; }
  .feed-row .who, .feed-row .tx-cell { display: none; }
  .foot { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .brand svg { height: 22px; }
}
@media (max-width: 860px) {
  .flap { grid-template-columns: 72px 1fr; min-height: 0; padding: 12px; gap: 12px; }
  .flap .card-art { width: 72px; }
  .flap h3 { font-size: 17px; }
  .cup { height: 76px; }
  .display .screen { min-height: 62px; }
  .display .screen svg.seg { height: 36px; }
  .key-buy { height: 52px; font-size: 16px; }
}
@media (max-width: 860px) {
  .pull-stage .flap .card-art { width: min(160px, 50%); }
  table.receipts th:nth-child(2), table.receipts td:nth-child(2), table.receipts th:nth-child(5), table.receipts td:nth-child(5) { display: none; }
  table.receipts td { white-space: normal; }
}
@media (max-width: 520px) {
  .machine { padding: 10px; border-radius: 22px; }
  .marquee { padding: 18px 16px; }
  .window { grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px; }
  .slot { padding: 8px 2px 6px; gap: 5px; }
  .slot .pack { width: 54px; }
  .slot .slot-name { font-size: 12px; }
  .slot .tag { font-size: 11px; padding: 3px 5px; gap: 4px; }
  .slot .tag svg.seg { height: 12px; }
  .slot .out-label { font-size: 9.5px; }
  .panel-col { padding: 12px; gap: 10px; }
  .box-numbers { grid-template-columns: 1fr; }
  .hero-under .btn, .band .btn { width: 100%; }
  .wallet-btn.on .bal { display: none; }
  .foot { grid-template-columns: 1fr; }
}
