/* Binder phone demo. The design rules (docs/DEMO_BRIEF.md, "Polish rules"):
   - display font once per screen; everything else in the UI font, on a fixed type scale
   - thick outlines only on objects (cards, sleeves, binders, notices); panels are tone and space
   - three buttons: primary, secondary, text; one height, one radius; one primary per screen
   - one spacing scale, 16px page margins; one easing and three durations
   - every tappable thing is at least 44px */
:root {
  --cream: #F4EAD5; --red: #C42C1E; --blue: #0B58FD; --mustard: #F09B12; --sky: #7CAEDD; --green: #098C4B; --ink: #2A1F1A;
  --pull-red: #FE341B;                                  /* big pulls only, with blue and green */
  --paper-2: #EADDC2; --tape: #EBD9A2; --cork: #C49A62; --page: #33271F; --page-2: #3E3027;
  --tone: rgba(42, 31, 26, .06); --tone-2: rgba(42, 31, 26, .1); --line: rgba(42, 31, 26, .13); --mute: rgba(42, 31, 26, .64);
  /* type scale */
  --f-xs: 11px; --f-s: 13px; --f-m: 15px; --f-l: 17px; --f-xl: 22px; --d-m: 28px; --d-l: 36px;
  --display: "Titan One", "Baloo 2", system-ui, sans-serif;
  --ui: "Inter", "DM Sans", system-ui, -apple-system, sans-serif;
  --hand: "Gochi Hand", "Bradley Hand", cursive;
  /* spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r1: 10px; --r2: 16px; --btn-h: 48px; --btn-r: 24px;
  /* motion */
  --ease: cubic-bezier(.32, .72, 0, 1); --t1: 120ms; --t2: 280ms; --t3: 420ms;
  --ol: 2.5px solid var(--ink);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .16 0 0 0 0 .12 0 0 0 0 .1 0 0 0 .55 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --checker: repeating-conic-gradient(var(--ink) 0 25%, var(--cream) 0 50%) 0 0 / 12px 12px;
}
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; height: 100dvh; background: var(--paper-2); -webkit-text-size-adjust: 100%; }
body { color: var(--ink); font: 500 var(--f-m)/1.4 var(--ui); overscroll-behavior: none; }
#app { position: relative; width: 100%; max-width: 430px; height: 100%; margin: 0 auto; background: var(--cream); overflow: hidden; display: flex; flex-direction: column; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#main { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
#screen { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; display: flex; flex-direction: column; }
#screen::-webkit-scrollbar { display: none; }
#screen > * { flex-shrink: 0; }
#screen > .inside { flex: 1 1 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
input, textarea { -webkit-user-select: text; user-select: text; font: inherit; color: inherit; }
img { display: block; max-width: 100%; -webkit-user-drag: none; }
h1, h2, h3 { font: 700 var(--f-l)/1.25 var(--ui); }
p { font-size: var(--f-s); line-height: 1.45; }
.num { font-variant-numeric: tabular-nums; }
.mute { color: var(--mute); }
.dsp { font-family: var(--display); font-weight: 400; line-height: 1; }
.cents { font-size: .5em; vertical-align: .72em; margin-left: .04em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.wordmark { font: 400 30px/1 "Bagel Fat One", var(--display); text-transform: lowercase; letter-spacing: -.01em; }

/* ---------- buttons: primary, secondary, text ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: var(--s2); width: 100%; min-height: var(--btn-h); padding: 0 var(--s4); border-radius: var(--btn-r); background: var(--red); color: var(--cream); font: 700 var(--f-m)/1.15 var(--ui); font-variant-numeric: tabular-nums; text-align: center; transition: transform var(--t1) var(--ease), opacity var(--t1) var(--ease), background-color var(--t1) var(--ease); }
.btn.sec { background: var(--tone-2); color: var(--ink); }
.btn.txt { background: none; color: var(--blue); min-height: 44px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .42; }
button:active:not(:disabled), a.btn:active, .press:active { transform: scale(.97); opacity: .82; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); } .two .btn { padding: 0 var(--s2); gap: 6px; }
.acts { display: grid; gap: var(--s2); }
/* an icon button and a chip: 44px to the touch */
.ib { position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 22px; font: 700 20px/1 var(--ui); transition: transform var(--t1) var(--ease), opacity var(--t1) var(--ease); }
.ib.on, .ib.tone { background: var(--tone-2); }
.chip { position: relative; flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 18px; background: var(--tone-2); font: 600 var(--f-s)/1 var(--ui); white-space: nowrap; transition: transform var(--t1) var(--ease), background-color var(--t1) var(--ease); }
.chip::after { content: ""; position: absolute; inset: -4px 0; }
.chip.on { background: var(--ink); color: var(--cream); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: 14px; background: var(--tone-2); }
.seg button { min-height: 44px; padding: 0 var(--s2); border-radius: 11px; font: 600 var(--f-s)/1.1 var(--ui); transition: background-color var(--t1) var(--ease), transform var(--t1) var(--ease); }
.seg button.on { background: var(--ink); color: var(--cream); }
.stp { display: inline-grid; grid-template-columns: 44px auto 44px; align-items: center; border-radius: 22px; background: var(--tone-2); font: 700 var(--f-s)/1 var(--ui); font-variant-numeric: tabular-nums; }
.stp button { height: 44px; font: 700 20px/1 var(--ui); } .stp span { padding: 0 var(--s1); white-space: nowrap; text-align: center; }
.sw { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 48px; font: 500 var(--f-m)/1.2 var(--ui); }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw i { flex: none; width: 50px; height: 30px; border-radius: 15px; background: var(--tone-2); position: relative; transition: background-color var(--t2) var(--ease); }
.sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--cream); box-shadow: 0 0 0 1px var(--line); transition: transform var(--t2) var(--ease); }
.sw input:checked + i { background: var(--green); } .sw input:checked + i::after { transform: translateX(20px); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; display: block; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--red) var(--fill, 50%), var(--tone-2) var(--fill, 50%)); }
input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--red) var(--fill, 50%), var(--tone-2) var(--fill, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; background: var(--cream); border: var(--ol); border-radius: 50%; }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; background: var(--cream); border: var(--ol); border-radius: 50%; }
/* the pack-price slider keeps its notches: one per price on the grid */
input.notched::-webkit-slider-runnable-track { height: 14px; border-radius: 7px; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 24 - 2px), rgba(42, 31, 26, .35) calc(100% / 24 - 2px) calc(100% / 24)), linear-gradient(90deg, var(--red) var(--fill, 50%), var(--tone-2) var(--fill, 50%)); }
input.notched::-moz-range-track { height: 14px; border-radius: 7px; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 24 - 2px), rgba(42, 31, 26, .35) calc(100% / 24 - 2px) calc(100% / 24)), linear-gradient(90deg, var(--red) var(--fill, 50%), var(--tone-2) var(--fill, 50%)); }
input.notched::-webkit-slider-thumb { margin-top: -8px; }
.field { width: 100%; min-height: 44px; padding: 0 var(--s4); border: 0; border-radius: 22px; background: var(--tone-2); font: 500 16px/1 var(--ui); -webkit-appearance: none; appearance: none; outline: 0; }
.field:focus { box-shadow: 0 0 0 2.5px var(--blue); }
.money { display: inline-flex; align-items: center; gap: 2px; padding: 0 var(--s3); border-radius: 14px; background: var(--tone-2); font: 700 var(--f-xl)/1 var(--ui); }
.money input { width: 120px; min-height: 48px; border: 0; background: transparent; font: 700 var(--f-xl)/1 var(--ui); font-variant-numeric: tabular-nums; text-align: right; outline: 0; -moz-appearance: textfield; appearance: textfield; }
.money input::-webkit-outer-spin-button, .money input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.money:focus-within { box-shadow: 0 0 0 2.5px var(--blue); }

