/* Édition Atelier — a single, self-contained visual system. */
:root {
  color-scheme: light;
  --paper: #f7f7f2;
  --surface: #fffefa;
  --surface-soft: #edf0e9;
  --ink: #253b32;
  --text: #2a3430;
  --muted: #68736c;
  --line: #dfe4db;
  --accent: #3e6957;
  --accent-soft: #e7eee5;
  --good: #35644b;
  --gold: #846424;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-height: 76px;
  --scroll-fade: 1;
  --nav-height: 62px;
  --content-width: 1160px;
  --gutter: 20px;
  --ease: cubic-bezier(.22,.68,.2,1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { background: var(--paper); scrollbar-width: none; scroll-padding-top: calc(84px + var(--safe-top)); }
html::-webkit-scrollbar, .filters::-webkit-scrollbar { display: none; }
body { margin: 0; min-width: 280px; min-height: 100dvh; background: var(--paper); color: var(--text); line-height: 1.5; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, input, select, summary { transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease); }
button:disabled { cursor: default; opacity: .43; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:focus:not(:focus-visible) { outline: none; }
input, select { color: var(--text); font-size: 16px; min-width: 0; accent-color: var(--accent); }
input::placeholder { color: #758077; opacity: 1; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.ui-icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { color: var(--ink); }
.shell { width: 100%; }
.page-content { max-width: var(--content-width); margin: 0 auto; padding: calc(100px + var(--safe-top)) max(var(--gutter),env(safe-area-inset-right)) calc(var(--nav-height) + var(--safe-bottom) + 36px) max(var(--gutter),env(safe-area-inset-left)); animation: page-arrive .28s var(--ease); }
.topbar { position: fixed; inset: 0 0 auto; height: calc(var(--header-height) + var(--safe-top)); padding: var(--safe-top) max(var(--gutter),env(safe-area-inset-right)) 0 max(var(--gutter),env(safe-area-inset-left)); z-index: 100; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner { height: 100%; max-width: calc(var(--content-width) - 2 * var(--gutter)); margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { border: 0; padding: 0; background: transparent; display: flex; align-items: center; gap: 11px; text-align: left; min-width: 0; }
.brand img { width: 36px; height: 36px; flex: none; border-radius: 10px; }
.brand>span { min-width: 0; }
.brand strong { font-size: 17px; font-weight: 650; letter-spacing: -.45px; white-space: nowrap; line-height: 1.25; display: block; }
.brand small { display: block; color: var(--muted); font-size: 11px; line-height: 17px; max-height: calc(17px * var(--scroll-fade)); opacity: var(--scroll-fade); overflow: hidden; white-space: nowrap; }
.sync { display: block; font-size: 11px; line-height: 1.4; color: var(--muted); text-align: right; max-width: 150px; }
.bottomnav { position: fixed; inset: auto 0 0; background: var(--paper); border-top: 1px solid var(--line); z-index: 100; padding: 0 max(8px,env(safe-area-inset-right)) var(--safe-bottom) max(8px,env(safe-area-inset-left)); }
.nav-inner { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); max-width: 600px; height: var(--nav-height); margin: auto; }
.bottomnav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; border: 0; padding: 6px 4px; background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 500; }
.bottomnav .ui-icon { width: 21px; height: 21px; }
.bottomnav button::before { content: ""; position: absolute; top: -1px; width: 24px; height: 2px; background: var(--accent); border-radius: 0 0 2px 2px; opacity: 0; transition: opacity .2s; }
.bottomnav button.active { color: var(--accent); font-weight: 650; }
.bottomnav button.active::before { opacity: 1; }
.eyebrow { display: block; color: var(--muted); font-size: 10px; line-height: 1.4; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.textlink { display: inline-flex; align-items: center; gap: 7px; padding: 8px 0 8px 8px; min-height: 40px; color: var(--accent); background: transparent; border: 0; font-size: 12px; }
.textlink .ui-icon { width: 16px; height: 16px; }
.collection-overview { margin: 0 0 30px; }
.overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 20px 0; }
.stat { min-width: 0; padding: 0 20px; }
.stat+.stat { border-left: 1px solid var(--line); }
.stat b { display: block; color: var(--ink); font-size: 30px; line-height: 1.2; font-weight: 500; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: 11px; color: var(--muted); margin-top: 5px; }
.sectionhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 0 0 15px; }
.sectionhead h2 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 400; letter-spacing: -.6px; line-height: 1.15; }
.section-caption { color: var(--muted); font-size: 11px; padding-bottom: 3px; text-align: right; }
.gamegrid { display: grid; grid-template-columns: 1fr; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; overflow: hidden; }
.gamechoice { display: grid; grid-template-columns: 136px minmax(0,1fr) 20px; width: 100%; gap: 24px; align-items: center; min-height: 96px; text-align: left; padding: 15px 22px; border: 0; background: transparent; }
.gamechoice+.gamechoice { border-top: 1px solid var(--line); }
.gamebrand { display: flex; align-items: center; justify-content: center; width: 136px; height: 64px; padding: 12px 14px; background: #f0f1ea; border-radius: 9px; flex: none; overflow: hidden; }
.gamebrand.on-ink { background: #2e3933; }
.gamebrand img { width: 100%; height: 100%; object-fit: contain; }
.wordmark { display: none; font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--ink); align-items: center; justify-content: center; }
.on-ink .wordmark { color: #f7f7f2; }
.gamecopy { display: block; min-width: 0; }
.gamename { display: block; font-size: 16px; color: var(--ink); line-height: 1.4; font-weight: 600; }
.gamedescription { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.gamechoice>.ui-icon { width: 17px; height: 17px; color: #849087; }
.gamechoice.pending { cursor: default; grid-template-columns: 136px minmax(0,1fr); }
.upcominggames { margin-top: 26px; border-top: 1px solid var(--line); }
.upcominggames summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0; cursor: pointer; }
.upcominggames summary::-webkit-details-marker { display: none; }
.upcominggames summary strong { display: block; font-size: 14px; color: var(--ink); font-weight: 550; }
.upcominggames summary small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.upcominggames summary>.ui-icon { width: 17px; height: 17px; color: var(--muted); transition: transform .25s var(--ease); }
.upcominggames[open] summary>.ui-icon { transform: rotate(90deg); }
.cataloguenote { color: var(--muted); font-size: 12px; margin: 0 0 15px; }
.edition-note { color: var(--muted); font-size: 10px; text-align: center; letter-spacing: .04em; margin: 30px 0 0; }
.edition-note span { padding: 0 7px; }
.breadcrumb { margin: -6px 0 23px; }
.breadcrumb button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 0; border: 0; background: none; color: var(--muted); font-size: 12px; }
.breadcrumb .ui-icon { width: 17px; height: 17px; }
.titleline { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 26px; }
.titleline h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(30px,5vw,44px); letter-spacing: -.9px; line-height: 1.15; margin: 6px 0 10px; }
.titleline p { color: var(--muted); font-size: 13px; margin: 0; line-height: 1.55; }
.catalogue-hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.catalogue-hero .titleline { margin: 0; }
.catalogue-hero .gamebrand { width: 164px; height: 86px; padding: 16px; }
.cataloguetools { display: flex; align-items: flex-end; gap: 16px; margin: 0 0 26px; }
.catalogue-search { flex: 1; min-width: 0; }
.catalogue-block { flex: 0 1 310px; min-width: 0; }
.cataloguetools label { display: block; font-size: 11px; font-weight: 500; margin-bottom: 7px; color: var(--muted); }
.search { position: relative; margin: 0 0 16px; }
.search>.ui-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #758077; width: 18px; height: 18px; pointer-events: none; }
.search input, .field input, .field select, .cataloguetools select { display: block; width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); line-height: 1.35; }
.search>.ui-icon+input { padding-left: 42px; }
.search input:focus, .field input:focus, .field select:focus, .cataloguetools select:focus { border-color: #8da696; }
.cataloguetools .search { margin: 0; }
.resultcount { font-size: 11px; color: var(--muted); margin: 0 0 18px; }
.yeargroup { margin: 26px 0 0; }
.yeargroup>h2 { display: flex; align-items: center; gap: 14px; font-size: 14px; font-weight: 500; letter-spacing: .02em; margin: 0 0 14px; }
.yeargroup>h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.setgrid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.setcard { display: flex; flex-direction: column; align-items: stretch; min-width: 0; min-height: 168px; text-align: left; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-top>.ui-icon { width: 17px; height: 17px; color: #849087; }
.code { font-size: 10px; font-weight: 650; letter-spacing: .08em; color: var(--accent); }
.setcard h3 { font-size: 15px; line-height: 1.35; font-weight: 550; margin: 14px 0 5px; }
.settranslation { color: var(--muted); font-size: 11px; line-height: 1.4; margin: 0 0 14px; }
.setdiscover { display: block; padding-top: 18px; margin-top: auto; font-size: 11px; color: var(--accent); }
.setcard .progress { margin-top: auto; }
.progress, .completiontrack { height: 4px; background: #e4e8df; border-radius: 4px; overflow: hidden; }
.progress i, .completiontrack i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s var(--ease); }
.setmeta { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; line-height: 1.4; margin-top: 8px; color: var(--muted); }
.setmeta b { color: var(--accent); font-weight: 550; font-variant-numeric: tabular-nums; }
.completionstrip { display: grid; grid-template-columns: auto minmax(28px,1fr) auto auto; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.completionstrip b { font-weight: 600; color: var(--accent); font-size: 11px; }
.completionstrip small { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; scrollbar-width: none; }
.pill { border: 1px solid transparent; border-radius: 7px; padding: 8px 11px; min-height: 36px; font-size: 12px; line-height: 1.25; color: var(--muted); background: transparent; }
.pill.active { color: var(--accent); background: var(--accent-soft); border-color: #d1dece; font-weight: 600; }
.gallerytoolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 20px; }
.gallerymodes { display: flex; min-width: 0; padding: 3px; background: #e9ede5; border: 1px solid #e1e6dc; border-radius: 10px; }
.gallerymodes button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 38px; padding: 8px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; line-height: 1.3; }
.gallerymodes .ui-icon { width: 15px; height: 15px; }
.gallerymodes button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px #253b3210; }
.undobutton, .secondary, .primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--accent); font-size: 12px; line-height: 1.35; font-weight: 550; }
.undobutton { border-color: transparent; padding: 8px; background: transparent; color: var(--muted); white-space: nowrap; }
.undobutton .ui-icon { width: 16px; height: 16px; }
.primary { width: 100%; background: var(--accent); border-color: var(--accent); color: #fffefa; font-size: 14px; }
.primary.small { min-height: 36px; margin-top: 12px; padding: 8px 6px; font-size: 12px; }
.collectiontitle { flex-wrap: wrap; }
.collectiontitle .secondary { flex: none; }
.collectiontools { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 22px; }
.collectiontools .gallerytoolbar { margin-bottom: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(142px,1fr)); align-items: start; gap: 24px 16px; margin: 0; }
.card { min-width: 0; background: transparent; border: 0; border-radius: 8px; }
.realart { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 5 / 7; overflow: hidden; border: 0; border-radius: 7px; background: #e9ece4; padding: 0; box-shadow: 0 1px 2px #20372b14,0 4px 10px #20372b0b; }
.zoomcard { cursor: zoom-in; }
.realart img { width: 100%; height: 100%; object-fit: contain; }
.fallback { font-size: 11px; color: var(--muted); text-align: center; padding: 12px; }
.cardbody { padding: 9px 1px 0; }
.cardbody h3 { font-size: 12px; line-height: 1.4; font-weight: 550; margin: 0 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cardbody>small { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ownedline { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 23px; margin-top: 2px; color: var(--muted); font-size: 10px; }
.card.isowned .ownedline { color: var(--good); }
.card.isowned [data-owned] { font-weight: 600; }
.ownedline [data-favorite-mark] { color: var(--gold); }
.price { color: var(--ink); font-size: 11px; font-weight: 550; font-variant-numeric: tabular-nums; }
body[data-gallery-mode="consultation"] .managementcontrols { display: none; }
.managementcontrols { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
.quantitycontrols { display: grid; gap: 9px; }
.variantrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 10px; min-width: 0; }
.variantrow>span { font-size: 10px; color: var(--muted); }
.variantrow.foil>span { color: var(--gold); }
.qty { display: grid; grid-template-columns: 32px minmax(14px,1fr) 32px; align-items: center; gap: 3px; width: 100%; min-width: 0; }
.qty button { display: grid; place-items: center; width: 32px; height: 34px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; font-size: 18px; line-height: 1; color: var(--accent); }
.qty b { text-align: center; font-size: 12px; font-weight: 550; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fav { display: inline-flex; justify-content: center; align-items: center; width: 36px; height: 36px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); }
.fav .ui-icon { width: 17px; height: 17px; }
.fav.on { color: var(--gold); border-color: #ddcba3; background: #f6f0e1; }
.fav.on .ui-icon { fill: #e8d59a; }
.managementcontrols>.fav { width: 100%; margin-top: 9px; min-height: 34px; }
.opcolourheading { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 550; margin: 0; padding: 3px 0; }
.opcolourheading::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.cards>.opcolourheading:not(:first-child) { margin-top: 6px; }
.empty { grid-column: 1 / -1; padding: 44px 20px; border: 1px dashed #cdd6ca; border-radius: 14px; text-align: center; font-size: 13px; color: var(--muted); }
.empty h2 { font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 400; letter-spacing: -.4px; line-height: 1.3; margin: 16px 0 9px; }
.empty p { max-width: 370px; margin: 0 auto 22px; font-size: 13px; line-height: 1.65; }
.collectionempty>.ui-icon { width: 32px; height: 32px; color: var(--accent); }
.spinner { display: inline-block; width: 26px; height: 26px; margin-bottom: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1.1s linear infinite; }
.collectionnotice { position: fixed; z-index: 600; bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px); left: max(12px,env(safe-area-inset-left)); right: max(12px,env(safe-area-inset-right)); display: flex; align-items: center; gap: 10px; max-width: 610px; margin: auto; padding: 12px 14px; color: #f7f7f2; background: #304b3e; border: 1px solid #496456; border-radius: 12px; box-shadow: 0 8px 24px #253b3224; font-size: 12px; animation: notice-arrive .2s var(--ease); }
.collectionnotice>span { min-width: 0; flex: 1; overflow-wrap: anywhere; line-height: 1.45; }
.collectionnotice button { flex: none; border: 0; background: transparent; color: #fffefa; min-height: 40px; padding: 6px; font-size: 12px; font-weight: 600; }
.collectionnotice button:last-child { width: 32px; font-size: 22px; font-weight: 400; }
.scanlayout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; align-items: start; margin: 0 0 28px; }
.scanpanel { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); min-width: 0; }
.panel-label { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.panel-label>span { font-size: 11px; color: var(--accent); letter-spacing: .04em; border-right: 1px solid var(--line); padding-right: 11px; }
.panel-label h2 { margin: 0; font-size: 15px; font-weight: 550; }
.livecamera { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; background: #293931; margin-bottom: 16px; }
.livecamera video { width: 100%; height: 100%; object-fit: cover; }
.scanframe { position: absolute; inset: 8% 28%; border: 1px solid #f7f7f290; border-radius: 9px; box-shadow: 0 0 0 100vmax #00000012; pointer-events: none; }
.scannote, .assistnote { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 14px 0 0; }
.assistnote { margin: 0 0 22px; padding: 12px 14px; background: var(--surface-soft); border-radius: 9px; }
.field { display: block; color: var(--muted); font-size: 12px; margin: 18px 0; }
.field input, .field select { margin-top: 7px; }
#scanResults>h2 { font-size: 22px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.scanresults .cardbody>small { white-space: normal; }
.backupintro { font-size: 14px; color: var(--muted); max-width: 740px; line-height: 1.7; }
.backuppanels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin: 26px 0; }
.backuppanel { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.backuppanel h2 { font-size: 18px; font-weight: 550; margin: 0 0 12px; }
.backuppanel p { font-size: 13px; color: var(--muted); line-height: 1.65; }
.backuppanel>.primary, .backuppanel>.secondary { display: flex; width: 100%; margin-top: 12px; min-height: 46px; white-space: normal; }
.backuppanel .backuphelp { font-size: 11px; }
.filepicker { display: block; font-size: 13px; color: var(--ink); margin-top: 20px; }
.filepicker input { display: block; width: 100%; font-size: 12px; margin-top: 10px; color: var(--muted); }
.filepicker input::file-selector-button { background: var(--accent-soft); color: var(--accent); padding: 12px; margin-right: 10px; border: 1px solid #d1dece; border-radius: 9px; cursor: pointer; }
.importpanel { max-width: 850px; margin: 20px 0; }
.importfilename { overflow-wrap: anywhere; }
.importsummary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.importsummary>div { padding: 14px; background: var(--surface-soft); border-radius: 9px; }
.importsummary dt { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.importsummary dd { margin: 0; font-size: 13px; line-height: 1.55; }
.importchoices { border: 0; margin: 22px 0; padding: 0; }
.importchoices legend { font-size: 14px; font-weight: 550; margin-bottom: 10px; }
.importchoices label, .replaceconsent { display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; margin: 14px 0; font-size: 13px; cursor: pointer; }
.importchoices input, .replaceconsent input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--accent); }
.importchoices small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.importresult { color: var(--accent) !important; font-weight: 600; }
.replaceconsent { padding: 14px; background: #fbf6e9; border: 1px solid #ded0aa; border-radius: 10px; color: #72551c; }
.importactions { display: flex; gap: 12px; margin-top: 18px; }
.importactions .primary { width: auto; min-width: 140px; }
@media (hover: hover) {
  .gamechoice:not(.pending):hover { background: #f2f5ee; }
  .setcard:hover { background: #fafcf5; border-color: #aebfac; box-shadow: 0 3px 12px #253b3206; }
  .primary:not(:disabled):hover { background: #325a48; border-color: #325a48; }
  .secondary:hover, .qty button:not(:disabled):hover, .bottomnav button:hover { background: var(--accent-soft); }
  .pill:not(.active):hover, .undobutton:not(:disabled):hover { background: #e9ede5; color: var(--ink); }
  .zoomcard:hover { box-shadow: 0 2px 5px #20372b24,0 6px 18px #20372b12; }
}
@media (min-width: 900px) {
  :root { --gutter: 32px; }
  .home-page { max-width: 900px; }
  .collectiontools { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 24px; }
  .collectiontools .search, .collectiontools .gallerytoolbar { margin: 0; }
  .stats { padding: 23px 0; }
  .stat { padding: 0 28px; }
}
@media (max-width: 760px) {
  .setgrid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .catalogue-hero { align-items: flex-start; gap: 15px; }
  .catalogue-hero .gamebrand { width: 100px; height: 64px; padding: 11px; }
  .catalogue-hero h1 { font-size: 32px; }
  .backuppanels { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  :root { --gutter: 18px; }
  .topbar-inner { gap: 12px; }
  .sync { font-size: 10px; max-width: 96px; }
  .stat { padding: 0 13px; }
  .stat b { font-size: 27px; }
  .stat span { font-size: 10px; }
  .gamechoice { grid-template-columns: 96px minmax(0,1fr) 15px; gap: 14px; min-height: 87px; padding: 13px; }
  .gamechoice.pending { grid-template-columns: 96px minmax(0,1fr); }
  .gamebrand { width: 96px; height: 56px; padding: 10px; border-radius: 7px; }
  .gamename { font-size: 14px; }
  .gamedescription { font-size: 10px; margin-top: 3px; }
  .gamechoice>.ui-icon { width: 15px; height: 15px; }
  .sectionhead h2 { font-size: 27px; }
  .section-caption { max-width: 120px; font-size: 10px; }
  .cataloguetools { display: block; }
  .catalogue-block { margin-top: 16px; }
  .setcard { min-height: 158px; padding: 15px; }
  .setcard h3 { font-size: 14px; }
  .settranslation { font-size: 10px; }
  .setmeta { font-size: 9px; }
  .setmeta span { max-width: 85px; }
  .cards { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px 10px; }
  .cardbody h3 { font-size: 11px; }
  .cardbody>small, .ownedline { font-size: 9px; }
  .cardbody .price { font-size: 10px; }
  .gallerymodes button { padding: 8px 9px; gap: 5px; font-size: 11px; }
  .gallerymodes .ui-icon { width: 14px; height: 14px; }
  .undobutton { font-size: 11px; gap: 5px; padding: 8px 5px; }
  .titleline { gap: 12px; }
  .collectiontitle .secondary { font-size: 11px; gap: 6px; padding: 8px 11px; }
  .collectiontitle .secondary .ui-icon { width: 17px; height: 17px; }
  .scanlayout { grid-template-columns: 1fr; gap: 18px; }
  .scanpanel { padding: 19px; }
  .importsummary { grid-template-columns: 1fr; }
  .backuppanel { padding: 19px; }
}
@media (max-width: 359px) {
  :root { --gutter: 14px; }
  .brand { gap: 8px; }
  .brand img { width: 32px; height: 32px; }
  .brand strong { font-size: 15px; }
  .brand small { font-size: 10px; }
  .sync { max-width: 83px; font-size: 9px; }
  .overview-heading .eyebrow { font-size: 9px; }
  .textlink { font-size: 11px; }
  .gamechoice { grid-template-columns: 84px minmax(0,1fr) 13px; gap: 10px; padding: 11px; }
  .gamechoice.pending { grid-template-columns: 84px minmax(0,1fr); }
  .gamebrand { width: 84px; height: 50px; padding: 8px; }
  .gamename { font-size: 13px; }
  .gamedescription { font-size: 9px; }
  .catalogue-hero .gamebrand { width: 74px; height: 56px; padding: 7px; }
  .catalogue-hero h1 { font-size: 28px; }
  .cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .setgrid { grid-template-columns: 1fr; }
  .setcard { min-height: 144px; }
  .gallerymodes .ui-icon { display: none; }
  .gallerytoolbar { gap: 5px; }
}
@keyframes page-arrive { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes notice-arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes backdrop-arrive { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
