/* Catalogue component styles: combined in their original cascade order. */

/* --- tcg-detail-v4.css --- */
/* Collector's Hub | TCG gallery controls — isolated, cache-safe stylesheet.
   Designed to work with every existing site theme. */
#page-tcg *,#page-tcg *::before,#page-tcg *::after{box-sizing:border-box}
#tcgCardDetail{min-width:0;max-width:100%;gap:1.25rem}
#tcgCardDetail .tcg-detail-heading{margin-top:.1rem;gap:1.1rem;min-width:0;align-items:center}
#tcgCardDetail .tcg-detail-heading>div:last-child{min-width:0}
#tcgCardDetail .tcg-detail-artwork{overflow:hidden;flex-shrink:0}
#tcgCardDetail .tcg-card-toolbar.tcg-view-toolbar{display:grid;grid-template-columns:minmax(230px,1fr) auto auto;align-items:end;gap:1rem;padding:1.05rem 1.15rem;background:var(--bg-card);border:1px solid var(--border-color);border-radius:1rem;box-shadow:0 8px 24px rgba(0,0,0,.09);min-width:0}
#tcgCardDetail .tcg-card-toolbar .tcg-search-field{display:flex;flex-direction:column;min-width:0;gap:.4rem;width:100%;max-width:none;font-size:.73rem;letter-spacing:.065em;font-weight:800;color:var(--text-muted);text-transform:uppercase}
#tcgCardDetail .tcg-card-toolbar .tcg-search-field input{display:block;min-width:0;width:100%;height:45px;border:1px solid var(--border-color);border-radius:.7rem;background:var(--bg-input);padding:0 .9rem;font-size:.88rem;font-weight:500;color:var(--text-main);text-transform:none;letter-spacing:normal}
#tcgCardDetail .tcg-card-toolbar .tcg-search-field input:focus{outline:2px solid var(--accent-color);outline-offset:1px}
#tcgCardDetail .tcg-view-switch{display:flex;align-items:center;gap:4px;border:1px solid var(--border-color);border-radius:.75rem;padding:4px;background:var(--bg-input);min-width:0;align-self:end;overflow:visible}
#tcgCardDetail .tcg-view-switch button{min-height:36px;border:0;border-radius:.52rem;background:transparent;color:var(--text-muted);padding:.45rem .8rem;min-width:70px;display:inline-flex;align-items:center;justify-content:center;gap:.46rem;white-space:nowrap;font-size:.79rem;line-height:1.2;font-weight:780;transition:background .15s,color .15s,box-shadow .15s}
#tcgCardDetail .tcg-view-switch button:hover{background:var(--bg-hover);color:var(--text-main)}
#tcgCardDetail .tcg-view-switch button.tcg-view-active,#tcgCardDetail .tcg-view-switch button[aria-pressed="true"]{color:#fff;background:var(--accent-color);box-shadow:0 2px 8px rgba(0,0,0,.18)}
#tcgCardDetail .tcg-view-switch button.tcg-view-active:hover{filter:brightness(1.08)}
#tcgCardDetail .tcg-print-open{min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:.65rem;flex-shrink:0;border:1px solid var(--accent-color);border-radius:.7rem;background:var(--accent-color);color:white;font-size:.79rem;font-weight:800;padding:.55rem 1rem;white-space:nowrap;line-height:1.2;box-shadow:0 5px 16px rgba(0,0,0,.12)}
#tcgCardDetail #tcgPrintOpen[aria-expanded="true"]{filter:brightness(1.15)}
#tcgCardDetail .tcg-print-open:hover{filter:brightness(1.12)}
#tcgCardDetail .tcg-print-open:focus-visible,#tcgCardDetail .tcg-view-switch button:focus-visible{outline:2px solid var(--accent-color);outline-offset:3px}
#tcgCardDetail .tcg-print-settings{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr)) auto;gap:.85rem;align-items:end;border:1px solid var(--border-color);background:var(--bg-card);border-radius:.85rem;padding:1rem 1.15rem;min-width:0}
#tcgCardDetail .tcg-print-settings.hidden{display:none!important}
#tcgCardDetail .tcg-print-settings label{display:flex;flex-direction:column;gap:.45rem;min-width:0;font-size:.69rem;letter-spacing:.06em;text-transform:uppercase;font-weight:800;color:var(--text-muted)}
#tcgCardDetail .tcg-print-settings select{height:42px;min-width:0;width:100%;background:var(--bg-input);border:1px solid var(--border-color);border-radius:.6rem;color:var(--text-main);padding:.55rem;font-size:.83rem;font-weight:600;letter-spacing:normal;text-transform:none}
#tcgCardDetail .tcg-print-settings .tcg-print-help{grid-column:1/-1;font-size:.74rem;color:var(--text-muted);max-width:none;margin:0}
#tcgCardDetail .tcg-ownership-note{font-size:.75rem;line-height:1.5;color:var(--text-muted);margin:0}
#tcgCardDetail .gallery-summary{font-size:.78rem;color:var(--text-muted);margin-top:0}
#tcgCardDetail .tcg-gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(172px,1fr));gap:1rem;min-width:0}
#tcgCardDetail .tcg-printing-card{width:100%;min-width:0;overflow:hidden;border-radius:.85rem;border:1px solid var(--border-color);background:var(--bg-card)}
#tcgCardDetail .tcg-printing-card .tcg-art-frame{aspect-ratio:.70;overflow:hidden;position:relative;display:grid;place-items:center;isolation:isolate;padding:.48rem;background:var(--bg-input)}
#tcgCardDetail .tcg-printing-card .tcg-art-frame img{width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}
#tcgCardDetail .tcg-printing-details{padding:.8rem .85rem;display:flex;flex-direction:column;gap:.35rem;min-width:0}
#tcgCardDetail .tcg-printing-name{color:var(--text-main);font-size:.83rem;line-height:1.3;min-width:0}
#tcgCardDetail .tcg-quick-toggle{touch-action:manipulation;display:grid;place-items:center}
#tcgCardDetail .tcg-quick-toggle:focus-visible{outline:3px solid var(--accent-color);outline-offset:2px}
#tcgCardDetail .tcg-binder-controls{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:.75rem;align-items:center;justify-content:stretch}
#tcgCardDetail .tcg-binder-controls button{background:var(--bg-card);border:1px solid var(--border-color);border-radius:.65rem;padding:.72rem .9rem;min-height:44px;color:var(--text-main);font-size:.8rem;font-weight:800}
#tcgCardDetail .tcg-binder-controls button:last-child{justify-self:end}
#tcgCardDetail .tcg-binder-controls strong{font-size:.8rem;color:var(--text-main);text-align:center;white-space:nowrap}
#tcgCardDetail .tcg-binder-pocket{min-width:0}
#tcgCardDetail .tcg-binder-art .tcg-quick-toggle{width:30px;height:30px}
#tcgCardDetail .tcg-card-list-root{max-width:100%;overflow-x:auto}
#tcgCardDetail .tcg-card-list-root .tcg-list-table{min-width:620px;width:100%}
#tcgCardDetail .tcg-card-list-root .tcg-list-table button{position:static}
#tcgCardDetail .tcg-gallery-pager,#tcgCardDetail .gallery-pager{align-items:center;justify-content:center;gap:1rem;flex-wrap:wrap}
#tcgCardDetail .gallery-pager button{min-height:40px;padding:.6rem 1rem;border-radius:.6rem;background:var(--bg-card);border:1px solid var(--border-color);color:var(--text-main);font-weight:700}
#tcgCardDetail .gallery-pager button:disabled{opacity:.45}
@media(max-width:1080px){#tcgCardDetail .tcg-card-toolbar.tcg-view-toolbar{grid-template-columns:minmax(170px,1fr) auto}#tcgCardDetail .tcg-print-open{grid-column:2;justify-self:stretch}#tcgCardDetail .tcg-view-switch{grid-column:2;grid-row:1}#tcgCardDetail .tcg-print-settings{grid-template-columns:repeat(3,minmax(0,1fr))}#tcgCardDetail #tcgPrintGenerate{grid-column:1/-1}}
@media(max-width:760px){#tcgCardDetail .tcg-card-toolbar.tcg-view-toolbar{grid-template-columns:minmax(0,1fr);padding:.85rem;gap:.75rem}#tcgCardDetail .tcg-card-toolbar .tcg-search-field{grid-column:1;grid-row:auto}#tcgCardDetail .tcg-view-switch{grid-column:1;grid-row:auto;width:100%;justify-content:stretch}#tcgCardDetail .tcg-view-switch button{flex:1;min-width:0}#tcgCardDetail .tcg-print-open{grid-column:1;grid-row:auto;justify-self:stretch}#tcgCardDetail .tcg-print-settings{grid-template-columns:repeat(2,minmax(0,1fr));padding:.85rem}#tcgCardDetail .tcg-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem}#tcgCardDetail .tcg-detail-heading{gap:.65rem}#tcgCardDetail .tcg-detail-heading h3{line-height:1.15}#tcgCardDetail .tcg-printing-details{padding:.55rem .6rem}#tcgCardDetail .tcg-printing-name{font-size:.76rem}#tcgCardDetail .tcg-binder-book{padding:.5rem}#tcgCardDetail .tcg-binder-controls button{padding:.6rem .4rem;font-size:.72rem}#tcgCardDetail .tcg-printing-badge{font-size:.51rem!important}}
@media(max-width:430px){#tcgCardDetail .tcg-print-settings{grid-template-columns:minmax(0,1fr)}#tcgCardDetail #tcgPrintGenerate{grid-column:1}#tcgCardDetail .tcg-view-switch button{font-size:.76rem;padding:.5rem .4rem}#tcgCardDetail .tcg-binder-controls strong{white-space:normal;font-size:.69rem}}
@media(prefers-reduced-motion:reduce){#tcgCardDetail .tcg-view-switch button{transition:none}}
#tcgCardDetail .tcg-binder-controls button:first-child{justify-self:start}

/* One card image per numbered card: variants chosen below the art. */
#tcgCardDetail .tcg-unique-card .tcg-printing-details{gap:.6rem}
#tcgCardDetail .tcg-card-variant-row{display:flex;flex-direction:column;gap:.35rem;min-width:0;margin:.15rem 0}
#tcgCardDetail .tcg-variant-label{display:flex;flex-direction:column;gap:.3rem;font-size:.67rem;letter-spacing:.025em;font-weight:750;color:var(--text-muted);min-width:0}
#tcgCardDetail .tcg-variant-select{display:block;width:100%;min-width:0;height:36px;border:1px solid var(--border-color);border-radius:.5rem;background:var(--bg-input);color:var(--text-main);padding:.42rem .55rem;font-size:.75rem;font-weight:650;text-overflow:ellipsis;letter-spacing:0}
#tcgCardDetail .tcg-variant-select:focus-visible{outline:2px solid var(--accent-color);outline-offset:2px}
#tcgCardDetail .tcg-variant-count{font-size:.66rem;font-weight:600;color:var(--text-muted);line-height:1.25}
#tcgCardDetail .tcg-binder-caption .tcg-variant-select{height:29px;font-size:.64rem;padding:.2rem}
#tcgCardDetail .tcg-print-settings{grid-template-columns:repeat(4,minmax(130px,1fr)) auto}
@media(max-width:1100px){#tcgCardDetail .tcg-print-settings{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){#tcgCardDetail .tcg-print-settings{grid-template-columns:minmax(0,1fr)}}

/* v4: separate tile per physical printing, grouped into collection sections. */
#tcgCardDetail #tcgGalleryGrid.tcg-gallery-grid{display:block;min-width:0}
#tcgCardDetail .tcg-printing-section-nav{display:flex;gap:.4rem;flex-wrap:wrap;margin:0 0 1.7rem;align-items:center}
#tcgCardDetail .tcg-printing-section-chip{display:inline-flex;align-items:center;gap:.5rem;min-height:37px;padding:.46rem .75rem;background:var(--bg-card);border:1px solid var(--border-color);border-radius:.5rem;color:var(--text-main);font-size:.72rem;font-weight:800;line-height:1.2}
#tcgCardDetail .tcg-printing-section-chip:hover,#tcgCardDetail .tcg-printing-section-chip:focus-visible{border-color:var(--accent-color);color:var(--accent-color)}
#tcgCardDetail .tcg-section-count{display:inline-flex;padding:.16rem .4rem;background:var(--bg-input);color:var(--accent-color);border-radius:99px;font-size:.69rem}
#tcgCardDetail .tcg-printing-section{scroll-margin-top:1.1rem;margin-bottom:2.4rem}
#tcgCardDetail .tcg-printing-section + .tcg-printing-section{border-top:1px solid var(--border-color);padding-top:1.5rem}
#tcgCardDetail .tcg-printing-section-head{display:flex;gap:1rem;align-items:end;justify-content:space-between;margin-bottom:.8rem}
#tcgCardDetail .tcg-printing-eyebrow{display:block;font-size:.66rem;font-weight:800;letter-spacing:.13em;color:var(--text-muted);margin-bottom:.55rem}
#tcgCardDetail .tcg-printing-section-head h3{font-weight:850;color:var(--text-main);font-size:1.2rem;line-height:1.2;margin:0}
#tcgCardDetail .tcg-printing-section-head p{font-size:.72rem;color:var(--text-muted);line-height:1.45;margin:.25rem 0 0}
#tcgCardDetail .tcg-printing-progress{font-size:.69rem;color:var(--text-muted);border:1px solid var(--border-color);border-radius:99px;padding:.36rem .64rem;white-space:nowrap}
#tcgCardDetail .tcg-printing-section-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(165px,1fr));gap:.85rem;align-items:start}
#tcgCardDetail .tcg-variant-tile{min-width:0;overflow:hidden}
#tcgCardDetail .tcg-variant-tile .tcg-art-frame{padding:.36rem;aspect-ratio:.72}
#tcgCardDetail .tcg-variant-tile .tcg-printing-details{gap:.3rem}
#tcgCardDetail .tcg-printing-variant-name{font-size:.7rem;line-height:1.35;color:var(--text-muted);overflow-wrap:anywhere}
#tcgCardDetail .tcg-list-section-row th{padding:.8rem!important;background:var(--bg-input);color:var(--text-main);text-align:left}
#tcgCardDetail .tcg-binder-printing-name{font-size:.59rem!important;overflow-wrap:anywhere;white-space:normal}
@media(max-width:680px){#tcgCardDetail .tcg-printing-section-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:.57rem}#tcgCardDetail .tcg-printing-section-head{align-items:start;flex-direction:column;gap:.45rem}#tcgCardDetail .tcg-printing-section-head h3{font-size:1.05rem}#tcgCardDetail .tcg-printing-section-chip{font-size:.66rem}#tcgCardDetail .tcg-printing-progress{margin-top:.2rem}}

/* --- tcg-admin-v7.css --- */
/* Collectors Hub TCG Gallery v7 — no per-card owned quantity, protected admin editor */
.tcg-ownership-indicator { display: none !important; }
.tcg-admin-bar[hidden],.tcg-admin-overlay[hidden],.tcg-admin-image-preview[hidden] { display:none !important; }
.tcg-admin-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0 14px;padding:12px 16px;border:1px solid rgba(99,162,252,.3);border-radius:12px;background:rgba(46,89,151,.12);color:var(--text-color,#b8d4fb);font-size:.88rem;font-weight:600}
.tcg-admin-edit-btn{appearance:none;border:1px solid rgba(99,162,252,.6)!important;border-radius:8px;background:#183965!important;color:#eaf3ff!important;padding:8px 12px;font-size:.79rem;font-weight:650;cursor:pointer;transition:background .15s ease}
.tcg-admin-edit-btn:hover,.tcg-admin-edit-btn:focus-visible{background:#2760a0!important;outline:2px solid #64a9ff;outline-offset:2px}
.tcg-admin-card-btn{margin-top:8px;align-self:flex-start}
.tcg-binder-caption .tcg-admin-edit-btn{padding:4px 7px;font-size:.68rem;margin:3px auto 0}
.tcg-list-table .tcg-admin-edit-btn{margin-left:8px;white-space:nowrap}
.tcg-admin-overlay{position:fixed;inset:0;background:rgba(5,10,20,.88);display:flex;align-items:center;justify-content:center;padding:18px;z-index:99999;overflow-y:auto}
.tcg-admin-dialog{width:min(700px,100%);max-height:calc(100vh - 36px);overflow-y:auto;border:1px solid #4675ac;border-radius:16px;background:#182439;color:#e5edf8;box-shadow:0 20px 75px rgba(0,0,0,.5);padding:20px 22px}
.tcg-admin-dialog-top{display:flex;justify-content:space-between;align-items:center;gap:10px}
.tcg-admin-dialog-top h2{font-size:1.24rem;font-weight:800;line-height:1.3}
.tcg-admin-dialog-top button{border:1px solid #50627b;border-radius:9px;background:#243248;color:#fff;font-size:1.6rem;line-height:1;padding:3px 10px;cursor:pointer}
.tcg-admin-note,.tcg-admin-id{font-size:.83rem;color:#b6c9e2;margin:9px 0 12px}
.tcg-admin-id{padding:8px;background:#111d31;border-radius:7px;overflow-wrap:anywhere}
#tcgAdminFields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.tcg-admin-field{display:flex;flex-direction:column;gap:5px;font-size:.83rem;font-weight:650;min-width:0}
.tcg-admin-field:has(textarea),.tcg-admin-field:has([name="imageUrl"]),.tcg-admin-field:has([name="logoUrl"]),.tcg-admin-field:has([name="symbolUrl"]),.tcg-admin-id{grid-column:1/-1}
.tcg-admin-field input,.tcg-admin-field textarea,.tcg-admin-field select,.tcg-admin-image-label input{background:#0e1a2c!important;color:#edf5ff!important;border:1px solid #445d79!important;border-radius:8px!important;box-sizing:border-box!important;padding:9px 10px!important;width:100%!important;min-width:0}
.tcg-admin-field textarea{resize:vertical;font-family:ui-monospace,Consolas,monospace;font-size:.78rem;line-height:1.4}
.tcg-admin-field small{font-weight:400;color:#a8bad2;font-size:.74rem;line-height:1.45}
.tcg-admin-image-label{display:flex;flex-direction:column;gap:8px;font-size:.82rem;font-weight:650;margin:14px 0}
.tcg-admin-image-preview{display:flex;justify-content:center;margin:10px 0;border:1px solid #3f5576;padding:12px;border-radius:10px;background:#0e192b}
.tcg-admin-image-preview img{max-height:220px;max-width:100%;object-fit:contain}
#tcgAdminMessage{min-height:1.45em;color:#9fd4aa;font-size:.83rem;margin:8px 0}
#tcgAdminMessage.is-error{color:#ffb2ab}
.tcg-admin-dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:12px}
.tcg-admin-dialog-actions button{border-radius:8px;border:1px solid #53708d;padding:10px 18px;background:#253650;color:#fff;cursor:pointer;font-weight:700}
#tcgAdminSave{background:#2571c2;border-color:#3d92f0}
#tcgAdminSave:disabled{opacity:.5;cursor:wait}
@media(max-width:620px){#tcgAdminFields{grid-template-columns:1fr}.tcg-admin-dialog{padding:14px}.tcg-admin-bar{flex-wrap:wrap}}

/* --- collection-games-v24.css --- */
/* Collectors Hub v24 — game systems on collection dashboard and cards */
.collection-item-system {font-size:11px; color:var(--text-muted,#92b4df); margin:3px 0 8px; line-height:1.35; white-space:normal;}
.collection-item-system i {font-size:10px; margin-right:5px; opacity:.85;}
.list-view-item .collection-item-system {margin:3px 0 0;}

/* --- tcg-view-fix-v9.css --- */
/* Gallery v8: three mutually exclusive views. Grid and List show everything, without pagination. */
/* Older detail CSS forces #tcgGalleryGrid to display:block; this override is required. */
#tcgCardDetail #tcgGalleryGrid.hidden,
#tcgCardDetail #tcgGalleryGrid[hidden],
#tcgCardDetail #tcgBinderRoot.hidden,
#tcgCardDetail #tcgBinderRoot[hidden],
#tcgCardDetail #tcgListRoot.hidden,
#tcgCardDetail #tcgListRoot[hidden],
#tcgCardDetail #tcgGalleryPager { display: none !important; }


/* Gallery v9 — fix legacy flex-on-<td> rule breaking five-column table geometry. */
#tcgCardDetail .tcg-card-list-root { max-width:100%; overflow-x:auto; }
#tcgCardDetail .tcg-list-table-v9 {
  display:table;
  table-layout:fixed;
  border-collapse:collapse;
  border-spacing:0;
  width:100%;
  min-width:700px;
  font-size:.8rem;
}
#tcgCardDetail .tcg-list-table-v9 thead { display:table-header-group; }
#tcgCardDetail .tcg-list-table-v9 tbody { display:table-row-group; }
#tcgCardDetail .tcg-list-table-v9 tr { display:table-row; }
#tcgCardDetail .tcg-list-table-v9 th,
#tcgCardDetail .tcg-list-table-v9 td,
#tcgCardDetail .tcg-list-table-v9 td:first-child {
  display:table-cell !important;
  vertical-align:middle;
  box-sizing:border-box;
  border-bottom:1px solid var(--border-color);
  text-align:left;
  padding:.65rem .8rem;
  height:auto;
}
#tcgCardDetail .tcg-list-table-v9 .tcg-list-col-card { width:31%; }
#tcgCardDetail .tcg-list-table-v9 .tcg-list-col-number { width:10%; }
#tcgCardDetail .tcg-list-table-v9 .tcg-list-col-printing { width:23%; }
#tcgCardDetail .tcg-list-table-v9 .tcg-list-col-rarity { width:16%; }
#tcgCardDetail .tcg-list-table-v9 .tcg-list-col-collection { width:20%; }
#tcgCardDetail .tcg-list-table-v9 thead th {
  font-weight:800;
  font-size:.68rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  white-space:nowrap;
}
#tcgCardDetail .tcg-list-table-v9 .tcg-list-section-row th {
  display:table-cell !important;
  padding:.9rem .8rem !important;
  height:auto;
}
#tcgCardDetail .tcg-list-table-v9 .tcg-list-card-content {
  display:flex;
  align-items:center;
  gap:.75rem;
  min-width:0;
}
#tcgCardDetail .tcg-list-table-v9 .tcg-list-card-content img {
  display:block;
  width:38px;
  height:52px;
  flex:0 0 38px;
  object-fit:contain;
  border-radius:.2rem;
}
#tcgCardDetail .tcg-list-table-v9 .tcg-list-card-content strong {
  display:block;
  min-width:0;
  font-size:.82rem;
  font-weight:750;
  line-height:1.35;
  overflow-wrap:anywhere;
}
#tcgCardDetail .tcg-list-table-v9 .tcg-list-collection-controls {
  display:flex;
  flex-wrap:wrap;
  gap:.65rem;
  align-items:center;
  min-width:0;
}
#tcgCardDetail .tcg-list-table-v9 .tcg-quick-toggle {
  position:static;
  display:inline-grid;
  flex:0 0 32px;
  width:32px;
  height:32px;
  margin:0;
}
#tcgCardDetail .tcg-list-table-v9 .tcg-admin-card-btn {
  position:static;
  margin:0;
  white-space:nowrap;
  min-height:31px;
}
#tcgCardDetail .tcg-list-table-v9 .tcg-ownership-indicator[hidden] { display:none!important; }
#tcgCardDetail .tcg-list-table-v9 .tcg-save-message:empty { display:none; }
#tcgCardDetail .tcg-list-table-v9 td:nth-child(2) { white-space:nowrap; font-variant-numeric:tabular-nums; }
#tcgCardDetail .tcg-list-table-v9 td:nth-child(3) { overflow-wrap:anywhere; }
#tcgCardDetail .tcg-list-table-v9 tbody tr.tcg-list-card-row:hover td { background:var(--bg-input); }
@media (max-width:780px){
  #tcgCardDetail .tcg-list-table-v9 { min-width:750px; }
  #tcgCardDetail .tcg-list-table-v9 td,
  #tcgCardDetail .tcg-list-table-v9 th { padding:.55rem .65rem; }
}

/* --- tcg-art-admin-v11.css --- */
/* Art Pokédex and card-profile editor. Scoped to the TCG pages. */
#tcgArtPokedex.hidden,#tcgAdminOverlay[hidden],#tcgArtMore[hidden],#tcgAdminPreviewWrap[hidden]{display:none!important}
.tcg-admin-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.tcg-art-open-btn{border:1px solid #627ba5;border-radius:9px;background:#233e68;color:#eff7ff;padding:10px 16px;font-weight:800;white-space:nowrap;cursor:pointer}
.tcg-art-open-btn:hover{background:#30588d}
.tcg-admin-image-click{cursor:pointer;outline-offset:3px}
.tcg-admin-image-click:hover{outline:2px solid #65aaff}
.tcg-admin-dialog{width:min(1040px,98vw)!important;max-height:min(94vh,1100px)!important;padding:22px!important}
.tcg-admin-dialog-top h2{font-size:clamp(1.35rem,2.8vw,2.25rem)!important}
.tcg-admin-note{max-width:770px}
.tcg-editor-layout{display:grid;grid-template-columns:minmax(210px,300px) minmax(0,1fr);align-items:start;gap:28px;margin-top:18px}
.tcg-editor-art-panel{position:sticky;top:4px;display:flex;flex-direction:column;gap:14px;background:#101b2e;border:1px solid #3b5575;border-radius:14px;padding:17px}
.tcg-editor-art-panel .catalogue-eyebrow{font-size:.72rem;letter-spacing:.12em;color:#9fbcde}
.tcg-editor-art-panel .tcg-admin-image-preview{padding:0;margin:0;border:0;background:transparent;display:flex!important;align-items:center;justify-content:center;min-height:160px}
.tcg-editor-art-panel .tcg-admin-image-preview[hidden]{display:none!important}
.tcg-editor-art-panel .tcg-admin-image-preview img{max-height:360px;max-width:100%;object-fit:contain;border-radius:10px}
.tcg-editor-art-panel .tcg-admin-image-label{margin:0;color:#dbeafe;line-height:1.5}
.tcg-editor-help{font-size:.77rem;line-height:1.5;color:#9eb0c9}
.tcg-editor-info-panel{min-width:0}
.tcg-editor-info-panel #tcgAdminFields{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.tcg-editor-info-panel .tcg-admin-field:has([name="artGroup"]),
.tcg-editor-info-panel .tcg-admin-field:has([name="variantsJson"]),
.tcg-editor-info-panel .tcg-admin-field:has([name="imageUrl"]){grid-column:1/-1}
#tcgAdminFields .tcg-admin-field>span{color:#b2c9e8}
.tcg-art-pokedex{padding:8px 0 30px}
.tcg-art-hero{display:flex;justify-content:space-between;gap:16px;align-items:center;border-bottom:1px solid #34506c;padding:19px 0 26px}
.tcg-art-hero h2{font-size:clamp(2rem,4vw,3.8rem);font-weight:850;line-height:1.16;margin:9px 0 8px;color:#f3f7ff}
.tcg-art-hero p{max-width:730px;font-size:.93rem;line-height:1.55;color:#a7c3e6}
.tcg-art-stats{display:flex;gap:11px;flex-wrap:wrap;margin:20px 0}
.tcg-art-stats>div{display:flex;flex-direction:column;min-width:130px;padding:12px 19px;border:1px solid #375579;background:#1b2c45;border-radius:12px}
.tcg-art-stats strong{font-weight:800;font-size:1.52rem;color:#f4f8ff}
.tcg-art-stats span{font-size:.76rem;color:#a7c1e2}
.tcg-art-filters{display:flex;align-items:end;flex-wrap:wrap;gap:12px;background:#1a2941;border:1px solid #344963;padding:15px;border-radius:13px;margin:12px 0 20px}
.tcg-art-filters label{display:flex;flex-direction:column;gap:6px;font-size:.79rem;letter-spacing:.02em;color:#bad0eb;font-weight:650;min-width:150px}
.tcg-art-filters label:first-child{flex:1 1 240px}
.tcg-art-filters input,.tcg-art-filters select{padding:11px 12px;border-radius:9px;background:#101c30;color:#eef5ff;border:1px solid #526881;min-width:0;max-width:100%}
.tcg-art-view-switch{display:flex;border:1px solid #425b79;border-radius:9px;overflow:hidden}
.tcg-art-view-switch button{padding:11px 14px;background:#213651;color:#d2e0f4;border:0;cursor:pointer}
.tcg-art-view-switch button.is-active{background:#397bd1;color:#fff;font-weight:750}
#tcgArtStatus{min-height:1.5em;font-size:.82rem;color:#9abce7;margin-bottom:14px}
.tcg-art-pokedex-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(165px,1fr));gap:15px}
.tcg-art-pokedex-card{min-width:0;background:#1c293e;border:1px solid #39506b;border-radius:11px;overflow:hidden;display:flex;flex-direction:column;transition:box-shadow .18s ease}
.tcg-art-pokedex-card:hover{box-shadow:0 5px 24px #09152d}
.tcg-art-pokedex-card.is-owned{border-color:#2ba681}
.tcg-art-picture{position:relative;display:flex;align-items:center;justify-content:center;padding:12px;background:#253c5b;min-height:195px}
.tcg-art-picture img{display:block;width:100%;height:225px;object-fit:contain}
.tcg-art-quick-toggle{position:absolute;top:7px;right:7px;z-index:1;border:2px solid #7798bb;background:#0d1b2e;color:#fff;font-size:1.2rem;font-weight:800;width:36px;height:36px;border-radius:50%;cursor:pointer}
.tcg-art-quick-toggle.is-owned{background:#117e5b;border-color:#3fdab7}
.tcg-art-quick-toggle:disabled{opacity:.45;cursor:wait}
.tcg-art-group-pill{position:absolute;left:9px;bottom:9px;background:#12223b;color:#eaf2fb;border:1px solid #5a7b9a;padding:3px 8px;border-radius:6px;font-size:.66rem;font-weight:800;text-transform:uppercase}
.tcg-art-card-copy{display:flex;flex-direction:column;gap:6px;padding:13px;flex:1}
.tcg-art-card-copy small{color:#9fb8d7;font-size:.65rem;line-height:1.35}
.tcg-art-card-copy strong{font-size:.9rem;color:#f3f7ff;overflow-wrap:anywhere}
.tcg-art-card-copy>span{font-size:.77rem;color:#b7cee9}
.tcg-art-card-footer{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-top:auto;padding-top:12px}
.tcg-art-card-footer span{font-size:.69rem;color:#9fb8d7}
.tcg-art-open-set{border:1px solid #5276a7;color:#ecf6ff;border-radius:8px;padding:5px 8px;background:#254774;cursor:pointer;font-size:.7rem}
.tcg-art-list{border-collapse:collapse;width:100%;table-layout:fixed}
.tcg-art-list th{text-align:left;background:#2a3c57;color:#bdd2ec;padding:14px 10px;font-size:.74rem}
.tcg-art-list td{padding:10px;border-bottom:1px solid #334961;color:#e8f2ff;vertical-align:middle;font-size:.84rem;overflow-wrap:anywhere}
.tcg-art-list-identity{display:flex;gap:12px;align-items:center}
.tcg-art-list-identity img{height:54px;max-width:42px;object-fit:contain}
.tcg-art-list .tcg-art-quick-toggle{position:static;display:inline-flex;align-items:center;justify-content:center}
.tcg-art-binder-controls{display:flex;justify-content:center;align-items:center;gap:20px;margin:15px 0}
.tcg-art-binder-controls button,.tcg-art-load-more{padding:10px 18px;border-radius:8px;border:1px solid #5779a5;background:#254872;color:#fff;cursor:pointer}
.tcg-art-binder-controls button:disabled{opacity:.4;cursor:default}
.tcg-art-binder-page{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;max-width:920px;margin:auto;padding:22px;border-radius:15px;border:3px solid #345274;background:#111c30}
.tcg-art-binder-page .tcg-art-picture img{height:270px}
.tcg-art-load-more{display:block;margin:22px auto}
.tcg-art-empty{padding:30px;text-align:center;color:#b2c9df}
@media(max-width:740px){.tcg-editor-layout{grid-template-columns:1fr}.tcg-editor-art-panel{position:static}.tcg-editor-info-panel #tcgAdminFields{grid-template-columns:1fr}.tcg-art-hero{align-items:flex-start;flex-direction:column}.tcg-art-binder-page{gap:7px;padding:8px}.tcg-art-binder-page .tcg-art-picture{padding:3px;min-height:110px}.tcg-art-binder-page .tcg-art-picture img{height:160px}.tcg-art-binder-page .tcg-art-card-copy{padding:6px}.tcg-art-binder-page .tcg-art-open-set{font-size:.62rem}.tcg-art-binder-page .tcg-art-group-pill{font-size:.48rem}}

.tcg-editor-price-note{padding:11px 12px;border:1px solid #385373;background:#172942;border-radius:9px;color:#bad6f6;font-size:.8rem;line-height:1.45}

.tcg-editor-printings{grid-column:1/-1;display:flex;flex-direction:column;gap:11px;border:1px solid #345170;border-radius:10px;background:#101d30;padding:13px}
.tcg-editor-printings-title{font-size:.83rem;color:#e6f3ff}
.tcg-editor-printing-chips{display:flex;gap:7px;flex-wrap:wrap}
.tcg-editor-printing-chips span{font-size:.75rem;font-weight:700;background:#26446d;border:1px solid #5e85ad;border-radius:7px;color:#e4f3ff;padding:5px 9px}
.tcg-editor-printing-controls{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.tcg-editor-printing-controls select,.tcg-editor-printing-controls input{flex:1;min-width:130px;padding:8px;border:1px solid #405f82;background:#0c182b;color:#fff;border-radius:7px}
.tcg-editor-printing-controls input[hidden]{display:none!important}
.tcg-editor-printing-controls button{background:#2c66a4;border:1px solid #4c8cce;border-radius:7px;padding:8px 13px;color:#fff;font-weight:700;cursor:pointer}

/* Art Pokédex v12: long named gallery captions stay inside each card */
.tcg-art-group-pill{max-width:calc(100% - 20px);white-space:normal;overflow-wrap:anywhere;line-height:1.2;text-align:left}
.tcg-art-filters label:has(#tcgArtGroup){flex:0 1 320px;min-width:220px}

/* --- tcg-art-scope-v31.css --- */
/* v43: Keep both Pokémon Dex shortcuts aligned with the left edge of the
   game browser, including when the administrator-only editing tools appear.
   Applies only to the Pokémon Dex launch row; existing game-ID visibility
   is controlled by the website JavaScript and remains unchanged. */
#tcgArtEntryRow[hidden],
#tcgOpenArtPokedex[hidden],
#tcgOpenTrainerDex[hidden] { display: none !important; }

#tcgGameWorkspace #tcgArtEntryRow {
    display: flex;
    justify-content: flex-start !important;
    align-items: center;
    align-content: flex-start;
    flex-flow: row wrap;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin: 0 0 12px 0;
    padding: 12px 0;
    text-align: left;
}
#tcgGameWorkspace #tcgArtEntryRow > .tcg-art-open-btn {
    flex: 0 0 auto;
    margin-left: 0;
    margin-right: 0;
}
@media (max-width: 480px) {
    #tcgGameWorkspace #tcgArtEntryRow { gap: 8px; }
}

/* --- tcg-import-v33.css --- */
/* Collectors Hub v32 — inherit the existing blue/theme-variable styling. */
.tcg-import-panel[hidden],.tcg-import-source[hidden],#tcgImportOpen[hidden]{display:none!important}
.tcg-import-panel{margin:12px 0 20px;padding:clamp(14px,2.5vw,24px);border:1px solid var(--border-color,var(--border,#425065));border-radius:15px;background:var(--card-bg,var(--bg-card,#1f2937));color:var(--text-color,inherit);box-shadow:0 5px 24px #00000014}
.tcg-import-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;flex-wrap:wrap;border-bottom:1px solid var(--border-color,#546174);padding-bottom:14px;margin-bottom:15px}
.tcg-import-head h3{font-size:1.15rem;font-weight:750;margin:3px 0 4px;color:var(--text-primary,inherit)}
.tcg-import-head p,.tcg-import-note{color:var(--text-muted,#97a5b9);font-size:.84rem;line-height:1.5}
.tcg-import-formrow{display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin-bottom:13px}
.tcg-import-formrow label,.tcg-import-jsonlabel,.tcg-import-file{display:flex;flex-direction:column;gap:6px;font-size:.83rem;font-weight:650}
.tcg-import-grow{flex:1 1 230px}
.tcg-import-panel select,.tcg-import-panel input[type="search"],.tcg-import-panel textarea,.tcg-import-panel input[type="file"]{width:100%;max-width:100%;border:1px solid var(--border-color,#576579);border-radius:8px;background:var(--input-bg,var(--bg-input,#17202e));color:var(--text-color,#f8f8f8);font:inherit;padding:9px 11px}
.tcg-import-panel textarea{min-height:160px;font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;resize:vertical}
.tcg-import-source{display:grid;gap:8px}
.tcg-import-results{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr));gap:8px;max-height:290px;overflow:auto;margin-top:5px;scrollbar-width:thin}
.tcg-import-set{appearance:none;border:1px solid var(--border-color,#536076);border-radius:10px;background:var(--input-bg,#17202e);color:inherit;padding:11px;text-align:left;cursor:pointer;display:flex;flex-direction:column;gap:4px;min-width:0}
.tcg-import-set strong{font-size:.86rem;font-weight:700;overflow-wrap:anywhere}
.tcg-import-set small{font-size:.75rem;color:var(--text-muted,#9caebf);overflow-wrap:anywhere}
.tcg-import-set[aria-pressed="true"]{outline:2px solid #60a5fa;outline-offset:-2px;border-color:#60a5fa}
.tcg-import-set:hover{border-color:#6b9cff}
.tcg-import-actions{display:flex;gap:9px;flex-wrap:wrap;margin:18px 0 12px}
.tcg-import-actions button:disabled,.tcg-import-formrow button:disabled{opacity:.5;cursor:not-allowed}
.tcg-import-confirm:not(:disabled){background:#247c6a;border-color:#289b7f;color:#fff}
.tcg-import-summary{font-size:.85rem;display:grid;gap:5px}
.tcg-import-totals{font-weight:800;color:var(--text-primary,inherit);margin-bottom:4px}
.tcg-import-preview-line{border-left:3px solid #4394ee;padding:5px 10px;background:#3c85cf12}
.tcg-import-message{min-height:1.1rem;color:var(--text-muted,#96a6b8);font-size:.86rem;margin-top:8px;overflow-wrap:anywhere}
.tcg-import-message[data-state="error"]{color:#e58b8b}
.tcg-import-message[data-state="success"]{color:#5bc69d}
@media(max-width:640px){.tcg-import-head{flex-direction:column}.tcg-import-formrow>*{width:100%}.tcg-import-actions button{flex:1 1 150px}}

/* --- catalogue-item-page-v19.css --- */
/* Collectors Hub v19: full-page collection details; no copy-link buttons. */
.item-detail-page{width:100%;max-width:1120px;margin:0 auto;padding:0 0 3rem;}
.item-detail-topbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:0 0 1.25rem;}
.item-detail-back,.item-detail-edit{display:inline-flex;gap:.55rem;align-items:center;border:1px solid var(--border-color,#45617c);background:var(--card-bg,#25364e);color:var(--text-main,#f4f8ff);padding:.7rem .95rem;border-radius:.7rem;font-weight:600;font-size:.9rem;cursor:pointer;}
.item-detail-back:hover,.item-detail-edit:hover{background:var(--input-bg,#354962);}
.item-detail-kicker{font-size:.7rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--text-muted,#9fb0c6);}
.item-detail-surface{background:var(--card-bg,#1f2b40);border:1px solid var(--border-color,#41516c);border-radius:1.1rem;padding:clamp(1rem,3vw,2rem);box-shadow:0 12px 34px rgba(0,0,0,.14);}
.item-detail-columns{display:grid;grid-template-columns:minmax(240px, .82fr) minmax(0,1.18fr);gap:clamp(1rem,3vw,2.5rem);align-items:start;}
.item-detail-artwork,.item-detail-information{min-width:0;}
.item-detail-artwork>div{max-width:460px;margin:0 auto;}
.item-detail-information{display:flex;flex-direction:column;}
.item-detail-information h2{font-size:clamp(1.5rem,2.5vw,2.4rem);overflow-wrap:anywhere;}
.item-detail-edit{margin:.6rem 0 1rem;align-self:flex-start;}
.item-detail-information .space-y-3>div{gap:.5rem;}
.item-detail-information .space-y-3>div>span:last-child{overflow-wrap:anywhere;text-align:right;}
.tcg-direct-target{outline:3px solid #5bbdff!important;outline-offset:3px;box-shadow:0 0 0 5px rgba(41,141,216,.25)!important;scroll-margin:6rem;}
@media(max-width:720px){.item-detail-columns{grid-template-columns:minmax(0,1fr)}.item-detail-artwork>div{max-width:350px}.item-detail-kicker{display:none}.item-detail-surface{border-radius:.85rem;}.item-detail-information h2{font-size:1.7rem;}}

/* --- tcg-game-chooser-v20.css --- */
/* Collectors Hub v20 — responsive TCG game-selection landing page. */
#page-tcg #tcgGameBrowse.hidden,
#page-tcg #tcgGameWorkspace.hidden{display:none!important}
.tcg-games-browser{max-width:1280px;margin-inline:auto}
.tcg-games-heading{display:flex;justify-content:space-between;align-items:end;margin:0 0 1.25rem}
.tcg-games-heading h3{font-size:1.45rem;line-height:1.25;font-weight:750;color:var(--text-primary,var(--text-color,inherit));margin:.25rem 0}
.tcg-games-heading p{color:var(--text-secondary,#a0a6b7);font-size:.96rem}
.tcg-games-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,265px),1fr));gap:1rem}
.tcg-game-cell{min-width:0}
.tcg-game-choice{width:100%;min-height:235px;display:flex;flex-direction:column;align-items:stretch;text-align:left;gap:.85rem;padding:1.1rem;border:1px solid var(--border-color,rgba(134,154,190,.23));border-radius:15px;background:var(--bg-card,rgba(70,91,126,.08));color:inherit;cursor:pointer;transition:border-color .15s,transform .15s,box-shadow .15s;box-shadow:0 3px 14px rgba(0,0,0,.07)}
.tcg-game-choice:hover,.tcg-game-choice:focus-visible{border-color:var(--accent,#8c9cf9);box-shadow:0 5px 22px rgba(0,0,0,.15);transform:translateY(-2px);outline-offset:2px}
.tcg-game-choice-art{height:110px;min-height:110px;width:100%;display:flex;align-items:center;justify-content:center;border-radius:11px;background:rgba(127,143,176,.075);overflow:hidden}
.tcg-game-choice-art img{max-height:92px;max-width:90%;width:auto;height:auto;object-fit:contain}
.tcg-game-choice-art .tcg-logo-fallback{font-size:2rem;font-weight:800;color:var(--text-primary,inherit);opacity:.75;letter-spacing:.1em}
.tcg-game-choice-info{display:flex;flex-direction:column;gap:.28rem;min-width:0}
.tcg-game-choice-info strong{font-size:1.11rem;line-height:1.3;word-wrap:break-word}
.tcg-game-choice-info small{font-size:.84rem;color:var(--text-secondary,#a0a6b7)}
.tcg-game-choice-action{margin-top:auto;font-size:.83rem;font-weight:700;color:var(--accent,#8c9cf9)}
.tcg-games-message{color:var(--text-secondary,#a0a6b7);font-size:.9rem;min-height:1.1em;margin:.8rem 0}
.tcg-games-back-row{margin:0 0 .9rem}
@media(max-width:620px){.tcg-games-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,180px),1fr));gap:.7rem}.tcg-game-choice{min-height:200px;padding:.85rem}.tcg-game-choice-art{height:88px;min-height:88px}.tcg-game-choice-art img{max-height:70px}}
@media(max-width:410px){.tcg-games-grid{grid-template-columns:1fr 1fr}.tcg-game-choice-info strong{font-size:.95rem}.tcg-game-choice{padding:.7rem;min-height:198px}}
@media(prefers-reduced-motion:reduce){.tcg-game-choice{transition:none}.tcg-game-choice:hover{transform:none}}

/* --- tcg-game-meta-v25.css --- */
/* Preserve existing Trading Cards theme; fit admin editing into each game tile. */
.tcg-game-cell { min-width:0; }
.tcg-game-cell > .tcg-game-choice { width:100%; }
.tcg-game-choice-info { min-width:0; }
.tcg-game-choice-info small {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  overflow:hidden;
  white-space:normal;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.tcg-game-edit-btn {
  display:block;
  margin:8px 0 2px auto;
  padding:7px 10px;
  font-size:.82rem;
  max-width:100%;
  text-align:center;
}
/* Existing .tcg-admin-edit-btn styles provide the theme colors. */
.tcg-game-edit-btn[hidden], #tcgEditGame[hidden] { display:none !important; }
#tcgGameWorkspace .tcg-series-toolbar { flex-wrap:wrap; }
#tcgAdminFields [name="description"] { min-height:120px; resize:vertical; }

/* --- art-pokedex-options-v15.css --- */
/* Art Pokédex v15 — source-inspired filter rail, scoped to the Art Pokédex. */
#tcgArtPokedex .tcg-art-page-layout{display:grid;grid-template-columns:minmax(225px,270px) minmax(0,1fr);gap:20px;align-items:start;margin-top:16px}
#tcgArtPokedex .tcg-art-filter-rail{background:#111b2c;border:1px solid #354b66;border-radius:12px;overflow:hidden;position:sticky;top:12px;max-height:calc(100vh - 24px);overflow-y:auto}
#tcgArtPokedex .tcg-art-filter-heading{font-size:.83rem;font-weight:800;padding:15px 16px;border-bottom:1px solid #354b66;color:#eff5ff}
#tcgArtPokedex .tcg-art-filter-form{display:flex;flex-direction:column;gap:12px;padding:14px}
#tcgArtPokedex .tcg-art-filter-form>label{display:flex;flex-direction:column;gap:6px;font-size:.74rem;font-weight:700;color:#a9c2e2;letter-spacing:.02em}
#tcgArtPokedex .tcg-art-filter-form>label>input,#tcgArtPokedex .tcg-art-filter-form>label>select{display:block;width:100%;min-width:0;border:1px solid #455b75;border-radius:8px;background:#0f192a;color:#e9f2ff;padding:10px;font:inherit;font-size:.82rem;min-height:40px}
#tcgArtPokedex .tcg-art-filter-form>label>input:focus-visible,#tcgArtPokedex .tcg-art-filter-form>label>select:focus-visible{outline:2px solid #6ab5ff;outline-offset:1px}
#tcgArtPokedex .tcg-art-filter-toggles{display:flex;flex-direction:column;gap:7px;border:0;border-top:1px solid #34485f;margin:4px 0 0;padding:13px 0 0;min-width:0}
#tcgArtPokedex .tcg-art-filter-toggles legend{font-size:.75rem;font-weight:800;color:#e2edfc;padding:0 4px}
#tcgArtPokedex .tcg-art-filter-toggle{display:flex;gap:10px;align-items:flex-start;padding:10px 8px;cursor:pointer;border:1px solid #2b3e55;border-radius:9px;background:#0e1827;font-size:inherit;letter-spacing:normal;color:inherit}
#tcgArtPokedex .tcg-art-filter-toggle:hover{border-color:#5479a5}
#tcgArtPokedex .tcg-art-filter-toggle input[type=checkbox]{appearance:none;-webkit-appearance:none;display:block;position:relative;flex:0 0 31px;width:31px;height:18px;min-width:0;margin:2px 0 0;border:1px solid #577089;border-radius:999px;background:#263442;cursor:pointer}
#tcgArtPokedex .tcg-art-filter-toggle input[type=checkbox]::after{content:"";display:block;position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#aebfd1;transition:transform .12s ease}
#tcgArtPokedex .tcg-art-filter-toggle input[type=checkbox]:checked{background:#2478cf;border-color:#7dbeff}
#tcgArtPokedex .tcg-art-filter-toggle input[type=checkbox]:checked::after{transform:translateX(13px);background:#fff}
#tcgArtPokedex .tcg-art-filter-toggle input[type=checkbox]:focus-visible{outline:2px solid #a6d4ff;outline-offset:3px}
#tcgArtPokedex .tcg-art-filter-toggle>span{display:flex;flex-direction:column;gap:4px;min-width:0;line-height:1.25}
#tcgArtPokedex .tcg-art-filter-toggle strong{font-size:.79rem;font-weight:750;color:#e6f1fe;overflow-wrap:anywhere}
#tcgArtPokedex .tcg-art-filter-toggle small{font-size:.68rem;line-height:1.45;color:#9eb5cf}
#tcgArtPokedex .tcg-art-filter-apply{min-height:42px;background:#e2eaf4;border:1px solid #d0d9e6;border-radius:8px;color:#142035;font-weight:800;cursor:pointer}
#tcgArtPokedex .tcg-art-filter-apply:hover{background:#fff}
#tcgArtPokedex .tcg-art-filter-clear{background:transparent;border:0;color:#b2c8df;cursor:pointer;font-size:.78rem;padding:6px 10px}
#tcgArtPokedex .tcg-art-filter-help{padding:13px 14px 18px;background:#111b2c;border-top:1px solid #354b66;color:#91aaca;font-size:.73rem;line-height:1.6}
#tcgArtPokedex .tcg-art-results-panel{min-width:0;overflow-x:auto}
#tcgArtPokedex .tcg-art-results-toolbar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:12px;border-bottom:1px solid #344b68;padding-bottom:11px}
#tcgArtPokedex .tcg-art-results-title{font-size:.77rem;text-transform:uppercase;letter-spacing:.09em;color:#a6c4e6;font-weight:800}
#tcgArtPokedex .tcg-art-want-toggle{position:absolute;top:7px;left:7px;z-index:2;width:35px;height:35px;border:2px solid #637991;border-radius:50%;background:#112032;color:#e0e8f7;font-size:1.27rem;line-height:1;display:inline-flex;justify-content:center;align-items:center;cursor:pointer;padding:0}
#tcgArtPokedex .tcg-art-want-toggle.is-wanted{color:#ffdc65;border-color:#e7b85b;background:#3b3020}
#tcgArtPokedex .tcg-art-want-toggle:hover{border-color:#ffcf52}
#tcgArtPokedex .tcg-art-want-toggle:disabled{opacity:.5;cursor:wait}
#tcgArtPokedex .tcg-art-list{min-width:700px}
#tcgArtPokedex .tcg-art-list .tcg-art-want-toggle{position:static;width:33px;height:33px}
#tcgArtPokedex .tcg-art-binder-page .tcg-art-want-toggle{width:31px;height:31px;font-size:1.05rem}
#tcgArtPokedex .tcg-art-pokedex-card:has(.tcg-art-want-toggle.is-wanted){box-shadow:inset 0 0 0 1px rgba(224,178,82,.45)}
@media(max-width:950px){#tcgArtPokedex .tcg-art-page-layout{grid-template-columns:minmax(190px,230px) minmax(0,1fr);gap:12px}#tcgArtPokedex .tcg-art-filter-form{padding:10px}#tcgArtPokedex .tcg-art-pokedex-grid{grid-template-columns:repeat(auto-fill,minmax(145px,1fr))}}
@media(max-width:700px){#tcgArtPokedex .tcg-art-page-layout{grid-template-columns:minmax(0,1fr)}#tcgArtPokedex .tcg-art-filter-rail{position:static;max-height:none}#tcgArtPokedex .tcg-art-results-toolbar{margin-top:6px}}

/* --- trainer-dex-v38.css --- */
/* v42 — Trainer Dex deliberately shares Art Pokédex's page hierarchy:
   Pokémon expansion header -> game toolbar & tabs -> Dex heading -> small stats
   -> left filter rail + four-column artwork gallery.
   The v41 full-width filter row and five-column gallery have been removed. */
#tcgOpenTrainerDex[hidden], #tcgTrainerDex.hidden, #tcgArtEntryRow[hidden] {display:none!important}
#tcgArtEntryRow {display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:12px 0; margin:0 0 10px;}
#tcgArtEntryRow .tcg-art-open-btn {min-height:40px; border-radius:10px; padding:9px 16px; font-size:.9rem; font-weight:700; cursor:pointer;}
#tcgOpenTrainerDex {color:#f5e9ff; border:1px solid rgba(175,133,237,.65); background:rgba(117,77,158,.23)}
#tcgOpenTrainerDex:hover,#tcgOpenTrainerDex:focus-visible {background:rgba(117,77,158,.4)}
/* Keep the same heading, all-games/back button, search, refresh and Dex tabs that Art Pokédex uses. */
#page-tcg.trainer-dex-page {min-width:0; max-width:100%; overflow-x:clip;}
#tcgGameWorkspace.trainer-dex-mode > #tcgApiStatus {display:none!important}
#tcgTrainerDex, #tcgTrainerDex *, #tcgTrainerDex *::before, #tcgTrainerDex *::after {box-sizing:border-box}
#tcgTrainerDex {--td-bg:#111f34;--td-panel:#1e304a;--td-stroke:#385474;--td-text:#eef3ff;--td-muted:#b4cbea;
  display:block; width:100%; min-width:0; max-width:100%; margin:56px 0 32px;
  padding:0; border:0; border-radius:0; background:transparent; color:var(--td-text); overflow:visible;}
#tcgTrainerDex .tcg-art-hero {display:flex; justify-content:space-between; align-items:center; gap:14px;
  padding:0 0 25px; margin-bottom:20px; border-bottom:1px solid #304966;}
#tcgTrainerDex .tcg-art-hero > div {flex:1 1 380px; min-width:0}
#tcgTrainerDex .catalogue-eyebrow {font-size:.72rem; text-transform:uppercase; letter-spacing:.15em;
  font-weight:800; color:#5d9bff;}
#tcgTrainerDex .tcg-art-hero h2 {font-size:clamp(2.4rem,5vw,3.55rem); font-weight:780; line-height:1.12;
  color:#f3f5ff; margin:12px 0 12px; letter-spacing:-.03em;}
#tcgTrainerDex .tcg-art-hero p {max-width:680px; line-height:1.55; color:#c1daf7; font-size:.94rem; margin:0;}
#tcgTrainerDex #tcgTrainerBack {flex:none; align-self:center; min-height:39px; padding:8px 13px;
  border:1px solid #4b82b9; border-radius:9px; background:#173761; color:white;
  font-size:.82rem; font-weight:700; cursor:pointer; white-space:nowrap;}
/* In the reference Art Pokédex, counters are four compact cards, not four full-width columns. */
#tcgTrainerDex .tcg-art-stats {display:grid; width:max-content; max-width:100%;
  grid-template-columns:repeat(4,minmax(0,130px)); gap:12px; margin:0 0 20px;}
#tcgTrainerDex .tcg-art-stats > div {min-width:0; min-height:81px; display:flex; flex-direction:column;
  justify-content:center; gap:6px; padding:14px 16px; border:1px solid var(--td-stroke);
  background:var(--td-panel); border-radius:12px;}
#tcgTrainerDex .tcg-art-stats strong {font-size:1.56rem; font-weight:750; line-height:1.07; color:#f6f7ff; font-variant-numeric:tabular-nums;}
#tcgTrainerDex .tcg-art-stats span {font-size:.76rem; color:#b5d4ff; line-height:1.25;}
/* Art Pokédex's defining layout: persistent left rail and gallery on the right. */
#tcgTrainerDex .tcg-art-page-layout {display:grid; grid-template-columns:270px minmax(0,1fr);
  align-items:start; column-gap:20px; width:100%; min-width:0;}
#tcgTrainerDex .tcg-art-filter-rail {min-width:0; width:100%; margin:0; padding:0;
  border:1px solid #385474; border-radius:12px; overflow:hidden; background:#101e31;}
#tcgTrainerDex .tcg-art-filter-heading {display:block; margin:0; padding:18px 16px;
  border-bottom:1px solid #334e6c; font-size:.93rem; font-weight:750; color:#f4f7ff;}
#tcgTrainerDex .tcg-art-filter-form {display:flex; flex-direction:column; align-items:stretch;
  gap:14px; margin:0; padding:14px;}
#tcgTrainerDex .tcg-art-filter-form label {display:flex; flex-direction:column; align-items:stretch;
  gap:6px; color:#acd0ff; font-size:.82rem; font-weight:700; line-height:1.25; min-width:0;}
#tcgTrainerDex .tcg-art-filter-form input[type=search],#tcgTrainerDex .tcg-art-filter-form select {
  display:block; width:100%; min-width:0; max-width:100%; min-height:41px;
  padding:9px 11px; border-radius:8px; border:1px solid #48658b;
  background:#13243b; color:#f1f5ff; font-size:.86rem; font-weight:500; outline-offset:2px;}
#tcgTrainerDex .tcg-art-filter-form input::placeholder {color:#91a9c9; opacity:1;}
#tcgTrainerDex .tcg-art-filter-form input:focus-visible,#tcgTrainerDex .tcg-art-filter-form select:focus-visible {outline:2px solid #85b5ff;}
#tcgTrainerDex .tcg-art-filter-actions {display:flex; flex-direction:column; gap:9px; margin:0;}
#tcgTrainerDex .tcg-art-filter-apply,#tcgTrainerDex .tcg-art-filter-clear {width:100%; min-height:38px;
  border-radius:8px; padding:8px 10px; border:1px solid #587ca9; cursor:pointer; font-size:.84rem; font-weight:700;}
#tcgTrainerDex .tcg-art-filter-apply {background:#3177d8; border-color:#5397f7; color:white;}
#tcgTrainerDex .tcg-art-filter-clear {background:#223b5b; color:white;}
#tcgTrainerDex .tcg-art-pref-status {font-size:.76rem; line-height:1.45; color:#bad1ef; margin:0;}
#tcgTrainerDex .tcg-art-filter-help {font-size:.75rem; line-height:1.5; color:#b0c8e8;
  border-top:1px solid #334e6c; padding:13px 14px; margin:0;}
#tcgTrainerDex .tcg-art-results-panel {min-width:0; width:100%; margin:0; padding:0; border:0; background:transparent;}
#tcgTrainerDex .tcg-art-results-toolbar {display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
  gap:9px; margin:0 0 11px; padding:0 0 13px; border-bottom:1px solid #304966;}
#tcgTrainerDex .tcg-art-results-title {font-size:.81rem; font-weight:800;
  color:#9ec7ff; letter-spacing:.06em; text-transform:uppercase;}
#tcgTrainerDex .tcg-art-view-switch {display:inline-flex; align-items:stretch; gap:0; overflow:hidden;
  background:#1e304a; border:1px solid #395574; border-radius:10px;}
#tcgTrainerDex .tcg-art-view-switch button {color:#e9f2ff; border:0; cursor:pointer;
  background:transparent; min-height:40px; padding:8px 13px; font-size:.85rem; font-weight:700;}
#tcgTrainerDex .tcg-art-view-switch button.is-active {background:#367ed8; color:white;}
#tcgTrainerDex #tcgTrainerMessage {color:#a7d0ff; font-size:.82rem; line-height:1.4; margin:0 0 12px; min-height:1em;}
#tcgTrainerDex .tcg-trainer-sync {display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  padding:11px 13px; margin:0 0 13px; background:rgba(30,56,89,.26); border:1px dashed #4b6b93; border-radius:10px;}
#tcgTrainerDex .tcg-trainer-sync[hidden],#tcgTrainerDex #tcgTrainerSync[hidden]{display:none!important}
#tcgTrainerDex .tcg-trainer-sync button {color:white; background:#2c619f; border:1px solid #6599ee;
  border-radius:8px; font-size:.8rem; font-weight:700; min-height:36px; padding:8px 12px; cursor:pointer;}
#tcgTrainerDex .tcg-trainer-sync button:disabled {opacity:.5; cursor:wait;}
#tcgTrainerDex .tcg-trainer-sync span {color:#b5cdeb; font-size:.78rem; line-height:1.35; flex:1 1 160px;}
#tcgTrainerDex .tcg-art-items {width:100%; min-width:0; overflow-x:visible;}
/* Exactly four columns at normal desktop width, matching the Art Pokédex screenshot. */
#tcgTrainerDex .tcg-art-pokedex-grid {display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; align-items:stretch;}
#tcgTrainerDex .tcg-art-pokedex-card {min-width:0; min-height:0; display:flex; flex-direction:column;
  background:#1d2d46; border:1px solid #3b597b; border-radius:12px; overflow:hidden;}
#tcgTrainerDex .tcg-art-picture {display:flex; align-items:center; justify-content:center;
  width:100%; aspect-ratio:.77; padding:9px; background:#294365; position:relative;}
#tcgTrainerDex .tcg-art-picture img {display:block; width:100%; height:100%; object-fit:contain; border-radius:5px;}
#tcgTrainerDex .tcg-art-picture > .tcg-art-quick-toggle,#tcgTrainerDex .tcg-art-picture > .tcg-art-want-toggle {
  position:absolute; top:7px; z-index:3; display:flex; align-items:center; justify-content:center;
  height:34px; min-width:34px; padding:0; border:2px solid #628bb2; border-radius:50%;
  color:#fff; background:#13253f; box-shadow:0 2px 7px rgba(0,0,0,.3); cursor:pointer;
  font-size:1.1rem; font-weight:800;}
#tcgTrainerDex .tcg-art-picture > .tcg-art-quick-toggle {right:7px;}
#tcgTrainerDex .tcg-art-picture > .tcg-art-want-toggle {left:7px;}
#tcgTrainerDex .tcg-art-quick-toggle.is-owned {background:#2864a5; border-color:#9ac7ff;}
#tcgTrainerDex .tcg-art-want-toggle.is-wanted {background:#68408f; border-color:#bd97ee; color:#fff3b1;}
#tcgTrainerDex .tcg-art-quick-toggle:disabled,#tcgTrainerDex .tcg-art-want-toggle:disabled {opacity:.5; cursor:wait;}
#tcgTrainerDex .tcg-art-group-pill {position:absolute; bottom:9px; left:8px; z-index:2;
  max-width:calc(100% - 16px); padding:3px 6px; border-radius:5px; border:1px solid #6592bd;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; background:#122741; color:white;
  font-size:.64rem; line-height:1.1; font-weight:800; text-transform:uppercase;}
#tcgTrainerDex .tcg-art-card-copy {display:flex; flex:1; flex-direction:column; gap:7px; min-height:140px;
  min-width:0; padding:12px; overflow-wrap:anywhere;}
#tcgTrainerDex .tcg-art-card-copy small {color:#b1cfff; font-size:.73rem; line-height:1.32;}
#tcgTrainerDex .tcg-art-card-copy strong {color:white; font-size:.9rem; line-height:1.28;}
#tcgTrainerDex .tcg-art-card-copy > span {color:#c1d8f9; font-size:.8rem; line-height:1.32;}
#tcgTrainerDex .tcg-art-card-footer {display:flex; align-items:center; justify-content:space-between;
  gap:7px; margin-top:auto; padding-top:6px;}
#tcgTrainerDex .tcg-art-card-footer span {color:#b9cfee; font-size:.75rem;}
#tcgTrainerDex .tcg-art-open-set {flex:none; width:auto; min-height:30px; padding:5px 9px;
  background:#315c90; color:#fff; border:1px solid #678bad; border-radius:7px; font-size:.74rem;
  font-weight:650; cursor:pointer;}
#tcgTrainerDex .tcg-art-load-more {display:block; margin:16px auto 0; padding:9px 19px;
  border-radius:8px; border:1px solid #6c9fdb; color:white; background:#285a95; cursor:pointer;}
#tcgTrainerDex .tcg-art-load-more[hidden] {display:none!important;}
#tcgTrainerDex .tcg-art-empty {color:#b9d4f8; text-align:center; padding:32px 12px;}
#tcgTrainerDex .tcg-art-binder-controls {display:flex; justify-content:center; align-items:center; gap:10px; flex-wrap:wrap; margin:0 0 12px;}
#tcgTrainerDex .tcg-art-binder-controls button {background:#214778; color:#fff; border:1px solid #6799d1; border-radius:8px; padding:8px;}
#tcgTrainerDex .tcg-art-binder-page {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px;}
#tcgTrainerDex .tcg-art-items:has(.tcg-art-list) {overflow-x:auto;}
#tcgTrainerDex .tcg-art-list {border-collapse:collapse; width:100%; min-width:620px; color:#eaf2ff; font-size:.83rem;}
#tcgTrainerDex .tcg-art-list th,#tcgTrainerDex .tcg-art-list td {text-align:left; border-bottom:1px solid #354d70; padding:9px 7px;}
#tcgTrainerDex .tcg-art-list-identity {display:flex; gap:8px; align-items:center;}
#tcgTrainerDex .tcg-art-list-identity img {width:36px; height:50px; object-fit:contain;}
#tcgTrainerDex .tcg-art-list button.tcg-art-quick-toggle,#tcgTrainerDex .tcg-art-list button.tcg-art-want-toggle {
  position:static; min-width:33px; min-height:33px; border:1px solid #6283a9; border-radius:8px;
  background:#233d5e; color:#fff; cursor:pointer; font-size:1rem;}
#tcgTrainerDex button:focus-visible {outline:2px solid #90c0ff; outline-offset:2px;}
/* The sidebar stays beside the cards on desktop. Stack only on narrow screens. */
@media(max-width:1040px){#tcgTrainerDex .tcg-art-page-layout{grid-template-columns:240px minmax(0,1fr);gap:14px;}
  #tcgTrainerDex .tcg-art-pokedex-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}}
@media(max-width:890px){#tcgTrainerDex .tcg-art-page-layout{grid-template-columns:230px minmax(0,1fr);gap:12px;}
  #tcgTrainerDex .tcg-art-pokedex-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;}}
@media(max-width:740px){#tcgTrainerDex .tcg-art-page-layout{grid-template-columns:1fr;gap:16px;}
  #tcgTrainerDex .tcg-art-stats{grid-template-columns:repeat(2,minmax(0,130px));}
  #tcgTrainerDex .tcg-art-pokedex-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
  #tcgTrainerDex .tcg-art-filter-rail{max-width:none;}}
@media(max-width:600px){#tcgTrainerDex .tcg-art-hero{flex-direction:column;align-items:stretch;}
  #tcgTrainerDex .tcg-art-hero > div {flex:auto;}
  #tcgTrainerDex #tcgTrainerBack{align-self:flex-start;white-space:normal;}
  #tcgTrainerDex .tcg-art-pokedex-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  #tcgTrainerDex .tcg-art-card-copy{padding:9px;min-height:123px;}
  #tcgTrainerDex .tcg-art-hero h2{font-size:2.25rem;}
  #tcgTrainerDex {margin:32px 0 24px;}}
@media(max-width:390px){#tcgTrainerDex .tcg-art-pokedex-grid{gap:8px;}
  #tcgTrainerDex .tcg-art-picture{padding:5px;}
  #tcgTrainerDex .tcg-art-group-pill{font-size:.56rem;}}

/* v40 Art Pokédex admin-only, preview-first updater, responsive to phone widths. */
#tcgArtUpdateBox {margin:0 0 14px; padding:12px; border:1px dashed #5073a1; border-radius:12px; background:rgba(29,54,87,.35);}
#tcgArtUpdateBox[hidden], #tcgArtUpdateTools[hidden] {display:none!important;}
#tcgArtUpdateBox button {cursor:pointer; border-radius:9px; border:1px solid #6599ee; background:#285b99; color:#fff; font-weight:700; padding:9px 12px; min-height:38px;}
#tcgArtUpdateBox button:disabled {opacity:.45; cursor:not-allowed;}
#tcgArtUpdateTools {padding:10px 0 0; color:#d5e4fb; font-size:.87rem; line-height:1.4;}
#tcgArtUpdateTools p {margin:3px 0 12px;}
#tcgArtUpdateBox .tcg-dex-update-fields {display:flex; flex-wrap:wrap; gap:10px; align-items:end; margin:10px 0;}
#tcgArtUpdateBox label {min-width:min(100%,190px); flex:1 1 185px; display:flex; flex-direction:column; gap:5px; font-weight:650;}
#tcgArtUpdateBox input, #tcgArtUpdateBox select {width:100%; min-height:38px; border-radius:8px; border:1px solid #5877a2; background:#192a43; color:#fff; padding:7px 10px;}
#tcgArtUpdateSummary {color:#c5d9f6; min-height:1.2em; overflow-wrap:anywhere;}



/* v44 — Art Pokédex-style Include / hide toggles, scoped to Trainer Dex. */
#tcgTrainerDex .tcg-trainer-toggle-options {
  border:0; margin:0; padding:0; min-width:0;
  display:flex; flex-direction:column; gap:8px;
}
#tcgTrainerDex .tcg-trainer-toggle-options legend {
  width:100%; padding:0 0 10px; margin:0 0 3px;
  border-bottom:1px solid #385474; font-size:.82rem;
  font-weight:750; color:#e7f2ff;
}
#tcgTrainerDex .tcg-art-filter-form label.tcg-trainer-toggle {
  display:flex; flex-direction:row; align-items:flex-start;
  gap:10px; padding:12px 9px; cursor:pointer;
  border:1px solid #345474; border-radius:10px;
  background:#0e1a2d; color:#eaf3ff;
}
#tcgTrainerDex .tcg-trainer-toggle input[type=checkbox] {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
#tcgTrainerDex .tcg-trainer-switch {
  position:relative; flex:0 0 31px; height:18px; margin-top:2px;
  border:1px solid #69829e; border-radius:20px; background:#263c51;
  transition:background .16s,border-color .16s;
}
#tcgTrainerDex .tcg-trainer-switch::after {
  content:''; position:absolute; top:2px; left:3px; width:12px; height:12px;
  border-radius:50%; background:#bed0dc; transition:transform .16s;
}
#tcgTrainerDex .tcg-trainer-toggle input:checked + .tcg-trainer-switch {
  background:#3186e5; border-color:#80b9ff;
}
#tcgTrainerDex .tcg-trainer-toggle input:checked + .tcg-trainer-switch::after {
  background:#fff; transform:translateX(12px);
}
#tcgTrainerDex .tcg-trainer-toggle input:focus-visible + .tcg-trainer-switch {
  outline:2px solid #a8d5ff; outline-offset:3px;
}
#tcgTrainerDex .tcg-trainer-toggle-copy {
  display:flex; flex-direction:column; gap:4px; flex:1; min-width:0;
}
#tcgTrainerDex .tcg-trainer-toggle-copy strong {
  display:block; color:#f4f7ff; font-size:.82rem; font-weight:750;
  line-height:1.22;
}
#tcgTrainerDex .tcg-trainer-toggle-copy small {
  display:block; color:#94c7ff; font-size:.72rem; font-weight:400;
  line-height:1.35;
}
