
:root {
  color-scheme: light;
  scroll-padding-top:5.25rem;
  scrollbar-gutter:stable;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg:#faf6ef; --surface:#fffdf8; --header:#f2e8dd; --text:#2b211b;
  --muted:#705e52; --accent:#943e29; --tint:#f8e7db; --line:#ddcfc2; --on-accent:#fff;
}
:root[data-theme="dark"] { 
  color-scheme: dark;
  --bg:#151311; --surface:#201b17; --header:#211b16; --text:#f6efea;
  --muted:#c2b1a5; --accent:#f0b597; --tint:#3c2a22; --line:#55453a; --on-accent:#271912;
 }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { 
  color-scheme: dark;
  --bg:#151311; --surface:#201b17; --header:#211b16; --text:#f6efea;
  --muted:#c2b1a5; --accent:#f0b597; --tint:#3c2a22; --line:#55453a; --on-accent:#271912;
 }
}
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; display:flex; flex-direction:column; background:var(--bg); color:var(--text); }
a { color:inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline:2px solid var(--accent); outline-offset:3px;
}
.shell { width:min(100% - 2rem, 72rem); margin-inline:auto; }
.site-header { position:sticky; top:0; z-index:10; background:var(--header); border-bottom:1px solid var(--line); }
.site-footer { background:var(--header); border-top:1px solid var(--line); padding-block:1rem; }
.header-content { min-height:4.25rem; display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.header-actions { display:flex; align-items:center; gap:clamp(.55rem,2vw,1rem); }
.brand { display:inline-flex; align-items:center; gap:.35rem; font-size:2.1rem; font-weight:750; text-decoration:none; }
.brand-name { line-height:1; transform:translateY(-.05em); }
.brand-mark { display:block; width:2rem; height:2rem; object-fit:contain; }
.header-link, .back-link, .footer-link { color:var(--accent); text-underline-offset:.25em; }
main { flex:1; padding-block:clamp(1.4rem, 4vw, 3.5rem); }
h1 { font-size:clamp(1.8rem, 4vw, 3rem); line-height:1.12; letter-spacing:-.035em; margin:.65rem 0 1.5rem; overflow-wrap:anywhere; }
h2 { margin:0; font-size:1.15rem; line-height:1.35; overflow-wrap:anywhere; }
.catalog-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.8rem 1.3rem; margin:.65rem 0 1.5rem; }
.catalog-heading h1 { margin:0; }
.plan-link { display:inline-block; padding:.55rem .8rem; border:1px solid var(--line); border-radius:.45rem; background:transparent; color:var(--accent); text-decoration:none; }
.plan-link:hover { border-color:var(--accent); }
.plan-catalog-name { margin-top:-.7rem; }
.plan-years { display:flex; flex-wrap:wrap; gap:.65rem; margin:1.25rem 0; }
.plan-year { margin:1.75rem 0; scroll-margin-top:1rem; }
.plan-year > h2 { font-size:1.45rem; }
.plan-series { margin:1.1rem 0 .65rem; overflow-wrap:anywhere; }
.planned-coins { list-style:none; padding:0; margin:0; }
.planned-coin { background:var(--surface); border:1px solid var(--line); border-radius:.8rem; padding:.9rem; overflow-wrap:anywhere; }
.planned-coin h4 { margin:0; font-size:1rem; }
.planned-coin p { margin:.35rem 0 0; }
.catalog-grid, .coin-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%, 17rem), 1fr)); gap:1rem; }
.catalog-card, .coin-card { display:flex; text-decoration:none; border:1px solid var(--line); background:var(--surface); border-radius:.8rem; min-width:0; }
.catalog-card:hover, .coin-card:hover { border-color:var(--accent); }
.catalog-card { flex-direction:column; justify-content:space-between; align-items:flex-start; padding:1.35rem; gap:1.15rem; min-height:8rem; }
.count { padding:.25rem .55rem; background:var(--tint); color:var(--accent); border-radius:.35rem; font-size:.875rem; font-weight:650; }
.coin-card { display:grid; grid-template-columns:4rem minmax(0,1fr); gap:.85rem; align-items:center; padding:.9rem; }
.coin-card h2 { font-size:1rem; }
.coin-card p { margin:.3rem 0 0; }
.coin-image { display:block; width:100%; aspect-ratio:1; object-fit:contain; border-radius:50%; }
.meta, .status, figcaption, dt { color:var(--muted); font-size:.9rem; }
.status { min-height:1.25em; margin:1.2rem 0; }
.filter-form { display:grid; grid-template-columns:minmax(0,1fr); gap:1rem; padding:1.1rem; background:var(--surface); border:1px solid var(--line); border-radius:.8rem; }
.filter-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,10rem),1fr)); gap:.75rem; }
label, .filter-field { display:grid; align-content:start; gap:.4rem; min-width:0; font-size:.875rem; font-weight:650; }
button, input, select { font:inherit; min-height:2.75rem; border:1px solid var(--line); border-radius:.45rem; }
input, select { width:100%; background:var(--bg); color:var(--text); padding:.5rem .7rem; font-size:1rem; font-weight:400; }
select, .filter-picker-trigger { appearance:none; padding-right:2rem; background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%); background-position:right 1rem center,right .7rem center; background-size:.3rem .3rem; background-repeat:no-repeat; }
button { color:var(--text); background:var(--surface); cursor:pointer; padding:.5rem .85rem; }
.filter-picker-trigger { width:100%; min-width:0; max-width:100%; padding:.5rem 2rem .5rem .7rem; overflow:hidden; background-color:var(--bg); font-size:1rem; font-weight:400; text-align:left; }
.filter-selection { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
html.filter-picker-open { overflow:hidden; }
.filter-picker { width:min(28rem, calc(100% - 1.5rem)); max-height:calc(100% - 1.5rem); padding:0; overscroll-behavior:contain; border:1px solid var(--line); border-radius:.8rem; background:var(--surface); color:var(--text); }
.filter-picker::backdrop { background:rgba(0,0,0,.65); }
.filter-picker-panel { display:grid; gap:.85rem; padding:1rem; }
.filter-option-list { max-height:min(52vh, 22rem); overflow:auto; overscroll-behavior:contain; }
.filter-option { display:flex; align-items:center; padding:.6rem .35rem; gap:.65rem; border-bottom:1px solid var(--line); font-size:1rem; font-weight:400; cursor:pointer; }
.filter-option[hidden] { display:none; }
.filter-option input { flex:none; width:1.1rem; min-height:0; height:1.1rem; padding:0; margin:0; accent-color:var(--accent); }
.filter-option span { overflow-wrap:anywhere; }
.picker-actions { justify-content:flex-end; }
.picker-reset { margin-right:auto; }
button:hover:not(:disabled) { border-color:var(--accent); }
button:disabled { opacity:.6; cursor:default; }
.theme-toggle:not([hidden]) { display:grid; place-items:center; width:2.75rem; padding:0; color:var(--accent); font-size:1.4rem; line-height:1; }
.primary { background:var(--accent); color:var(--on-accent); border-color:transparent; font-weight:650; }
.actions, .pagination { display:flex; align-items:center; gap:.65rem; flex-wrap:wrap; }
.filter-actions { justify-content:flex-end; }
.filter-actions button { padding-inline:1rem; }
.filter-reset { font-weight:500; }
.catalog-results-bar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.65rem 1rem; margin:.85rem 0 1rem; }
.catalog-sort { width:min(100%, 14rem); background-color:var(--surface); }
.catalog-results-bar .status { margin:0 0 0 auto; text-align:right; }
.catalog-pagination { display:grid; gap:.75rem; margin-top:1.35rem; text-align:center; overflow-anchor:none; }
.load-more { width:100%; min-height:3rem; font-weight:650; }
.load-more[aria-disabled="true"] { cursor:progress; opacity:.65; }
.pagination-status { color:var(--muted); font-size:.9rem; }
.pagination-status:empty { display:none; }
.pagination { justify-content:center; gap:.3rem; }
.page-number, .pagination-gap { padding:.4rem .6rem; }
.page-number { min-width:2rem; border-radius:.45rem; text-decoration:none; }
.page-number:hover, .page-number[aria-current="page"] { background:var(--tint); color:var(--accent); }
.pagination-gap { color:var(--muted); }
.detail { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); gap:clamp(1.5rem,5vw,4rem); align-items:start; }
.coin-gallery { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.8rem; }
figure { margin:0; min-width:0; text-align:center; }
.image-frame { border-radius:.8rem; background:var(--surface); border:1px solid var(--line); padding:clamp(.5rem,2vw,1.15rem); }
.coin-zoom { display:block; width:100%; min-height:0; border:0; padding:0; cursor:zoom-in; background:transparent; }
.coin-photo-viewer { max-width:calc(100% - 1.5rem); max-height:calc(100% - 1.5rem); padding:0; border:1px solid var(--line); border-radius:.8rem; background:var(--surface); color:var(--text); }
.coin-photo-viewer::backdrop { background:rgba(0,0,0,.75); }
.coin-photo-panel { padding:.85rem; }
.coin-photo-header { display:flex; align-items:center; justify-content:space-between; gap:.85rem; max-width:32rem; margin:0 auto .65rem; }
.coin-photo-header h2 { font-size:1rem; }
.coin-photo-close { flex:none; display:grid; place-items:center; width:2.75rem; height:2.75rem; padding:0; }
.coin-photo-close::before, .coin-photo-close::after { content:""; grid-area:1/1; width:.85rem; height:2px; border-radius:1px; background:currentColor; }
.coin-photo-close::before { transform:rotate(45deg); }
.coin-photo-close::after { transform:rotate(-45deg); }
.coin-photo-full { display:block; width:auto; height:auto; max-width:100%; max-height:76vh; max-height:76dvh; object-fit:contain; border-radius:50%; margin-inline:auto; }
figcaption { margin:.55rem 0; }
.specs { margin:0; }
.spec-row { display:grid; grid-template-columns:minmax(7rem, 2fr) minmax(0,3fr); gap:.65rem; padding:.68rem 0; border-bottom:1px solid var(--line); }
dd { margin:0; overflow-wrap:anywhere; }
.descriptions h2 { margin-top:1.4rem; }
.descriptions p { line-height:1.6; white-space:pre-line; overflow-wrap:anywhere; }
@media (max-width:44rem) { .detail { grid-template-columns:1fr; } }
@media (max-width:22rem) {
  .header-content { width:calc(100% - 1rem); }
  .header-content, .header-actions { gap:.35rem; }
  .header-link { font-size:.875rem; }
}
