:root {
  --bg: #0a0a0b; --surface: #121214; --raised: #1a1a1d; --hover: #202024;
  --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.12);
  --text: #ededef; --muted: #8e8e98; --faint: #5f5f69;
  --owned: #4ade80; --owned-soft: rgba(74,222,128,.13); --focus: #7aa2ff; --danger: #f87171;
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --ease: cubic-bezier(.22,1,.36,1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --top-h: 56px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.5 "Inter var", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: -.006em; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }
.ic { flex: none; display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 22px; padding: 0 20px; background: rgba(10,10,11,.82); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; letter-spacing: -.02em; }
.brand-mark { width: 22px; height: 22px; flex: 0 0 22px; background: url('/icon.svg') center / contain no-repeat; }
.topnav { display: flex; gap: 2px; }
.topnav a { padding: 6px 10px; border-radius: 7px; color: var(--muted); font-size: 14px; font-weight: 500; transition: color .15s, background .15s; }
.topnav a:hover { color: var(--text); }
.topnav a.active { color: var(--text); background: var(--raised); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top-actions .top-scan { margin-left: 8px; }
.syncbadge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 0 8px; }
.syncbadge .ic { animation: spin 1.4s linear infinite; }

/* bottom tabs (mobile) */
.tabs { display: none; }
@media (max-width: 759px) {
  .topbar { padding: 0 10px 0 16px; gap: 10px; }
  .topnav, .top-actions .top-scan { display: none; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(10,10,11,.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
  .tabs a { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; padding: 9px 0 8px; font-size: 11px; font-weight: 500; color: var(--faint); transition: color .15s; }
  .tabs a.active { color: var(--text); }
}
main { max-width: 1120px; margin: 0 auto; padding: 32px 20px calc(110px + var(--safe-b)); }
@media (max-width: 759px) { main { padding: 20px 14px calc(96px + var(--safe-b)); } }

/* type */
h1 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -.025em; margin: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 38px 0 12px; }
.section-title .link { font-size: 13px; font-weight: 500; color: var(--muted); }
.section-title .link:hover { color: var(--text); }
.eyebrow { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.eyebrow a:hover { color: var(--text); }
.row-sub, .muted { color: var(--muted); font-size: 13px; }
.count { color: var(--muted); font-weight: 500; margin-left: 6px; margin-right: auto; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--raised); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--text); color: #0a0a0b; border-color: var(--text); }
.btn-primary:hover { background: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--raised); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
.btn.lg { height: 44px; padding: 0 18px; font-size: 15px; border-radius: 10px; }
.btn .muted { font-size: 12px; }
.btn-primary .muted { color: #5a5a62; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); color: var(--muted); background: none; border: 0; transition: color .15s, background .15s; }
.icon-btn:hover { color: var(--text); background: var(--raised); }
.input { height: 36px; padding: 0 11px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; min-width: 0; transition: border-color .15s; }
.input:focus { outline: none; border-color: var(--focus); }
.input.sm { height: 28px; font-size: 12.5px; padding: 0 8px; }
select.input { padding-right: 28px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e98' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
input[type=search]::-webkit-search-cancel-button { filter: invert(.6); }
input[type=checkbox] { accent-color: var(--text); width: 15px; height: 15px; margin: 0; }
.search-field { position: relative; flex: 1 1 220px; display: flex; min-width: 0; }
.search-field .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-field .input { width: 100%; padding-left: 34px; }
.search-field.lg .input { height: 46px; font-size: 15.5px; border-radius: 10px; }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); transition: color .15s, background .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--raised); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 1px 2px rgba(0,0,0,.45); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; }
.toolbar .spacer { flex: 1; }
.toolbar.sticky { position: sticky; top: var(--top-h); z-index: 10; margin: 0 -20px 20px; padding: 10px 20px; background: rgba(10,10,11,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
@media (max-width: 759px) {
  .toolbar.sticky { position: static; margin: 0 0 16px; padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .seg button { padding: 5px 9px; }
}
.inline-opt { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.tag { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; margin-left: 8px; border-radius: 99px; font-size: 11px; font-weight: 500; color: var(--muted); border: 1px solid var(--line-2); vertical-align: 1px; }
.tag-accent { color: var(--owned); border-color: rgba(74,222,128,.35); }

/* lists */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list:empty { display: none; }
.row + .row { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; transition: background .15s; }
a.row:hover { background: var(--hover); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { text-align: right; white-space: nowrap; font-size: 13.5px; }
.row-end .row-sub { display: block; font-size: 12px; }
.set-logo { width: 72px; height: 36px; flex: none; display: grid; place-items: center; }
.set-logo img { max-width: 72px; max-height: 36px; object-fit: contain; }
.set-logo:empty { display: none; }
.setrow .meter { margin-top: 8px; max-width: 440px; }

/* meters */
.meter { height: 3px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--text); transition: width .5s var(--ease); }
.meter.done i { background: var(--owned); }
.meter-row + .meter-row { margin-top: 14px; }
.meter-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; }
.meter-head span:first-child { color: var(--muted); }

/* home */
.hero { padding: 4px 0; }
.hero-value { font-size: 46px; font-weight: 600; letter-spacing: -.04em; line-height: 1.1; margin-top: 6px; }
.hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 4px 24px; margin-top: 12px; color: var(--muted); font-size: 13.5px; }
.hero-stats b { color: var(--text); font-weight: 600; }
.callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px; border: 1px dashed var(--line-2); border-radius: var(--r); }
.callout .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 118px; gap: 14px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.strip::-webkit-scrollbar { display: none; }
.mini { border: 0; background: none; padding: 0; text-align: left; scroll-snap-align: start; }
.mini .t-name { margin-top: 9px; }

/* card art */
.art { display: block; width: 100%; aspect-ratio: 63 / 88; border-radius: 4.6% / 3.3%; overflow: hidden; background: var(--raised); border: 0; padding: 0; position: relative; }
.art img { width: 100%; height: 100%; object-fit: cover; transition: filter .35s var(--ease), opacity .35s var(--ease), transform .35s var(--ease); }
button.art:hover img { transform: scale(1.025); }
.tile:not(.owned) .art img, .art.dim img { filter: grayscale(1); opacity: .38; }
.tile:not(.owned) .art:hover img { opacity: .55; }
.art.sm { width: 48px; flex: none; border-radius: 3px; }
.art.xs { width: 36px; flex: none; border-radius: 3px; }

/* grid tiles */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 26px 16px; }
@media (max-width: 759px) { .grid { grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 20px 10px; } }
.tile-meta { margin-top: 9px; }
.t-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-sub span:first-child { overflow: hidden; text-overflow: ellipsis; }
.vchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.vchip { height: 22px; min-width: 28px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .01em; transition: background .2s, color .2s, border-color .2s; }
.vchip:hover { color: var(--text); border-color: rgba(255,255,255,.24); }
.vchip.on { background: var(--owned-soft); border-color: transparent; color: var(--owned); }
.vchip span { font-weight: 500; opacity: .8; margin-left: 2px; }

