
:root {
  --ink: #191a16; --ink-soft: #34362f; --muted: #707267; --paper: #f5f1e7; --paper-deep: #ebe4d5;
  --card: #fffdf8; --line: #d8d1c1; --line-strong: #bdb4a2; --accent: #934735; --accent-dark: #743426;
  --gold: #af8844; --success: #3d6537; --radius-sm: 10px; --radius: 18px; --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(45,38,24,.05); --shadow: 0 18px 50px rgba(45,38,24,.09);
  color: var(--ink); background: var(--paper); font-family: Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif; font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 0; scroll-behavior: smooth; }
body { min-width: 0; margin: 0; overflow-x: hidden; color: var(--ink); background: var(--paper); line-height: 1.55; }
body::before { position: fixed; inset: 0; z-index: -1; pointer-events: none; content: ""; opacity: .38; background-image: radial-gradient(rgba(78,66,43,.12) .65px,transparent .65px); background-size: 7px 7px; }
main { min-width: 0; }
a { color: inherit; text-decoration-color: color-mix(in srgb,currentColor 32%,transparent); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
img { display: block; max-width: 100%; height: auto; }
h1,h2,h3,p { overflow-wrap: break-word; }
.skip { position: fixed; left: 1rem; top: -5rem; z-index: 100; border-radius: var(--radius-sm); background: var(--ink); color: #fff; padding: .7rem 1rem; }
.skip:focus { top: 1rem; }
:focus-visible { outline: 3px solid color-mix(in srgb,var(--gold) 68%,white); outline-offset: 3px; }

.site-header { position: sticky; top: 0; z-index: 20; display: flex; min-width: 0; height: 76px; align-items: center; justify-content: space-between; gap: 24px; padding: 0 max(24px,calc((100vw - 1240px)/2)); border-bottom: 1px solid rgba(189,180,162,.7); background: rgba(245,241,231,.9); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-family: Georgia,"Times New Roman",serif; font-size: 1.27rem; font-weight: 700; letter-spacing: -.015em; text-decoration: none; white-space: nowrap; }
.brand__logo { width: 168px; height: auto; }
.brand--admin { min-width: 0; }
.brand--admin small { flex: 0 0 auto; }
.brand__logo { width: 180px; height: 60px; object-fit: contain; }
.brand__mark { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--accent); font-family: Inter,sans-serif; font-size: .67rem; font-weight: 850; letter-spacing: .04em; box-shadow: inset 0 0 0 4px var(--paper),inset 0 0 0 5px color-mix(in srgb,var(--gold) 48%,transparent); }
.brand small { color: var(--muted); font-family: Inter,sans-serif; font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.brand--admin small { padding-left: 11px; border-left: 1px solid var(--line-strong); }
.nav-link { display: inline-flex; min-height: 38px; align-items: center; border-radius: 999px; padding: 0 14px; color: var(--muted); font-size: .9rem; font-weight: 700; text-decoration: none; }
.nav-link:hover,.nav-link.is-active { background: rgba(255,253,248,.7); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

.page-shell,.admin-shell { width: min(100%,1288px); margin-inline: auto; padding: 52px 24px 88px; }
.hero { position: relative; min-height: 300px; max-width: none; padding: 54px 320px 64px 0; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::after { position: absolute; right: 50px; top: 18px; width: 220px; height: 220px; border: 1px solid color-mix(in srgb,var(--gold) 54%,transparent); border-radius: 50%; content: ""; opacity: .72; background: radial-gradient(circle at 38% 34%,rgba(255,255,255,.85) 0 8%,transparent 9%),radial-gradient(circle,transparent 0 38%,rgba(175,136,68,.15) 38.5% 40%,transparent 40.5% 60%,rgba(147,71,53,.12) 60.5% 61.5%,transparent 62%),linear-gradient(135deg,rgba(255,253,248,.9),rgba(216,209,193,.35)); box-shadow: inset 0 0 0 12px rgba(255,253,248,.42),0 30px 70px rgba(54,45,29,.12); transform: rotate(-8deg); }
.hero::before { position: absolute; right: 15px; top: 196px; z-index: -1; width: 185px; height: 185px; border-radius: 50%; content: ""; background: rgba(147,71,53,.08); }
.hero h1,.coin-page h1,.admin-title h1 { max-width: 820px; margin: .14em 0 .26em; font: clamp(2.8rem,6vw,5.6rem)/.94 Georgia,"Times New Roman",serif; letter-spacing: -.045em; text-wrap: balance; }
.hero > p:last-child { max-width: 620px; margin: 0; color: var(--muted); font-size: 1.05rem; }
.eyebrow { margin: 0; color: var(--accent); font-size: .7rem; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }

.catalogue-layout { display: grid; min-width: 0; grid-template-columns: 260px minmax(0,1fr); gap: 44px; padding-top: 40px; }
.filters { position: sticky; top: 100px; align-self: start; display: grid; min-width: 0; gap: 15px; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: rgba(255,253,248,.82); box-shadow: var(--shadow-sm); }
.filters__heading { display: grid; gap: 2px; margin-bottom: 2px; }
.filters h2 { margin: 0; font: 1.65rem/1.1 Georgia,serif; letter-spacing: -.02em; }
label { display: grid; min-width: 0; gap: 7px; color: var(--ink-soft); font-size: .81rem; font-weight: 760; }
input,select,textarea,button { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .72rem .8rem; background: #fff; color: var(--ink); font: inherit; transition: border-color .16s,box-shadow .16s,background .16s,transform .16s; }
input:hover,select:hover,textarea:hover { border-color: var(--line-strong); }
input:focus,select:focus,textarea:focus { border-color: var(--gold); outline: 0; box-shadow: 0 0 0 3px rgba(175,136,68,.16); }
input::placeholder,textarea::placeholder { color: #9a9a90; }
textarea { resize: vertical; }
button,.button-link { display: inline-flex; width: auto; min-height: 44px; align-items: center; justify-content: center; border-color: var(--ink); border-radius: var(--radius-sm); padding: .7rem 1rem; background: var(--ink); color: #fff; font-weight: 780; text-decoration: none; cursor: pointer; box-shadow: 0 5px 14px rgba(25,26,22,.13); }
button:hover,.button-link:hover { background: var(--accent-dark); border-color: var(--accent-dark); transform: translateY(-1px); }
.filters button { width: 100%; margin-top: 3px; }
.quiet-link { display: block; border-radius: 6px; color: var(--muted); font-size: .84rem; text-align: center; }
.results { min-width: 0; }
.results[aria-busy="true"] { opacity: .55; transition: opacity .15s; }
.results-toolbar { display: flex; min-width: 0; min-height: 64px; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.results-toolbar p { margin: 0; color: var(--muted); font-size: .88rem; }
.results-toolbar strong { color: var(--ink); font-size: 1.05rem; }
.sort-form { min-width: 0; }
.sort-form label { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.sort-form select { width: min(310px,100%); }
.coin-grid { display: grid; min-width: 0; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; }
.coin-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); transition: border-color .2s,transform .2s,box-shadow .2s; }
.coin-card:hover { border-color: var(--line-strong); transform: translateY(-4px); box-shadow: var(--shadow); }
.coin-card > a { display: block; text-decoration: none; }
.coin-card__image,.detail-image { display: grid; aspect-ratio: 1; overflow: hidden; place-items: center; color: var(--muted); background: radial-gradient(circle at 42% 36%,#fff 0,#f5f1e7 31%,#e6decd 72%,#d7cdb8 100%); }
.coin-card__image img,.detail-image img { width: 100%; height: 100%; object-fit: cover; }
.detail-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.detail-gallery figure { overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); }
.detail-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--paper-deep); }
.detail-gallery figcaption { padding: 13px 16px; color: var(--muted); font-size: .84rem; }
.coin-placeholder { display: grid; width: 58%; aspect-ratio: 1; place-items: center; border: 1px solid rgba(175,136,68,.42); border-radius: 50%; color: #857e70; font-size: .76rem; letter-spacing: .04em; background: radial-gradient(circle,transparent 0 39%,rgba(175,136,68,.1) 40% 41%,transparent 42%),rgba(255,253,248,.48); box-shadow: inset 0 0 0 9px rgba(255,253,248,.32),0 15px 32px rgba(58,46,25,.08); }
.coin-card__body { min-height: 142px; padding: 19px; }
.coin-card h2 { margin: .32rem 0 .55rem; font: 1.34rem/1.14 Georgia,serif; letter-spacing: -.015em; }
.coin-card p { margin: .25rem 0; color: var(--muted); font-size: .9rem; }
.coin-card .eyebrow { color: var(--accent); font-size: .64rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 42px 0 0; color: var(--muted); font-size: .9rem; }
.pagination a { color: var(--ink); font-weight: 700; }
.empty { padding: 78px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255,253,248,.45); text-align: center; }
.empty h2 { margin: 0 0 7px; font: 1.7rem Georgia,serif; }
.empty p { margin: 0; color: var(--muted); }
.suggestions { position: absolute; top: 136px; left: 24px; z-index: 8; width: calc(100% - 48px); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow); }
.suggestions a { display: block; padding: 11px 13px; text-decoration: none; }
.suggestions a + a { border-top: 1px solid var(--line); }
.suggestions a:hover,.suggestions a:focus { background: var(--paper); }

.breadcrumbs { display: flex; min-width: 0; align-items: center; gap: 9px; color: var(--muted); font-size: .84rem; }
.breadcrumbs span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-lead { display: grid; grid-template-columns: minmax(280px,.92fr) minmax(0,1.08fr); gap: clamp(34px,6vw,76px); align-items: center; margin: 38px 0 82px; }
.coin-lead .detail-image { border: 1px solid var(--line); border-radius: 50%; box-shadow: inset 0 0 0 12px rgba(255,253,248,.36),var(--shadow); }
.coin-lead header { min-width: 0; }
.coin-page h1 { font-size: clamp(2.6rem,5.6vw,5rem); }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: .38rem .78rem; background: #e6eee2; color: var(--success); font-size: .82rem; font-weight: 780; }
.status.discontinued { background: #eee5e0; color: #764b3e; }
.coin-page > section { max-width: 900px; margin: 68px auto; }
.coin-page > section > h2 { margin-bottom: 22px; border-bottom: 1px solid var(--line); padding-bottom: 11px; font: 2rem/1.1 Georgia,serif; letter-spacing: -.02em; }
.specs { display: grid; grid-template-columns: 1fr 1fr; margin: 0; column-gap: 34px; }
.specs div { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 680; text-align: right; }
.prose { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.75; }

footer { border-top: 1px solid var(--line); background: rgba(235,228,213,.42); }
.footer-inner { display: flex; width: min(100%,1288px); min-height: 120px; align-items: center; justify-content: space-between; gap: 28px; margin: auto; padding: 26px 24px; }
.footer-inner p { max-width: 520px; margin: 0; color: var(--muted); font-size: .84rem; text-align: right; }
.brand--footer { font-size: 1.05rem; }
.brand--footer .brand__logo { width: 150px; height: 50px; }
.brand--footer .brand__mark { width: 32px; height: 32px; flex-basis: 32px; }

.admin { background: #f3f0e8; }
.admin .site-header { position: relative; background: rgba(255,253,248,.72); }
.admin-identity { min-width: 0; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; text-align: right; }
.admin-nav { display: flex; min-width: 0; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); padding: 9px max(20px,calc((100vw - 1240px)/2)); background: rgba(255,253,248,.48); scrollbar-width: thin; }
.admin-nav a { flex: 0 0 auto; border-radius: 7px; padding: .5rem .72rem; color: var(--muted); font-size: .81rem; font-weight: 680; text-decoration: none; }
.admin-nav a:hover { background: var(--card); color: var(--ink); }
.admin-shell { min-width: 0; max-width: 1120px; padding-top: 44px; }
.admin-shell > h1 { margin: 0 0 28px; font: clamp(2.5rem,5vw,4rem)/1 Georgia,serif; letter-spacing: -.035em; }
.admin-title { display: flex; min-width: 0; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.admin-title > div { min-width: 0; }
.admin-title h1 { margin-bottom: 0; font-size: clamp(2.7rem,5vw,4.5rem); }
.editor-form { display: grid; width: 100%; min-width: 0; max-width: 1000px; gap: 26px; }
.panel { display: grid; min-width: 0; gap: 19px; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 25px; background: var(--card); box-shadow: var(--shadow-sm); }
.panel > legend { max-width: calc(100% - 24px); padding: 0 9px; font: 1.36rem/1.2 Georgia,serif; white-space: normal; }
.fields-2,.fields-3 { display: grid; min-width: 0; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.fields-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.nested { display: grid; min-width: 0; gap: 13px; margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 17px; }
.nested legend { padding-inline: 6px; color: var(--ink-soft); font-size: .87rem; font-weight: 750; }
.checks { display: flex; min-width: 0; flex-wrap: wrap; gap: 10px 22px; margin: 0; border: 0; padding: 0; }
.checks legend { width: 100%; margin-bottom: 3px; font-size: .81rem; font-weight: 760; }
.checks label,.check { display: flex; align-items: center; gap: 8px; }
.checks input,.check input { width: auto; }
.hint,small { color: var(--muted); }
.hint { margin: 0; }
.alert { margin: 20px 0; border: 1px solid #d88475; border-radius: 12px; padding: 18px; background: #fff0ed; }
.notice { margin: 20px 0; border: 1px solid #8bad82; border-radius: 12px; padding: 14px 18px; color: #294b25; background: #edf7e9; }
.media-manager { display: grid; width: 100%; max-width: 1000px; gap: 20px; margin-top: 18px; scroll-margin-top: 110px; }
.media-manager h2 { margin: 0 0 5px; font: 2rem/1.15 Georgia,serif; }
.media-admin-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.media-admin-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); }
.media-admin-card > img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--paper-deep); }
.media-admin-card > div { display: grid; gap: 5px; padding: 14px; }
.media-admin-card span,.media-admin-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-remove { margin-top: 8px; color: var(--accent); }
.media-upload-form { align-items: start; }
.media-upload-form input[type=file] { padding: .55rem; background: var(--paper); }
.media-upload-form button { justify-self: start; }
.list-filter { max-width: 250px; margin-bottom: 22px; }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; background: var(--card); font-size: .88rem; }
.data-table th,.data-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data-table th { background: #f1ede3; color: var(--muted); font-size: .69rem; letter-spacing: .08em; text-transform: uppercase; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #faf7f0; }
.table-status { display: inline-flex; border-radius: 999px; padding: .24rem .55rem; background: #ece8df; color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: capitalize; }
.table-status--published { background: #e6eee2; color: var(--success); }
.table-status--archived { background: #eee5e0; color: #764b3e; }

@media(max-width:950px) {
  .hero { padding-right: 250px; }
  .hero::after { right: 24px; width: 185px; height: 185px; }
  .catalogue-layout { grid-template-columns: 220px minmax(0,1fr); gap: 28px; }
  .coin-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .coin-lead { grid-template-columns: minmax(250px,.8fr) minmax(0,1.2fr); }
}
@media(max-width:760px) {
  .hero { min-height: 0; padding: 40px 160px 46px 0; }
  .hero::after { top: 34px; right: 4px; width: 125px; height: 125px; }
  .hero::before { display: none; }
  .catalogue-layout { grid-template-columns: minmax(0,1fr); }
  .filters { position: relative; top: auto; }
  .suggestions { top: 136px; }
  .coin-lead { grid-template-columns: 1fr; gap: 34px; }
  .coin-lead .detail-image { width: min(100%,480px); margin-inline: auto; }
  .fields-3 { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:560px) {
  .site-header { height: 66px; gap: 12px; padding-inline: 15px; }
  .brand { gap: 8px; font-size: 1.08rem; }
  .brand__logo { width: 146px; }
  .brand--admin .brand__logo { width: 124px; }
  .brand__logo { width: 150px; height: 50px; }
  .brand__mark { width: 34px; height: 34px; flex-basis: 34px; }
  .site-header nav { display: none; }
  .page-shell,.admin-shell { width: 100%; padding: 30px 15px 64px; }
  .hero { padding: 28px 0 38px; }
  .hero::after { display: none; }
  .hero h1,.coin-page h1 { font-size: clamp(2.55rem,13vw,3.65rem); }
  .hero > p:last-child { font-size: .94rem; }
  .catalogue-layout { gap: 32px; padding-top: 26px; }
  .filters { width: 100%; padding: 21px; }
  .results-toolbar { min-height: 0; flex-wrap: wrap; align-items: stretch; padding-bottom: 18px; }
  .sort-form,.sort-form label,.sort-form select { width: 100%; }
  .sort-form label { display: grid; white-space: normal; }
  .coin-grid,.fields-2,.fields-3,.specs,.media-admin-grid,.detail-gallery { grid-template-columns: minmax(0,1fr); }
  .coin-card__body { min-height: 0; }
  .coin-page > section { margin: 50px auto; }
  .specs div { grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); }
  .footer-inner { min-height: 0; flex-direction: column; align-items: flex-start; padding: 28px 15px; }
  .footer-inner p { text-align: left; }
  .admin .site-header { height: auto; min-height: 72px; align-items: center; }
  .admin .brand { min-width: 0; white-space: normal; }
  .admin .brand > span:last-child { line-height: 1.08; }
  .admin .brand small { display: none; }
  .admin-identity { max-width: 42%; font-size: .7rem; }
  .admin-nav { padding-inline: 10px; }
  .admin-title { align-items: end; gap: 14px; }
  .admin-title h1 { font-size: clamp(2.45rem,12vw,3.4rem); }
  .admin-title .button-link,.admin-title button { flex: 0 0 auto; }
  .panel { padding: 21px; }
  .panel > legend { font-size: 1.2rem; }
  .checks { display: grid; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior: auto!important; transition-duration: .01ms!important; } }
