:root {
  --paper: #ffffff;
  --paper-2: #f3f4f6;
  --paper-3: #e5e7eb;
  --surface: #ffffff;
  --ink: #16181b;
  --ink-2: #3b3e43;
  --muted: #6b7079;
  --line: #dcdfe4;
  --accent: #2f6fbd;
  --accent-ink: #1f528f;
  --accent-rgb: 47,111,189;
  --have: #2d7a4b;
  --desk: #f3f4f6;
  --bg: #ffffff;
  --bgimg: none;
  --pagebg: #141517;
  --r: 4px;
  --ui: 'Schibsted Grotesk', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --serif: 'Instrument Serif', Georgia, serif;
  color-scheme: light;
}
/* dark mode (Account → Appearance) */
:root[data-theme="dark"] {
  --paper: #1c1f23;
  --paper-2: #24282d;
  --paper-3: #2e3339;
  --surface: #23272c;
  --ink: #ecebe7;
  --ink-2: #c9c7c1;
  --muted: #9a9ca1;
  --line: #363b42;
  --accent: #5a9be3;
  --accent-ink: #8dbcf0;
  --accent-rgb: 90,155,227;
  --have: #4fb27a;
  --desk: #15171a;
  --bg: #141619;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg) var(--bgimg); background-attachment: fixed; color: var(--ink); font: 14px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.center { text-align: center; }
.grow { flex: 1; }
.grow2 { flex: 2; }
.pad { padding: 4px 2px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row3 { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin: 12px 0; }
.err { color: var(--accent-ink); margin: 0; }
.warn { background: #f6e2c6; border-left: 3px solid #c47f1b; padding: 8px 10px; margin: 8px 0 0; font-size: 13px; }
kbd { font: 11px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; padding: 0 4px; border-radius: 3px; background: var(--surface); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; max-width: 100%; padding: 5px 14px; line-height: 1.2; text-align: center; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: var(--r); font-weight: 600; cursor: pointer; text-decoration: none; transition: background .12s, transform .05s; } /* long labels wrap inside the button instead of spilling out */
.btn:hover { background: #000; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); background: rgba(0,0,0,.03); }
.btn.danger { color: var(--accent-ink); }
.btn.danger:not(.ghost) { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.big { min-height: 44px; padding: 6px 22px; font-size: 15px; }
.btn.sm { min-height: 28px; padding: 3px 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn.icon-only { width: 34px; padding: 0; font-size: 18px; flex: none; }
.btn.have { background: var(--have); border-color: var(--have); }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); padding: 2px; background: var(--paper); }
.seg button { border: 0; background: none; padding: 0 10px; height: 28px; border-radius: 2px; cursor: pointer; color: var(--ink-2); font-weight: 500; }
.seg button.on { background: var(--ink); color: var(--paper); }
.seg.sm button { height: 24px; padding: 0 8px; font-size: 12.5px; }

/* fields */
.field { display: flex; flex-direction: column; gap: 5px; margin: 0 0 12px; }
.field > span, .num > span { font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.field input:not([type=range]):not([type=checkbox]), .field select, input.search, .copyrow input {
  height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 0 11px; outline: none; width: 100%;
}
.field input:focus, .field select:focus, input.search:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22,24,27,.08); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline input { width: 72px !important; height: 30px !important; }
.field.inline em { color: var(--muted); font-style: normal; }
input[type=range] { accent-color: var(--ink); width: 100%; }
.num { display: flex; flex-direction: column; gap: 5px; }
.num > div { display: flex; height: 38px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; width: 118px; }
.num button { width: 34px; border: 0; background: var(--paper); cursor: pointer; font-size: 16px; }
.num button:hover { background: var(--paper-2); }
.num input { width: 50px; border: 0; text-align: center; outline: none; font-family: var(--mono); }
.chk { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 10px 0; font-weight: 500; }
.switch input { display: none; }
.switch span { width: 34px; height: 20px; border-radius: 10px; background: var(--paper-3); position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { left: 16px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 24px; height: 24px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); cursor: pointer; }
.swatches button.on { outline: 2px solid var(--ink); outline-offset: 2px; }

/* shell */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.app.bare .view { flex: 1; display: flex; flex-direction: column; }
.view { flex: 1; }
.top { height: 58px; display: flex; align-items: center; gap: 18px; padding: 0 28px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; text-decoration: none; letter-spacing: -0.02em; }
.mark { width: 30px; height: 30px; border-radius: 23%; flex: none; }
.nav { text-decoration: none; font-weight: 500; color: var(--ink-2); }
.nav:hover { color: var(--ink); }
.pro { font: 600 10px var(--mono); font-style: normal; background: var(--accent); color: #fff; padding: 1px 4px; border-radius: 2px; vertical-align: 1px; }
.foot { display: flex; gap: 18px; flex-wrap: wrap; padding: 22px 28px; border-top: 1px solid var(--line); font-size: 12px; margin-top: 40px; }
.foot > span:first-child { font-weight: 700; }
.center-msg { min-height: 50vh; display: grid; place-content: center; gap: 10px; text-align: center; }
.spin { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .7s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r); z-index: 200; font-weight: 500; animation: up .18s ease-out; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.toast.bad { background: var(--accent-ink); }
.toast { display: flex; align-items: center; gap: 12px; }
.toast-act { border: 0; background: none; color: #ffd54a; font: inherit; font-weight: 700; cursor: pointer; padding: 2px 4px; pointer-events: auto; }
@keyframes up { from { opacity: 0; transform: translate(-50%, 8px); } }

/* landing */
.landing { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.hero { display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; gap: 48px; align-items: center; padding: 64px 0 56px; }
.hero h1 { font: 400 clamp(44px, 5.6vw, 74px)/0.98 var(--serif); letter-spacing: -0.02em; }
.hero h1 em { color: var(--accent); }
.lede { font-size: 17px; color: var(--ink-2); max-width: 30em; margin: 22px 0 26px; }
.demo { transform: rotate(-1.2deg); }
.demo .spread { box-shadow: 0 30px 60px -20px rgba(0,0,0,.35); }
.demo-ph { aspect-ratio: 1.45; background: var(--paper-2); border-radius: 6px; }
.feat { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.feat > div { padding: 22px 22px 26px 0; border-bottom: 1px solid var(--line); }
.feat > div:not(:nth-child(3n+1)) { padding-left: 22px; border-left: 1px solid var(--line); }
.feat .n { color: var(--accent); }
.feat h3 { margin: 6px 0 4px; font-size: 18px; }
.feat p { margin: 0; color: var(--ink-2); }

/* auth */
.auth { display: grid; place-items: center; padding: 60px 20px; }
.card-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 4px; }
.card-form h1 { margin-bottom: 18px; }
.gbtn { display: flex; flex-direction: column; align-items: center; min-height: 44px; }
.gbtn > div:first-child { width: 100%; display: flex; justify-content: center; }
.or { display: flex; align-items: center; gap: 12px; margin: 14px 0 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.card-form .forgot { align-self: flex-end; margin: -2px 0 8px; color: var(--muted); }

/* dashboard */
.dash { max-width: 1240px; margin: 0 auto; padding: 32px 28px; }
.dash-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.dash-head .btn { margin-left: auto; align-self: center; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 26px 22px; margin-bottom: 30px; }
.bcard { position: relative; }
.bcard.new { aspect-ratio: .78; border: 2px dashed #b9b2a0; background: none; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 600; color: var(--ink-2); }
.bcard.new span { font-size: 36px; font-weight: 300; line-height: 1; color: var(--accent); }
.bcard.new:hover { border-color: var(--ink); color: var(--ink); }
.cover { display: block; aspect-ratio: .78; background: var(--cover); border-radius: 4px 7px 7px 4px; padding: 14px 14px 14px 22px; position: relative; box-shadow: inset 6px 0 0 rgba(0,0,0,.25), 0 10px 22px -12px rgba(0,0,0,.5); transition: transform .15s; }
.cover:hover { transform: translateY(-3px); }
.cover::before { content: ''; position: absolute; inset: 8px 8px 8px 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 3px; }
.mini { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 4px; height: 100%; align-content: center; }
.mini i { aspect-ratio: 63/88; background: rgba(255,255,255,.07); border-radius: 2px; overflow: hidden; }
.mini img { width: 100%; height: 100%; object-fit: cover; }
.meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 10px 26px 6px 0; position: relative; }
.meta .nm { font-weight: 700; text-decoration: none; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .mono { font-size: 12px; }
.more { position: absolute; right: 0; top: 8px; border: 0; background: none; font-size: 18px; cursor: pointer; padding: 0 4px; color: var(--muted); }
.menu { position: absolute; right: 0; top: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 20; min-width: 130px; padding: 4px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; cursor: pointer; border-radius: 3px; }
.menu button:hover { background: var(--paper); }
.menu .danger { color: var(--accent-ink); }
.bar { height: 6px; background: var(--paper-3); border-radius: 3px; overflow: hidden; }
.bar.thin { height: 3px; }
.bar i { display: block; height: 100%; background: var(--have); }

.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.presets button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 12px 8px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); cursor: pointer; font-size: 12.5px; font-weight: 500; min-width: 82px; }
.presets button.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.gridicon rect { fill: var(--paper-3); }
.presets button.on .gridicon rect { fill: var(--ink); }

/* account */
.account { max-width: 720px; margin: 0 auto; padding: 32px 28px; }
.account section { border-top: 1px solid var(--line); padding: 20px 0; }
.account h1 { margin-bottom: 18px; }
.account h2 { margin-bottom: 10px; }
.plan { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.plan p { margin: 4px 0 0; }
.plan.is-pro h2 { color: var(--accent); }

/* modal */
.scrim { position: fixed; inset: 0; background: rgba(22,24,27,.42); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--paper); width: 100%; max-width: 440px; border-radius: 6px; box-shadow: 0 24px 60px -10px rgba(0,0,0,.4); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { max-width: 640px; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 6px; }
.modal .x { border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal .body { padding: 10px 20px 16px; overflow: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.copyrow { display: flex; gap: 8px; margin: 6px 0; }
table.list { width: 100%; border-collapse: collapse; }
table.list td { padding: 7px 6px; border-bottom: 1px solid var(--line); }
table.list tr { cursor: pointer; }
table.list tr:hover td { background: var(--paper-2); }

/* ---------- editor ---------- */
.editor { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.ed-top { height: 54px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--paper); flex: none; }
.back { font-size: 24px; text-decoration: none; width: 30px; text-align: center; color: var(--ink-2); }
.bname { border: 1px solid transparent; background: none; font-weight: 700; font-size: 16px; padding: 4px 8px; border-radius: var(--r); min-width: 60px; max-width: 280px; }
/* the name box is as wide as the name (browsers that can size it to the text do so exactly) */
@supports (field-sizing: content) { .bname { field-sizing: content; width: auto !important; } }
.bname:hover { border-color: var(--line); }
.bname:focus { border-color: var(--ink); outline: none; background: var(--surface); }
.savestate { font-size: 12px; color: var(--muted); }
.savestate.error { color: var(--accent-ink); }
.prog { display: flex; align-items: center; gap: 8px; margin-right: 8px; font: 500 13px var(--mono); }
.prog em { color: var(--muted); font-style: normal; }
.prog .bar { width: 90px; }

.ed-body { flex: 1; display: grid; grid-template-columns: 1fr; min-height: 0; position: relative; }
aside { background: var(--paper); min-height: 0; display: flex; flex-direction: column; }
aside.left { border-right: 1px solid var(--line); }
/* the selected pocket's details: a column beside the binder, only while something is selected */
.ed-body { transition: grid-template-columns .18s ease; }
.ed-body.has-insp { grid-template-columns: 1fr 320px; }
aside.right { position: relative; border-left: 1px solid var(--line); overflow: auto; animation: insp-in .18s ease-out; }
aside.right .close-panel { display: block; position: absolute; right: 6px; top: 6px; z-index: 1; border: 0; background: none; font-size: 22px; line-height: 1; padding: 4px 8px; cursor: pointer; color: var(--muted); }
/* custom art in the right panel (computer) */
aside.right.side-add { overflow: hidden; animation: none; }
aside.right.side-add .tabs .close-panel { position: static; flex: 0 0 auto; padding: 0 12px; }
.insp-idle { padding-top: 24px; text-align: center; }
@keyframes insp-in { from { opacity: 0; transform: translateX(16px); } }
.ed-settings { gap: 6px; }
.lockmark { position: absolute; top: 4%; right: 5%; z-index: 3; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.62); color: #fff; pointer-events: none; }
.lockbtn { gap: 6px; }
.lockbtn.on { color: var(--accent); border-color: rgba(var(--accent-rgb), .5); }
.insp-pic { display: flex; align-items: center; gap: 8px; }
.insp-pic img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.insp.settings { padding: 0; }
.close-panel { display: none; }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { flex: 1; border: 0; background: none; padding: 12px 6px 10px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.lang-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 0; gap: 8px; }
.lang-sel { flex: 1; min-width: 0; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); }
.tabbody { padding: 10px 12px; overflow: auto; flex: 1; min-height: 0; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 10px; }
.tile { border: 0; padding: 0; background: none; cursor: grab; position: relative; border-radius: 4px; }
.tile img, .tile .noimg { width: 100%; aspect-ratio: 63/88; object-fit: cover; border-radius: 4px; background: var(--paper-2); }
.tile:hover img { outline: 2px solid var(--ink); outline-offset: 1px; }
.tile > span { position: absolute; right: 3px; bottom: 3px; font: 500 10px var(--mono); background: rgba(22,24,27,.82); color: #fff; padding: 0 4px; border-radius: 2px; }
.tile .noimg .ni-set { text-align: left; right: 30px; }
.noimg { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8% 7%; font-size: 11px; line-height: 1.15; background: var(--paper-2); color: var(--ink-2); gap: 4px; aspect-ratio: 63/88; overflow: hidden;
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.035) 6px 7px); box-shadow: inset 0 0 0 3px var(--paper-2), inset 0 0 0 4px var(--line); }
.noimg b { font-weight: 700; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.noimg .ni-num { position: absolute; top: 7%; left: 0; right: 0; font: 500 .85em var(--mono); opacity: .7; }
.noimg .ni-set { position: absolute; bottom: 7%; left: 8%; right: 8%; font-size: .8em; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.needgrid .noimg { border-radius: 5px; margin-bottom: 6px; font-size: 13px; }
.sethead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sethead b { display: block; line-height: 1.2; }
.sethead small { color: var(--muted); }
.setlist { margin-top: 8px; }
.serie { font: 600 11px var(--mono); text-transform: uppercase; color: var(--muted); padding: 12px 4px 4px; letter-spacing: .05em; }
.setrow { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 6px 4px; cursor: pointer; text-align: left; border-radius: 3px; }
.setrow:hover { background: var(--paper-2); }
.setrow .sym { width: 20px; height: 20px; flex: none; }
.setrow .sym img { width: 100%; height: 100%; object-fit: contain; }
.setrow .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setrow .ct { font: 12px var(--mono); color: var(--muted); }
.drop { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 22px 10px; text-align: center; cursor: pointer; font-weight: 600; background: var(--surface); }
.drop:hover { border-color: var(--ink); }
.selinfo { font-size: 13px; padding: 8px 10px; background: var(--paper-2); border-radius: var(--r); margin: 6px 0 10px; }
.arts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 14px; }
.art { position: relative; }
.art > button:first-child { border: 0; padding: 0; width: 100%; aspect-ratio: 1; cursor: pointer; border-radius: 4px; overflow: hidden; background: var(--paper-2); }
.art img { width: 100%; height: 100%; object-fit: cover; }
.art > button:first-child:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.art .del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; line-height: 1; display: none; }
.art:hover .del { display: block; }

.canvas { background: var(--bg) var(--bgimg); display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; flex: none; }
.pager .pg { font: 500 14px var(--mono); min-width: 90px; text-align: center; }
.pager .pg em { color: var(--muted); font-style: normal; }
.pager .seg { margin-left: 12px; }
.stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 6px 24px 10px; min-height: 0; container-type: size; }
.dots { display: flex; justify-content: center; gap: 5px; padding: 10px 10px 16px; flex-wrap: wrap; flex: none; }
.dots button { width: 7px; height: 7px; border-radius: 50%; border: 0; background: rgba(0,0,0,.18); cursor: pointer; padding: 0; }
.dots button.on { background: var(--ink); width: 18px; border-radius: 4px; }
.dots input { width: min(400px, 80%); }
.mobile-bar { display: none; }

/* binder render */
.spread { --gap: 1.1cqmin; display: flex; gap: 0; background: var(--cover, #22262b); padding: 1.6cqmin; border-radius: 1.2cqmin; position: relative; box-shadow: 0 18px 40px -18px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.06); max-width: 100%; max-height: 100%; }
.landing .spread, .shareview .spread { --gap: 7px; padding: 12px; border-radius: 9px; }
.page { background: var(--pagebg); padding: 2.2cqmin 2.4cqmin 3.4cqmin; position: relative; border-radius: .5cqmin; }
.landing .page, .shareview .page { padding: 14px 16px 22px; }
.page.left { border-radius: .5cqmin 0 0 .5cqmin; margin-right: 2.4cqmin; }
.page.right { border-radius: 0 .5cqmin .5cqmin 0; margin-left: 2.4cqmin; }
.page.blank { background: color-mix(in srgb, var(--cover) 70%, black); opacity: .55; }
.grid { display: grid; grid-template-columns: repeat(var(--cols), var(--cw)); grid-template-rows: repeat(var(--rows), calc(var(--cw) * 88 / 63)); gap: var(--gap); }
/* size pockets to fit the stage: width-limited or height-limited, whichever is tighter */
.stage .spread { --pairs: 2; }
.stage .spread:has(.page.solo) { --pairs: 1; }
.stage .page { --cw: min(calc((100cqw - 14cqmin) / (var(--pairs) * var(--cols)) - var(--gap)), calc((100cqh - 10cqmin) / var(--rows) * 63 / 88 - var(--gap))); }
.landing .page { --cw: min(calc((52vw - 120px) / (2 * var(--cols))), 84px); }
.shareview .stage .page { --cw: min(calc((100cqw - 14cqmin) / (var(--pairs) * var(--cols)) - var(--gap)), calc((100cqh - 10cqmin) / var(--rows) * 63 / 88 - var(--gap))); }
.pnum { position: absolute; bottom: .9cqmin; left: 0; right: 0; text-align: center; font: 500 1.3cqmin var(--mono); color: rgba(255,255,255,.3); }
.landing .pnum, .shareview .pnum { font-size: 10px; bottom: 5px; }
.rings { position: absolute; left: 50%; top: 0; bottom: 0; width: 0; display: flex; flex-direction: column; justify-content: space-around; padding: 12% 0; }
.rings i { width: 3.2cqmin; height: 1.3cqmin; margin-left: -1.6cqmin; background: linear-gradient(#d7d9dc, #8d9196 60%, #c5c8cc); border-radius: 1cqmin; box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.landing .rings i, .shareview .rings i { width: 22px; height: 8px; margin-left: -11px; border-radius: 5px; }

.pocket { position: relative; border-radius: 3px; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); overflow: hidden; user-select: none; }
.pocket::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,0) 35%, rgba(255,255,255,0) 70%, rgba(255,255,255,.04)); pointer-events: none; }
.editor .pocket { cursor: pointer; }
@media (hover: hover) { .editor .pocket:hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); } }
.pocket.sel, .editor .pocket.sel { box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px rgba(var(--accent-rgb),.3); z-index: 2; overflow: visible; }
.pocket.over { box-shadow: 0 0 0 2px #fff; }
.face, .face img, .face .noimg { width: 100%; height: 100%; }
.face { container-type: inline-size; }
.face img { object-fit: cover; border-radius: 3px; }
.face .noimg { background-color: #2a2c30; color: #d7d5cf; border-radius: 3px; font-size: clamp(7px, 11cqi, 14px);
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255,255,255,.035) 6px 7px); box-shadow: inset 0 0 0 3px #2a2c30, inset 0 0 0 4px #4a4d53; }
.face.want img { filter: grayscale(1) contrast(.9); opacity: .38; }
.face.want .noimg { opacity: .5; }
.flag { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); font: 600 max(8px, 1.1cqmin) var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.75); background: rgba(0,0,0,.55); padding: 1px 5px; border-radius: 2px; pointer-events: none; }
.landing .flag, .shareview .flag { font-size: 8px; }
.piece { position: absolute; inset: 0; overflow: hidden; }
.piece img { position: absolute; max-width: none; }

/* inspector */
.insp { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.insp .pos { font: 12px var(--mono); color: var(--muted); }
.insp .big:not(.chip) { width: 100%; max-width: 240px; aspect-ratio: 63/88; margin: 0 auto; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 24px -10px rgba(0,0,0,.4); }
.insp .big .face img { border-radius: 8px; }
.insp h3 { margin-top: 4px; }
.insp p { margin: 0; }
.insp .keys { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.empty-hint { aspect-ratio: 63/88; width: 140px; border: 1.5px dashed var(--line); border-radius: 6px; display: grid; place-items: center; color: var(--muted); font-size: 13px; margin: 6px auto; }
.statbox { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.statbox div { padding: 10px 8px; text-align: center; }
.statbox div + div { border-left: 1px solid var(--line); }
.statbox b { display: block; font: 600 18px var(--mono); }
.statbox span { font-size: 11.5px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; }
.kv b { font-family: var(--mono); font-weight: 500; }

/* ads */
.ad { margin: 12px; border: 1px solid var(--line); border-radius: var(--r); padding: 6px; position: relative; min-height: 90px; background: var(--surface); }
.ad-l { position: absolute; top: 2px; right: 6px; font: 10px var(--mono); color: var(--muted); z-index: 1; }
.ad-l a { color: inherit; }
.ad.house { display: flex; flex-direction: column; justify-content: center; gap: 2px; text-decoration: none; min-height: 0; padding: 12px 14px; background: var(--paper-2); border-style: dashed; }
.ad.house span { font-size: 12.5px; color: var(--muted); }
.ad-banner { margin: 24px 0; }
aside .ad { margin-top: auto; }

/* scan */
.scan { display: grid; grid-template-columns: 200px 1fr; gap: 22px; align-items: start; }
.qr { background: #fff; padding: 8px; border-radius: var(--r); border: 1px solid var(--line); aspect-ratio: 1; }
.qr svg { width: 100%; height: 100%; display: block; }
.steps { margin: 0 0 14px; padding-left: 20px; }
.steps li { margin-bottom: 4px; }
.status { font-weight: 600; margin: 12px 0 4px; }
.status::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.scanres { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 130px)); justify-content: center; gap: 12px; }
.sr { display: flex; flex-direction: column; gap: 4px; }
.sr img { width: 100%; aspect-ratio: 63/88; object-fit: cover; border-radius: 4px; background: var(--paper-2); }
.sr img.off { opacity: .25; }
.sr select { width: 100%; font-size: 11.5px; height: 28px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
.emptycell { aspect-ratio: 63/88; border: 1.5px dashed var(--line); border-radius: 4px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }

/* tour */
.tour { position: fixed; inset: 0; z-index: 150; pointer-events: none; }
.tour-ring { position: fixed; border: 2px solid var(--accent); border-radius: 6px; box-shadow: 0 0 0 9999px rgba(22,24,27,.35); transition: all .25s; }
.tour-pop { position: fixed; background: var(--ink); color: var(--paper); padding: 14px 16px 12px; border-radius: 6px; pointer-events: auto; box-shadow: 0 14px 40px rgba(0,0,0,.3); animation: fade .2s; }
.tour-ring.follow { transition: none; }
.tour-pop.follow { animation: none; }
.tour-pop p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.4; }
.tour-foot { display: flex; align-items: center; gap: 12px; }
.tour-foot .mono { color: rgba(255,255,255,.5); font-size: 12px; flex: 1; }
.tour-foot .link { color: rgba(255,255,255,.6); }
.tour-foot .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* share view */
.shareview { max-width: 1240px; margin: 0 auto; padding: 28px; }
.sv-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.sv-head p { margin: 4px 0 0; }
.canvas.ro { border-radius: 8px; height: min(78vh, 760px); }
.needgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px; }
.needgrid img { width: 100%; aspect-ratio: 63/88; object-fit: cover; border-radius: 5px; background: var(--paper-2); margin-bottom: 6px; }
.needgrid b { display: block; font-size: 13px; }

/* print */
.printview { background: var(--paper-2); min-height: 100vh; }
.print-bar { position: sticky; top: 0; z-index: 10; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.print-marks { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; padding: 8px 16px 0; }
.sheets .pcard, .sheets .pjoin { cursor: pointer; }
.p-done { position: absolute; top: 2mm; right: 2mm; z-index: 2; background: var(--accent); color: #fff; font-size: 7pt; font-weight: 600; padding: 0.6mm 2mm; border-radius: 99px; }
.print-hint { text-align: center; font-size: 13px; color: var(--ink-2); margin: 14px; }
.sheets { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 0 16px 40px; }
.sheet { background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(0,0,0,.12); flex: none; }
.sheet { box-sizing: border-box; }
.sgrid { display: grid; grid-template-columns: repeat(3, 63mm); grid-auto-rows: 88mm; align-content: center; }
.mm-in { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.pcard .rcm { position: absolute; width: 3mm; height: 3mm; z-index: 1; pointer-events: none; --rg: transparent 2.9mm, #fff 3mm; }
.pcard .rcm.tl { left: 0; top: 0; background: radial-gradient(circle at 100% 100%, var(--rg)); }
.pcard .rcm.tr { right: 0; top: 0; background: radial-gradient(circle at 0 100%, var(--rg)); }
.pcard .rcm.br { right: 0; bottom: 0; background: radial-gradient(circle at 0 0, var(--rg)); }
.pcard .rcm.bl { left: 0; bottom: 0; background: radial-gradient(circle at 100% 0, var(--rg)); }
/* printer test: lines 1-20 mm in from each edge, numbered */
.pt-sheet { position: relative; padding: 0 !important; display: block; overflow: hidden; color: #111; }
.pt-l { position: absolute; }
.pt-l::before { content: ''; position: absolute; background: #111; }
.pt-l.top, .pt-l.bottom { left: calc(50% - 6mm); width: 12mm; height: 0; }
.pt-l.top { top: var(--d); } .pt-l.bottom { bottom: var(--d); }
.pt-l.top::before, .pt-l.bottom::before { left: 0; right: 0; top: -0.1mm; height: 0.2mm; }
.pt-l.left, .pt-l.right { top: calc(50% - 6mm); height: 12mm; width: 0; }
.pt-l.left { left: var(--d); } .pt-l.right { right: var(--d); }
.pt-l.left::before, .pt-l.right::before { top: 0; bottom: 0; left: -0.1mm; width: 0.2mm; }
.pt-l b { position: absolute; font: 600 5pt/1 system-ui, sans-serif; }
.pt-l.top b, .pt-l.bottom b { top: -0.9mm; } .pt-l.top b.a, .pt-l.bottom b.a { right: calc(100% + 1mm); } .pt-l.top b.z, .pt-l.bottom b.z { left: calc(100% + 1mm); }
.pt-l.left b, .pt-l.right b { left: 0; writing-mode: vertical-rl; transform: translateX(-50%) rotate(180deg); } .pt-l.left b.a, .pt-l.right b.a { bottom: calc(100% + 0.8mm); } .pt-l.left b.z, .pt-l.right b.z { top: calc(100% + 0.8mm); }
.pt-mid { position: absolute; left: 25%; right: 25%; top: 35%; text-align: center; font: 11pt/1.4 system-ui, sans-serif; }
.pt-arrow { font-size: 20pt; font-weight: 700; }
.mm-four { flex-wrap: wrap; gap: 4px 8px; }
.mm-four label { display: inline-flex; align-items: center; gap: 4px; }
.mm-four input { width: 52px !important; }
.mm-in input { width: 58px; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--r); font: inherit; }
.pcard { width: 63mm; height: 88mm; position: relative; overflow: hidden; background: #fff; }
.pjoin { position: relative; } /* a joined picture: its pieces side by side with no gap, cut apart along their edges */
/* the cut line: solid black just outside each card or picture, so the picture is never cut into */
.sgrid.cuts .pcard { box-shadow: 0 0 0 0.3mm #000; }
.sheet { position: relative; }
.pjoin { background: #fff; z-index: 1; }
.pj-in { position: absolute; left: 0; top: 0; }
.sgrid.cuts .pjoin .pcard { box-shadow: none; }
.sgrid.cuts .pj-in { box-shadow: 0 0 0 0.3mm #000; }
.p-shelf { max-width: 900px; margin: 0 auto; padding: 0 16px 48px; text-align: center; }
.p-shelf h3 { margin: 0 0 2px; }
.p-shelf-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.p-shelf-it { zoom: .4; opacity: .75; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.p-shelf-it:hover { opacity: 1; }
.sgrid { position: relative; z-index: 1; }
/* inset, not centred with a transform: Chrome counts the untransformed box as wider than the paper and shrinks the whole print */
.guides { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
/* the printable part of the page, and the cards' frame in its middle (turned a quarter when the cards go sideways);
   nothing in it counts as overflowing the paper (Chrome would shrink the whole print to fit) */
.s-in { position: absolute; overflow: clip; contain: paint; }
.rcell, .rcell foreignObject { display: block; overflow: visible; }
.turn { position: relative; }
.turn > .pcard:only-child { margin: 0 auto; }
.s-in { display: flex; align-items: center; justify-content: center; }
.sframe { position: relative; flex: none; display: flex; align-items: center; justify-content: center; }
.guides i { position: absolute; background: #555; }
.guides .gv { top: 0; bottom: 0; width: 0.3mm; margin-left: -0.15mm; }
.guides .gh { left: 0; right: 0; height: 0.3mm; margin-top: -0.15mm; }
.pcard > img { width: 100%; height: 100%; object-fit: cover; }
.pcard.ph > img { filter: grayscale(1); }
.pcard.ph.light > img { filter: grayscale(1) brightness(1.22) contrast(.8); }
.pcard .ol { position: absolute; inset: 3mm; border: 0.3mm solid #222; border-radius: 2.5mm; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2mm; padding: 4mm; color: #111; }
.pcard .ol b { font-size: 14pt; line-height: 1.1; }
.pcard .ol span { font-size: 9pt; color: #444; }
.pcard .tag { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 2mm; padding: 1mm 2mm; background: #fff; font-size: 6.5pt; color: #222; border-top: 0.2mm solid #bbb; }
.pcard .tag span:first-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media print {
  .noprint { display: none !important; }
  /* the paper stays white in dark mode too (the margins show the page's own background) */
  :root { color-scheme: light !important; }
  html, body, body > *, .canvas, .printview { background: #fff !important; }
  .sheets { padding: 0; gap: 0; display: block; }
  /* nothing may spill past the paper (with no margin, even a fraction of a mm makes an extra page) */
  html, body { margin: 0 !important; padding: 0 !important; }
  .printview { padding: 0 !important; margin: 0 !important; }
  .toast { display: none !important; }
  .sheet { box-shadow: none; break-after: page; page-break-after: always; break-inside: avoid; overflow: hidden; margin: 0 !important; }
  .sheet:last-child { break-after: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- small screens ---------- */
@media (max-width: 1100px) { .ed-body.has-insp { grid-template-columns: 1fr 290px; } .prog .bar { display: none; } }
@media (max-width: 900px) {
  .top { padding: 0 16px; }
  .hero { grid-template-columns: 1fr; padding: 36px 0; gap: 30px; }
  .landing .page { --cw: min(calc((100vw - 110px) / (2 * var(--cols))), 80px); }
  .feat { grid-template-columns: 1fr; }
  .feat > div:not(:nth-child(3n+1)) { padding-left: 0; border-left: 0; }
  .landing, .dash, .account, .shareview { padding-left: 16px; padding-right: 16px; }
  .shelf { grid-template-columns: repeat(2, 1fr); gap: 18px 14px; }
  .ed-body { grid-template-columns: 1fr; position: relative; }
  aside.left, aside.right { position: fixed; left: 0; right: 0; bottom: 0; height: 72vh; z-index: 60; border: 0; border-top: 1px solid var(--line); border-radius: 12px 12px 0 0; box-shadow: 0 -12px 40px rgba(0,0,0,.25); transform: translateY(105%); transition: transform .22s ease; }
  .p-left aside.left, .p-right aside.right { transform: none; }
  .close-panel { display: block; border: 0; background: none; font-size: 22px; padding: 0 14px; cursor: pointer; color: var(--muted); flex: 0 !important; }
  aside.right .close-panel { position: absolute; right: 4px; top: 8px; }
  .mobile-bar { display: flex; gap: 8px; padding: 0 12px 14px; justify-content: center; }
  .ed-top .btn.ghost.icon-only, .savestate { display: none; }
  .ed-top { gap: 6px; padding: 0 8px; }
  .ed-top .btn { padding: 0 10px; }
  .bname { max-width: 120px; }
  .prog { display: none; }
  .stage { padding: 4px 8px; }
  .scan { grid-template-columns: 1fr; }
  .qr { max-width: 220px; }
  .print-bar { gap: 6px; }
}

.ad-frame { display: block; width: 100%; border: 0; }
.ad-fit { width: 100%; overflow: hidden; }
.landing > .ad-banner { margin: 8px 0 28px; }
.account > .ad-banner { margin-top: 32px; }
.ad-canvas { padding: 0 12px; }
.ad-canvas .ad { margin: 8px 0 4px; min-height: 0; }
@media print { .ad { display: none !important; } }
.sr-pic { position: relative; }
.sr-lang { position: absolute; left: 4px; top: 4px; font: 600 9.5px var(--mono); background: rgba(22,24,27,.82); color: #fff; padding: 1px 4px; border-radius: 3px; }
.crop { display: flex; flex-direction: column; gap: 10px; }
.crop-wrap { display: flex; justify-content: center; background: #16181b; border-radius: 4px; padding: 8px; touch-action: none; }
.crop-wrap canvas { display: block; max-width: 100%; }
.crop .row .grow { flex: 1; }
.crop-wrap canvas { touch-action: none; }
.scrim:has(.crop) .body { overscroll-behavior: contain; }
.own-photo { gap: 8px; flex-wrap: nowrap; }
.own-photo .grow { flex: 1; }

/* live camera scanner: camera on top, the page diagram below */
.live { position: fixed; inset: 0; z-index: 180; background: #000; color: #fff; display: flex; flex-direction: column; overscroll-behavior: contain; touch-action: manipulation; }
.live-cam { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; }
.live-cam video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; } /* size and place set by the scanner */
.live-guide { position: absolute; border: 2px solid rgba(255,255,255,.75); border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.5); pointer-events: none; transition: border-color .15s; }
.live-track { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.live-guide.read { border-color: #ffd54a; }
.live-guide.placed { border-color: #3ddc84; }
.live-top { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; z-index: 2; }
.live-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 18px; cursor: pointer; }
.live-btn.on { background: #ffd54a; color: #000; }
.live-msg { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 24px; }
.live-msg .spin { border-color: rgba(255,255,255,.25); border-top-color: #fff; }
.live-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(0,0,0,.55); padding: 7px 14px; border-radius: 20px; font-weight: 600; pointer-events: none; white-space: nowrap; }
.live-panel { flex: none; background: var(--paper); color: var(--ink); padding: 10px 14px max(12px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; border-radius: 14px 14px 0 0; margin-top: -14px; position: relative; }
.live-last { display: flex; align-items: center; gap: 10px; }
.live-last img { width: 38px; height: 53px; object-fit: cover; border-radius: 3px; flex: none; background: var(--paper-2); }
.live-last .grow { min-width: 0; display: flex; flex-direction: column; }
.live-last b, .live-last span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-last span { font-size: 12px; color: var(--muted); }
.live-pg { display: flex; align-items: center; justify-content: center; gap: 14px; font-weight: 700; }
.live-grid { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 4px; width: min(100%, calc(26dvh * var(--cols) * 63 / 88 / var(--rows))); margin: 0 auto; }
.live-slot { aspect-ratio: 63 / 88; padding: 0; border: 0; border-radius: 4px; background: #2a2c31; overflow: hidden; cursor: pointer; position: relative; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.live-slot img { width: 100%; height: 100%; object-fit: cover; }
.live-slot span { position: absolute; inset: 2px; display: grid; place-items: center; font-size: 8px; line-height: 1.1; color: #ddd; text-align: center; overflow: hidden; }
.live-slot.on { box-shadow: 0 0 0 3px var(--accent); animation: slotpulse 1.2s ease-in-out infinite; }
.live-slot.new img { animation: slotin .35s ease-out; }
@keyframes slotpulse { 50% { box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.35); } }
@keyframes slotin { from { transform: scale(1.25); opacity: .3; } }
.live-sheet { position: fixed; inset: 0; z-index: 190; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; }
.live-pick { width: 100%; max-height: 75dvh; overflow-y: auto; background: var(--paper); color: var(--ink); border-radius: 12px 12px 0 0; padding: 12px 12px max(12px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.live-opts { display: flex; flex-direction: column; gap: 6px; }
.live-qrow { display: flex; gap: 8px; }
.live-qrow select { height: 42px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 0 8px; }
.live-q { flex: 1; min-width: 0; width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.live-opt { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.live-opt img { grid-row: span 2; width: 44px; height: 61px; object-fit: cover; border-radius: 3px; }
.live-opt span { font-size: 12px; color: var(--muted); }
.live-opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* shared card photos + admin */
.credit { margin: -4px 0 0; }
.ta-r { text-align: right; }
.admin table.list tr { cursor: default; }
.admin .btn.small { padding: 4px 10px; font-size: 12.5px; }
.review { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.rv { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.rv-pics { display: flex; gap: 8px; }
.rv-pics figure { margin: 0; flex: 1; }
.rv-pics img { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 4px; background: var(--paper-3); }
.rv-pics figcaption { font: 11px var(--mono); color: var(--muted); text-align: center; margin-top: 3px; }
.rv-info { display: flex; flex-direction: column; gap: 2px; }

/* install the app */
.inst-hero { display: none; margin-top: 10px; }
@media (pointer: coarse) { .inst-hero { display: flex; justify-content: center; } }
.inst-scrim { position: fixed; inset: 0; z-index: 400; background: rgba(10,11,12,.45); display: flex; align-items: flex-end; justify-content: center; animation: inst-fade .2s ease; }
.inst { position: relative; width: min(440px, 100%); background: var(--paper); border-radius: 16px 16px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.25); animation: inst-up .25s ease; }
@media (min-width: 600px) { .inst-scrim { align-items: center; } .inst { border-radius: 14px; } }
/* iPhone Safari's Share button is at the bottom: point at it */
.inst-down::after { content: ''; position: absolute; left: 50%; bottom: -9px; width: 18px; height: 18px; background: var(--paper); transform: translateX(-50%) rotate(45deg); }
.inst-scrim:has(.inst-down) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.inst-scrim:has(.inst-down) .inst { border-radius: 16px; width: min(420px, calc(100% - 20px)); }
.inst-x { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border: 0; background: none; font-size: 16px; color: var(--muted); cursor: pointer; }
.inst-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; padding-right: 30px; }
.inst-head img { width: 56px; height: 56px; border-radius: 14px; flex: none; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.inst-head b { display: block; font-size: 16px; line-height: 1.25; }
.inst-head span { color: var(--muted); font-size: 13px; }
.inst-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 10px; }
.inst-steps li { counter-increment: s; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14.5px; }
.inst-steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 600 12px var(--mono); display: inline-flex; align-items: center; justify-content: center; margin-right: 4px; flex: none; }
.ii { width: 20px; height: 20px; color: #0a7aff; vertical-align: -4px; }
.ii-dots { font-size: 18px; line-height: 1; padding: 0 3px; }
@keyframes inst-up { from { transform: translateY(30px); opacity: 0; } }
@keyframes inst-fade { from { opacity: 0; } }
/* running as an installed app: keep clear of the notch and home bar */
@media (display-mode: standalone) {
  .top { padding-top: env(safe-area-inset-top); height: calc(58px + env(safe-area-inset-top)); }
  .foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@media (display-mode: standalone) and (max-width: 899px) {
  aside.left, aside.right { padding-bottom: env(safe-area-inset-bottom); }
}
.top .nav { white-space: nowrap; }
.top .support { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.top .support .heart { color: #e0245e; }
.modal .shop { margin: 12px 0 0; }
.scrim:has(.shop) { grid-template-columns: minmax(0, 1fr); } /* the listings row scrolls instead of widening the popup */
@media (max-width: 440px) {
  .top { gap: 10px; }
  .brand { font-size: 15px; gap: 7px; }
  .top .btn { padding-left: 10px; padding-right: 10px; }
  .top .support .lbl { display: none; }
}

/* phones: fit everything to the screen */
.view { overflow-x: clip; }
.hero > * { min-width: 0; }
.editor { height: 100dvh; }
@media screen { .sheets .sheet { zoom: var(--fit, 1); } }
@media print { .sheets .sheet { zoom: 1 !important; } }
@media (pointer: coarse) {
  /* under 16px, iPhones zoom into a field when it's tapped and stay zoomed */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .landing .page { --cw: min(calc((100vw - 170px) / (2 * var(--cols))), 80px); }
  .demo { transform: none; }
  aside.left, aside.right { height: 78dvh; padding-bottom: env(safe-area-inset-bottom); }
  .ed-top .btn.ghost.icon-only.undo { display: inline-flex; width: 34px; padding: 0; justify-content: center; }
  .bname { flex: 1; min-width: 0; max-width: none; }
  .ed-top .grow { display: none; }
  .mobile-bar { padding: 0 12px max(12px, env(safe-area-inset-bottom)); }
  .mobile-bar .btn { flex: 1; min-height: 44px; }
  .account .row { flex-wrap: wrap; align-items: stretch; }
  .account .row .field { flex: 1 1 100%; }
  .account .row > .btn { flex: 1; }
  .scrim { padding: 10px; align-items: end; }
  .scrim > * { max-height: 88dvh; }
}
@media (max-width: 480px) {
  #t-print { display: none; }
  .ed-top .btn { padding: 0 9px; }
}
.phone-msg { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; background: #000; color: #fff; }
.phone-msg .spin { border-color: rgba(255,255,255,.25); border-top-color: #fff; }
.scan-float { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; align-items: center; gap: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 10px 10px 16px; box-shadow: 0 12px 40px -8px rgba(0,0,0,.3); }
.scan-float .status { margin: 0; }

/* printing / language / version shortcuts */
.shortcuts { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.live-panel .shortcuts { margin: 0; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 11px; font: 600 12.5px var(--ui); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.chip:hover { border-color: var(--ink-2); }
.chip.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.chip.big { padding: 10px 14px; font-size: 14px; }
.sc-prints { display: flex; flex-wrap: wrap; gap: 8px; }
.pv { width: 18px; height: 25px; border-radius: 3px; background: #c9c4b6; flex: none; }
.pv.holo { background: linear-gradient(#c9c4b6 0 12%, transparent 12% 52%, #c9c4b6 52%), linear-gradient(120deg, #9fd6ff, #f7b5e8 45%, #fff3a6 70%, #9fe8c9); }
.pv.reverse { background: linear-gradient(#c9c4b6, #c9c4b6) 50% 30% / 70% 38% no-repeat, linear-gradient(120deg, #9fd6ff, #f7b5e8 45%, #fff3a6 70%, #9fe8c9); }
.sc-sheet h3 { margin: 0; }
@media (min-width: 700px) { .live-sheet { align-items: center; justify-content: center; } .live-pick { max-width: 480px; border-radius: 12px; } }
.live-pg { position: relative; }
.live-type { position: absolute; right: 0; height: 32px; padding: 0 12px; font-size: 13px; }
/* printings on the binder */
.face { position: relative; }
.ed1 { position: absolute; left: 7%; top: 53%; font: 700 max(6px, 5.5cqi) var(--mono); font-style: normal; background: #111; color: #fff; padding: 0 3px; border-radius: 2px; pointer-events: none; }
/* search sheets sit at the top so the phone keyboard never covers the search box */
.live-sheet.top { align-items: flex-start; }
.live-sheet.top .live-pick { border-radius: 0 0 12px 12px; padding-top: max(12px, env(safe-area-inset-top)); max-height: 60dvh; }
@media (min-width: 700px) { .live-sheet.top { align-items: center; } .live-sheet.top .live-pick { border-radius: 12px; max-height: 75dvh; } }

/* page turns */
.flipbox { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; touch-action: pan-y; }
/* 3D only while a page turns: iPhones sometimes don't draw a card put into a page that sits in 3D space */
.flipbox.turning { perspective: 1800px; }
.flip-wrap { display: grid; max-width: 100%; max-height: 100%; }
.flip-wrap > .spread { grid-area: 1 / 1; }
.spread.ghost { background: transparent; box-shadow: none; pointer-events: none; transform-style: preserve-3d; }
.spread.ghost .page.off { visibility: hidden; }
.spread.ghost .page.leaf { backface-visibility: hidden; -webkit-backface-visibility: hidden; animation-duration: .62s; animation-timing-function: linear; animation-fill-mode: both; will-change: transform, opacity; box-shadow: 0 0 30px rgba(0,0,0,.35); }
.page.leaf.right { transform-origin: calc(-1.2cqmin) 50%; }
.page.leaf.left { transform-origin: calc(100% + 1.2cqmin) 50%; }
.page.leaf.solo { transform-origin: 0 50%; }
.page.leaf.fwd-front { animation-name: turn-r-out; }
.page.leaf.fwd-back { animation-name: turn-l-in; }
.page.leaf.back-front { animation-name: turn-l-out; }
.page.leaf.back-back { animation-name: turn-r-in; }
.page.leaf.solo-out { animation-name: turn-r-out; }
.page.leaf.solo-in { animation-name: turn-solo-in; }
/* each face shows only for its half of the turn (some browsers ignore backface-visibility mid-animation) */
@keyframes turn-r-out { 0% { transform: rotateY(0); opacity: 1; animation-timing-function: ease-in; } 49.9% { opacity: 1; } 50% { transform: rotateY(-90deg); opacity: 0; } 100% { transform: rotateY(-180deg); opacity: 0; } }
@keyframes turn-l-out { 0% { transform: rotateY(0); opacity: 1; animation-timing-function: ease-in; } 49.9% { opacity: 1; } 50% { transform: rotateY(90deg); opacity: 0; } 100% { transform: rotateY(180deg); opacity: 0; } }
@keyframes turn-l-in { 0% { transform: rotateY(180deg); opacity: 0; } 50% { transform: rotateY(90deg); opacity: 0; } 50.1% { opacity: 1; animation-timing-function: ease-out; } 100% { transform: rotateY(0); opacity: 1; } }
@keyframes turn-r-in { 0% { transform: rotateY(-180deg); opacity: 0; } 50% { transform: rotateY(-90deg); opacity: 0; } 50.1% { opacity: 1; animation-timing-function: ease-out; } 100% { transform: rotateY(0); opacity: 1; } }
@keyframes turn-solo-in { 0% { transform: rotateY(-180deg); opacity: 0; } 50% { transform: rotateY(-90deg); opacity: 0; } 50.1% { opacity: 1; animation-timing-function: ease-out; } 100% { transform: rotateY(0); opacity: 1; } }
.live-slot.edit { box-shadow: 0 0 0 3px #3a7bd5; }
.live-last .btn { flex: none; }
.insp-acts { display: flex; gap: 8px; }
.insp-acts .btn { flex: 1; }
@media (max-width: 900px) { aside.right .insp .big:not(.chip) { max-width: 150px; } }
@media (pointer: coarse) { .insp .keys { display: none; } }
/* held-still snapshot */
.live-flash { position: absolute; inset: 0; background: #fff; pointer-events: none; z-index: 2; animation: shutter .35s ease-out forwards; }
@keyframes shutter { from { opacity: .7; } to { opacity: 0; } }
.snap-head { display: flex; align-items: center; gap: 12px; }
.snap-head img { width: 54px; height: 75px; object-fit: cover; border-radius: 4px; flex: none; }
.snap-acts { display: flex; gap: 8px; }
.snap-acts .btn { flex: 1; }
.pv.reverse.poke { background: linear-gradient(#c9c4b6, #c9c4b6) 50% 30% / 70% 38% no-repeat, linear-gradient(120deg, #f06a6a, #fff 50%, #e23c3c); }
.pv.reverse.master { background: linear-gradient(#c9c4b6, #c9c4b6) 50% 30% / 70% 38% no-repeat, linear-gradient(120deg, #8a4fd6, #f39ad8 50%, #6a3bc0); }
/* scanner: language of the cards being scanned */
.live-tr { display: flex; align-items: center; gap: 8px; }
.live-lang { display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 6px 0 14px; border-radius: 21px; background: rgba(0,0,0,.5); color: #fff; font-size: 13px; font-weight: 600; }
.live-lang span { opacity: .75; }
.live-lang select { background: transparent; border: 0; color: #fff; font-weight: 700; font-size: 16px; padding: 4px 2px; }
.live-lang select option { color: #000; }

.live-x { flex: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 16px; cursor: pointer; }
/* shutter + queue of pictures taken */
.live-shutter { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: 70px; height: 70px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 4px; cursor: pointer; z-index: 2; }
.live-shutter i { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .1s; }
.live-shutter:active i { transform: scale(.85); }
.live-shutter:disabled { opacity: .35; }
.live-queue { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.live-queue::-webkit-scrollbar { display: none; }
.lq { position: relative; flex: none; width: 40px; height: 56px; padding: 0; border: 0; border-radius: 4px; overflow: hidden; background: var(--paper-2); cursor: pointer; }
.lq img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lq i { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; border-radius: 50%; font: 700 11px/16px system-ui; text-align: center; font-style: normal; color: #fff; }
.lq.read::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.lq.read i { border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; width: 14px; height: 14px; right: 13px; bottom: 21px; z-index: 1; animation: spin .8s linear infinite; }
.lq.done i { background: #2e9e5b; }
.lq.pick i { background: #e0a100; }
.lq.none i { background: #d64545; }
.lq.pick, .lq.none { box-shadow: 0 0 0 2px #e0a100; }
.lq.none { box-shadow: 0 0 0 2px #d64545; }
.lq-th { width: 30px; height: 42px; object-fit: cover; border-radius: 3px; flex: none; }
.sc-other { display: flex; gap: 8px; }
.sc-other input { flex: 1; min-width: 0; }
/* the queue and card row keep a fixed height so the camera's scan box never resizes as pictures are added */
.live-info { height: 166px; flex: none; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.live-info .live-queue { height: 60px; flex: none; }
.live-info .shortcuts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.live-info .shortcuts::-webkit-scrollbar { display: none; }
.admin-pic { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px dashed var(--line); border-radius: 10px; }
.admin-pic .row { display: flex; gap: 6px; }
.admin-pic input { min-width: 0; }

/* quick taps (page turns, buttons) never zoom the page; pinch zoom still works */
:where(*) { touch-action: manipulation; }
.pager, .dots, .flipbox { -webkit-user-select: none; user-select: none; }
@media (max-width: 480px) { .pager { gap: 6px; padding: 10px 6px; } .pager .pg { min-width: 70px; } .pager .seg { margin-left: 4px; } }
.live-btn.zoom { font: 600 13px var(--ui); }

.foot-links { display: flex; gap: 14px; }
.foot-links a { color: inherit; }
.legal { max-width: 720px; margin: 0 auto; padding: 32px 28px 8px; line-height: 1.6; }
.legal h1 { margin-bottom: 4px; }
.legal h2 { font-size: 17px; margin: 26px 0 8px; }
.legal ul { padding-left: 20px; margin: 8px 0; }
.legal li { margin: 6px 0; }

.live-view { padding: 0; border: 0; background: none; cursor: zoom-in; flex: none; }
.live-big .big-pair { display: flex; gap: 10px; justify-content: center; }
.live-big figure { margin: 0; flex: 1; max-width: 260px; text-align: center; }
.live-big figure img { width: 100%; aspect-ratio: 63 / 88; object-fit: contain; border-radius: 8px; background: var(--paper-2); }
.live-big figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.live-pick select, .live-pick input { font-size: 16px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); }

/* picking a block of pockets on a phone: dragging selects instead of scrolling or turning the page */
.canvas.multi .flipbox, .canvas.multi .pocket { touch-action: none; }
.add-pic { display: flex; gap: 10px; align-items: center; }
.add-pic > img, .add-pic-empty { width: 64px; height: 89px; object-fit: cover; border-radius: 5px; flex: none; background: rgba(127,127,127,.15); display: grid; place-items: center; }
.add-pic .col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.admin-swap summary { cursor: pointer; margin: 6px 0; }
.live-shutter.busy { opacity: .8; }
.live-shutter.busy i { transform: scale(.55); opacity: .6; animation: shutter-wait 0.9s ease-in-out infinite alternate; }
@keyframes shutter-wait { to { transform: scale(.75); opacity: 1; } }
.imgs { position: fixed; inset: 0; z-index: 1000; background: var(--paper); display: flex; flex-direction: column; }
.imgs-bar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid rgba(127,127,127,.2); }
.imgs-bar input { min-width: 0; }
.imgs-bar .live-x { position: static; }
.imgs-msg { padding: 24px 16px; text-align: center; }
.imgs-grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; padding: 10px 12px 24px; align-content: start; }
.imgs-item { border: 0; padding: 0; background: none; cursor: pointer; display: flex; flex-direction: column; gap: 3px; text-align: left; color: inherit; }
.imgs-item img { width: 100%; aspect-ratio: 5 / 7; object-fit: contain; background: rgba(127,127,127,.12); border-radius: 5px; }
.imgs-item:hover img, .imgs-item:focus-visible img { outline: 2px solid var(--accent); }
.imgs-item span { font-size: 11px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imgs-src { margin: 8px 12px 0; align-self: flex-start; }
.imgs-item b { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auto-pics { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; align-items: center; padding: 4px 2px; min-height: 40px; flex: none; }
.auto-pic { flex: none; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 5px; }
.auto-pic img { display: block; width: 52px; height: 72px; object-fit: contain; border-radius: 5px; background: rgba(127,127,127,.12); }
.auto-pic.on img { outline: 3px solid var(--accent); outline-offset: 1px; }
.auto-more { flex: none; margin-left: auto; }

/* ---------- storage ---------- */
.sto-head { margin-top: 8px; }
.sto-head h2 { margin: 0; font-size: 20px; }
.sto-empty { margin: -10px 0 26px; }
.sto-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 30px; }
.sto-card { display: flex; gap: 12px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: inherit; }
.sto-card:hover { border-color: var(--ink); }
.sto-pics { display: grid; grid-template-columns: repeat(2, 26px); gap: 3px; flex: none; }
.sto-pics i { width: 26px; aspect-ratio: 63/88; background: var(--paper-2); border-radius: 2px; overflow: hidden; }
.sto-pics img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sto-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sto-used { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sto-page { max-width: 1100px; }
.sto-top { display: flex; align-items: center; gap: 8px; }
.sto-top .bname { flex: 1; font-size: 22px; max-width: none; }
.sto-sum { margin: 4px 0 18px 38px; }
.sto-sum b { color: var(--ink); }
.sto-add { margin-bottom: 18px; }
.sto-add .row { gap: 8px; }
.sto-add .lang-sel { width: auto; }
.sto-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.sto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-bottom: 24px; }
.sto-grid.sm { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); margin: 10px 0 0; }
.sto-tile { cursor: pointer; }
.sto-tile.gone img, .sto-tile.gone .noimg { opacity: .45; }
.sto-tile .qty { position: absolute; right: 3px; top: 3px; bottom: auto; font: 600 11px var(--mono); background: var(--accent); color: #fff; padding: 1px 5px; border-radius: 3px; }
.sto-tile .outb { position: absolute; left: 3px; right: 3px; bottom: 3px; font: 500 10px var(--sans, inherit); font-style: normal; background: rgba(22,24,27,.82); color: #fff; padding: 1px 4px; border-radius: 2px; text-align: center; }
.sto-h { margin: 8px 0 10px; font-size: 16px; }
.sto-arts { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.sto-arts .art img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: block; }
.sto-up { padding: 0; min-height: 80px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.sto-foot { margin-top: 30px; }
.sto-item { display: flex; gap: 16px; align-items: flex-start; }
.sto-item-pic { width: 150px; flex: none; }
.sto-item-pic img, .sto-item-pic .noimg { width: 100%; aspect-ratio: 63/88; object-fit: cover; border-radius: 6px; }
.sto-item .grow { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sto-tabhead { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.sto-tabhead a { color: inherit; text-decoration: none; }
.sto-tabhead a:hover b { text-decoration: underline; }
aside.left .tabbody .row { gap: 6px; }
@media (max-width: 560px) {
  .sto-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .sto-grid.sm { grid-template-columns: repeat(4, 1fr); }
  .sto-sum { margin-left: 0; }
  .sto-item { flex-direction: column; align-items: center; }
  .sto-shelf { grid-template-columns: 1fr; }
}
.sto-arts .art .del { display: block; }
.sto-add .row, aside.left .tabbody .row, .sto-bar { align-items: center; flex-wrap: nowrap; }
.tabs button { white-space: nowrap; }
.sto-add .lang-sel { flex: none; width: 84px; }

/* scanning into a storage box: the card just scanned, in the space the binder pages use */
.live-detail { display: flex; gap: 12px; height: 26dvh; min-height: 150px; }
.ld-pic { flex: none; height: 100%; aspect-ratio: 63 / 88; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--paper-2); cursor: zoom-in; }
.ld-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ld-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.ld-info > b { font-size: 17px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ld-info dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; overflow: hidden; }
.ld-info dt { color: var(--muted); }
.ld-info dd { margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-acts { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.ld-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
/* box mode: the panel keeps one height, so the camera view doesn't jump between scans */
.live.box .live-info { height: 112px; }
.live.box .live-panel { height: calc(26dvh + 112px + 40px); min-height: calc(150px + 112px + 40px); }
.live.box .live-detail { flex: 1; height: auto; min-height: 0; }
/* one-time help for browsers that ask for the camera every time */
.cam-tip { position: absolute; z-index: 5; left: 12px; right: 12px; top: 64px; background: var(--paper); color: var(--ink); border-radius: 12px; padding: 12px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.4); display: flex; flex-direction: column; gap: 6px; }
.cam-tip ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.45; }
.cam-tip > .btn, .cam-tip > .row { align-self: flex-end; }
.cam-tip > .row { display: flex; gap: 8px; }

/* add card: set picker you can type in, and the card when it's already on the site */
.set-pick { position: relative; }
.set-pick input { width: 100%; }
.set-list { margin-top: 4px; max-height: 40dvh; overflow-y: auto; background: var(--paper); border: 1px solid rgba(127,127,127,.3); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25); padding: 4px; }
.set-list button { display: flex; gap: 8px; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: none; color: inherit; border-radius: 6px; font: inherit; cursor: pointer; }
.set-list button:hover, .set-list button.on { background: rgba(127,127,127,.15); }
.set-list p { margin: 8px 10px; }
.add-have { display: flex; gap: 10px; align-items: center; }
.add-have > img, .add-have > .add-pic-empty { width: 64px; height: 89px; object-fit: cover; border-radius: 5px; flex: none; }
.add-have .col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fix-title { font-size: 15px; }

/* choosing a stamped version's picture */
.chip.warn { border-color: #d98a1c; color: #b5650a; }
.pc-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; overflow-y: auto; max-height: 60dvh; }
.pc-opt { display: flex; flex-direction: column; gap: 3px; padding: 4px; border: 1px solid rgba(127,127,127,.25); border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pc-opt img { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 5px; background: rgba(127,127,127,.15); }
.pc-opt b { font-size: 12px; line-height: 1.25; }
.pc-opt span { font-size: 11px; opacity: .65; }
.pc-opt.far { opacity: .6; }
.cropbox { display: flex; flex-direction: column; gap: 8px; }
.cropbox-pic { position: relative; align-self: center; max-width: calc(100% - 24px); margin: 12px; touch-action: none; user-select: none; line-height: 0; }
.cropbox-pic img { display: block; max-width: 100%; max-height: 52dvh; width: auto; height: auto; -webkit-user-drag: none; pointer-events: none; }
.cropbox-r { position: absolute; border: 2px solid #ffd54a; cursor: move; touch-action: none; }
.cropbox-clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; } /* only the shading is cut at the picture's edge, not the handles */
.cropbox-clip i { position: absolute; box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); }
.cropbox-h { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #ffd54a; border: 2px solid #000; touch-action: none; z-index: 1; }
.cropbox-h::before { content: ''; position: absolute; inset: -10px; } /* a bigger area to grab with a finger */
.cropbox-h.nw { left: 0; top: 0; cursor: nwse-resize; } .cropbox-h.n { left: 50%; top: 0; cursor: ns-resize; } .cropbox-h.ne { left: 100%; top: 0; cursor: nesw-resize; }
.cropbox-h.e { left: 100%; top: 50%; cursor: ew-resize; } .cropbox-h.se { left: 100%; top: 100%; cursor: nwse-resize; } .cropbox-h.s { left: 50%; top: 100%; cursor: ns-resize; }
.cropbox-h.sw { left: 0; top: 100%; cursor: nesw-resize; } .cropbox-h.w { left: 0; top: 50%; cursor: ew-resize; }
.cropbox-pic .spin { position: absolute; inset: 0; margin: auto; }
.dym { margin: 4px 2px; min-height: 26px; line-height: 26px; font-size: 16px; opacity: .85; flex: none; }
.dym .linkish { font-weight: 600; padding: 0 2px; }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--accent, #2a6fdb); text-decoration: underline; cursor: pointer; }
.chip.more-v { display: inline-flex; align-items: center; gap: 6px; }
.chip.more-v img { width: 22px; height: 31px; object-fit: cover; border-radius: 2px; }

/* dragging cards with a finger: hold, then drag (dnd.js) */
.tile, .pocket { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; border-radius: 4px; overflow: hidden; box-shadow: 0 12px 28px rgba(0,0,0,.45); opacity: .95; }
.drag-ghost img { width: 100%; height: 100%; object-fit: cover; display: block; }
.drag-src { opacity: .35; }
.drop-preview { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .6; outline: 3px solid var(--accent); outline-offset: -3px; border-radius: 3px; }
.drop-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dragging-card, .dragging-card * { cursor: grabbing !important; }
.canvas { position: relative; }
/* the storage box pinned under the binder */
.sto-tray { flex: none; margin: 6px 10px 0; background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.sto-tray-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sto-tray-head b { white-space: nowrap; }
.sto-tray-head .muted { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sto-tray-head .search { width: 110px; height: 30px; flex: none; }
.sto-tray-list { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 2px; min-height: 92px; align-items: flex-start; }
.sto-tray-list .tile { flex: none; width: 72px; }
/* the tray made bigger: rows of bigger cards, scrolling up and down */
.sto-tray.big .sto-tray-list { flex-wrap: wrap; overflow-x: hidden; overflow-y: auto; max-height: min(46vh, 440px); align-content: flex-start; }
.sto-tray.big .sto-tray-list .tile { width: 96px; }
.sto-tray.big .tray-grp { flex-basis: 100%; writing-mode: horizontal-tb; transform: none; }
.sto-tray.big .sto-tray-list, .sto-tray.big .sto-tray-list .tile { touch-action: pan-y pinch-zoom; }
.tray-art img { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 4px; display: block; }
.art-peek.card-peek { width: min(24vw, 300px); right: auto; transform: none; left: -9999px; top: 0; } /* placed beside the pointer (CardPeek) */
.card-peek .art-peek-pic img { background: none; border-radius: 4.5% / 3.2%; }
.sto-tray-list p { margin: 8px 4px; }
/* Pokémon art from artofpkm.com */
.pkm-art { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pkm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.pkm-item { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-2); aspect-ratio: 3 / 4; overflow: hidden; cursor: pointer; }
.pkm-item { display: block; width: 100%; background: #1b1c1f center / contain no-repeat; } /* the whole picture, to see its shape */
.pkm-head { margin: 2px 0 -2px; }
.pkm-item .spin { position: absolute; inset: 0; margin: auto; }
/* custom art on a shared binder: tap to see where it came from and use it */
.pocket.tappable { cursor: pointer; }
.use-art { display: flex; flex-direction: column; gap: 10px; }
.use-art > img { max-height: 46vh; max-width: 100%; object-fit: contain; align-self: center; border-radius: 8px; }
.art-src { overflow-wrap: anywhere; line-height: 1.4; }
/* a card dragged from the binder back into the box */
.sto-tray.over, .sto-drop.over { outline: 2px dashed var(--accent); outline-offset: -3px; background: rgba(var(--accent-rgb),.08); }
.dragging-card .sto-tray { outline: 1px dashed rgba(127,127,127,.6); outline-offset: -3px; }
/* a touch on a pocket never scrolls the page (pinch zoom still works); the tray only scrolls sideways,
   so dragging a card up out of it can't scroll anything */
.editor .pocket { touch-action: pinch-zoom; }
.sto-tray-list, .sto-tray-list .tile { touch-action: pan-x pinch-zoom; }
/* the pocket a dragged card will go in */
.dragging-card .pocket.over { box-shadow: 0 0 0 3px var(--accent), 0 0 18px rgba(var(--accent-rgb),.55); z-index: 3; }
/* choosing how many pockets a picture fills */
.placer { display: flex; flex-direction: column; gap: 10px; }
.placer-pic { position: relative; width: min(100%, 360px); max-height: 50vh; align-self: center; overflow: hidden; border-radius: 6px; background: #111; }
.placer-pic { touch-action: none; cursor: grab; }
.placer-pic img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.placer-tip { margin-top: -4px; text-align: center; }
.placer-grid { position: absolute; inset: 0; display: grid; pointer-events: none; }
.placer-grid i { border: 2px solid rgba(255,255,255,.95); border-radius: 4.76% / 3.41%; box-shadow: 0 0 0 1px rgba(0,0,0,.35), inset 0 0 0 1px rgba(0,0,0,.25); }
.mb-hint { flex: 1; text-align: center; font-size: 13px; color: var(--ink-2); align-self: center; }
.placer-grid i.gap { background: rgba(0,0,0,.72); border-color: rgba(255,255,255,.35); border-style: dashed; }
.pp-pages { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
/* flipping custom art */
.flip-row { align-items: center; gap: 6px; flex-wrap: wrap; }
.flip-row > span { flex: 1; min-width: 0; }
.flip-row .btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.switch-row { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 10px; cursor: pointer; }
.switch-row > span { flex: 1; line-height: 1.35; }
.switch-row input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
/* custom art in a binder's cover preview */
.mini i { position: relative; }
.mini .piece img { max-width: none; object-fit: fill; }
/* the storage box under the binder, as a deck of cards (tap to spread it out into the tray) */
.sto-deck { flex: none; align-self: center; display: flex; align-items: center; gap: 12px; margin: 6px 10px 0; padding: 6px 14px 6px 8px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; color: inherit; font: inherit; text-align: left; cursor: pointer; max-width: calc(100% - 20px); touch-action: pinch-zoom; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.deck-stack { position: relative; width: 54px; height: 75px; flex: none; margin-right: 8px; }
.deck-stack > i, .deck-stack > .deck-top { position: absolute; inset: 0; border-radius: 3px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.25); overflow: hidden; }
.deck-stack > i:nth-child(1) { transform: translate(6px, -3px) rotate(6deg); }
.deck-stack > i:nth-child(2) { transform: translate(3px, -1px) rotate(3deg); }
.deck-stack > .deck-top { transform: none; }
.deck-stack > .deck-top img { width: 100%; height: 100%; object-fit: cover; display: block; }
.deck-stack > .deck-top .cname, .deck-stack > .deck-top span { font-size: 7px; }
.sto-deck.none .deck-stack > i { border-style: dashed; background: transparent; box-shadow: none; }
.deck-txt { display: flex; flex-direction: column; min-width: 0; }
.deck-txt b, .deck-txt em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: normal; }
.deck-open { margin-left: 4px; opacity: .6; }
.sto-deck.over { outline: 2px dashed var(--accent); outline-offset: 2px; background: rgba(var(--accent-rgb),.08); }
.sto-tray .tile.over { outline: 3px solid var(--accent); outline-offset: 1px; border-radius: 6px; } /* a binder card held over a box card: they'll swap */
.dragging-card .sto-deck { outline: 1px dashed rgba(127,127,127,.6); outline-offset: 2px; }
.sto-deck.drag-src { opacity: 1; }
.sto-deck.drag-src .deck-stack > .deck-top { opacity: .3; }
.sto-tray-head .grp-sel { height: 30px; max-width: 110px; flex: none; }
.tray-grp { flex: none; align-self: stretch; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; font-weight: 600; padding: 4px 2px; border-left: 2px solid var(--accent); opacity: .8; max-height: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* groups in the storage box */
.grp-by { display: flex; align-items: center; gap: 6px; }
.grp-by select { height: 32px; }
.sto-group { margin-bottom: 10px; }
.grp-h { margin: 12px 0 6px; font-size: 15px; display: flex; align-items: baseline; gap: 6px; }
.sto-tile.picked { outline: 3px solid var(--accent); outline-offset: -1px; }
.sto-tile .tick { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.55); border: 2px solid #fff; color: #fff; font-style: normal; font-size: 13px; display: grid; place-items: center; }
.sto-tile.picked .tick { background: var(--accent); }
.sel-bar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); margin: 8px -12px 0; background: var(--paper); border-top: 1px solid var(--line); }
.sel-bar .small { flex: 1; }
.grp-pick { display: flex; flex-direction: column; gap: 8px; }
.grp-btn { align-self: flex-start; }
/* a card picked up with a double tap, waiting for the pocket it goes to */
.pocket.lifted { z-index: 4; }
.pocket.lifted .face { transform: translateY(-6px) scale(1.06) rotate(-2deg); box-shadow: 0 10px 22px rgba(0,0,0,.5), 0 0 0 3px var(--accent); border-radius: 4px; transition: transform .15s; }
.pocket.drop-ok { outline: 1px dashed rgba(var(--accent-rgb),.55); outline-offset: -2px; }

/* wanted cards (in storage, not had yet): greyed like a needed pocket */
.tile.want img, .sto-item-pic.want img { filter: grayscale(1) contrast(.9); opacity: .45; }
.tile.want .noimg { opacity: .5; }
.as-want .tile img { filter: grayscale(1) contrast(.9); opacity: .6; }
/* search filters */
.f-btn.on { border-color: var(--accent); color: var(--accent); }
.s-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 8px; margin: 6px 0; align-items: end; }
.s-filters label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.s-filters label span { font-size: 11px; color: var(--muted, #888); }
.s-filters input, .s-filters select { width: 100%; min-width: 0; box-sizing: border-box; }
.add-as { align-items: center; gap: 8px; margin: 4px 0; }
.s-filters .btn { justify-self: start; }

/* dark mode touch-ups */
:root[data-theme="dark"] .warn { background: #3a2f1c; border-left-color: #c47f1b; }
:root[data-theme="dark"] .btn:hover { background: #fff; }
:root[data-theme="dark"] .btn.ghost:hover { background: rgba(255,255,255,.06); }
:root[data-theme="dark"] .chip.warn { border-color: #d98a1c; color: #e7a44a; }
:root[data-theme="dark"] .modal-scrim, :root[data-theme="dark"] .scrim { background: rgba(0,0,0,.6); }
/* Appearance settings */
.look-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 12px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; padding: 0; position: relative; }
.swatch.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.swatch.custom { overflow: hidden; background: conic-gradient(#e66, #ec6, #6c6, #6ce, #66e, #e6e, #e66); }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.font-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.font-pick button { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 10px 8px; cursor: pointer; font-size: 15px; color: var(--ink); }
.font-pick button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* Google sign-in: loading and waiting */
.gbtn-load { height: 44px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--r); color: var(--muted); font-size: 13px; }
.spin.sm { width: 16px; height: 16px; border-width: 2px; }
.gwait { position: fixed; inset: 0; z-index: 2000; background: rgba(10,12,15,.72); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #fff; text-align: center; padding: 20px; }
.gwait .muted { color: rgba(255,255,255,.8); max-width: 280px; }
.gwait .btn.ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.gbtn-load .spin, .gwait .spin { margin: 0; }
.gwait .spin { width: 34px; height: 34px; border-color: rgba(255,255,255,.3); border-top-color: #fff; }

/* custom art search: bigger view, and the picture under the mouse shown big */
.pkm-top { align-items: center; flex-wrap: nowrap; }
.pkm-scrim { position: fixed; inset: 0; z-index: 940; background: rgba(0,0,0,.45); }
.pkm-art.big { position: fixed; z-index: 950; inset: 4vh max(16px, 4vw); background: var(--paper); border-radius: 10px; padding: 16px; overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,.35); margin: 0; }
.pkm-art.big .pkm-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.pkm-art.big .pkm-item { min-height: 150px; }
.art-peek { position: fixed; z-index: 1200; right: 24px; top: 50%; transform: translateY(-50%); width: min(46vw, 620px); pointer-events: none; background: var(--surface); border-radius: 8px; padding: 8px; box-shadow: 0 18px 50px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 6px; }
.art-peek-pic { position: relative; }
.art-peek-pic img { width: 100%; max-height: 72vh; object-fit: contain; border-radius: 4px; background: #000; }
.art-peek-pic img.full { position: absolute; inset: 0; height: 100%; opacity: 0; transition: opacity .2s; }
.art-peek-pic img.full.on { opacity: 1; }
.art-peek span { font-size: 12px; color: var(--muted); padding: 0 2px; }
.art-peek.left { right: auto; left: 24px; }
:root[data-theme="dark"] .tour-pop { background: #2c3238; color: #fff; border: 1px solid #454c55; }
:root[data-theme="dark"] .tour-foot .btn { background: #fff; color: #15171a; border-color: #fff; }
:root[data-theme="dark"] .tour-ring { box-shadow: 0 0 0 9999px rgba(0,0,0,.45); }
.paste-back { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin: 8px 0; border-radius: var(--r); background: rgba(var(--accent-rgb), .12); border: 1px solid rgba(var(--accent-rgb), .45); }
.paste-back span { flex: 1; font-weight: 600; }
@media (max-width: 900px) {
  .ed-body.has-insp { grid-template-columns: 1fr; }
  aside.right { animation: none; }
  .ed-settings { display: none; }
}

/* Pro plan buttons on the account page */
.plan .pro-buy { display: flex; flex-direction: column; gap: 8px; flex: none; }
.plan .pro-buy .btn { white-space: nowrap; }

/* the owner's eBay store (Shop in ads.js) */
.shop { display: block; margin: 24px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper-2); }
.shop-head { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.shop-logo { flex: none; width: 48px; height: 48px; border-radius: 50%; background: #fff; }
.shop-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.shop-t b { font-size: 16px; }
.shop .go { flex: none; font-weight: 700; color: var(--accent); white-space: nowrap; }
.shop-head:hover .go { text-decoration: underline; }
.shop-items { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(120px, 1fr); gap: 10px; margin-top: 12px; padding-bottom: 4px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.shop-item { min-width: 0; display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; scroll-snap-align: start; }
.shop-pic { display: block; aspect-ratio: 3 / 4; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.shop-pic img { width: 100%; height: 100%; object-fit: contain; transition: transform .15s; }
.shop-item:hover .shop-pic img { transform: scale(1.06); }
.shop-item:hover .shop-name { text-decoration: underline; }
.shop-name { font-size: 12px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-price { font-size: 14px; }
@media (max-width: 520px) { .shop .go { display: none; } .shop-items { grid-auto-columns: 112px; } }

/* computer: the add menu (search cards, custom art) floats by the pointer instead of a side panel */
@media (min-width: 901px) {
  aside.left.pop { display: none; position: fixed; z-index: 900; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.28); overflow: hidden; }
  aside.left.pop.on { display: flex; animation: fade .12s; }
  aside.left.pop .close-panel { display: block; flex: 0 0 auto; border: 0; background: none; font-size: 22px; line-height: 1; padding: 0 12px; cursor: pointer; color: var(--muted); }
}
.set-row { margin-top: 6px; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
/* a picture hovered in the art search: beside the pointer, in the shape of the pockets being filled */
.art-peek.near { right: auto; transform: none; left: -9999px; top: 0; width: min(34vw, 420px); }
.art-peek.near.framed { width: auto; }
.art-peek.near .art-peek-pic img { max-height: 58vh; }
.art-peek-frame { position: relative; overflow: hidden; border-radius: 3px; background: #000; }
.art-peek-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-peek-frame img.full { opacity: 0; transition: opacity .2s; }
.art-peek-frame img.full.on { opacity: 1; }
.art-peek-frame svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--paper); }
/* sideways scrolling (the box's tray, rows of pictures) stops at its ends instead of turning into the
   browser's swipe back to the previous page; in the binder editor, no swipe back at all */
.sto-tray-list, .shop-items, .sc-prints { overscroll-behavior-x: contain; }
html:has(.editor), html:has(.editor) body { overscroll-behavior-x: none; }
.rec-sites { gap: 6px; }
.rec-sites .btn { flex: 1; min-width: 0; }
/* Arrange pages (Binder settings) */
.arr-top { gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.arr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: min(62vh, 640px); overflow-y: auto; overscroll-behavior: contain; }
.arr-row { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.arr-row.moved { border-color: var(--accent); }
.arr-pages { display: flex; gap: 2px; padding: 3px; background: var(--cover, #22262b); border-radius: 4px; flex: none; }
.arr-thumb .page { --cw: calc(54px / var(--cols)); --gap: 1px; padding: 2px; border-radius: 2px; pointer-events: none; }
.arr-thumb .pnum, .arr-thumb .flag, .arr-thumb .lockmark { display: none; }
.arr-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.arr-acts { display: flex; gap: 6px; align-items: center; flex: none; }
.arr-to { height: 32px; max-width: 150px; }
@media (max-width: 520px) { .arr-row { flex-wrap: wrap; } .arr-acts { width: 100%; } .arr-to { flex: 1; max-width: none; } }
/* a card's market prices (details panel, big preview, box card window) */
.card-price { display: grid; gap: 3px; margin: 6px 0; font-size: 12.5px; }
.card-price div { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.card-price b { font-weight: 600; min-width: 78px; }
.card-price em { color: var(--muted); font-style: normal; font-size: 12px; }
.card-peek .card-price { padding: 4px 8px 2px; margin: 0; }
.price-cell { text-align: right; white-space: nowrap; }
.need-total { margin: 0 0 8px; }