/* set page */
.set-hero { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.set-hero-logo { width: 150px; flex: none; display: flex; justify-content: center; }
.set-hero-logo img { max-height: 76px; object-fit: contain; }
.set-hero h1 { margin: 3px 0 4px; }
@media (max-width: 759px) { .set-hero { gap: 14px; } .set-hero-logo { width: 84px; } .set-hero-logo img { max-height: 46px; } h1 { font-size: 22px; } }
.related { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 13px; }
.related a { color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.related a:hover { color: var(--text); }
.summary { display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 8px; }
@media (max-width: 759px) { .summary { grid-template-columns: 1fr; gap: 20px; padding: 16px; } }
.goal-box { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.goal-box .seg { align-self: flex-start; }
.cost { font-size: 13px; color: var(--muted); }
.cost b { color: var(--text); font-weight: 600; }

/* checklist */
table.check { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.check th { font-size: 12px; font-weight: 500; color: var(--faint); text-align: left; padding: 0 10px 8px; border-bottom: 1px solid var(--line); }
table.check td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.check td.n { color: var(--muted); width: 64px; }
table.check td.nm a { color: var(--muted); transition: color .15s; }
table.check tr.owned td.nm a, table.check td.nm a:hover { color: var(--text); }
table.check .vchips { margin: 0; }
table.check td.pr { text-align: right; color: var(--muted); white-space: nowrap; }
@media (max-width: 759px) { table.check .rar { display: none; } table.check td, table.check th { padding-left: 6px; padding-right: 6px; } }

/* binder */
.binder { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.binder-page { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.binder-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.binder-head b { color: var(--text); font-weight: 600; }
.pockets { display: grid; gap: 7px; }
.pocket { position: relative; aspect-ratio: 63 / 88; border-radius: 4px; overflow: hidden; background: var(--bg); outline: 1px dashed var(--line-2); outline-offset: -1px; cursor: pointer; }
.pocket.owned { outline: 0; }
.pocket img { width: 100%; height: 100%; object-fit: cover; }
.pocket:not(.owned) img { filter: grayscale(1); opacity: .28; }
.pocket .lbl { position: absolute; left: 4px; bottom: 4px; font-size: 9.5px; font-weight: 600; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.72); color: #fff; }
.pocket.faded { opacity: .22; }
button.pocket { border: 0; padding: 0; color: inherit; font: inherit; width: 100%; }
.pocket.empty { display: grid; place-items: center; color: var(--faint); transition: color .15s, background .15s; }
.pocket.empty:hover { color: var(--text); background: var(--surface); }
.binder-ico { color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form h2 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field .seg { align-self: flex-start; }
.pocketview { display: grid; grid-template-columns: 180px 1fr; gap: 22px; align-items: start; }
.pocketview h2 { font-size: 21px; margin: 4px 0; letter-spacing: -.02em; }
.pocketview .btns, .row .btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
@media (max-width: 759px) { .pocketview { grid-template-columns: 1fr; } .pocketview .art { max-width: 180px; margin: 0 auto; } }
.loc { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.loc a { color: var(--text); }

/* sheet */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0,0,0,.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet { position: relative; width: min(820px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.sheet-close { position: absolute; top: 12px; right: 12px; }
.sheet-grip { display: none; }
@media (max-width: 759px) {
  .modal { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 20px 20px 0 0; max-height: 92vh; padding: 10px 18px calc(24px + var(--safe-b)); border-bottom: 0; }
  .sheet-grip { display: block; width: 36px; height: 4px; border-radius: 99px; background: var(--line-2); margin: 0 auto 16px; }
}
.cardview { display: grid; grid-template-columns: 260px 1fr; gap: 30px; }
@media (max-width: 759px) { .cardview { grid-template-columns: 1fr; gap: 20px; } .cardview-art { max-width: 220px; margin: 0 auto; width: 100%; } }
.cardview-art .art { box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.cardview-info h2 { font-size: 24px; font-weight: 600; letter-spacing: -.025em; margin: 4px 0; }
.variants { margin-top: 22px; border-top: 1px solid var(--line); }
.variant { padding: 14px 0; border-bottom: 1px solid var(--line); }
.variant-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.variant-name { font-weight: 500; }
.owned-txt { color: var(--owned); font-size: 12.5px; font-weight: 500; margin-left: 8px; }
.entry { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.cond { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.stepper button { width: 32px; height: 30px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); }
.stepper button:hover { background: var(--raised); color: var(--text); }
.stepper span { min-width: 30px; text-align: center; font-weight: 600; font-size: 13.5px; }
.addrow { display: flex; gap: 6px; margin-top: 10px; }
.note { font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: var(--r-sm); background: var(--raised); margin-top: 12px; }

/* scan */
.scan-panel { display: flex; flex-direction: column; align-items: stretch; text-align: center; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.scan-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--raised); border: 1px solid var(--line-2); margin-bottom: 10px; }
.scan-title { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.scan-panel .row-sub { max-width: 380px; }
.scan-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 12px; }
#scanout:not(:empty) { margin-top: 16px; }
.scan-status { display: flex; align-items: center; gap: 16px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.scan-status img { width: 60px; border-radius: 4px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--text); animation: spin .8s linear infinite; margin-bottom: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.readout { font-size: 14px; margin: 0 2px 12px; }
.readout .row-sub { display: block; font-size: 12px; margin-bottom: 2px; }
.cand { align-items: flex-start; }
.cand.best { background: rgba(74,222,128,.035); }
.cand-actions { margin-top: 8px; }
.cand-actions .btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cand-variants { margin-top: 10px; }
.status { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 500; }
.status.new { color: var(--owned); }
.status.have { color: var(--text); }
.status.have .ic { color: var(--owned); }
.trade-txt { color: #93c5fd; font-size: 12.5px; font-weight: 500; margin-left: 8px; }
.added { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); flex-wrap: wrap; }
.added .row-main { min-width: 200px; }
.added .row-title { white-space: normal; }
.added-check { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--owned-soft); color: var(--owned); flex: none; }
.added .row-main a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }

/* scan queue */
.qitem { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 12px; }
.qhead, .qworking, .qdone { display: flex; align-items: center; gap: 12px; }
.qthumb { width: 46px; height: 64px; object-fit: cover; border-radius: 4px; flex: none; background: var(--raised); }
.qthumb.big { width: 84px; height: 117px; }
.qitem .list { margin-top: 10px; }
.qalt summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 10px; list-style: none; }
.qalt summary::-webkit-details-marker { display: none; }
.qalt summary:hover { color: var(--text); }
.qsearch { margin-top: 10px; }
.qresults:empty { display: none; }
.qlabel { margin-top: 12px; }
.qhead .btns { display: flex; gap: 6px; margin-top: 8px; }
.qworking .spinner { margin: 0; }
.section-title .btn { margin-left: 8px; }

/* Scan -> compare -> confirm. Dialog keeps a draft stable while DexyBot reads on. */
.scan-review-entry { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:18px 0; border-bottom:1px solid var(--line); }
.scan-review-entry[hidden] { display:none; }
.scan-review-entry strong { display:block; font-size:17px; margin-bottom:4px; }
.scan-mode .seg { display:flex; width:100%; }
.scan-mode .seg button { flex:1; min-height:44px; font-size:13px; }
.scan-panel .scan-mode-hint { max-width:none; margin:0; text-align:left; font-size:12px; }
.rapid-mode { position:absolute; left:14px; bottom:calc(190px + var(--safe-b)); z-index:2; }
.rapid-mode label { display:flex; align-items:center; gap:8px; padding:7px 10px; border-radius:10px; background:rgba(0,0,0,.78); font-size:12px; color:#fff; }
.rapid-mode select { min-width:125px; }
.sr-keep { border:1px solid var(--line-2); border-left:3px solid var(--owned); padding:14px; margin:14px 0; border-radius:8px; }
.sr-keep strong { display:block; font-size:14px; font-weight:600; }
.sr-keep p { margin:6px 0 12px; font-size:13px; line-height:1.5; color:var(--muted); }
.sr-keep small { display:block; color:var(--muted); font-size:11px; margin-top:10px; }
.sr-binder-place { display:block; color:var(--text); margin-top:6px; }
.qreview-preview { display:flex; align-items:center; gap:10px; }
.qreview-preview .art.sm { width:46px; height:64px; flex:none; }
.qpreview-empty { width:46px; height:64px; display:grid; place-items:center; background:var(--raised); border-radius:4px; color:var(--muted); }
.scan-review-dialog { color:var(--text); background:var(--bg); border:1px solid var(--line-2); border-radius:18px; padding:0; width:min(960px, calc(100vw - 40px)); height:min(940px, calc(100dvh - 40px)); max-width:none; max-height:none; margin:auto; overflow:hidden; }
.scan-review-dialog[open] { display:flex; flex-direction:column; }
.scan-review-dialog::backdrop, .sr-zoom::backdrop { background:rgba(0,0,0,.82); }
.sr-header { flex:none; padding:18px 24px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; gap:12px; }
.sr-header h2 { margin:0 0 4px; font-size:20px; letter-spacing:-.5px; }
.sr-header p { margin:0; }
.sr-body { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:20px 24px; }
.sr-compare { display:grid; grid-template-columns:1fr 1fr; gap:20px; max-width:740px; margin:0 auto 22px; }
.sr-compare figure { margin:0; min-width:0; }
.sr-compare figcaption { display:flex; flex-direction:column; gap:3px; margin-bottom:10px; font-size:14px; font-weight:600; }
.sr-compare figcaption span { font-size:11px; color:var(--muted); font-weight:400; }
.sr-image { position:relative; width:100%; height:clamp(200px, 37dvh, 390px); padding:0; border:1px solid var(--line); border-radius:10px; overflow:hidden; cursor:zoom-in; background:#141416; display:block; }
.sr-image img { position:absolute; inset:0; width:100%; height:100%; min-height:0; max-height:100%; object-fit:contain; display:block; }
.sr-no-card { height:clamp(200px, 37dvh, 390px); border:1px dashed var(--line-2); border-radius:10px; display:grid; align-content:center; text-align:center; padding:18px; color:var(--muted); font-size:13px; line-height:1.6; }
.sr-details { max-width:740px; margin:auto; }
.sr-details h3 { font-size:23px; letter-spacing:-.5px; margin:0 0 5px; }
.sr-meta { margin:0 0 12px; color:var(--muted); font-size:13px; line-height:1.5; }
.sr-owned { font-size:13px; margin:10px 0; color:var(--accent, #72cda0); }
.sr-warning { font-size:13px; padding-left:12px; border-left:2px solid var(--muted); color:var(--text); line-height:1.5; }
.sr-read { font-size:12px; color:var(--muted); margin:12px 0; }
.sr-read summary, .sr-correct summary { cursor:pointer; padding:6px 0; }
.sr-read p { margin:5px 0; }
.sr-fields { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:16px; }
.sr-fields label, .sr-search-label { display:flex; flex-direction:column; gap:7px; color:var(--muted); font-size:12px; }
.sr-fields .input { width:100%; height:42px; }
.sr-foil { font-size:12px; color:var(--muted); line-height:1.5; margin:9px 0 16px; }
.sr-destination { border:0; margin:16px 0; padding:0; }
.sr-destination legend { color:var(--muted); font-size:12px; margin-bottom:7px; }
.sr-destination .seg { display:flex; }
.sr-destination .seg button { flex:1; min-height:40px; }
.sr-correct { padding:10px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); margin:18px 0 8px; font-size:13px; }
.sr-search-label { margin:12px 0; }
.sr-results:empty { display:none; }
.sr-choice { width:100%; color:var(--text); background:transparent; border:0; border-bottom:1px solid var(--line); text-align:left; display:flex; align-items:center; padding:10px 0; gap:12px; cursor:pointer; }
.sr-choice:hover { background:var(--hover); }
.sr-choice img { height:62px; width:45px; object-fit:contain; flex:none; }
.sr-choice strong, .sr-choice small { display:block; line-height:1.5; }
.sr-choice strong { font-size:14px; font-weight:500; }
.sr-choice small { font-size:12px; color:var(--muted); }
.sr-tools { display:flex; justify-content:space-between; padding:5px 0; }
.sr-footer { flex:none; display:flex; gap:12px; border-top:1px solid var(--line); padding:14px 24px calc(14px + env(safe-area-inset-bottom, 0px)); background:var(--surface); }
.sr-footer .btn { min-height:46px; }
.sr-confirm { flex:1; }
.sr-feedback { flex:none; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:0 24px; font-size:12px; background:var(--surface); }
.sr-feedback:has(span:empty) { display:none; }
.sr-feedback span { padding:10px 0; }
.sr-empty { display:flex; min-height:300px; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:12px; padding:30px; }
.sr-empty h3, .sr-empty p { margin:0; }
.sr-zoom { width:100vw; height:100dvh; max-width:none; max-height:none; padding:0; margin:0; border:0; color:var(--text); background:#09090b; }
.sr-zoom[open] { display:flex; flex-direction:column; }
.sr-zoom-head { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:14px 20px; }
.sr-zoom-scroll { overflow:auto; flex:1; text-align:center; padding:12px; }
.sr-zoom-scroll img { display:block; width:auto; min-width:min(100%, 550px); max-width:100%; max-height:none; height:auto; margin:auto; }
@media (max-width:759px) {
  .rapid .rapid-top { display:grid; grid-template-columns:1fr auto auto; }
  .rapid-top .rapid-count { grid-column:1 / -1; font-size:13px; }
  .rapid-top .rapid-grid { display:flex; flex-wrap:nowrap; justify-self:start; }
  .rapid-top .rapid-grid button { min-width:34px; }
  .scan-review-dialog { width:100vw; height:100dvh; margin:0; border:0; border-radius:0; }
  .sr-header { padding:calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; }
  .sr-header h2 { font-size:19px; }
  .sr-body { padding:16px; }
  .sr-compare { gap:10px; margin-bottom:17px; }
  .sr-compare figcaption { font-size:13px; }
  .sr-image, .sr-no-card { height:clamp(180px, 30dvh, 280px); border-radius:7px; }
  .sr-details h3 { font-size:21px; }
  .sr-footer { padding-left:16px; padding-right:16px; }
  .sr-feedback { padding-left:16px; padding-right:16px; }
  .qreview-preview { gap:8px; }
  .qreview-preview .qthumb, .qreview-preview .art.sm, .qpreview-empty { width:36px; height:50px; }
  .qreview-preview .row-title { font-size:13px; }
  .qreview-preview .row-sub { font-size:11px; }
}

/* Trade connections and user-initiated conversations */
.connection { padding:22px; margin:12px 0; background:var(--surface); border:1px solid var(--line); border-radius:var(--r); }
.connection h3 { font-size:20px; letter-spacing:-.4px; line-height:1.35; margin:7px 0 12px; max-width:700px; }
.connection .btns { display:flex; flex-wrap:wrap; gap:8px; }
.connection-cards { display:flex; gap:8px; margin:14px 0; }
.connection-cards img { width:64px; height:89px; object-fit:contain; border-radius:4px; }
.connection-summary { font-size:15px; padding:14px 0; border-bottom:1px solid var(--line); }
.conversation-link { text-decoration:none; }
.conversation-link .row-sub { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.trade-thread { display:flex; flex-direction:column; gap:12px; max-width:850px; margin:16px auto 22px; }
.trade-bubble { padding:14px 16px; max-width:85%; align-self:flex-start; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
.trade-bubble.mine { align-self:flex-end; background:var(--raised); }
.trade-bubble p { white-space:pre-wrap; overflow-wrap:anywhere; margin:7px 0 0; }
.trade-compose { max-width:850px; margin:auto; }
.trade-compose label { display:block; margin-bottom:8px; font-size:13px; color:var(--muted); }
.trade-compose textarea { width:100%; min-height:120px; resize:vertical; }
.trade-compose .btns { display:flex; flex-wrap:wrap; gap:8px; }
.trade-message-status { color:var(--owned); font-size:13px; }
@media(max-width:759px) { .connection { padding:17px; } .connection h3 { font-size:18px; } .connection .btn-primary { width:100%; } .trade-bubble { max-width:95%; } }

/* needs */
.needset { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; overflow: hidden; }
.needset summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; }
.needset summary::-webkit-details-marker { display: none; }
.needset summary .chev { color: var(--faint); transition: transform .2s var(--ease); }
.needset[open] summary .chev { transform: rotate(90deg); }
.needset .row { border-top: 1px solid var(--line); }
.needset .art.xs img { filter: grayscale(1); opacity: .45; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 28px); padding: 10px 10px 10px 16px; background: var(--raised); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.5); font-size: 13.5px; font-weight: 500; }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button { border: 0; background: none; color: var(--text); font-weight: 600; font-size: 13px; padding: 4px 8px; border-radius: 6px; }
.toast button:hover { background: var(--hover); }
@media (max-width: 759px) { .toast { bottom: calc(78px + var(--safe-b)); } }

/* settings */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 14px; }
.panel h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.panel p { margin: 12px 0 0; }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 9px 16px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
@media (max-width: 759px) { .kv { grid-template-columns: 1fr 1fr; } }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--owned); }
.dot.bad { background: var(--danger); }
.panel .toolbar { margin: 16px 0 0; }

/* states */
.loading { padding: 80px 0; text-align: center; color: var(--faint); font-size: 13px; }
.error { padding: 12px 14px; border-radius: var(--r-sm); background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.3); color: #fecaca; font-size: 13.5px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 72px 16px; color: var(--muted); }
.empty h1 { color: var(--text); font-size: 20px; }
.empty p { max-width: 420px; margin: 0 0 12px; }
.empty-inline { padding: 36px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }

@media print {
  .topbar, .tabs, .toolbar, .noprint, .modal, .toast { display: none !important; }
  body, main { background: #fff; color: #000; padding: 0; }
  .needset { border: 0; background: none; break-inside: avoid; }
  .needset .row { border-color: #ddd; }
  .needset .art { display: none; }
  .row-sub, .muted { color: #444; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* trading */
.subnav { display: flex; gap: 6px; margin: -8px 0 22px; overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); white-space: nowrap; transition: color .15s, background .15s; }
.subnav a:hover { color: var(--text); }
.subnav a.on { color: var(--text); background: var(--raised); border-color: var(--line-2); }
.trade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 759px) { .trade-grid { grid-template-columns: 1fr; } }
.trade-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.trade-side .search-field { flex: none; }
.trade-side .list:empty { display: none; }
.ts-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ts-head h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.ts-total { font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.tline { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tline .row-main { min-width: 0; }
.tline .row-title { white-space: normal; }
.tline .opts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.stepper button:disabled { opacity: .3; cursor: default; }
.trade-summary { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.verdict { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.balance { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--line-2); }
.balance i { display: block; height: 100%; transition: width .4s var(--ease); }
.balance .g { background: var(--muted); }
.balance .r { background: var(--owned); }
.trade-summary .fields { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
@media (max-width: 759px) { .trade-summary .fields { grid-template-columns: 1fr; } }
.trade-summary .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.tradelog { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.tradelog.reverted { opacity: .5; }
.tl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tl-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.tl-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tl-thumbs .art.xs { width: 40px; }
.want-txt { color: #fbbf24; }
.tag-want { color: #fbbf24; border-color: rgba(251,191,36,.35); }
.form .btns { display: flex; flex-wrap: wrap; gap: 8px; }
/* public share page */
body.share main { padding-bottom: 60px; }
.share-head { margin-bottom: 18px; }

/* rapid scan */
.rapid { position: fixed; inset: 0; z-index: 80; background: #000; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.rapid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rapid-guide { position: absolute; inset: 0; display: grid; place-items: center; }
.rapid-guide i { width: min(74vw, calc(60vh * 63 / 88)); aspect-ratio: 63 / 88; border: 2px solid rgba(255,255,255,.9); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0,0,0,.38); pointer-events: none; }
.rapid-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.rapid-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 14px; background: linear-gradient(rgba(0,0,0,.65), transparent); }
.rapid-count { color: #fff; font-weight: 600; font-size: 14px; margin-right: auto; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.rapid-strip { position: absolute; left: 0; right: 0; bottom: calc(124px + var(--safe-b)); display: flex; gap: 6px; padding: 0 14px; overflow: hidden; pointer-events: none; }
.rapid-strip img { width: 38px; height: 53px; object-fit: cover; border-radius: 4px; border: 1.5px solid var(--owned); flex: none; }
.rapid-strip img.pending { border-color: rgba(255,255,255,.55); opacity: .75; }
.rapid-strip img.failed { border-color: var(--danger); }
.rapid-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 20px 0 calc(28px + var(--safe-b)); background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.rapid-shutter { width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff; background: rgba(255,255,255,.92); box-shadow: 0 0 0 5px rgba(0,0,0,.3); transition: transform .08s; }
.rapid-shutter:active { transform: scale(.9); }

/* layout pass */
.tab-scan-btn { display: grid; place-items: center; width: 46px; height: 46px; margin-top: -22px; border-radius: 50%; background: var(--text); color: #0a0a0b; box-shadow: 0 6px 18px rgba(0,0,0,.5), 0 0 0 4px var(--bg); }
.tabs a.tab-scan { color: var(--muted); }
.tabs a.tab-scan.active { color: var(--text); }
.rapid-cta { height: 56px; font-size: 17px; font-weight: 600; border-radius: 14px; gap: 10px; width: 100%; }
.scan-alt { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 6px; }
.subnav { margin-top: -4px; }
.page-head { margin-bottom: 16px; }
@media (max-width: 759px) {
  .page-head h1 { font-size: 22px; }
  .hero-value { font-size: 40px; }
  .section-title { margin-top: 30px; }
}

/* accounts */
body.guest .tabs, body.guest .topnav, body.guest .top-actions { display: none !important; }
.auth { max-width: 380px; margin: 6vh auto 0; display: flex; flex-direction: column; gap: 14px; }
.auth-brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.auth h1 { font-size: 26px; }
.auth .btn.lg { width: 100%; }
.auth .link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.bell { position: relative; }
.bellcount { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }

/* market */
.listing .art { position: relative; }
.want-lbl { position: absolute; left: 5px; top: 5px; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: rgba(0,0,0,.75); color: #fbbf24; }
.trade-set { margin: 26px 0 34px; }
.trade-set:first-child { margin-top: 0; }
.trade-set-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.trade-set-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
#pbody .want-lbl { max-width: calc(100% - 10px); white-space: normal; line-height: 1.35; text-align: left; }
.need-availability { margin-top: 5px; white-space: normal; }
.profile-match p { margin: 7px 0 0; }
.profile-need-filter[hidden] { display: none; }
.price-big { color: var(--text); font-weight: 600; }
.listing-view { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: start; }
@media (max-width: 759px) { .listing-view { grid-template-columns: 1fr; gap: 18px; } .lv-art { max-width: 230px; margin: 0 auto; width: 100%; } }
.lv-art .art { box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.lv-info h1 { margin: 4px 0; }
.lv-price { display: flex; flex-direction: column; gap: 2px; margin: 18px 0 6px; }
.lv-price b { font-size: 32px; font-weight: 600; letter-spacing: -.03em; }
.lv-desc { margin: 10px 0 0; color: var(--text); white-space: pre-wrap; }
.lv-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; align-items: flex-start; }
.lv-actions .btn.lg { width: 100%; max-width: 360px; }
.bidrow { display: flex; gap: 8px; width: 100%; max-width: 360px; }
.bidrow .input { flex: 1; height: 44px; font-size: 16px; }
.bidrow .btn { height: 44px; }
.msgs { display: flex; flex-direction: column; gap: 8px; }
.msg { align-self: flex-start; max-width: 85%; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; white-space: pre-wrap; }
.msg.mine { align-self: flex-end; background: var(--surface); }
.msgform { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.msgform .input[name=body] { flex: 1; min-width: 160px; }
.fields2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fields2 > * { min-width: 0; }
.fields2 .input { width: 100%; }
.rev-hint { color: #fbbf24; margin-top: 6px; }
.stars { color: #fbbf24; font-weight: 600; white-space: nowrap; }
.rate { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); max-width: 360px; }
.starpick { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; font-size: 26px; }
.starpick input { display: none; }
.starpick span { color: var(--line-2); cursor: pointer; }
.starpick label:has(input:checked) span, .starpick label:has(input:checked) ~ label span { color: #fbbf24; }
.chartbox { margin-top: 16px; }
.chartbox:empty { display: none; }
.chart { display: block; width: 100%; height: 120px; margin-top: 8px; }
.hero .chart { height: 90px; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11.5px; margin-top: 4px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.rapid-grid { background: rgba(0,0,0,.45); border-color: rgba(255,255,255,.2); }
.rapid-grid button { color: #fff; padding: 4px 10px; }
.rapid-guide i.g2, .rapid-guide i.g3 { width: min(94vw, calc(70vh * 63 / 88)); display: grid; }
.rapid-guide i b { border: 1px dashed rgba(255,255,255,.55); border-radius: 6px; margin: 3px; }
/* profiles */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.profile-head h1 { margin: 0; }
.avatar { width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--raised); border: 1px solid var(--line-2); font-size: 22px; font-weight: 600; }
.prof-stats { margin-top: 0; }
.plink { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.plink:hover { text-decoration-color: currentColor; }
/* visual binder */
.book-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.book-ov { position: fixed; inset: 0; z-index: 48; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 45%, #1d1d23 0%, #060607 72%); user-select: none; -webkit-user-select: none; }
.book-top { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 4px; }
.book-title { font-weight: 600; margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-pn { color: var(--muted); font-size: 13px; white-space: nowrap; }
.book-stage { flex: 1; min-height: 0; display: grid; place-items: center; perspective: 2600px; overflow: hidden; touch-action: pan-y; padding: 8px; }
.book { --pw: min(45vw, calc((100vh - 150px) * .74)); position: relative; display: flex; width: calc(var(--pw) * 2); height: calc(var(--pw) / .74); transform-style: preserve-3d; filter: drop-shadow(0 30px 40px rgba(0,0,0,.55)); }
.book.single { --pw: min(92vw, calc((100vh - 150px) * .74)); width: var(--pw); }
.book.closed:not(.single) { transform: translateX(-25%); }
.book:not(.single):not(.closed)::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 30px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, rgba(0,0,0,.45) 45%, rgba(0,0,0,.45) 55%, transparent); pointer-events: none; z-index: 5; }
.half { position: relative; width: 50%; height: 100%; }
.half.full { width: 100%; }
.bpage { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 5.5% 5% 3%; background: linear-gradient(180deg, #1c1c21, #151519); border: 1px solid rgba(255,255,255,.06); border-radius: 6px; overflow: hidden; }
.half.left .bpage, .leaf.r .face.back .bpage, .leaf.l .face:not(.back) .bpage { border-radius: 10px 3px 3px 10px; }
.half.right .bpage, .leaf.r .face:not(.back) .bpage, .leaf.l .face.back .bpage { border-radius: 3px 10px 10px 3px; }
.bpage.blank { background: linear-gradient(180deg, #19191d, #131316); }
.bgrid { flex: 1; display: grid; gap: 3.5%; align-content: center; }
.bpocket { position: relative; aspect-ratio: 63 / 88; border-radius: 4.5% / 3.2%; overflow: hidden; background: rgba(255,255,255,.035); outline: 1px solid rgba(255,255,255,.07); outline-offset: -1px; cursor: pointer; }
.bpocket::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(125deg, rgba(255,255,255,.16), rgba(255,255,255,0) 38%, rgba(255,255,255,0) 70%, rgba(255,255,255,.06)); }
.bpocket img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bpocket.missing img { filter: grayscale(1); opacity: .22; }
.bpocket.empty { cursor: default; }
.btag { position: absolute; left: 4%; top: 3%; z-index: 1; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.75); color: #fbbf24; }
.bfoot { text-align: center; font-size: 11px; color: var(--faint); margin-top: 2.5%; }
.inner-cover { align-items: center; justify-content: center; text-align: center; gap: 8px; background: linear-gradient(180deg, #141418, #101013); }
.ic-title { font-size: clamp(16px, 2.4vw, 24px); font-weight: 600; letter-spacing: -.02em; }
.bcover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12%; text-align: center; cursor: pointer; border-radius: 4px 12px 12px 4px;
  background: radial-gradient(circle at 28% 18%, rgba(255,255,255,.16), transparent 45%), linear-gradient(160deg, rgba(255,255,255,.05), rgba(0,0,0,.25)), var(--bc);
  box-shadow: inset 10px 0 18px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.12); }
.bcover::before { content: ""; position: absolute; inset: 5%; border: 2px dashed rgba(255,255,255,.22); border-radius: 8px; pointer-events: none; }
.bc-title { position: relative; font-size: clamp(20px, 3.4vw, 32px); font-weight: 700; letter-spacing: -.02em; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.bc-sub { position: relative; color: rgba(255,255,255,.75); font-size: 14px; }
.bc-hint { position: relative; margin-top: 18px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.leaf { position: absolute; top: 0; height: 100%; width: 50%; transform-style: preserve-3d; z-index: 4; will-change: transform; }
.leaf.r { left: 50%; transform-origin: left center; }
.leaf.l { left: 0; transform-origin: right center; }
.leaf.full { left: 0; width: 100%; transform-origin: left center; }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.back { transform: rotateY(180deg); }
.shade { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(90deg, rgba(0,0,0,.6), rgba(0,0,0,0) 65%); border-radius: inherit; }
.leaf.l .shade, .face.back .shade { background: linear-gradient(270deg, rgba(0,0,0,.6), rgba(0,0,0,0) 65%); }
.book-nav { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 14px calc(14px + env(safe-area-inset-bottom, 0px)); }
.book-range { flex: 1; max-width: 420px; accent-color: var(--text); }
.tag-jp { color: #f87171; border-color: rgba(248,113,113,.35); }

/* Reader estimate: separate from catalog verification and finish selection. */
.sr-confidence { margin: 14px 0; padding: 12px; border: 1px solid var(--line-2); border-radius: 9px; }
.sr-confidence > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.sr-confidence meter { display: block; width: 100%; height: 16px; margin: 7px 0; }
.sr-confidence small, .sr-learning p, .sr-learned { color: var(--muted); font-size: 12px; line-height: 1.5; }
.sr-learning { margin: 14px 0; }

.sr-confidence.needs-check meter::-webkit-meter-optimum-value { background: #c9a85c; }
.sr-confidence.needs-check meter::-moz-meter-bar { background: #c9a85c; }

/* DexyBot: a quiet local-scanning companion, not a separate recognition path. */
.dexi-bot { display: inline-block; width: 34px; height: 34px; flex: 0 0 auto; vertical-align: middle; color: var(--text); }
.dexi-label { display: inline-flex; align-items: center; gap: 6px; }
.dexi-label .dexi-bot { width: 24px; height: 24px; }
.dexi-signal { opacity: 0; }
.dexi-bot.is-active .dexi-head { transform-origin: 24px 25px; animation: dexi-hover 2.4s ease-in-out infinite; }
.dexi-bot.is-active .dexi-eyes { transform-origin: 24px 24px; animation: dexi-blink 3.6s ease-in-out infinite; }
.dexi-bot.is-active .dexi-signal { animation: dexi-signal 2.4s ease-in-out infinite; }
.sr-empty > .dexi-bot { width: 72px; height: 72px; color: var(--text); margin-bottom: 2px; }
.qworking > .dexi-bot { margin-left: 4px; }
@keyframes dexi-hover { 0%, 100% { transform: translateY(1px); } 50% { transform: translateY(-1.5px); } }
@keyframes dexi-blink { 0%, 42%, 48%, 100% { transform: scaleY(1); } 45% { transform: scaleY(.15); } }
@keyframes dexi-signal { 0%, 100% { opacity: .15; } 50% { opacity: .8; } }
@media (prefers-reduced-motion: reduce) {
  .dexi-bot.is-active .dexi-head, .dexi-bot.is-active .dexi-eyes, .dexi-bot.is-active .dexi-signal { animation: none; }
  .dexi-bot.is-active .dexi-signal { opacity: .6; }
}

/* Personal binder artwork. Only server-validated local asset IDs reach these variables. */
.binder-styled .binder-page, .book-themed .bpage:not(.inner-cover) { background: var(--binder-infill) center / cover; }
.book-themed .bcover { background: var(--binder-front) center / cover; color: var(--binder-front-ink); }
.book-themed .bcover-back { background-image: var(--binder-back); color: var(--binder-back-ink); }
/* Material sits above the art, below labels; never intercepts taps or page turns. */
.book-themed .bcover, .bd-cover { position: relative; isolation: isolate; overflow: hidden; }
.book-themed .bcover { position: absolute; box-shadow: inset 2px 0 2px rgba(255,255,255,.3), inset 12px 0 15px rgba(0,0,0,.38), inset -2px 0 3px rgba(0,0,0,.32), inset 0 2px 2px rgba(255,255,255,.3), inset 0 -3px 5px rgba(0,0,0,.32), 3px 5px 0 #151714, 5px 9px 16px rgba(0,0,0,.35); }
.book-themed .bcover::before, .bd-cover::before {
  content: ""; display: block; position: absolute; inset: 0; z-index: 0; pointer-events: none; border: 0; border-radius: inherit;
  background-image: url('/binder-assets/cover-grain.png'), linear-gradient(90deg, rgba(0,0,0,.42), rgba(0,0,0,.13) 3%, rgba(255,255,255,.18) 4%, rgba(0,0,0,.14) 5%, transparent 9%, transparent 96%, rgba(0,0,0,.15)), linear-gradient(135deg, rgba(255,255,255,.12), transparent 40%, rgba(0,0,0,.08));
  background-size: 128px 128px, 100% 100%, 100% 100%;
}
.book-themed .bcover::after, .bd-cover::after {
  content: ""; position: absolute; inset: 2.6% 3.2% 2.6% 5.8%; z-index: 1; pointer-events: none;
  border: 1.5px dashed rgba(31,31,23,.57); border-radius: 3px 9px 9px 3px;
  box-shadow: 0 1px 0 rgba(255,255,255,.5), inset 0 1px 0 rgba(255,255,255,.38), 0 0 0 3px rgba(0,0,0,.045);
}
.book-themed .bcover > *, .bd-cover > * { position: relative; z-index: 2; }
.bd-cover::after { border-width: 1px; border-radius: 2px 5px 5px 2px; }

.book-themed .bc-title, .book-themed .bc-sub, .book-themed .bc-hint { color: inherit; text-shadow: none; }
/* Let front artwork stand alone; keep the title in the toolbar and back cover. */
.bcover:not(.bcover-back) > .bc-title, .bcover:not(.bcover-back) > .bc-sub, .bcover:not(.bcover-back) > .bc-hint, .bd-front > span, .bd-front > small { display: none; }
.book-themed .bc-sub { opacity: .8; }
.book-themed .bc-hint { opacity: .65; }
.binder-styled .pocket.empty { background: rgba(255,255,255,.025); }
.binder-designer h2 { margin: 5px 0 8px; }
.bd-preview { margin: 20px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.bd-preview-inner { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; max-width: 510px; margin: auto; }
.bd-preview figure { margin: 0; min-width: 0; }
.bd-cover, .bd-page { aspect-ratio: 5/7; border-radius: 3px 9px 9px 3px; box-shadow: inset 3px 0 7px rgba(0,0,0,.25), 0 6px 14px rgba(0,0,0,.18); }
.bd-cover { padding: 20% 12%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 12px; background: var(--binder-front) center / cover; color: var(--binder-front-ink); }
.bd-back { background-image: var(--binder-back); color: var(--binder-back-ink); }
.bd-cover > span { font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.bd-cover small { font-size: 9px; opacity: .75; }
.bd-cover .bd-monogram { font-size: 26px; font-weight: 400; letter-spacing: -.08em; }
.bd-page { background: var(--binder-infill) center / cover; padding: 12% 9%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: repeat(3,minmax(0,1fr)); gap: 7%; }
.bd-pocket { border: 1px solid rgba(255,255,255,.16); border-radius: 3px; background: rgba(255,255,255,.035); }
.bd-pocket.occupied { background: #b5b5ba; box-shadow: inset 0 0 0 3px #73737a; }
.bd-preview figcaption { font-size: 11px; color: var(--muted); text-align: center; margin-top: 10px; }
.bd-parts { display: flex; width: 100%; margin-bottom: 16px; }
.bd-parts button { flex: 1; }
.bd-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px 12px; }
.bd-option { padding: 0; border: 0; background: transparent; text-align: left; color: var(--text); cursor: pointer; min-width: 0; border-radius: 8px; }
.bd-swatch { display: block; height: 82px; background-position: center; background-size: cover; border: 1px solid var(--line-2); border-radius: 8px; position: relative; margin-bottom: 8px; }
.bd-option.selected .bd-swatch { outline: 2px solid var(--text); outline-offset: 2px; }
.bd-option strong { display: block; font-size: 12px; font-weight: 550; }
.bd-option small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.bd-check { display: none; position: absolute; right: 6px; top: 6px; background: var(--text); color: var(--bg); width: 20px; height: 20px; border-radius: 50%; text-align: center; line-height: 20px; font-size: 12px; }
.bd-option.selected .bd-check { display: block; }
.bd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 6px; }
.bd-note { font-size: 12px; }
.bd-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 759px) {
  .bd-preview { padding: 12px; margin: 16px 0; }
  .bd-preview-inner { gap: 8px; }
  .bd-cover > span { font-size: 12px; }
  .bd-cover small { font-size: 8px; }
  .bd-preview figcaption { font-size: 10px; }
  .bd-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bd-swatch { height: 66px; }
  .bd-footer .btn-primary { flex: 1; }
  .book-themed .book-top { gap: 8px; }
  .book-themed .book-pn { font-size: 11px; }
}

.book-themed .bc-title { overflow-wrap: anywhere; }

/* Human-use layout A */
.collection-row { width:100%; background:transparent; color:inherit; text-align:left; font:inherit; border:0; cursor:pointer; }
.collection-row .row-title,.collection-row .row-sub,.binder-tile .row-title,.binder-tile .row-sub { display:block; }
.collection-row:hover,.collection-row:focus-visible { background:rgba(255,255,255,.035); }
button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible { outline:2px solid var(--text); outline-offset:3px; }
.binder-shelf { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:20px; }
.binder-tile.row { display:flex; flex-direction:column; align-items:stretch; gap:16px; padding:18px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.binder-miniature.bd-cover { display:block; width:100%; max-width:210px; align-self:center; padding:0; }
.binder-tile .row-main { width:100%; }
.binder-tile .row-title { white-space:normal; overflow-wrap:anywhere; margin-bottom:6px; }
.binder-tile .row-sub { white-space:normal; }
.binder-tile .meter { margin:12px 0 8px; }
.binder-more { position:relative; }
.binder-more summary { list-style:none; cursor:pointer; }
.binder-more summary::-webkit-details-marker { display:none; }
.binder-more-items { position:absolute; z-index:20; right:0; min-width:180px; padding:8px; background:var(--bg); border:1px solid var(--line); border-radius:10px; box-shadow:0 10px 30px #0008; }
.binder-more-items .btn { width:100%; justify-content:flex-start; }
@media(max-width:759px) {
 .btn,.btn.sm,.seg button,.subnav a,.icon-btn,.input,.input.sm,summary.btn { min-height:44px; }
 .icon-btn { min-width:44px; }
 .seg button { min-width:44px; }
 .subnav a { display:inline-flex; align-items:center; }
 .inline-opt { min-height:44px; }
 .binder-shelf { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
 .binder-tile.row { padding:12px; gap:12px; }
 .binder-tile .row-title { font-size:14px; }
 .binder-tile .row-sub { font-size:11px; }
 .binder-actions { gap:8px; }
 .binder-actions > .btn-primary { flex:1; }
}

/* Human-use layout B: short, grouped navigation. */
.collection-tools,.market-tools { display:flex; flex-wrap:wrap; gap:8px 20px; margin:-6px 0 20px; }
.collection-tools a,.market-tools a { display:inline-flex; align-items:center; color:var(--muted); font-size:13px; min-height:36px; border-bottom:2px solid transparent; }
.collection-tools a[aria-current],.market-tools a[aria-current] { color:var(--text); border-bottom-color:var(--text); }
.market-groups { overflow:visible; }
@media(max-width:759px) { .market-groups { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; } .market-groups a { justify-content:center; padding-left:8px; padding-right:8px; font-size:12px; } .collection-tools a,.market-tools a { min-height:44px; } }

/* Human-use layout C: task-first Home and content-led collection views. */
.home-heading { margin-bottom:14px; }
.hero-compact { padding:0 0 18px; border-bottom:1px solid var(--line); }
.hero-compact .hero-value { font-size:32px; }
.hero-compact .hero-stats { display:flex; flex-wrap:wrap; gap:6px 20px; }
.value-history { margin-top:10px; }
.value-history summary,.settings-maintenance > summary { cursor:pointer; min-height:44px; display:flex; align-items:center; gap:8px; }
.value-history summary::after,.settings-maintenance > summary::after { content:'+'; margin-left:auto; }
.value-history[open] summary::after,.settings-maintenance[open] > summary::after { content:'−'; }
.value-history summary { color:var(--muted); font-size:13px; }
.home-tasks { margin:20px 0 26px; }
.home-review { margin-bottom:14px; }
.home-review .row-sub { display:block; margin-top:4px; }
.continue-binder { display:grid; grid-template-columns:64px minmax(0,1fr) 18px; gap:16px; align-items:center; padding:14px 0; border-bottom:1px solid var(--line); }
.continue-binder .bd-cover { width:64px; padding:0; }
.continue-binder strong { display:block; margin:5px 0; overflow-wrap:anywhere; }
.home-shortcuts { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.collection-filters { display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; margin:0 0 18px; }
.collection-filters > label { display:flex; flex-direction:column; gap:5px; font-size:12px; color:var(--muted); min-width:150px; max-width:280px; flex:1; }
.collection-view { align-self:flex-end; }
.collection-list-head { display:none; }
.collection-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(165px,1fr)); gap:24px 16px; }
.collection-grid .collection-row { display:flex; flex-direction:column; align-items:stretch; gap:9px; padding:0; border:0; border-radius:8px; }
.collection-grid .art.sm { width:100%; }
.collection-grid .row-main { flex:auto; }
.collection-grid .row-title { white-space:normal; }
.collection-grid .row-end { display:flex; justify-content:space-between; gap:8px; }
.collection-grid .row-sub { font-size:12px; }
.settings-maintenance { margin-top:24px; border-top:1px solid var(--line); }
.settings-maintenance > summary { font-size:16px; font-weight:600; padding:14px 0; }
@media(min-width:760px) {
 .collection-list-head { display:grid; grid-template-columns:minmax(0,1fr) 60px 100px; gap:14px; padding:0 14px 8px; font-size:12px; color:var(--muted); text-align:right; }
 .collection-list-head > :first-child { text-align:left; }
 .collection-list .collection-row { display:grid; grid-template-columns:48px minmax(0,1fr) 60px 100px; }
 .collection-list .row-end { display:contents; }
 .collection-list .collection-qty,.collection-list .collection-price { text-align:right; font-size:13px; }
}
@media(max-width:759px) {
 .collection-filters > label { min-width:0; max-width:none; flex:1 1 calc(50% - 10px); }
 .collection-filters .input { width:100%; }
 .collection-view { flex:1; }
 .collection-view button { flex:1; }
 .collection-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px 12px; }
 .collection-grid .collection-row + .collection-row { border:0; }
 .scan-alt .inline-opt { width:100%; justify-content:center; }
 #scancond { max-width:220px; }
 .hero-compact .hero-value { font-size:30px; }
}

/* Show extra collection filters on demand on phone, keeping cards near the top. */
.collection-filter-drawer { flex:1; }
.collection-filter-drawer > summary { list-style:none; cursor:pointer; }
.collection-filter-drawer > summary::-webkit-details-marker { display:none; }
.collection-filter-fields { display:flex; gap:10px; }
.collection-filter-fields label { display:flex; flex:1; min-width:0; flex-direction:column; gap:5px; color:var(--muted); font-size:12px; }
.collection-filter-fields .input { width:100%; }
@media(min-width:760px) { .collection-filter-drawer > summary { display:none; } }
@media(max-width:759px) { .collection-filter-drawer { flex:0 0 auto; } .collection-filter-drawer[open] { flex-basis:100%; } .collection-filter-drawer[open] .collection-filter-fields { margin-top:10px; } .collection-filter-fields label { width:50%; } }
@media(max-width:759px) {
 .stepper button { min-width:44px; min-height:44px; }
 .rapid .rapid-top { grid-template-columns:minmax(0,1fr) auto; }
 .rapid-top .rapid-grid { grid-column:1; grid-row:2; }
 .rapid-top .rapid-grid button { min-width:44px; min-height:44px; }
 .rapid-top [data-r=cond] { grid-column:1; grid-row:3; min-width:0; width:100%; }
 .rapid-top [data-r=done] { grid-column:2; grid-row:2 / 4; align-self:stretch; }
 .home-shortcuts > a { min-height:44px; }
}
