:root {
    --bg: #f2f3f6; --surface: #fff; --sunken: #f6f7f9; --line: #dcdfe5; --text: #1c2028; --muted: #626a77;
    --accent: #0f766e; --accent-deep: #115e59; --accent-soft: #e7f6f4; --gold: #a87d2a; --danger: #b42318;
    --give: #b45309; --get: #0f766e;
    --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 14px rgba(16,24,40,.05); --r: 8px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--text); font: 15px/1.6 'Raleway', 'Segoe UI', system-ui, sans-serif; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 12px; }
h1 { font-size: clamp(26px, 3.4vw, 36px); }
.h3, h3 { font-size: 18px; }
p { margin: 0 0 12px; }
img { max-width: 100%; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 8px; background: #fff; padding: 8px; z-index: 50; }
:focus-visible { outline: 3px solid #14b8a6; outline-offset: 3px; }
[hidden] { display: none !important; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1200px; margin: auto; min-height: 70px; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { text-decoration: none; color: var(--text); display: flex; align-items: center; }
.brand-logo { display: block; width: 260px; height: auto; max-width: 100%; }
.brand-icon { display: block; width: 46px; height: 46px; border-radius: 11px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 20px; }
.brand strong { color: var(--accent); letter-spacing: .04em; }
.brand-dom { color: var(--muted); font-size: 13px; }
nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-weight: 600; font-size: 14px; }
nav a { text-decoration: none; color: var(--muted); }
nav a[aria-current] { color: var(--accent); }
nav a.btn { color: #fff; }
nav a.btn-ghost { color: var(--text); }
nav a.btn-ghost:hover { color: var(--accent); }
.site-menu { position: relative; }
.site-menu > summary { list-style: none; display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font-weight: 700; cursor: pointer; }
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu > summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s ease; }
.site-menu[open] > summary::after { transform: rotate(225deg) translate(-2px, -1px); }
.site-menu > nav { position: absolute; top: calc(100% + 10px); right: 0; z-index: 30; width: min(380px, calc(100vw - 32px)); max-height: min(75vh, 620px); overflow: auto; display: flex; align-items: stretch; flex-direction: column; flex-wrap: nowrap; gap: 2px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 32px rgba(16,24,40,.18); }
.site-menu > nav > a, .site-menu > nav > form { width: 100%; padding: 9px 11px; border-radius: 6px; text-align: left; }
.site-menu > nav > a:hover, .site-menu > nav > form:hover { background: var(--sunken); color: var(--accent); }
.site-menu > nav > a.btn { margin-top: 4px; text-align: center; }
.site-menu > nav > form button { text-align: left; }
.inline { display: inline; margin: 0; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.link:hover { color: var(--accent); }

.main { width: min(1200px, 100%); margin: 0 auto; padding: 24px 24px 60px; flex: 1; }
.main-store { width: 100%; max-width: none; }
.foot { border-top: 1px solid var(--line); background: var(--surface); padding: 22px max(24px, calc((100vw - 1152px) / 2)); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; min-height: 42px; border-radius: 7px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: 13px; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--sunken); border-color: var(--accent); color: var(--accent); }
.btn-danger { background: #fff5f4; color: var(--danger); border-color: #f0c2bd; }
.btn-danger:hover { background: #ffe4e0; border-color: var(--danger); color: var(--danger); }
.install-dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--r); color: var(--text); box-shadow: 0 16px 48px rgba(16,24,40,.22); }
.install-dialog::backdrop { background: rgba(16,24,40,.5); }
.install-dialog-content { padding: 24px; }
.install-dialog-content h2 { margin-bottom: 8px; }
.install-steps { padding-left: 22px; }
.install-steps li { margin: 0 0 12px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.narrow { max-width: 460px; margin: 32px auto; }
.narrow-wide { max-width: 760px; margin: 12px auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.notice { padding: 12px 16px; border-radius: 7px; border: 1px solid var(--line); background: #fff; margin-bottom: 14px; font-size: 14px; }
.notice.error { color: #a32020; border-color: #e8bcb8; background: #fff5f4; }
.notice.success { color: #17652e; border-color: #badcc5; background: #f0faf3; }
.notice.info { color: #0b4f4a; border-color: #b5e2dc; background: var(--accent-soft); }
.notice.small { font-size: 13px; padding: 9px 12px; margin: 6px 0 0; }

.form label, label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-weight: 400; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="color"] { appearance: none; -webkit-appearance: none; display: block; width: 72px; height: 44px; margin-top: 5px; padding: 4px; background: #fff; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 1px solid var(--line); border-radius: 4px; }
input[type="color"]::-moz-color-swatch { border: 1px solid var(--line); border-radius: 4px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: 4px; }

.hero { text-align: center; padding: 50px 10px 30px; }
.eyebrow { display: block; color: var(--accent); font-size: 11px; letter-spacing: .16em; font-weight: 800; margin-bottom: 14px; }
.hero h1 { font-size: clamp(30px, 4.6vw, 52px); }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--muted); font-size: 17px; max-width: 640px; margin: 0 auto 24px; }
.row-center { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.steps3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 10px; }
.card-folder-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 10px 0 22px; }
.card-folder-total { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 100px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.card-folder-total strong { color: var(--accent-deep); font-size: clamp(24px, 4vw, 34px); line-height: 1.1; }
.card-folder-total span { color: var(--muted); font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-bottom: 8px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin-bottom: 4px; }
.store-lookup { min-height: 100%; padding: 18px; border-radius: var(--r); }
.store-heading { text-align: center; margin: 0 0 18px; }
.store-heading h1 { margin: 0; }
.store-custom-logo { display: block; width: auto; max-width: min(100%, 360px); max-height: 150px; object-fit: contain; margin: 0 auto; }
.store-details { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.store-details > p { margin: 0; }
.store-details-links, .store-details-actions { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.store-details-actions { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions .grow, .grow { flex: 1; min-width: 180px; }
.actions input.grow { margin: 0; }
.stripe-amount-form, .stripe-configuration-note { margin-top: 15px; }
.stripe-amount-fields { display: flex; gap: 10px; }
.account-tabs { margin-bottom: 20px; }
.premium-benefit-copy { flex-grow: 1; }
.premium-billing-form, .premium-feedback { margin-top: 15px; }
.store-logo-remove-form { margin-top: 10px; }
.add-card-panel, .add-card-form { margin-top: 15px; }
.add-card-submit { margin-top: 10px; }
.inventory-card-controls { margin-top: 8px; }
.inventory-edit-form { margin-top: 8px; padding: 10px; background: rgba(0,0,0,.15); border-radius: 4px; }
.inventory-edit-fields { gap: 8px; margin-bottom: 8px; }
.inventory-condition-label { grid-column: span 2; }
.inventory-remove-form { margin-top: 6px; }
.inventory-remove-button { color: #ff6b6b; }
.folder-sharing { margin-top: 16px; }
.folder-sharing > summary { cursor: pointer; }
.folder-share-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.store-reservation-form { margin: 12px 0; }
.inventory-reserve-select { display: flex; align-items: center; gap: 8px; }
.inventory-reserve-select input { width: auto; margin: 0; }
.inventory-reserved { display: inline-block; }
.system-error-message { max-width: 520px; margin: 15vh auto; padding: 0 20px; font-family: sans-serif; }
.api-test-results { background: #1e1e1e; color: #d4d4d4; padding: 30px; line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.api-test-box { background: #252526; border: 1px solid #3c3c3c; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.api-test-results h2 { color: #4ec9b0; margin-top: 0; }
.api-test-results h3 { color: #dcdcaa; }
.api-test-results pre { background: #1e1e1e; color: #9cdcfe; padding: 15px; border-radius: 6px; overflow: auto; border: 1px solid #333; }
.api-test-back-btn { display: inline-block; background: #007acc; color: white; padding: 10px 20px; text-decoration: none; border-radius: 4px; font-weight: bold; margin-bottom: 20px; }
.api-test-back-btn:hover { background: #005999; }
.country-agreement { display: flex; align-items: center; gap: 8px; flex-basis: 100%; margin: 0; }
.country-agreement input { width: auto; margin: 0; }
.inline-check { display: flex; align-items: center; gap: 8px; }
.inline-check input { width: auto; margin: 0; }

.seg { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.seg label { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 20px; padding: 7px 14px; margin: 0; cursor: pointer; font-size: 14px; }
.seg input { width: auto; margin: 0; }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.suggest { list-style: none; margin: -8px 0 12px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: var(--shadow); max-height: 260px; overflow: auto; }
.suggest li button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 4px; font: inherit; cursor: pointer; }
.suggest li button:hover, .suggest li button:focus { background: var(--accent-soft); }

.sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.side { border-top: 4px solid var(--give); }
.side + .side, .side[data-dir="get"] { border-top-color: var(--get); }
.side-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.side-total { font-weight: 800; font-size: 18px; }
.side-head .add-card { margin-left: auto; }
.item-list, .items { list-style: none; margin: 0 0 12px; padding: 0; }
.item-row { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.item-row:first-child { border-top: 0; }
.item-thumb { display: block; width: 100%; max-width: 150px; max-height: 210px; aspect-ratio: 63 / 88; object-fit: contain; border-radius: 6px; background: var(--sunken); }
.item-thumb-placeholder { min-height: 80px; background: linear-gradient(135deg,#e5e7eb,#cbd5e1); }
.item-thumb-empty { background: transparent; }
.item-body { min-width: 0; }
.item-info { min-width: 0; margin-bottom: 8px; }
.item-info strong { overflow-wrap: anywhere; }
.item-controls { display: grid; grid-template-columns: minmax(70px, 1fr) minmax(100px, 1.4fr) auto; gap: 8px; align-items: end; }
.item-controls label { min-width: 0; margin: 0; font-size: 13px; }
.item-controls input { min-width: 0; margin-top: 4px; padding: 7px; }
.item-controls .remove-item-btn { margin-bottom: 1px; }
.item { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item-img { width: 52px; height: 72px; object-fit: cover; border-radius: 4px; background: var(--sunken); display: block; }
.item-img.ph { background: linear-gradient(135deg, #e5e7eb, #cbd5e1); }
.item-main { display: flex; flex-direction: column; min-width: 0; }
.item-main strong { overflow-wrap: anywhere; }
.item-price { text-align: right; font-weight: 700; display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.item-cond { margin-top: 4px; font-size: 11.5px; font-weight: 700; color: var(--accent-deep); background: var(--accent-soft); border-radius: 10px; padding: 1px 8px; }
.item-edit { display: grid; grid-template-columns: minmax(130px, 1.4fr) 64px 110px auto; gap: 6px; margin-top: 6px; align-items: center; }
.item-edit select, .item-edit input { margin: 0; padding: 5px 7px; font-size: 13px; }
.item-edit .x { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: 13px; padding: 4px; }
.x.reset { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }
.balance { font-size: 16px; display: flex; flex-direction: column; gap: 4px; }
.balance.even { border-left: 4px solid var(--accent); }

.status { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 12px; margin-right: 6px; background: var(--sunken); color: var(--muted); }
.st-you { background: #fff4e5; color: #b45309; }
.st-them { background: #eef2ff; color: #4338ca; }
.st-agreed { background: #f0faf3; color: #17652e; }
.st-draft { background: var(--sunken); color: var(--muted); }
.decide { border-left: 4px solid var(--gold); }
.history { margin: 0; padding-left: 18px; }
.history li { margin-bottom: 4px; }
.count { display: inline-block; background: var(--sunken); color: var(--muted); border-radius: 10px; font-size: 12px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }
.trade-list { list-style: none; margin: 0; padding: 0; }
.trade-row { display: flex; gap: 12px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; flex-wrap: wrap; }
.trade-list li:first-child .trade-row { border-top: 0; }
.trade-row:hover strong { color: var(--accent); }
.trade-row .grow { display: flex; flex-direction: column; }
.trade-sum { font-size: 13px; color: var(--muted); white-space: nowrap; }
.tag { font-size: 11px; background: var(--sunken); color: var(--muted); padding: 1px 7px; border-radius: 8px; font-weight: 600; }
.danger-zone summary { cursor: pointer; color: var(--danger); font-weight: 700; }
.danger-zone form { margin-top: 12px; }
.prose h2 { font-size: 20px; margin-top: 20px; }
.explain { background: var(--accent-soft); border: 1px solid #b5e2dc; border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.explain summary { cursor: pointer; font-weight: 800; color: var(--accent-deep); }
.explain p { margin: 8px 0; }
.cond-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.cond-chip { background: #fff; border: 1px solid #b5e2dc; border-radius: 14px; padding: 2px 10px; font-size: 13px; }
.cond-chip b { color: var(--accent-deep); }
#cm-cond-hint { margin: -2px 0 8px; color: var(--accent-deep); font-weight: 600; }

.modal { position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .55); display: flex; align-items: flex-start; justify-content: center; padding: 30px 14px; overflow: auto; }
.modal-box { background: #fff; border-radius: 12px; width: min(980px, 100%); padding: 20px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.grid-search { display: grid; grid-template-columns: 200px 1fr 190px; gap: 12px; }
.lookup-search { grid-template-columns: minmax(150px, .8fr) minmax(0, 1.6fr); }
.checker-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.card-lookup-anchor { scroll-margin-top: 84px; }
.card-lookup-anchor .suggest { margin: 0 0 8px; }
.versions { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 8px; }
.ver { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.ver img { width: 100%; max-height: 260px; height: auto; object-fit: contain; border-radius: 6px; background: var(--sunken); }
.dev-hash-progress { display: block; width: 100%; height: 22px; margin: 10px 0; }
.dev-camera-frame { position: fixed; inset: 0; z-index: 1000; overflow: hidden; background: #050607; }
.dev-camera-frame[hidden] { display: none; }
.dev-camera-frame:fullscreen { width: 100vw; height: 100vh; width: 100dvw; height: 100dvh; }
.dev-camera-frame video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.dev-camera-card-guide { position: absolute; left: 50%; top: 50%; width: min(96vw, 68dvh); aspect-ratio: 63 / 88; transform: translate(-50%, -50%); border: 2px solid rgba(255,255,255,.95); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.3); pointer-events: none; }
.dev-camera-art-guide { position: absolute; left: 8%; top: 10%; width: 84%; height: 40%; box-sizing: border-box; border: 2px solid #facc15; border-radius: 4px; background: rgba(250,204,21,.06); pointer-events: none; }
.dev-camera-overlay-status { position: absolute; top: calc(env(safe-area-inset-top) + 68px); left: 50%; width: min(92vw, 560px); transform: translateX(-50%); margin: 0; padding: 10px 14px; border-radius: 8px; color: #fff; background: rgba(0,0,0,.72); text-align: center; font-size: 14px; }
.dev-camera-stop { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: max(16px, env(safe-area-inset-right)); z-index: 2; }
.dev-camera-capture-form { position: absolute; inset: 0; z-index: 2; margin: 0; pointer-events: none; }
.dev-camera-capture-form[hidden] { display: none; }
.dev-camera-scan { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px); transform: translateX(-50%); min-width: 200px; min-height: 54px; box-shadow: 0 4px 18px rgba(0,0,0,.4); pointer-events: auto; }
.dev-camera-scan-preview { display: block; max-width: min(100%, 360px); max-height: 240px; width: auto; height: auto; margin: 0 auto 12px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: var(--sunken); }
.dev-scan-thumbnail { display: block; width: 72px; max-height: 96px; object-fit: contain; border-radius: 4px; }
.dev-scan-label-form { display: grid; gap: 6px; min-width: 180px; margin-top: 8px; }
.dev-scan-label-form input { width: 100%; }
.beta-card-scan { margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--sunken); }
.beta-card-scan h3 { margin-bottom: 8px; }
.beta-scan-status { margin: 10px 0 0; }
.beta-scan-results:empty { display: none; }
.beta-scan-suggestions { display: grid; gap: 8px; margin-top: 10px; }
.beta-scan-suggestion { justify-content: flex-start; text-align: left; }
.beta-camera-frame:fullscreen { width: 100vw; height: 100vh; width: 100dvw; height: 100dvh; }
.beta-camera-frame video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.admin-user-suggestions { margin: 8px 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.admin-user-suggestions[hidden] { display: none; }
.admin-user-suggestions > p { padding: 10px 12px; margin: 0; }
.admin-user-suggestion { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 10px 12px; border: 0; border-top: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.admin-user-suggestion:first-child { border-top: 0; }
.admin-user-suggestion:hover, .admin-user-suggestion:focus-visible { background: var(--sunken); }
.image-loading { visibility: hidden; }
.ver .ver-image-reveal { width: auto; min-height: 36px; align-self: flex-start; display: inline-flex; grid-template-columns: none; padding: 6px 10px; }
.ver .ver-image-reveal:disabled { cursor: wait; opacity: .7; }
.image-report-button { align-self: flex-start; }
.ver-name { font-size: 13px; font-weight: 700; line-height: 1.3; }
.ver-meta { font-size: 12px; color: var(--muted); }
.ver button { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--sunken); font: inherit; font-size: 13px; cursor: pointer; color: var(--text); font-weight: 600; text-align: left; }
.ver button span { color: var(--text); }
.ver button:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.ver.has-store-photo { border-color: #d4a017; box-shadow: 0 0 0 2px rgba(212, 160, 23, .2); }
.store-default-image-label { display: inline-block; padding: 1px 5px; border-radius: 5px; background: #fff4cc; color: #805b00 !important; font-size: 10px; font-weight: 700; }
.store-photo-version { display: grid; gap: 5px; padding: 7px; border: 2px solid #d4a017; border-radius: 7px; background: #fffaf0; }
.store-photo-version img { width: 100%; aspect-ratio: 63/88; object-fit: cover; border: 2px solid #d4a017; border-radius: 5px; }
.ver button:hover span, .ver button:hover b { color: var(--accent-deep); }
.ver button b { color: var(--accent-deep); font-weight: 700; }

@media (max-width: 640px) {
    .top-in, .main { padding-left: 16px; padding-right: 16px; }
    .store-details-actions { margin-left: 0; }
    .top-in { gap: 12px; }
    .brand-logo { width: min(220px, calc(100vw - 128px)); }
    .site-menu > nav { max-height: calc(100dvh - 96px); }
    .sides { grid-template-columns: 1fr; }
    .grid-search { grid-template-columns: 1fr; }
    .lookup-search { grid-template-columns: 1fr; gap: 4px; }
    .card-lookup-anchor:focus-within .suggest,
    .card-lookup-anchor:focus-within .versions {
        max-height: var(--lookup-results-height, 40vh);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    .modal { padding: 8px; }
    .modal-box { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 16px; }
    .item-edit { grid-template-columns: 1fr 1fr; }
    .page-head { align-items: flex-start; }
}
.custom-prices { background: #fff8e6; border: 2px solid #e0b44c; color: #6b4a00; font-size: 16px; text-align: center; margin: 0 0 14px; }
.sides + .custom-prices { margin-top: -4px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; margin-bottom: 10px; }
.price-grid label { margin: 0; font-size: 13.5px; }
.pct { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-weight: 700; }
.pct-control { display: flex; align-items: center; gap: 6px; }
.pct input { margin: 0; max-width: 90px; }
.pct-label { display: none; }
.shop-price-row { display: grid; grid-template-columns: minmax(110px, 1fr) repeat(3, minmax(110px, 1fr)); gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.shop-price-row label { margin: 0; }
.shop-price-head { font-size: 13px; color: var(--muted); }
@media (max-width: 560px) {
    .shop-price-head { display: none; }
    .shop-price-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: start; font-size: 12px; }
    .shop-price-row > strong { grid-column: 1 / -1; }
    .store-price-head { display: grid; }
    .store-price-head > strong:first-child { display: none; }
    .store-price-head > strong { grid-column: auto; font-size: 10px; line-height: 1.25; }
    .shop-price-row .pct { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
    .shop-price-row .pct-label { display: block; font-size: 11px; line-height: 1.25; }
    .shop-price-row .pct-control { gap: 4px; }
    .shop-price-row .pct input { width: 100%; min-width: 0; max-width: none; padding: 8px 6px; }
}
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 18px; }
.store-card h2 { margin-bottom: 4px; }
.checker-search { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.store-footnote { font-weight: 700; font-size: 14px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }
@media (max-width: 760px) { .checker-search { grid-template-columns: 1fr 1fr; } }
.hero-link { margin-top: 14px; }
.bulk-table { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.bulk-row { display: grid; grid-template-columns: 190px 1fr 110px 150px; gap: 8px; align-items: center; }
.bulk-row select, .bulk-row input { margin: 0; }
.bulk-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bulk-game { font-size: 15px; margin: 14px 0 6px; color: var(--accent-deep); }
.bulk-line { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.bulk-list .bulk-line:first-child { border-top: 0; }
.bulk-qty { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 600; }
.bulk-qty input { width: 110px; margin: 0; }
.bulk-est { min-width: 90px; text-align: right; font-weight: 800; }
.bulk-total { font-weight: 800; font-size: 17px; text-align: right; margin: 12px 0 0; }
.tag-bulk { background: var(--accent-soft); color: var(--accent-deep); vertical-align: middle; }
@media (max-width: 640px) { .bulk-row { grid-template-columns: 1fr 1fr; } .bulk-head { display: none; } }
.badge-count { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #d97706; color: #fff; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.verdict { display: inline-block; font-weight: 800; font-size: 13px; padding: 2px 10px; border-radius: 12px; }
.v-fair { background: #f0faf3; color: #17652e; }
.v-favours_requester { background: #eef2ff; color: #4338ca; }
.v-favours_other { background: #fff4e5; color: #b45309; }
.review-box { border-left: 4px solid var(--accent); }
.review-item { border-top: 1px solid var(--line); padding: 12px 0; }
.review-item:first-of-type { border-top: 0; }

/* TCGGuilds Hub: sign-in button and the linking pages shown inside the Hub */
.sso-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 13px; }
.sso-or::before, .sso-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.btn-hub { width: 100%; background: #1f2430; border-color: #1f2430; }
.btn-hub:hover { background: #000; border-color: #000; }
.sso-gap { margin-top: 26px; }
.hub-identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--sunken); }
.hub-identity .hint { width: 100%; }
.hub-cancel { margin-top: 10px; }
.hub-embed { background: var(--surface); }
.hub-embed-main { max-width: 520px; margin: 0 auto; padding: 16px; }
.hub-embed-main .panel { box-shadow: none; }
.hub-embed-brand { margin: 0 0 12px; font-size: 15px; }
.inventory-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:1rem}
.inventory-card{min-width:0}
.inventory-card-reserved { border: 2px solid #dc2626; }
.reservation-banner { display: grid; gap: 3px; margin: -8px -8px 10px; padding: 10px 12px; border-radius: 7px 7px 0 0; background: #fee2e2; color: #991b1b; }
.reservation-banner strong { font-size: 14px; }
.reservation-banner span { font-size: 12px; }
.user-folder-image, .store-folder-logo { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 50%; border: 2px solid var(--line); }
.user-folder-image-preview { display: block; width: min(180px, 100%); height: 180px; margin-bottom: 12px; object-fit: cover; border-radius: 10px; }
.store-folder-logo { object-fit: contain; border-radius: 10px; }
.store-follow-game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 14px; margin: 12px 0; }
.store-follow-games { margin-bottom: 10px; }
.ver.has-store-photo > img { border: 2px solid #d4a017; }
.inventory-image{display:block;width:100%;max-height:260px;object-fit:contain;background:#f8fafc;border-radius:.5rem}
.inventory-image-placeholder{width:100%;aspect-ratio:63/88;max-height:260px;margin-bottom:10px;border-radius:.5rem;background:linear-gradient(135deg,#e5e7eb,#cbd5e1)}
.item-thumb-placeholder{flex:none}
.inventory-card form input[type=file]{min-width:0;max-width:100%}
.inventory-filter-form { margin-bottom: 16px; align-items: end; }
.inventory-filter-submit { padding-bottom: 2px; }
.inventory-pagination { margin-top: 16px; text-align: center; }
.folder-badge { 
    background: #fef3c7; 
    color: #92400e; 
    border: 1px solid #f59e0b;
    font-weight: 700; 
    font-size: 10px; 
    padding: 1px 5px; 
    border-radius: 4px; 
    white-space: nowrap; 
}

.personal-folder-page { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); }
.personal-folder-page .panel { background: var(--surface); border-color: var(--line); }
.personal-folder-page .inventory-card h2 { color: var(--accent-deep); }
.folder-theme-forest { --bg: #edf4e9; --surface: #fbfff8; --sunken: #e3eddf; --line: #c7d8bf; --text: #203326; --muted: #536b59; --accent: #3f7650; --accent-deep: #2f5a3d; --accent-soft: #e4f1e4; }
.folder-theme-midnight { --bg: #171b2a; --surface: #22283a; --sunken: #2b3349; --line: #414b66; --text: #f1f4ff; --muted: #b6bfd6; --accent: #89a7ff; --accent-deep: #bdcbff; --accent-soft: #303d60; }
.folder-theme-rose { --bg: #fff1f3; --surface: #fffafb; --sunken: #f9e5e8; --line: #edc5cc; --text: #44252d; --muted: #77535c; --accent: #b74e68; --accent-deep: #8d344c; --accent-soft: #f8e2e7; }
.folder-theme-midnight input, .folder-theme-midnight select, .folder-theme-midnight textarea { background: #171b2a; color: #f1f4ff; border-color: #414b66; }
.folder-theme-midnight .btn-ghost { background: #22283a; color: #f1f4ff; border-color: #414b66; }
.folder-theme-midnight .tag { color: #1c2028; }

.ver.has-folder-match {
    border: 2px solid #f59e0b !important;
    background: #fffbeb !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.ver button { 
    display: grid; 
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 8px;
    width: 100%; 
    padding: 8px 10px; 
    border: 1px solid var(--line); 
    border-radius: 6px; 
    background: var(--sunken); 
    font: inherit; 
    font-size: 13px; 
    cursor: pointer; 
    color: var(--text); 
    font-weight: 600; 
}

.ver button > span { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    min-width: 0;
    flex: 1;
}

.ver button > b { 
    color: var(--accent-deep); 
    font-weight: 700; 
    white-space: nowrap;
    flex-shrink: 0;
}
.ver button > b.no-market-price-label { grid-column: 1 / -1; justify-self: start; white-space: normal; color: var(--muted); font-size: 12px; }
.ver button.no-market-price { grid-template-columns: minmax(0, 1fr); }
.ver button > .ver-meta { grid-column: 1 / -1; justify-self: end; white-space: nowrap; }

.ver button:hover { 
    border-color: var(--accent); 
    background: var(--accent-soft); 
}

.reservation-review-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reservation-review-row .grow { min-width: 0; display: grid; gap: 3px; }
.reservation-decision { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.reservation-decision label { display: grid; gap: 3px; }
.reservation-trade-panel { border-color: var(--gold); }
.inventory-reserve-select { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; }
.inventory-reserved { background: #fef3c7; color: #92400e; }
@media (max-width: 640px) {
    .item-row { grid-template-columns: minmax(0, 100px) minmax(0, 1fr); gap: 10px; }
    .item-controls { grid-template-columns: minmax(54px, .7fr) minmax(90px, 1.3fr) auto; gap: 5px; }
    .item-controls input { padding: 6px 5px; font-size: 12px; }
    .side-head { align-items: center; }
    .side-head .h3 { margin-bottom: 0; }
    .reservation-review-row { align-items: flex-start; flex-direction: column; }
    .reservation-decision { align-items: stretch; }
}