/* ---------- panels, rows, small labels ---------- */
.pn { padding: var(--s4); border-radius: var(--r2); background: var(--tone); }
.pn + .pn { margin-top: var(--s3); }
.pn h3 { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); margin-bottom: var(--s2); font: 600 var(--f-s)/1.3 var(--ui); color: var(--mute); }
.pn h3 span { font-weight: 500; font-size: var(--f-xs); text-align: right; }
.big { font: 700 var(--f-xl)/1.15 var(--ui); font-variant-numeric: tabular-nums; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: var(--s2) 0; font-size: var(--f-s); }
.kv + .kv { border-top: 1px solid var(--line); }
.kv b { font: 700 var(--f-m)/1.2 var(--ui); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.tagc { display: inline-block; padding: 4px 10px; border-radius: 12px; background: var(--ink); color: var(--cream); font: 600 var(--f-xs)/1.2 var(--ui); white-space: nowrap; }
.ill { display: inline-block; padding: 2px 7px; border-radius: 9px; background: var(--tone-2); color: var(--mute); font: 600 10px/1.3 var(--ui); font-style: normal; white-space: nowrap; vertical-align: 1px; }
.kick { font: 600 var(--f-xs)/1.3 var(--ui); color: var(--red); }
.rowl { display: grid; grid-template-columns: 40px 1fr auto; gap: var(--s3); align-items: center; width: 100%; min-height: 60px; padding: var(--s2) 0; text-align: left; border-top: 1px solid var(--line); }
.rowl:first-child { border-top: 0; }
.rowl b { display: block; font: 600 var(--f-s)/1.25 var(--ui); } .rowl small { display: block; font: 500 var(--f-xs)/1.35 var(--ui); color: var(--mute); }
.rowl .r { text-align: right; } .rowl .r b { font: 700 var(--f-m)/1.2 var(--ui); font-variant-numeric: tabular-nums; }
.empty { display: grid; gap: var(--s3); justify-items: center; padding: var(--s6) var(--s5); text-align: center; }
.empty b { font: 700 var(--f-l)/1.25 var(--ui); } .empty p { color: var(--mute); max-width: 280px; }
.empty .btn { width: auto; min-width: 180px; }
.chart { display: block; width: 100%; height: 88px; }
.ax { display: flex; justify-content: space-between; gap: var(--s2); margin-top: var(--s1); font: 500 10px/1.3 var(--ui); color: var(--mute); font-variant-numeric: tabular-nums; }

/* ---------- headers: a tab's root carries its colour; everything opened from it is cream ---------- */
.hd { position: relative; z-index: 5; display: flex; align-items: center; gap: var(--s1); min-height: 52px; padding: 4px var(--s2) 4px var(--s4); background: var(--cream); }
.hd.root { color: var(--cream); background-image: var(--grain); }
.hd.c0 { background-color: var(--red); } .hd.c1 { background-color: var(--blue); } .hd.c2 { background-color: var(--green); } .hd.c3 { background-color: var(--cork); }
.hd.back { padding-left: var(--s1); }
.hd-t { flex: 1; min-width: 0; font: 700 var(--f-l)/1.2 var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd.root .hd-t { font: 400 24px/1 var(--display); }
.hd-t small { display: block; margin-top: 2px; font: 500 var(--f-xs)/1.2 var(--ui); opacity: .9; font-variant-numeric: tabular-nums; }
.hd .dot { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 50%; background: var(--c, var(--red)); vertical-align: 1px; }
.ic { display: block; flex: none; } .btn .ic { width: 20px; height: 20px; stroke-width: 2.5; }
.pgn .ic { width: 15px; height: 15px; stroke-width: 3; } #tabs .ic { width: 22px; height: 22px; stroke-width: 2.3; }
.hd .ib.tx { width: auto; padding: 0 12px; font: 600 var(--f-s)/1 var(--ui); }
.tray b { position: absolute; right: 2px; top: 2px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border-radius: 9px; background: var(--ink); color: var(--cream); font: 700 10px/1 var(--ui); }
.hd.root .tray b { background: var(--cream); color: var(--ink); } .tray b:empty { display: none; }

/* ---------- tab bar ---------- */
#bar { flex: none; position: relative; z-index: 6; background: var(--cream); }
#tabs { flex: none; position: relative; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 5px var(--s2) calc(5px + env(safe-area-inset-bottom, 0px)); background: var(--cream); border-top: 1px solid var(--line); }
#tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 50px; border-radius: 16px; font: 600 10.5px/1.1 var(--ui); color: var(--mute); text-align: center; transition: background-color var(--t1) var(--ease), transform var(--t1) var(--ease); }
#tabs a.on { background: var(--tone-2); color: var(--ink); font-weight: 700; }
#toast { position: absolute; left: 50%; top: 60px; z-index: 80; transform: translate(-50%, -16px); padding: 11px 18px; border-radius: 22px; background: var(--ink); color: var(--cream); font: 600 var(--f-s)/1.2 var(--ui); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--t2) var(--ease), transform var(--t2) var(--ease); }
#toast.on { opacity: 1; transform: translate(-50%, 0); } #toast.tap { pointer-events: auto; padding-right: 34px; cursor: pointer; }
#toast.tap::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); }

/* ---------- cards: real images in real proportions; the outline belongs to the object ---------- */
.card-img, .card-ph { display: block; width: 100%; aspect-ratio: 63 / 88; border-radius: 4.5% / 3.2%; }
.card-img { object-fit: cover; background: var(--paper-2) linear-gradient(135deg, rgba(244, 234, 213, .9) 0 45%, transparent 45% 55%, rgba(244, 234, 213, .9) 55%); }
.card-img.in { background: var(--paper-2); }
.card-ph { background: var(--cream); border: 1.5px dashed var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6%; text-align: center; font: 600 10px/1.15 var(--ui); overflow: hidden; }
.card-ph i { font-style: normal; opacity: .75; }
.case { display: block; padding: 5.5% 5%; background: rgba(250, 244, 230, .6); border: var(--ol); border-radius: 7% / 5%; box-shadow: inset 0 0 0 2px rgba(42, 31, 26, .14); }
.cb { position: relative; display: block; width: 100%; aspect-ratio: 63 / 88; border-radius: 4.5% / 3.2%; background: var(--cream); border: 1.5px solid var(--ink); overflow: hidden; container-type: inline-size; }
.cb .art { position: absolute; left: 5%; right: 5%; top: 3.6%; height: 83.5%; overflow: hidden; border-radius: 3% / 2.3%; background: var(--red); }
.cb .art img, .cb .art svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.cb .wm { position: absolute; left: 0; right: 0; bottom: 1.2%; height: 11.5%; display: grid; place-items: center; font: 400 12.5cqw/1 "Bagel Fat One", var(--display); color: var(--red); }
.slabl { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-bottom: 4%; padding: 3% 4%; background: var(--cream); border: 1.5px solid var(--ink); border-radius: 3px; text-align: left; container-type: inline-size; }
.slabl span { min-width: 0; } .slabl b, .slabl i { display: block; font: 700 6.4cqw/1.15 var(--ui); font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .slabl i { font-weight: 500; }
.slabl em { flex: none; font: 800 12cqw/1 var(--ui); font-style: normal; text-align: center; } .slabl em small { display: block; font: 700 4.6cqw/1 var(--ui); }
.case.slabbed { padding-top: 4%; }
.case.slabbed.fx { display: flex; flex-direction: column; } .case.slabbed.fx .slabl { flex: none; } .case.slabbed.fx .card-img { flex: 1; min-height: 0; width: auto; max-width: 100%; align-self: center; }
.pslab { display: flex; flex-direction: column; aspect-ratio: 63 / 88; padding: 2px; background: rgba(250, 244, 230, .55); border: 1.5px solid var(--ink); border-radius: 4px; }
.pslab .slabl { flex: none; margin-bottom: 2px; padding: 1px 3px; border-width: 1px; } .pslab .card-img { flex: 1; min-height: 0; width: auto; max-width: 100%; align-self: center; }

/* ---------- the binder page: the dark inside of a binder; cards fill it ---------- */
.inside { position: relative; min-height: 0; display: flex; flex-direction: column; align-items: center; padding: 4px 3px 0; background: var(--page-2); overflow: hidden; }
.inside.scrolls { overflow-y: auto; }
.book { position: relative; flex: none; perspective: 1500px; perspective-origin: 30% 50%; touch-action: pan-y; }
.leaf { position: relative; background: var(--page); border: var(--ol); border-radius: 4px; padding: 5px 4px 5px 16px; transform-origin: 6px 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; will-change: transform; }
.leaf.under { position: absolute; inset: 0; }
.leaf.lift { box-shadow: 10px 0 0 rgba(0, 0, 0, .25); }
.rings { position: absolute; left: 2px; top: 0; bottom: 0; width: 11px; display: flex; flex-direction: column; justify-content: space-around; padding: 26px 0; }
.rings i { width: 9px; height: 9px; border-radius: 50%; background: var(--page-2); border: 2px solid var(--ink); box-shadow: 0 0 0 1.5px rgba(244, 234, 213, .35); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.pocket { position: relative; display: block; padding: 3px 3px 0; background: rgba(244, 234, 213, .07); border: 1.5px solid rgba(244, 234, 213, .4); border-top-color: rgba(244, 234, 213, .85); border-radius: 4px; min-width: 0; text-align: center; color: var(--ink); }
.pocket:active:not(:disabled) { transform: none; opacity: .86; }
.pocket.empty { border-style: dashed; border-color: rgba(244, 234, 213, .25); background: none; }
.pocket.empty::before { content: ""; display: block; aspect-ratio: 63 / 88; } .pocket.empty::after { content: ""; display: block; height: 31px; }
.pocket.src .pw { opacity: .25; } .pocket.hot { border-color: var(--mustard); background: rgba(240, 155, 18, .25); }
.pw { position: relative; display: block; }
.tg { display: block; height: 11px; margin-top: 2px; color: var(--cream); font: 600 8px/11px var(--ui); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; opacity: .92; }
.lb { display: block; height: 15px; margin: 0 -1px 3px; padding: 0 2px; background: var(--tape); color: var(--ink); border-radius: 2px; font: 700 9px/15px var(--ui); letter-spacing: -.03em; white-space: nowrap; overflow: hidden; }
.lb .out { font-weight: 500; opacity: .7; }
.xn { position: absolute; left: 3px; bottom: 3px; padding: 2px 5px 1px; background: var(--ink); color: var(--cream); border-radius: 8px; font: 700 10px/1.2 var(--ui); font-style: normal; }
.cst { position: absolute; right: -2px; top: -2px; min-width: 30px; padding: 3px 5px 2px; background: var(--blue); color: var(--cream); border: 2px solid var(--ink); border-radius: 9px; font: 700 10px/1 var(--ui); font-style: normal; text-align: center; }
.cstw { position: relative; display: block; } .cstw.big .cst { right: -8px; top: -8px; font-size: var(--f-s); padding: 5px 9px 4px; border-radius: 12px; }
.rcpt { display: flex; flex-direction: column; justify-content: center; gap: 3px; width: 100%; aspect-ratio: 63 / 88; padding: 6px 4px; background: var(--cream); color: var(--ink); border-radius: 3px; text-align: center; font: 500 8.5px/1.2 var(--ui); border-bottom: 3px dotted var(--ink); }
.rcpt b { font: 700 8.5px/1.1 var(--ui); color: var(--red); } .rcpt i { font-style: normal; } .rcpt strong { font: 700 13px/1 var(--ui); }
.pgn { flex: none; display: flex; align-items: center; justify-content: center; gap: var(--s1); height: 22px; color: var(--cream); font: 500 10px/1 var(--ui); opacity: .9; }
.pgn button { display: grid; place-items: center; width: 44px; height: 44px; margin: -11px 0; color: var(--cream); font: 700 15px/1 var(--ui); }
.inside > .list { align-self: stretch; flex: 1; min-height: 0; overflow-y: auto; margin: 2px 3px 6px; padding: 0 var(--s3); border-radius: var(--r1); background: var(--cream); }
.inside > .empty { align-self: stretch; margin: var(--s4) var(--s3); border-radius: var(--r2); background: var(--cream); }
.inside.arranging, .inside.arranging .pocket { touch-action: none; }
.dragc { border-radius: 5px; box-shadow: 6px 8px 0 rgba(0, 0, 0, .3); will-change: transform; }
.edge { position: absolute; top: 0; bottom: 22px; width: 30px; z-index: 4; pointer-events: none; opacity: 0; background: var(--mustard); transition: opacity var(--t1) var(--ease); } .edge.l { left: 0; } .edge.r { right: 0; } .edge.on { opacity: .45; }
/* search and the one-line summary of what is filtered: they appear only when in use */
.srch { display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s2) var(--s2) var(--s4); background: var(--cream); }
.actv { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 44px; padding: 0 var(--s1) 0 var(--s4); background: var(--cream); font: 600 var(--f-s)/1.2 var(--ui); }
.actv span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* chasing: the one card, as big as the page allows */
.chase1 { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4) var(--s2); background: var(--page-2); }
.chase1 .cw { flex: 1; min-height: 0; display: grid; place-items: center; width: 100%; container-type: size; }
.chase1 .star1 { display: block; width: min(96cqw, calc(97cqh * 63 / 88)); }
.star1 .card-img, .scard .card-img { box-shadow: 0 16px 34px rgba(0, 0, 0, .5), 0 3px 8px rgba(0, 0, 0, .35); background: none; }
.chase1 { padding-bottom: var(--s1); }
.ctag { flex: none; max-width: 100%; padding: 6px 12px; border-radius: 14px; background: rgba(244, 234, 213, .12); color: var(--cream); font: 500 12px/1.2 var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ctag b { font-weight: 700; }

/* ---------- the pull screen is one dark surface: header, page, dock and tabs share it ---------- */
#app[data-dark] #screen > .hd, #app[data-dark] #stage > .hd, #app[data-dark] .srch, #app[data-dark] .actv, #app[data-dark] #bar, #app[data-dark] #tabs {
  --tone: rgba(244, 234, 213, .08); --tone-2: rgba(244, 234, 213, .16); --line: rgba(244, 234, 213, .14); --mute: rgba(244, 234, 213, .66); background-color: var(--page-2); color: var(--cream); }
#app[data-dark] #tabs { border-top-color: transparent; } #app[data-dark] #tabs a.on { color: var(--cream); }
#app[data-dark] .btn.txt, #app[data-dark] .lnk { color: var(--sky); }
#app[data-dark] .field { color: var(--cream); } #app[data-dark] .field::placeholder { color: var(--mute); }
#app[data-dark] .tray b { background: var(--cream); color: var(--ink); }
#app[data-dark] #bar .pullbar .btn.txt { color: var(--sky); }
#tabs, .hd { transition: background-color var(--t2) var(--ease), color var(--t2) var(--ease); }
#screen.enter { animation: enter var(--t2) var(--ease); } @keyframes enter { from { opacity: 0; transform: translateY(8px); } }
#stage { animation: fadein var(--t2) var(--ease); } @keyframes fadein { from { opacity: 0; } }
/* the dock: the price with Pull attached; opened from the price, the slider, the quiet chips and one odds line */
.pullbar { padding-top: 0; } .pullbar.open { padding-top: var(--s1); }
.slim { display: flex; align-items: stretch; margin: 2px var(--s3) 6px; padding: 3px; border-radius: 28px; background: var(--tone-2); }
.pricebtn { flex: none; display: flex; align-items: center; gap: 2px; min-height: var(--btn-h); padding: 0 8px 0 14px; border-radius: var(--btn-r); font: 400 24px/1 var(--display); font-variant-numeric: tabular-nums; transition: transform var(--t1) var(--ease); }
.pricebtn .ic { width: 18px; height: 18px; stroke-width: 2.8; opacity: .8; transform: rotate(180deg); transition: transform var(--t2) var(--ease); }
.pullbar.open .pricebtn .ic { transform: none; }
.slim .btn { flex: 1; width: auto; min-width: 0; font-size: var(--f-l); }
.pullbar .more { display: none; padding: var(--s1) var(--s4) 0; }
.pullbar.open .more { display: grid; gap: 2px; }
.dchips { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
/* quiet chips: small to look at, 44 to the touch */
.qc { display: flex; gap: 2px; } .qc button { position: relative; min-height: 30px; padding: 0 10px; border-radius: 15px; font: 600 12px/1 var(--ui); color: var(--mute); transition: background-color var(--t1) var(--ease), color var(--t1) var(--ease); }
.qc button::after { content: ""; position: absolute; inset: -7px 0; } .qc.n button { min-width: 36px; }
.qc button.on { background: var(--cream); color: var(--ink); }
.pullbar.open .more { gap: 6px; }
.cov { margin: 0; text-align: center; font: 500 12px/1.2 var(--ui); color: var(--mute); }
.lnk { position: relative; font: 600 12px/1.2 var(--ui); color: var(--blue); } .lnk::after { content: ""; position: absolute; inset: -14px -8px; }
/* a compact segmented control: small to look at, 44 to the touch */
/* (a compact segmented control, kept for small two-way choices) */
.seg.sm { padding: 2px; border-radius: 10px; } .seg.sm button { position: relative; min-height: 30px; padding: 0 6px; border-radius: 8px; font-size: 12px; } .seg.sm button::after { content: ""; position: absolute; inset: -8px 0; } .seg.sm.n button { min-width: 34px; }
.traybar { padding: var(--s2) var(--s3); border-top: 1px solid var(--line); }
/* card detail: the card on the dark page, the details under it */
.star { margin: 0 calc(-1 * var(--s4)); padding: var(--s5) var(--s4); background: var(--page-2); display: grid; place-items: center; }
.star .scard { display: block; width: min(74%, 290px); } .star .case { width: min(74%, 290px); }
.sinfo { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); } .sinfo > div:last-child { text-align: right; flex: none; }
.sinfo small { display: block; margin-top: var(--s1); font: 500 var(--f-xs)/1.35 var(--ui); color: var(--mute); } .sinfo .val { font: 400 var(--d-m)/1 var(--display); font-variant-numeric: tabular-nums; }
.lead { font: 700 var(--f-l)/1.3 var(--ui); font-variant-numeric: tabular-nums; }
.hero.plain .val { font: 700 var(--f-xl)/1.1 var(--ui); }

/* ---------- home: three binders on the table (objects keep their outlines) ---------- */
.pinrow { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: var(--s3); min-height: 64px; padding: var(--s2) var(--s4); background: var(--cream); text-align: left; width: 100%; }
.pinrow b { display: block; font: 600 var(--f-s)/1.25 var(--ui); } .pinrow small { display: block; font: 500 var(--f-xs)/1.3 var(--ui); color: var(--mute); } .pinrow strong { font: 700 var(--f-l)/1 var(--ui); white-space: nowrap; font-variant-numeric: tabular-nums; }
.trim { height: 12px; background: var(--checker); }
.table { padding: var(--s5) var(--s4) var(--s5) var(--s3); background-color: var(--mustard); background-image: var(--grain); display: grid; gap: 20px; }
.bdr { position: relative; display: grid; grid-template-columns: 104px 1fr; gap: var(--s3); align-items: center; padding: 15px 16px 15px 34px; min-height: 180px; border: 3px solid var(--ink); border-radius: 10px 20px 20px 10px; background-color: var(--c); background-image: var(--grain); box-shadow: 6px 6px 0 var(--ink); text-align: left; width: 100%; color: var(--cream); transition: transform var(--t2) var(--ease), opacity var(--t2) var(--ease); }
.bdr:active:not(:disabled) { transform: scale(.985); opacity: 1; }
.bdr.c0 { --c: var(--red); transform: rotate(-1.2deg); } .bdr.c1 { --c: var(--blue); transform: rotate(1deg); } .bdr.c2 { --c: var(--green); transform: rotate(-.7deg); }
.table.opening .bdr { opacity: 0; } .table.opening .bdr.go { opacity: 1; transform: rotate(0) scale(1.05); }
.bdr .spine { position: absolute; left: 0; top: 0; bottom: 0; width: 22px; background: rgba(42, 31, 26, .32); border-right: 3px solid var(--ink); border-radius: 7px 0 0 7px; display: flex; flex-direction: column; justify-content: space-around; align-items: center; padding: 22px 0; }
.bdr .spine b { width: 9px; height: 9px; border-radius: 50%; background: #CFC6B4; border: 2px solid var(--ink); }
.bdr .zip, .rb .zip { position: absolute; inset: 6px 6px 6px 27px; border: 3.5px dashed var(--mustard); border-left: 0; border-radius: 0 13px 13px 0; pointer-events: none; }
.bdr.c0 .zip, .rb.c0 .zip { border-color: var(--cream); }
.bdr .zpull { position: absolute; right: -10px; top: 40%; width: 17px; height: 28px; background: var(--mustard); border: var(--ol); border-radius: 4px; } .bdr.c0 .zpull, .rb.c0 .zpull { background: var(--cream); }
.sleeve { display: block; position: relative; z-index: 1; padding: 5px; background: rgba(244, 234, 213, .2); border: 2.5px solid rgba(244, 234, 213, .8); border-radius: 8px; }
.bdr .face { position: relative; z-index: 1; min-width: 0; }
.nm { display: block; margin-bottom: var(--s2); font: 400 26px/1 var(--display); color: var(--cream); text-shadow: 3px 3px 0 var(--ink); white-space: nowrap; }
.plate { display: block; padding: var(--s2) 10px; background: var(--cream); color: var(--ink); border-radius: 9px; font-variant-numeric: tabular-nums; }
.plate .k { display: block; margin-top: 5px; font: 500 10px/1.25 var(--ui); color: var(--mute); } .plate .k:first-child { margin-top: 0; }
.plate .v { display: block; font: 700 var(--f-s)/1.25 var(--ui); } .plate .v small { font: 500 10.5px/1.2 var(--ui); }
.sec { padding: var(--s4); }
.sec > h3 { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s2); }
.foot { padding: 0 var(--s4) var(--s5); font: 500 var(--f-xs)/1.5 var(--ui); color: var(--mute); }

/* ---------- sheets: iOS-style, swipe down to close ---------- */
#sheet { position: absolute; inset: 0; z-index: 60; display: flex; align-items: flex-end; background: rgba(42, 31, 26, 0); transition: background-color var(--t2) var(--ease); }
#sheet.on { background: rgba(42, 31, 26, .5); }
.sheet { width: 100%; max-height: calc(100% - 28px); display: flex; flex-direction: column; background: var(--cream); border-radius: 18px 18px 0 0; transform: translateY(100%); transition: transform var(--t3) var(--ease); will-change: transform; padding-bottom: env(safe-area-inset-bottom, 0px); }
#sheet.on .sheet { transform: translateY(0); }
.sheet.drag { transition: none; }
.sheet.tall { height: calc(100% - 28px); }
.grab { flex: none; display: grid; place-items: center; height: 20px; touch-action: none; } .grab i { width: 38px; height: 5px; border-radius: 3px; background: var(--tone-2); }
.sh { flex: none; display: flex; align-items: flex-start; gap: var(--s2); padding: 0 var(--s2) var(--s3) var(--s4); touch-action: none; }
.sh > div { flex: 1; min-width: 0; padding-top: 6px; } .sh h2 { font: 700 var(--f-l)/1.25 var(--ui); } .sh p { margin-top: 2px; color: var(--mute); font-size: var(--f-s); }
.sheet .body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 var(--s4) var(--s5); }
.sheet .body > * + * { margin-top: var(--s3); }
.hero { display: grid; grid-template-columns: 44% 1fr; gap: var(--s4); align-items: center; }
.hero .val { font: 400 var(--d-m)/1 var(--display); font-variant-numeric: tabular-nums; } .hero small { display: block; margin-top: var(--s1); font: 500 var(--f-xs)/1.35 var(--ui); color: var(--mute); }
.hero .tagc { margin-bottom: var(--s2); } .hero p { margin: var(--s1) 0 var(--s3); color: var(--mute); font-size: var(--f-xs); }
.opt { display: grid; grid-template-columns: 1fr auto; gap: var(--s3); align-items: center; width: 100%; min-height: 64px; padding: var(--s3) var(--s4); border-radius: var(--r2); background: var(--tone); text-align: left; transition: transform var(--t1) var(--ease); }
.opt b { display: block; font: 700 var(--f-m)/1.25 var(--ui); } .opt small { display: block; margin-top: 2px; font: 500 var(--f-xs)/1.35 var(--ui); color: var(--mute); } .opt strong { font: 700 var(--f-l)/1 var(--ui); font-variant-numeric: tabular-nums; }
.ask { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); font: 500 var(--f-m)/1.2 var(--ui); } .ask > b { font: 700 var(--f-xl)/1 var(--ui); font-variant-numeric: tabular-nums; }
.fair { position: relative; height: 8px; margin: var(--s3) 0 var(--s1); border-radius: 4px; background: linear-gradient(90deg, var(--green) 0 50%, var(--mustard) 50%); }
.fair::before { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); }
.fair i { position: absolute; top: -6px; width: 12px; height: 20px; margin-left: -6px; background: var(--cream); border: var(--ol); border-radius: 4px; }
.prog { height: 8px; margin: var(--s2) 0; border-radius: 4px; background: var(--tone-2); overflow: hidden; } .prog i { display: block; height: 100%; background: var(--green); }
.band > button { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); align-items: center; width: 100%; min-height: 56px; padding: var(--s2) var(--s4); border-radius: var(--r1); background: var(--tone); text-align: left; }
.band > button b { font: 700 var(--f-m)/1.2 var(--ui); } .band > button small { display: block; font: 500 var(--f-xs)/1.3 var(--ui); color: var(--mute); } .band > button strong { font: 700 var(--f-m)/1.2 var(--ui); text-align: right; font-variant-numeric: tabular-nums; }
.band .rows { display: none; padding: 0 var(--s1); } .band.open .rows { display: block; } .band + .band { margin-top: var(--s2); }
.band .ex { display: none; grid-column: 1 / -1; padding: var(--s2) var(--s3); border-radius: var(--r1); background: var(--tone); font-size: var(--f-xs); line-height: 1.45; } .band .rowl.open .ex { display: block; }
.fgrp h3 { margin-bottom: var(--s2); font: 600 var(--f-s)/1.3 var(--ui); color: var(--mute); }

/* ---------- the stage: reveal, result, choose its home. The card is the star: dark behind it, nothing competing. ---------- */
#stage { position: absolute; inset: 0; z-index: 40; background: var(--page-2); overflow: hidden; display: flex; flex-direction: column; }
#app[data-stage="on"] #bar { display: none; }
.arena { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--page-2); }
.arena .tbl { position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background-color: var(--mustard); background-image: var(--grain); transition: transform var(--t3) var(--ease); }
.arena.clear .tbl { transform: translateY(105%); }
.skip { position: absolute; z-index: 20; right: var(--s3); top: var(--s2); width: auto; background: rgba(244, 234, 213, .16); color: var(--cream); }
.skip.l { right: auto; left: var(--s3); }
.rb { position: absolute; left: 50%; top: 50%; width: 236px; height: 318px; margin: -170px 0 0 -118px; perspective: 1400px; transition: transform var(--t3) var(--ease), opacity var(--t2) var(--ease); }
.arena.clear .rb { transform: translateY(120%); opacity: 0; }
.rb .inner, .rb .rpage, .rb .rcover { position: absolute; inset: 0; border: 3px solid var(--ink); border-radius: 8px 16px 16px 8px; }
.rb .inner { background: var(--c); }
.rb .rpage { inset: 8px 10px 8px 22px; background: var(--page); border-radius: 4px; padding: 8px 7px 8px 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; align-content: space-between; transform-origin: -8px 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.rb .rcover { background-color: var(--c); background-image: var(--grain); transform-origin: 0 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.rb .rcover::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 18px; background: rgba(42, 31, 26, .32); border-right: 3px solid var(--ink); border-radius: 5px 0 0 5px; }
.rb .zip { inset: 6px 6px 6px 24px; border-radius: 0 11px 11px 0; }
.rb .zpull { position: absolute; left: 0; top: 0; width: 16px; height: 26px; margin: -13px 0 0 -8px; background: var(--mustard); border: var(--ol); border-radius: 4px; z-index: 2; }
.rb .rcover .nm { margin: 0 0 0 14px; }
/* the card: straight, no frame, a soft shadow under it */
.fly { position: absolute; left: 0; top: 0; z-index: 10; width: 100px; transform-style: preserve-3d; will-change: transform; touch-action: none; }
.fly .f { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 4.5% / 3.2%; box-shadow: 0 16px 34px rgba(0, 0, 0, .5), 0 3px 8px rgba(0, 0, 0, .35); } .fly .f.front { transform: rotateY(180deg); }
.fly .f .card-img, .fly .f .cb { height: 100%; }
.fly .slab { position: absolute; inset: 0; border-radius: 4.5% / 3.2%; background: #1c1512; } .fly .sizer { visibility: hidden; }
.fly.cased .f { box-shadow: 0 16px 34px rgba(0, 0, 0, .5); border-radius: 7% / 5%; } .fly.cased .slab { border: var(--ol); border-radius: 7% / 5%; background: rgba(250, 244, 230, .5); }
.fly.xfade .f { transition: opacity .3s linear !important; } .fly.xfade .f.front { transform: none; opacity: 0; } .fly.xfade.up .f.front { opacity: 1; } .fly.xfade.up .f.back { opacity: 0; }
.persp { position: absolute; inset: 0; perspective: 1200px; pointer-events: none; z-index: 10; } .persp > * { pointer-events: auto; }
.fw { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.fw i { position: absolute; border-radius: 50%; transform: scale(0); transition: transform .5s cubic-bezier(.2, 1.5, .4, 1), opacity .45s linear; }
.fw.go i { transform: scale(1); } .fw.out i { opacity: 0; }
.waitrow { position: absolute; z-index: 20; left: 132px; top: var(--s2); height: 48px; display: flex; align-items: center; gap: 4px; font: 600 var(--f-xs)/1.2 var(--ui); color: var(--cream); }
.waitrow .cb { width: 22px; } .waitrow small { margin-left: 4px; font: inherit; white-space: nowrap; }
/* the details: a compact panel below the card */
.result, .homes { position: absolute; left: 10px; right: 10px; bottom: 8px; z-index: 12; padding: var(--s3) var(--s4) var(--s1); background: var(--cream); border-radius: 20px; }
.result { opacity: 0; transition: opacity var(--t2) var(--ease); pointer-events: none; }
.result.show { opacity: 1; pointer-events: auto; }
.rhead { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.rhead > div { min-width: 0; } .rhead h2 { font: 700 var(--f-m)/1.25 var(--ui); margin: 1px 0 var(--s1); }
.rhead .val { flex: none; font: 400 var(--d-m)/1 var(--display); font-variant-numeric: tabular-nums; }
.result .facts { margin: var(--s2) 0; } .result .facts .kv { padding: 5px 0; font-size: var(--f-xs); } .result .facts .kv b { font-size: var(--f-s); }
.ks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); } .ks .btn { padding: 0 var(--s2); gap: 6px; white-space: nowrap; }
.result > .btn.txt span { min-width: 0; overflow: hidden; white-space: nowrap; }
.result > .btn.txt, .homes > .btn.txt { min-height: 44px; font-size: var(--f-s); }
.sold { padding: var(--s1) 0 var(--s2); } .sold b { display: block; font: 400 var(--d-m)/1.1 var(--display); font-variant-numeric: tabular-nums; } .sold p { margin-top: var(--s1); color: var(--mute); }
.all { position: absolute; inset: 0; z-index: 14; background: var(--cream); display: flex; flex-direction: column; padding: var(--s3) var(--s4) var(--s3); }
.all h2 { font: 400 var(--d-m)/1 var(--display); }
.all .lst { flex: 1; min-height: 0; overflow-y: auto; margin: var(--s2) 0; }
.arow { display: grid; grid-template-columns: 72px 1fr; gap: var(--s3); align-items: center; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.arow b { display: block; font: 600 var(--f-s)/1.25 var(--ui); } .arow small { display: block; font: 500 var(--f-xs)/1.35 var(--ui); color: var(--mute); } .arow strong { display: block; font: 700 var(--f-l)/1.2 var(--ui); font-variant-numeric: tabular-nums; }
.arow .two { margin-top: var(--s2); } .arow .btn { min-height: 44px; font-size: var(--f-s); padding: 0 var(--s2); white-space: nowrap; } .arow .btn span { min-width: 0; overflow: hidden; } .arow .st { margin-top: var(--s1); font-weight: 600; }
.homes { transition: opacity var(--t1) var(--ease); } .homes.gone { opacity: 0; pointer-events: none; }
.homes h2 { font: 400 var(--d-m)/1 var(--display); } .homes > p { margin: var(--s1) 0 var(--s3); color: var(--mute); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.tile { position: relative; min-height: 76px; padding: var(--s3); border-radius: var(--r2); background: var(--tone); text-align: left; display: flex; flex-direction: column; justify-content: flex-end; transition: transform var(--t1) var(--ease), background-color var(--t1) var(--ease); }
.tile.hot { transform: scale(1.04); background: var(--mustard); } .tile.got { transform: scale(.96); }
.tile b { font: 700 var(--f-m)/1.2 var(--ui); } .tile small { margin-top: 2px; font: 500 var(--f-xs)/1.3 var(--ui); color: var(--mute); }
.tile .tic { position: absolute; right: var(--s3); top: var(--s3); color: var(--ink); opacity: .85; }
.homes.in > p, .homes.in > h2, .homes.in > .btn.txt { display: none; }
.choice { display: grid; gap: var(--s2); } .choice h3 { font: 700 var(--f-l)/1.25 var(--ui); } .choice p { color: var(--mute); }
/* every home has its move: a back layer under the card, a front layer over it, and the card goes in between */
.hm { position: absolute; z-index: 8; width: 210px; height: 240px; margin: -120px 0 0 -105px; opacity: 0; transform: translateY(18px) scale(.94); transition: opacity var(--t2) var(--ease), transform var(--t2) var(--ease); pointer-events: none; }
.hm.hmf { z-index: 12; } .hm.on { opacity: 1; transform: none; }
.hm i { position: absolute; display: block; }
.hm.h0 .hm-b { inset: 0; background: var(--page); border: var(--ol); border-radius: 6px; }
.hm.h0 .hm-f { left: 22px; right: 22px; top: 34px; bottom: 6px; border: 1.5px solid rgba(244, 234, 213, .55); border-top-color: rgba(244, 234, 213, .95); border-radius: 5px; background: linear-gradient(160deg, rgba(244, 234, 213, .2), rgba(244, 234, 213, .05) 45%); }
.hm.h1 .hm-b { inset: 0; background: var(--c); border: 3px solid var(--ink); border-radius: 8px 16px 16px 8px; filter: brightness(.72); }
.hm.h1 .hm-b .sp { left: 0; top: 0; bottom: 0; width: 18px; background: rgba(42, 31, 26, .4); }
.hm.h1 .hm-f { left: 0; right: 0; top: 74px; bottom: 0; background-color: var(--c); background-image: var(--grain); border: 3px solid var(--ink); border-radius: 4px 6px 16px 8px; display: grid; place-items: center; box-shadow: inset 18px 0 0 rgba(42, 31, 26, .32); }
.hm.h1 .hm-f b { font: 400 22px/1 var(--display); color: var(--cream); text-shadow: 2px 2px 0 var(--ink); padding-left: 14px; }
.hm.h2 .hm-b { inset: 0; background-color: var(--cork); background-image: var(--grain); border: var(--ol); border-radius: 6px; }
.hm.h2 .pinh { left: 50%; top: 22px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--red); border: var(--ol); opacity: 0; transform: translateY(-40px) scale(1.8); transition: transform var(--t2) cubic-bezier(.3, 1.6, .5, 1), opacity var(--t1) linear; }
.hm.h2.in .pinh { opacity: 1; transform: none; }
.hm.h3 { height: 168px; margin-top: -70px; }
.hm.h3 .hm-b { inset: 0; background: var(--paper-2); border: var(--ol); border-radius: 6px; }
.hm.h3 .hm-f { left: 0; right: 0; top: 14px; bottom: 0; background: var(--cream); border: var(--ol); border-radius: 3px 3px 6px 6px; background-image: linear-gradient(to top right, transparent calc(50% - 1.5px), var(--ink) calc(50% - 1.5px), var(--ink) calc(50% + 1.5px), transparent calc(50% + 1.5px)), linear-gradient(to top left, transparent calc(50% - 1.5px), var(--ink) calc(50% - 1.5px), var(--ink) calc(50% + 1.5px), transparent calc(50% + 1.5px)); background-size: 50% 62%, 50% 62%; background-position: left bottom, right bottom; background-repeat: no-repeat; }
.hm.h3 .flap { left: 0; right: 0; top: 0; height: 84px; background: var(--paper-2); border: var(--ol); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: 50% 0; transform: rotateX(180deg); transition: transform var(--t2) var(--ease); }
.hm.h3.in .flap { transform: none; }
.tray.bump { animation: bump .4s var(--ease); } @keyframes bump { 40% { transform: scale(1.3); } }

/* ---------- Your Shop: what the cards have earned is the hero ---------- */
.hd.c2 .hd-t { font: 700 var(--f-l)/1.2 var(--ui); }
.earned { padding: 0 var(--s4) var(--s4); background-color: var(--green); background-image: var(--grain); color: var(--cream); }
.earned b { display: block; font: 400 44px/1 var(--display); font-variant-numeric: tabular-nums; } .earned b span { font: 700 var(--f-l)/1 var(--ui); }
.earned small { display: block; margin-top: var(--s1); font: 500 var(--f-s)/1.3 var(--ui); } .earned .ill { background: rgba(244, 234, 213, .22); color: var(--cream); }
.srow div.r b { font: 700 var(--f-l)/1.2 var(--ui); font-variant-numeric: tabular-nums; } .srow .r b.up { color: var(--green); } .srow .r b.dn { color: var(--red); } .srow .r b.e0 { color: var(--mute); } .srow .m .up, .srow .m .dn { font-weight: 600; }
.chip .ic { width: 14px; height: 14px; margin-left: 3px; stroke-width: 3; }
.ylrow { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); } .ylrow .yl small { display: block; margin: var(--s1) 0 0; font: 600 var(--f-s)/1.2 var(--ui); }
.y2 { text-align: right; } .y2 b { display: block; font: 700 var(--f-xl)/1 var(--ui); } .y2 small { display: block; margin-top: var(--s1); font: 600 var(--f-s)/1.2 var(--ui); }
#sheet[data-name="binder-info"] .body > .mute + .mute { margin-top: var(--s1); }
/* payday: flat coins, a number that counts up, once a visit */
#payday { position: absolute; inset: 0; z-index: 88; display: grid; place-items: center; width: 100%; background: rgba(42, 31, 26, 0); transition: background-color var(--t2) var(--ease); }
#payday.on { background: rgba(42, 31, 26, .55); } #payday:active { transform: none; opacity: 1; }
.pd { display: grid; justify-items: center; gap: var(--s1); width: min(300px, 82%); padding: var(--s5) var(--s4); border-radius: 22px; background: var(--cream); opacity: 0; transform: translateY(14px) scale(.96); transition: opacity var(--t2) var(--ease), transform var(--t2) var(--ease); }
#payday.on .pd { opacity: 1; transform: none; }
.pd small { font: 600 var(--f-s)/1.3 var(--ui); color: var(--mute); } .pd b { font: 400 48px/1.05 var(--display); color: var(--green); font-variant-numeric: tabular-nums; }
.coins { position: relative; display: block; width: 150px; height: 46px; margin-bottom: var(--s2); }
.coins i { position: absolute; bottom: 0; left: calc(var(--i) * 26px + 6px); width: 34px; height: 34px; border-radius: 50%; background: var(--mustard); border: var(--ol); box-shadow: inset 0 0 0 4px rgba(244, 234, 213, .45); opacity: 0; }
#payday.on .coins i { animation: coin .5s var(--ease) calc(var(--i) * 90ms + 150ms) both; }
@keyframes coin { 0% { opacity: 0; transform: translateY(-46px); } 60% { opacity: 1; transform: translateY(4px); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .coins i { opacity: 1; } }
/* Your Binder: a card's status as a small icon on its sleeve */
.stt { position: absolute; left: 3px; top: 3px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--cream); border: 1.5px solid var(--ink); color: var(--ink); } .stt .ic { width: 13px; height: 13px; stroke-width: 3; }

.figs.two { grid-template-columns: 1fr 1fr; }
.figs { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: var(--s2); padding: var(--s4) var(--s4) 0; }
.figs div { padding: var(--s3); border-radius: var(--r1); background: var(--tone); min-width: 0; }
.figs small { display: block; margin-bottom: var(--s1); font: 500 var(--f-xs)/1.2 var(--ui); color: var(--mute); } .figs b { display: block; font: 700 var(--f-l)/1.1 var(--ui); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lg { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin: var(--s2) 0 var(--s1); font: 500 var(--f-xs)/1.3 var(--ui); } .lg i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; }
.tools { display: flex; align-items: center; gap: var(--s2); overflow-x: auto; scrollbar-width: none; padding: 4px 0; font: 500 var(--f-xs)/1 var(--ui); color: var(--mute); } .tools::-webkit-scrollbar { display: none; } .tools { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 28px; } .tools .sp { flex: 1; }
.tools.t2 { -webkit-mask-image: none; mask-image: none; padding-right: 0; overflow: visible; }
.spread { display: block; width: 100%; height: 48px; margin-top: var(--s2); }
.opt small.one { white-space: nowrap; overflow: hidden; } .opt strong small { display: block; margin-top: 2px; font: 500 10px/1 var(--ui); color: var(--mute); text-align: right; }
.tools.bar { padding: var(--s2) var(--s4); background: var(--cream); }
.ghd { display: flex; justify-content: space-between; align-items: baseline; margin-top: var(--s4); padding: var(--s2) 0; font: 500 var(--f-xs)/1.2 var(--ui); color: var(--mute); border-bottom: 1px solid var(--line); }
.ghd b { font: 700 var(--f-m)/1.2 var(--ui); color: var(--ink); } .ghd b i { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 50%; }
.srow { display: grid; grid-template-columns: auto 40px 1fr auto; gap: 3px var(--s3); align-items: start; width: 100%; padding: var(--s3) 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.srow.fresh { background: rgba(240, 155, 18, .2); margin: 0 calc(-1 * var(--s2)); padding-left: var(--s2); padding-right: var(--s2); width: auto; border-radius: var(--r1); }
.srow .ck { width: 22px; height: 22px; margin-top: 8px; border: 2px solid var(--ink); border-radius: 7px; } .srow .ck.on { background: var(--ink); box-shadow: inset 0 0 0 3px var(--cream); }
.srow .im { grid-column: 2; position: relative; } .srow .m { grid-column: 3; min-width: 0; } .srow .r { grid-column: 4; text-align: right; }
.srow .im .cst { right: -6px; top: -5px; min-width: 0; font-size: 8px; padding: 2px 3px; }
.srow b { display: block; font: 600 var(--f-s)/1.25 var(--ui); } .srow small { display: block; margin-top: 1px; font: 500 var(--f-xs)/1.35 var(--ui); color: var(--mute); }
.srow .r b { font: 700 var(--f-m)/1.2 var(--ui); font-variant-numeric: tabular-nums; } .srow .up { color: var(--green); font-weight: 600; } .srow .dn { color: var(--red); font-weight: 600; } .srow .shr { color: var(--blue); font-weight: 600; }
.ndg { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: var(--s1); padding: 0 var(--s1) 0 var(--s3); border-radius: var(--r1); background: var(--tone); font: 500 var(--f-xs)/1.35 var(--ui); }
.ndg .btn { width: auto; flex: none; padding: 0 var(--s3); font-size: var(--f-s); }
.everypack { padding: var(--s3) var(--s4); border-radius: var(--r1); background: var(--mustard); font: 700 var(--f-s)/1.3 var(--ui); }
.wkh { margin-top: var(--s4); padding-bottom: var(--s1); font: 600 var(--f-xs)/1.2 var(--ui); color: var(--mute); border-bottom: 1px solid var(--line); }
.fl { padding: var(--s3) 0; border-bottom: 1px solid var(--line); font: 500 var(--f-s)/1.45 var(--ui); } .fl.earn { font-weight: 600; } .fl.act { color: var(--mute); } .fl.paid { color: var(--green); font-weight: 600; }
.bulk { padding: var(--s2) var(--s3); border-top: 1px solid var(--line); } .bulk p { margin-bottom: var(--s2); font-weight: 600; } .bulk .b4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s1); } .bulk .b4 .btn { padding: 0 2px; font-size: var(--f-xs); min-height: 44px; }
.addbar { padding: var(--s2) var(--s3); border-top: 1px solid var(--line); }
.pk { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); } .pk small { flex: 0 0 100%; font: 600 var(--f-s)/1 var(--ui); color: var(--mute); } .chip:disabled { opacity: .35; }
.rowl.bad { color: var(--red); } .rowl .xm { display: grid; place-items: center; width: 40px; height: 56px; border: 1.5px dashed var(--red); color: var(--red); font: 700 var(--f-l)/1 var(--ui); border-radius: 4px; }
/* what would it earn: the card, then one binder at a time */
.car { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--s4)); } .car::-webkit-scrollbar { display: none; }
.cslide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; padding: 0 var(--s4); display: grid; gap: var(--s3); align-content: start; }
.chd { display: flex; align-items: center; gap: var(--s2); font: 700 var(--f-l)/1.2 var(--ui); } .chd i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); } .chd small { margin-left: auto; font: 500 var(--f-xs)/1 var(--ui); color: var(--mute); }
.yl { font: 400 var(--d-l)/1 var(--display); font-variant-numeric: tabular-nums; } .yl small { font: 600 var(--f-m)/1 var(--ui); margin-left: 6px; }
.th { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s1); margin-top: var(--s2); }
.dots { display: flex; justify-content: center; gap: 6px; } .dots button { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--tone-2); transition: background-color var(--t2) var(--ease); } .dots button::after { content: ""; position: absolute; inset: -18px -6px; } .dots button.on { background: var(--ink); }

/* ---------- the Noticeboard: cork is the loud part; a notice is a pinned slip (an object) ---------- */
.itabs { display: flex; gap: var(--s1); align-items: flex-end; padding: var(--s2) var(--s4) 0; background-color: var(--cork); background-image: var(--grain); }
.itabs button { min-height: 44px; padding: 0 var(--s4); background: var(--paper-2); border: var(--ol); border-bottom: 0; border-radius: 10px 10px 0 0; font: 600 var(--f-s)/1 var(--ui); opacity: .85; } .itabs button.on { background: var(--cream); opacity: 1; font-weight: 700; } .itabs span { font-weight: 500; margin-left: 3px; }
.rail { display: flex; flex-wrap: wrap; gap: var(--s2); padding: var(--s3) var(--s4); background: var(--cream); } .rail .field { flex: 1 1 130px; min-width: 110px; width: auto; }
main.cork { flex: 1 0 auto; padding: var(--s3) var(--s4) var(--s5); background-color: var(--cork); background-image: var(--grain); }
.cnt { display: inline-block; margin-bottom: var(--s4); padding: 4px 10px; border-radius: 12px; background: var(--cream); font: 600 var(--f-xs)/1.3 var(--ui); }
.nbtop { display: grid; gap: var(--s3); padding: 0 var(--s4) var(--s3); background-color: var(--cork); background-image: var(--grain); }
.nbtop p { color: var(--ink); font: 600 var(--f-s)/1.35 var(--ui); } .nbtop .seg { background: rgba(42, 31, 26, .16); }
main.cork > .btn { margin-bottom: var(--s4); }
.pins { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px var(--s3); align-items: start; }
.notice { position: relative; display: grid; justify-items: center; gap: 3px; padding: 12px 6px 8px; background: var(--cream); color: var(--ink); border: 2px solid var(--ink); text-align: center; transform: rotate(var(--r, -.7deg)); transform-origin: 50% 6px; min-width: 0; }
.notice:active:not(:disabled) { opacity: 1; }
.notice .pinh { position: absolute; left: 50%; top: -7px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--red); border: var(--ol); z-index: 2; }
.notice b { margin-top: 3px; font: 700 var(--f-l)/1.1 var(--ui); font-variant-numeric: tabular-nums; }
.notice small { max-width: 100%; font: 500 10.5px/1.25 var(--ui); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice .yours { position: absolute; left: -4px; top: 10px; z-index: 2; padding: 3px 6px; background: var(--blue); color: var(--cream); border-radius: 8px; font: 700 9.5px/1 var(--ui); font-style: normal; white-space: nowrap; } .notice .yours.offer { background: var(--red); }
.notice.sh { background: var(--tape); } .notice.sh .card-img { width: 70%; }
/* price against value: a good deal stands out */
.pv { display: inline-block; padding: 2px 6px; border-radius: 8px; font: 700 9.5px/1.3 var(--ui); white-space: nowrap; background: var(--tone-2); color: var(--ink); }
.pv.under { background: rgba(9, 140, 75, .16); color: #06693A; } .pv.over { background: rgba(240, 155, 18, .28); color: #6B4300; }
.corkp { padding: 22px 0 18px; background-color: var(--cork); background-image: var(--grain); border-radius: var(--r2); display: grid; place-items: center; } .corkp .notice { width: 140px; }
.tell { margin-top: var(--s4); border-radius: var(--r2); background: var(--cream); }

/* ---------- help for a first-timer: the (i), one-time hints, the welcome ---------- */
.inf { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 5px; color: var(--mute); vertical-align: -4px; } .inf .ic { width: 18px; height: 18px; stroke-width: 2.4; }
.inf::after { content: ""; position: absolute; inset: -13px; }
.hint { position: absolute; z-index: 75; max-width: 250px; padding: 10px 14px; border-radius: 14px; background: var(--mustard); color: var(--ink); font: 600 var(--f-s)/1.35 var(--ui); text-align: left; opacity: 0; transform: translateY(6px); transition: opacity var(--t2) var(--ease), transform var(--t2) var(--ease); }
.hint.on { opacity: 1; transform: none; } .hint:active:not(:disabled) { transform: none; opacity: .9; }
.hint::before { content: ""; position: absolute; left: var(--ax, 50%); top: -5px; width: 12px; height: 12px; margin-left: -6px; background: var(--mustard); transform: rotate(45deg); border-radius: 2px; }
.hint.up::before { top: auto; bottom: -5px; }
.hint.info { z-index: 85; font-weight: 500; }
.hint.slot { padding: 6px 10px; font-size: 12px; line-height: 1.2; } .hint.slot::before { display: none; }
.glow { box-shadow: 0 0 0 3px var(--mustard); animation: bump .5s var(--ease) 2; }
/* on the pull screen a toast sits in the header's title space, where nothing is under it */
#app[data-dark] #toast { left: 48px; top: 9px; transform: translateY(-8px); max-width: calc(100% - 48px - 140px); padding: 8px 12px; overflow: hidden; text-overflow: ellipsis; background: var(--cream); color: var(--ink); }
#app[data-dark] #toast.on { transform: none; } #app[data-dark] #toast.tap { padding-right: 28px; } #app[data-dark] #toast.tap::after { right: 12px; }
.bdr.nudge { animation: nudge 1.6s var(--ease) 3; box-shadow: 6px 6px 0 var(--ink), 0 0 0 5px var(--cream); }
@keyframes nudge { 50% { transform: rotate(0) scale(1.025); } }
#welcome { position: absolute; inset: 0; z-index: 90; display: flex; flex-direction: column; gap: var(--s4); padding: var(--s2) 0 calc(var(--s5) + env(safe-area-inset-bottom, 0px)); background: var(--cream); }
#welcome > .btn.txt { align-self: flex-end; width: auto; margin-right: var(--s2); }
#welcome > .btn:not(.txt) { width: auto; margin: 0 var(--s4); }
#welcome .car { flex: 1; min-height: 0; margin: 0; }
.wslide { flex: 0 0 100%; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: center; gap: var(--s5); padding: 0 var(--s5); }
.wslide h2 { font-size: var(--d-l); line-height: 1.05; }
.wart { position: relative; height: min(46vh, 320px); border-radius: var(--r2); background-color: var(--page-2); overflow: hidden; }

.wc { position: absolute; left: 50%; top: 50%; width: 150px; margin: -105px 0 0 -75px; transform: rotate(-3deg); }
.wc .cb, .wc .card-img { box-shadow: 0 12px 26px rgba(0, 0, 0, .4), 0 2px 6px rgba(0, 0, 0, .3); }
.wc.l { transform: translate(-62px, 10px) rotate(-14deg); } .wc.r { transform: translate(62px, 10px) rotate(11deg); }
.wart.w2 .wc.l { transform: translate(-44px, 4px) rotate(-9deg); } .wart.w2 .wc.r { transform: translate(44px, 4px) rotate(8deg); }
.wk, .ws { position: absolute; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: var(--ol); background: var(--cream); }
.wk { left: 16%; bottom: 8%; background: var(--green); color: var(--cream); } .ws { right: 16%; bottom: 8%; } .wk.up { left: auto; right: 8%; bottom: auto; top: 8%; background: var(--cream); color: var(--ink); }
@media (prefers-reduced-motion: reduce) { * { transition-duration: 1ms !important; animation: none !important; } }
