:root {
  --ink: #142720;
  --ink-soft: #29443a;
  --paper: #f3efe6;
  --paper-deep: #e7dfd0;
  --card: #fbf9f4;
  --card-solid: #fffefa;
  --gold: #b78b3b;
  --gold-light: #d7b773;
  --burgundy: #7a3133;
  --burgundy-soft: #f0dede;
  --sage: #8da092;
  --line: #d9d0bf;
  --muted: #706e67;
  --shadow: 0 16px 48px rgba(34, 39, 32, 0.09);
  --radius: 20px;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --sans: "Yu Gothic UI", "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.65; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
.static-snapshot .nav-item[data-view-target="trades"],
.static-snapshot .nav-item[data-view-target="storage"],
.static-snapshot .nav-item[data-view-target="settings"],
.static-snapshot #addNoteButton { display: none; }
.static-snapshot .private-filter { display: none; }
.static-snapshot .note-card { cursor: pointer; }
img, svg, video, canvas { max-width: 100%; }
img, video { height: auto; }
::selection { background: var(--gold-light); color: var(--ink); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.app-shell { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 22px 24px; color: #f7f2e8; background: var(--ink); display: flex; flex-direction: column; z-index: 30; overflow: hidden; }
.sidebar::after { content: ""; position: absolute; width: 360px; height: 360px; left: -180px; bottom: -160px; border: 1px solid rgba(215, 183, 115, .2); border-radius: 50%; box-shadow: 0 0 0 32px rgba(215,183,115,.04), 0 0 0 72px rgba(215,183,115,.035); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 13px; padding: 0 8px 29px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--gold-light); color: var(--gold-light); font-family: var(--serif); font-size: 22px; transform: rotate(45deg); }
.brand-mark::first-letter { transform: rotate(-45deg); }
.brand-mark { line-height: 1; }
.brand-mark::before { content: "幣"; transform: rotate(-45deg); }
.brand-mark { font-size: 0; }
.brand h1 { margin: 2px 0 0; font-family: var(--serif); font-size: 19px; letter-spacing: .08em; }
.eyebrow { margin: 0; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.brand .eyebrow { color: var(--gold-light); font-size: 8px; }
.primary-nav { display: grid; gap: 7px; margin-top: 28px; }
.nav-item { position: relative; width: 100%; border: 0; border-radius: 12px; padding: 13px 15px; display: flex; align-items: center; gap: 13px; background: transparent; color: rgba(255,255,255,.66); cursor: pointer; text-align: left; transition: background .2s, color .2s, transform .2s; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.nav-item.is-active { background: rgba(215,183,115,.13); color: #fff; }
.nav-item.is-active::before { content: ""; position: absolute; left: 0; width: 3px; height: 22px; background: var(--gold-light); border-radius: 5px; }
.nav-icon { width: 24px; color: var(--gold-light); font-size: 19px; text-align: center; }
.sidebar-foot { margin-top: auto; position: relative; z-index: 1; padding: 18px 8px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 11px; color: rgba(255,255,255,.48); }
.sidebar-foot p { margin: 6px 0 0; }
.connection-line { display: flex; gap: 8px; align-items: center; color: rgba(255,255,255,.76); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #d9a34c; box-shadow: 0 0 0 4px rgba(217,163,76,.12); }
.status-dot.is-online { background: #80bd91; box-shadow: 0 0 0 4px rgba(128,189,145,.12); }
.status-dot.is-offline { background: #dd7777; box-shadow: 0 0 0 4px rgba(221,119,119,.12); }

.main-content { min-width: 0; padding: 0 48px 64px; }
.topbar { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.topbar h2 { margin: 3px 0 0; font-family: var(--serif); font-size: clamp(24px, 2.4vw, 34px); letter-spacing: .02em; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.global-search { min-width: 280px; height: 44px; padding: 0 15px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 99px; background: rgba(255,255,255,.5); color: var(--muted); }
.global-search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(183,139,59,.1); }
.global-search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--ink); }
.button { min-height: 42px; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; font-size: 13px; font-weight: 700; cursor: pointer; transition: transform .16s, background .16s, border .16s, box-shadow .16s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--burgundy); box-shadow: 0 8px 20px rgba(122,49,51,.18); }
.button-primary:hover { background: #68282a; }
.button-secondary { border-color: var(--ink); color: var(--ink); background: transparent; }
.button-secondary:hover { color: #fff; background: var(--ink); }
.button-ghost { border-color: var(--line); background: var(--card); }
.button-light { color: var(--ink); background: #f9f5ec; }
.button-danger { color: var(--burgundy); border-color: #d9aeaf; background: #fff7f7; }
.full { width: 100%; margin-top: 10px; }
.text-button { border: 0; padding: 0; background: transparent; color: #f8ebd0; font-size: 12px; font-weight: 700; cursor: pointer; }
.text-button.ink { color: var(--burgundy); }
.loading-state { min-height: 62vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.loading-seal { width: 64px; height: 64px; display: grid; place-items: center; border: 1px solid var(--gold); font-family: var(--serif); color: var(--gold); font-size: 28px; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.94); opacity: .65; } }
.view { display: none; }
.view.is-active { display: block; animation: reveal .32s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(7px); } }

.atlas-hero { overflow: hidden; border-radius: 26px; background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.atlas-heading { padding: 34px 40px 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; border-bottom: 1px solid rgba(255,255,255,.09); background: radial-gradient(circle at 86% 0%, rgba(215,183,115,.15), transparent 38%); }
.atlas-heading h3 { margin: 6px 0 8px; font: 700 clamp(27px,3.5vw,46px)/1.28 var(--serif); letter-spacing: .03em; }
.atlas-heading > div:first-child > p:last-child { max-width: 680px; margin: 0; color: rgba(255,255,255,.59); font-size: 12px; }
.atlas-count { min-width: 105px; padding-left: 25px; border-left: 1px solid rgba(255,255,255,.14); text-align: right; }
.atlas-count strong { display: block; color: var(--gold-light); font: 700 34px/1 var(--serif); }
.atlas-count span { color: rgba(255,255,255,.48); font-size: 9px; letter-spacing: .1em; }
.atlas-primary-pickers { padding: 14px 40px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.atlas-compact-trigger { min-width: 0; min-height: 64px; padding: 9px 13px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(255,255,255,.045); color: #fff; text-align: left; cursor: pointer; transition: .18s; }
.atlas-compact-trigger:hover, .atlas-compact-trigger:focus-visible { border-color: var(--gold-light); background: rgba(215,183,115,.13); outline: none; }
.atlas-picker-step { color: var(--gold-light); font: 700 18px var(--serif); }
.atlas-compact-trigger small, .atlas-compact-trigger strong, .atlas-compact-trigger em { display: block; min-width: 0; }
.atlas-compact-trigger small { color: rgba(255,255,255,.45); font-size: 8px; letter-spacing: .12em; }
.atlas-compact-trigger strong { margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 14px var(--serif); }
.atlas-compact-trigger em { margin-top: 1px; overflow: hidden; color: rgba(255,255,255,.42); font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.atlas-compact-trigger > i { color: var(--gold-light); font: 700 18px var(--serif); }
.country-picker { display: grid; grid-template-columns: 124px 1fr; gap: 18px; padding: 12px 40px; align-items: center; border-bottom: 1px solid rgba(255,255,255,.08); }
.country-picker > p { margin: 0; color: rgba(255,255,255,.58); font-size: 10px; letter-spacing: .08em; }
.country-picker > p span { margin-right: 7px; color: var(--gold-light); font: 700 15px var(--serif); }
.horizontal-picker { min-width: 0; display: grid; grid-template-columns: 28px minmax(0,1fr) 28px; gap: 7px; align-items: stretch; }
.picker-scroll-button { min-width: 0; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; background: rgba(255,255,255,.045); color: var(--gold-light); font: 700 20px/1 var(--serif); cursor: pointer; transition: border-color .18s, background .18s, opacity .18s; }
.picker-scroll-button:hover:not(:disabled) { border-color: var(--gold-light); background: rgba(215,183,115,.14); }
.picker-scroll-button:disabled { opacity: .2; cursor: default; }
.era-list { min-width: 0; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; mask-image: linear-gradient(90deg,transparent,#000 18px,#000 calc(100% - 18px),transparent); }
.era-list::-webkit-scrollbar, .region-symbols::-webkit-scrollbar, .country-symbols::-webkit-scrollbar { display: none; }
.era-timeline { min-width: calc(var(--era-count) * 78px); position: relative; display: grid; grid-template-columns: repeat(var(--era-count),minmax(72px,1fr)); gap: 7px; padding-top: 17px; }
.era-track { position: absolute; top: 8px; left: calc(50% / var(--era-count)); right: calc(50% / var(--era-count)); height: 2px; background: rgba(255,255,255,.18); }
.era-track span { display: block; width: 0; height: 100%; background: var(--gold-light); box-shadow: 0 0 10px rgba(215,183,115,.5); transition: width .45s ease; }
.era-button { min-width: 0; padding: 9px 5px; border: 0; border-radius: 9px; position: relative; background: transparent; color: rgba(255,255,255,.65); cursor: pointer; text-align: center; scroll-snap-align: center; transition: color .18s, background .18s, transform .18s; }
.era-button i { position: absolute; top: -15px; left: 50%; width: 10px; height: 10px; border: 2px solid #697a74; border-radius: 50%; background: var(--ink); transform: translateX(-50%); transition: .3s; }
.era-button strong, .era-button span { display: block; }
.era-button strong { color: #fff; font: 700 18px var(--serif); }
.era-button span { margin-top: 1px; font-size: 8px; white-space: nowrap; }
.era-button:hover, .era-button.is-active { color: #fff; background: rgba(215,183,115,.1); transform: translateY(-1px); }
.era-button.is-active i { border-color: #fff1c7; background: var(--gold-light); box-shadow: 0 0 0 5px rgba(215,183,115,.14); }
.region-symbols { display: flex; gap: 9px; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; scroll-snap-type: x proximity; mask-image: linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 16px),transparent); }
.region-symbol { min-width: 150px; padding: 10px 14px; display: grid; gap: 2px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.04); color: #fff; cursor: pointer; text-align: left; scroll-snap-align: start; transition: .18s; }
.region-symbol strong { font-size: 11px; }
.region-symbol small { color: rgba(255,255,255,.46); font-size: 8px; }
.region-symbol:hover, .region-symbol.is-active { border-color: var(--gold-light); background: rgba(215,183,115,.13); }
.region-symbol.is-active { box-shadow: 0 0 0 2px rgba(215,183,115,.09); }
.atlas-next-step:empty { display: none; }

.atlas-choice-dialog { width: min(560px,calc(100vw - 24px)); max-height: min(82dvh,760px); padding: 0; border: 1px solid rgba(215,183,115,.35); border-radius: 20px; background: #10261f; color: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.45); }
.atlas-choice-dialog::backdrop { background: rgba(6,17,14,.78); backdrop-filter: blur(5px); }
.atlas-choice-shell { max-height: min(82dvh,760px); display: flex; flex-direction: column; }
.atlas-choice-shell > header { flex: 0 0 auto; padding: 20px 22px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.1); }
.atlas-choice-shell > header h2 { margin: 3px 0 0; font: 700 22px var(--serif); }
.atlas-choice-shell > header button { width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: transparent; color: #fff; font-size: 22px; cursor: pointer; }
.atlas-choice-list { min-height: 0; padding: 14px; overflow-y: auto; }
.atlas-choice-dialog .era-list { overflow-x: hidden; scrollbar-width: auto; scroll-snap-type: none; mask-image: none; }
.atlas-choice-dialog .era-timeline { min-width: 0; display: grid; grid-template-columns: 1fr; gap: 7px; padding: 0; }
.atlas-choice-dialog .era-track, .atlas-choice-dialog .era-button i { display: none; }
.atlas-choice-dialog .era-button { min-width: 0; padding: 11px 13px; display: grid; grid-template-columns: 76px minmax(0,1fr); align-items: center; gap: 12px; border: 1px solid rgba(255,255,255,.08); text-align: left; }
.atlas-choice-dialog .era-button strong { font-size: 19px; }
.atlas-choice-dialog .era-button span { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.atlas-choice-dialog .region-symbols { max-width: none; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; overflow-x: hidden; overflow-y: auto; mask-image: none; }
.atlas-choice-dialog .region-symbol { min-width: 0; padding: 12px 14px; }
.country-symbols { display: flex; gap: 9px; min-width: 0; max-width: 100%; min-height: 52px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; scroll-snap-type: x proximity; mask-image: linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 16px),transparent); }
.picker-guidance { align-self: center; color: rgba(255,255,255,.42); font-size: 9px; }
.country-symbol { min-width: 238px; padding: 7px 12px 7px 8px; display: flex; align-items: center; gap: 11px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.04); color: #fff; cursor: pointer; text-align: left; scroll-snap-align: start; transition: .18s; }
.country-symbol.has-wide-name strong { max-width: 150px; white-space: normal; line-height: 1.25; }
.country-symbol:hover, .country-symbol.is-active { border-color: var(--gold-light); background: rgba(215,183,115,.13); }
.country-symbol.is-active { box-shadow: 0 0 0 2px rgba(215,183,115,.09); }
.country-flag { width: 55px; aspect-ratio: 3 / 2; flex: 0 0 auto; overflow: hidden; display: block; border: 1px solid rgba(255,255,255,.34); border-radius: 2px; background: #fff; box-shadow: 0 3px 9px rgba(0,0,0,.22); }
.country-flag img, .country-flag-svg { width: 100%; height: 100%; display: block; object-fit: fill; }
.country-flag-label { color: #24303c; font-family: "Times New Roman", serif; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.country-symbol strong, .country-symbol small { display: block; }
.country-symbol strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.country-symbol small { color: rgba(255,255,255,.46); font-size: 8px; line-height: 1.45; }
.country-symbol small:first-of-type { color: rgba(255,239,198,.76); }
.atlas-next-step { margin: 0; padding: 9px 40px; border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(215,183,115,.07); color: rgba(255,255,255,.67); font-size: 9px; letter-spacing: .025em; }
.atlas-stage { min-height: 480px; display: grid; grid-template-columns: minmax(230px,.7fr) minmax(560px,1.8fr); align-items: stretch; background: linear-gradient(135deg, #172e27, #0e211b); }
.map-copy { z-index: 2; padding: 52px 0 42px 40px; display: flex; flex-direction: column; align-items: flex-start; }
.map-overline { margin: 0; color: var(--gold-light); font-size: 9px; font-weight: 700; letter-spacing: .2em; }
.map-copy h4 { margin: 12px 0 13px; font: 700 clamp(24px,3vw,38px)/1.35 var(--serif); }
.map-country-heading span, .map-country-heading small { display: block; }
.map-country-heading small { margin-top: 5px; color: var(--gold-light); font: italic 500 clamp(13px,1.25vw,17px)/1.3 Georgia,serif; letter-spacing: .045em; }
.map-facts { margin: 0 0 16px; padding: 10px 13px; border-left: 2px solid var(--gold-light); background: rgba(255,255,255,.05); }
.map-facts p { margin: 0; }
.map-facts p + p { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.1); }
.map-facts span, .map-facts strong { display: block; }
.map-facts span { color: rgba(255,255,255,.42); font-size: 8px; letter-spacing: .12em; }
.map-facts strong { margin-top: 3px; color: #fff1c7; font-size: 11px; line-height: 1.5; }
.map-copy > p:not(.map-overline) { max-width: 330px; margin: 0; color: rgba(255,255,255,.58); font-size: 11px; }
.currency-chronology { width: min(100%,330px); min-height: 0; margin-top: 24px; padding-top: 15px; border-top: 1px solid rgba(215,183,115,.25); }
.currency-chronology > header { padding-left: 18px; }
.currency-chronology > header .eyebrow { margin: 0; color: var(--gold-light); font-size: 7px; letter-spacing: .2em; }
.currency-chronology h5 { margin: 3px 0 2px; font: 700 14px var(--serif); letter-spacing: .06em; }
.currency-chronology > header > span { display: block; color: rgba(255,255,255,.39); font-size: 8px; }
.currency-chronology-list { max-height: 250px; margin-top: 10px; padding: 3px 7px 3px 18px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(215,183,115,.5) transparent; }
.currency-era { width: 100%; min-height: 54px; padding: 7px 9px 7px 19px; position: relative; display: grid; grid-template-columns: 76px 1fr; grid-template-rows: auto auto; column-gap: 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; text-align: left; transition: .18s; }
.currency-era::before { content: ""; position: absolute; top: -5px; bottom: -5px; left: 5px; width: 1px; background: rgba(215,183,115,.28); }
.currency-era:first-child::before { top: 50%; }
.currency-era:last-child::before { bottom: 50%; }
.currency-era i { position: absolute; z-index: 1; top: 50%; left: 1px; width: 9px; height: 9px; border: 2px solid #819087; border-radius: 50%; background: #142a23; transform: translateY(-50%); transition: .18s; }
.currency-era-years { grid-row: 1 / 3; align-self: center; color: rgba(255,255,255,.45); font: 700 9px var(--serif); letter-spacing: .02em; }
.currency-era strong { align-self: end; color: #fff4d1; font-size: 10px; line-height: 1.35; }
.currency-era small { align-self: start; color: rgba(255,255,255,.43); font-size: 7px; line-height: 1.35; }
.currency-era:hover, .currency-era.is-active { border-color: rgba(215,183,115,.45); background: linear-gradient(90deg,rgba(215,183,115,.16),rgba(215,183,115,.045)); }
.currency-era.is-active i { border-color: #fff4cf; background: var(--gold-light); box-shadow: 0 0 0 4px rgba(215,183,115,.13),0 0 12px rgba(215,183,115,.7); }
.map-collection-button { margin-top: auto; }
.world-map-wrap { min-width: 0; padding: 24px 24px 18px 0; display: flex; flex-direction: column; justify-content: center; }
.world-map { width: 100%; height: auto; overflow: hidden; color: rgba(215,183,115,.07); cursor: grab; touch-action: none; user-select: none; }
.world-map:active { cursor: grabbing; }
.world-map:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.graticule { fill: none; stroke: rgba(215,183,115,.1); stroke-width: 1; }
.map-camera { transform-box: view-box; transform-origin: 0 0; transition: transform .72s cubic-bezier(.22,.75,.18,1); }
.world-map.is-interacting .map-camera { transition: none; }
.historical-map-data { transition: opacity .25s ease; }
.map-territory { fill: rgba(225,220,198,.13); stroke: transparent; pointer-events: none; }
.map-territory[data-map-feature-name] { cursor: pointer; pointer-events: visiblePainted; stroke: rgba(215,183,115,.001); stroke-width: 10; vector-effect: non-scaling-stroke; transition: fill .18s, stroke .18s; }
.map-territory[data-map-feature-name]:hover, .map-territory[data-map-feature-name]:focus-visible { fill: rgba(215,183,115,.42); stroke: rgba(255,230,166,.8); stroke-width: 1.5; vector-effect: non-scaling-stroke; outline: none; }
.historical-region-data, .historical-border-data, .historical-label { pointer-events: none; }
.map-region-hatch { fill: url(#mapRegionHatch); stroke: rgba(255,230,166,.9); stroke-width: 1.5; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 5px rgba(215,183,115,.32)); transform-box: fill-box; transform-origin: center; }
#mapRegionHatch line { stroke: rgba(255,226,158,.58); stroke-width: 2; }
.map-selected-border { fill: rgba(215,183,115,.83); stroke: #ffe6a6; stroke-width: 2.1; vector-effect: non-scaling-stroke; filter: url(#mapGlow); transform-box: fill-box; transform-origin: center; transition: fill .3s, stroke .3s, opacity .3s; }
.map-selected-border.outline-only { fill: rgba(215,183,115,.035); stroke: #ffe6a6; stroke-width: 2.6; filter: none; }
.map-selected-border.precision-1 { stroke-dasharray: 2.5 2.5; }
.map-selected-border.precision-2 { stroke-dasharray: 5 2; }
.map-context-boundary { fill: rgba(21,31,41,.62); stroke: #f5ca72; stroke-width: 1.7; stroke-dasharray: 4 2; vector-effect: non-scaling-stroke; }
.map-highlight-entering { animation: map-highlight-rise .72s cubic-bezier(.18,.82,.22,1) both; animation-delay: var(--map-entry-delay, 0ms); }
.map-selected-border.outline-only.map-highlight-entering { animation-name: map-outline-rise; }
.historical-border-data.is-burning-out .map-selected-border { animation: map-highlight-burn-out .56s cubic-bezier(.55,.02,.8,.35) both; pointer-events: none; }
.historical-border-data.is-burning-out .map-selected-border.outline-only { animation-name: map-outline-burn-out; }
.historical-region-data.is-burning-out .map-region-hatch { animation: map-region-burn-out .56s cubic-bezier(.55,.02,.8,.35) both; pointer-events: none; }
@keyframes map-highlight-rise {
  0% { opacity: 0; fill: rgba(255,242,196,.08); stroke: rgba(255,248,222,.2); transform: translateY(2px) scale(.92); }
  58% { opacity: 1; fill: rgba(255,226,150,.96); stroke: #fff8dc; transform: translateY(-1px) scale(1.025); }
  100% { opacity: 1; fill: rgba(215,183,115,.83); stroke: #ffe6a6; transform: translateY(0) scale(1); }
}
@keyframes map-outline-rise {
  0% { opacity: 0; fill: rgba(215,183,115,.015); stroke: rgba(255,248,222,.15); transform: translateY(2px) scale(.94); }
  58% { opacity: 1; fill: rgba(215,183,115,.035); stroke: #fff8dc; transform: translateY(-1px) scale(1.02); }
  100% { opacity: 1; fill: rgba(215,183,115,.035); stroke: #ffe6a6; transform: translateY(0) scale(1); }
}
@keyframes map-highlight-burn-out {
  0% { opacity: 1; fill: rgba(215,183,115,.83); stroke: #ffe6a6; transform: scale(1); }
  34% { opacity: 1; fill: rgba(255,177,63,.94); stroke: #fff7d2; transform: scale(1.018); }
  68% { opacity: .72; fill: rgba(151,49,24,.66); stroke: #ff8b45; stroke-dashoffset: 12; transform: scale(.99); }
  100% { opacity: 0; fill: rgba(34,18,12,0); stroke: rgba(102,45,27,0); stroke-dashoffset: 24; transform: scale(.955); }
}
@keyframes map-outline-burn-out {
  0% { opacity: 1; fill: rgba(215,183,115,.035); stroke: #ffe6a6; transform: scale(1); }
  38% { opacity: 1; fill: rgba(215,183,115,.035); stroke: #fff7d2; stroke-width: 3.4; transform: scale(1.012); }
  72% { opacity: .65; fill: rgba(215,183,115,.02); stroke: #ff7e3f; stroke-dashoffset: 14; transform: scale(.985); }
  100% { opacity: 0; fill: rgba(215,183,115,0); stroke: rgba(102,45,27,0); stroke-dashoffset: 28; transform: scale(.96); }
}
@keyframes map-region-burn-out {
  0% { opacity: 1; stroke: rgba(255,230,166,.9); transform: scale(1); }
  38% { opacity: 1; stroke: #fff7d2; transform: scale(1.012); }
  72% { opacity: .6; stroke: #ff7e3f; stroke-dashoffset: 14; transform: scale(.985); }
  100% { opacity: 0; stroke: rgba(102,45,27,0); stroke-dashoffset: 28; transform: scale(.96); }
}
.historical-label { opacity: 0; transition: opacity .35s ease .15s; }
.historical-label.is-visible { opacity: 1; }
.map-marker { fill: #fff4cf; stroke: var(--burgundy); stroke-width: 3; }
.map-label { fill: #fff7de; font: 700 13px var(--sans); paint-order: stroke; stroke: #12261f; stroke-width: 5px; }
.map-legend { margin-top: 10px; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.07); display: flex; justify-content: flex-end; gap: 20px; color: rgba(255,255,255,.42); font-size: 8px; letter-spacing: .08em; }
.map-legend span:first-child { display: flex; align-items: center; gap: 6px; }
.map-legend b { font: inherit; font-weight: 400; }
.map-legend i { width: 10px; height: 10px; border: 1px solid #ffdf91; background: rgba(215,183,115,.72); }
.map-legend.is-outline-only i { border-width: 2px; background: transparent; }
.map-secondary-actions { min-height: 37px; padding: 0 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.map-action-notes { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.map-controls { display: inline-flex; overflow: hidden; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; }
.map-controls button { width: 34px; height: 30px; border: 0; border-right: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.045); color: #fff1c7; cursor: pointer; font: 700 16px/1 var(--sans); }
.map-controls button:last-child { border-right: 0; }
.map-controls button:hover, .map-controls button:focus-visible { background: rgba(215,183,115,.2); outline: none; }
.map-clear-selection { min-height: 25px; padding: 3px 8px; border: 0; border-bottom: 1px solid rgba(255,255,255,.18); background: transparent; color: rgba(255,255,255,.38); font-size: 8px; cursor: pointer; }
.map-clear-selection:hover, .map-clear-selection:focus-visible { border-bottom-color: rgba(255,255,255,.55); color: rgba(255,255,255,.75); outline: none; }
.atlas-source-note { position: relative; }
.atlas-source-note summary { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: rgba(255,255,255,.58); cursor: pointer; list-style: none; font: 700 12px/1 Georgia,serif; }
.atlas-source-note summary::-webkit-details-marker { display: none; }
.atlas-source-note summary:hover, .atlas-source-note summary:focus-visible, .atlas-source-note[open] summary { border-color: rgba(215,183,115,.65); background: rgba(215,183,115,.12); color: #fff1c7; outline: none; }
.atlas-source-note p { width: min(360px,calc(100vw - 54px)); margin: 0; padding: 12px 14px; position: absolute; z-index: 5; top: 36px; right: 0; border: 1px solid rgba(215,183,115,.3); border-radius: 9px; background: rgba(8,25,20,.97); color: rgba(255,255,255,.65); box-shadow: 0 12px 30px rgba(0,0,0,.32); font-size: 9px; line-height: 1.7; letter-spacing: .02em; }
.atlas-source-note p strong { display: block; margin-bottom: 3px; color: #fff1c7; font-size: 9px; letter-spacing: .1em; }
.era-button:focus-visible, .region-symbol:focus-visible, .country-symbol:focus-visible, .currency-era:focus-visible, .map-collection-button:focus-visible, .picker-scroll-button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.hero-panel { min-height: 340px; padding: 46px clamp(28px, 4vw, 58px); border-radius: 26px; position: relative; overflow: hidden; background: var(--ink); color: #fff; display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; box-shadow: var(--shadow); }
.hero-panel::before { content: ""; position: absolute; inset: 0; opacity: .18; background: repeating-radial-gradient(circle at 85% 50%, transparent 0 18px, #d7b773 19px 20px); mask-image: linear-gradient(to left, #000, transparent 56%); }
.hero-panel::after { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(215,183,115,.22); border-radius: 19px; pointer-events: none; }
.hero-copy { position: relative; z-index: 2; max-width: 650px; }
.hero-kicker { color: var(--gold-light); font-size: 10px; letter-spacing: .25em; font-weight: 700; }
.hero-copy h3 { max-width: 600px; margin: 12px 0 18px; font-family: var(--serif); font-size: clamp(30px, 4vw, 53px); line-height: 1.32; letter-spacing: .03em; }
.hero-copy > p:not(.hero-kicker) { max-width: 600px; margin: 0; color: rgba(255,255,255,.65); font-size: 14px; }
.hero-actions { display: flex; align-items: center; gap: 22px; margin-top: 28px; }
.specimen-stack { min-height: 245px; position: relative; z-index: 1; perspective: 800px; }
.specimen { position: absolute; width: min(340px, 93%); aspect-ratio: 2 / 1; right: 1%; top: 30px; border-radius: 9px; border: 1px solid rgba(255,255,255,.32); background: #d8c8a0; box-shadow: 0 18px 40px rgba(0,0,0,.24); overflow: hidden; }
.specimen::after { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(30,55,45,.35); background: repeating-radial-gradient(ellipse at center, transparent 0 7px, rgba(20,39,32,.09) 8px 9px); }
.specimen-back { transform: rotate(8deg) translate(18px,-16px); opacity: .42; }
.specimen-mid { transform: rotate(-5deg) translate(-8px,3px); opacity: .65; color: var(--ink); display: grid; place-items: center; font-family: var(--serif); letter-spacing: .3em; }
.specimen-front { padding: 29px; display: flex; align-items: center; gap: 24px; transform: rotate(1deg); background: #e8d9af; color: var(--ink); }
.specimen-front > * { position: relative; z-index: 2; }
.specimen-seal { width: 80px; height: 80px; flex: 0 0 auto; border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font: 38px var(--serif); }
.specimen-front small, .specimen-front span { display: block; font-size: 8px; letter-spacing: .16em; }
.specimen-front strong { display: block; font-size: 43px; line-height: 1.05; font-family: var(--serif); }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0; }
.metric-card { min-height: 132px; padding: 22px; border: 1px solid rgba(217,208,191,.8); border-radius: var(--radius); background: var(--card); }
.metric-top { display: flex; align-items: center; justify-content: space-between; }
.metric-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--paper-deep); color: var(--burgundy); }
.metric-card p { margin: 0; color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-card strong { display: block; margin-top: 10px; font: 700 27px var(--serif); }
.metric-card small { color: var(--muted); font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(320px,.8fr); gap: 20px; }
.panel { border: 1px solid rgba(217,208,191,.78); border-radius: var(--radius); background: var(--card); box-shadow: 0 4px 18px rgba(34,39,32,.035); }
.country-panel, .rarity-panel, .activity-panel { padding: 26px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.panel-heading h3 { margin: 3px 0 0; font-family: var(--serif); font-size: 19px; }
.formula-pill { padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 9px; }
.ranking-list { display: grid; gap: 16px; }
.ranking-row { display: grid; grid-template-columns: 128px 1fr 30px; gap: 13px; align-items: center; font-size: 12px; }
.ranking-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-bar { height: 7px; border-radius: 99px; background: var(--paper-deep); overflow: hidden; }
.ranking-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--burgundy), #b86661); }
.ranking-count { font-weight: 700; text-align: right; }
.rarity-list { display: grid; }
.rarity-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.rarity-row:first-child { border-top: 0; }
.mini-note { width: 46px; height: 31px; border: 1px solid var(--ink-soft); border-radius: 3px; background: #d9cfaa; position: relative; overflow: hidden; }
.mini-note::before { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(20,39,32,.4); border-radius: 50%; }
.rarity-info strong { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.rarity-info span { color: var(--muted); font-size: 9px; }
.rarity-score { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--gold-light); font: 700 12px var(--serif); }
.activity-panel { margin-top: 20px; }
.activity-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.lot-chip { min-width: 0; padding: 14px; border-radius: 13px; background: var(--paper-deep); }
.lot-chip time { color: var(--muted); font-size: 9px; }
.lot-chip strong { display: block; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.lot-chip span { color: var(--burgundy); font: 700 13px var(--serif); }

.section-intro { min-height: 102px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 0 2px 24px; }
.section-intro h3 { margin: 2px 0 5px; font: 700 28px var(--serif); }
.section-intro p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; }
.collection-intro { min-height: auto; align-items: center; padding-top: 18px; }
.segmented { padding: 3px; display: flex; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.4); }
.segmented button { border: 0; border-radius: 7px; padding: 7px 13px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.segmented button.is-active { color: #fff; background: var(--ink); }
.source-ribbon { margin: 0 0 12px; padding: 12px 16px; border: 1px solid rgba(183,139,59,.35); border-radius: 13px; background: linear-gradient(90deg, rgba(183,139,59,.12), rgba(255,255,255,.38)); display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 10px; }
.source-ribbon b { color: var(--ink); margin-right: 7px; }
.image-collection-policy { margin: 0 0 14px; padding: 16px 18px; border: 1px solid rgba(183,139,59,.38); border-radius: 15px; background: linear-gradient(135deg, rgba(183,139,59,.13), rgba(255,255,255,.5)); display: grid; grid-template-columns: minmax(0,1fr) minmax(260px,.55fr); gap: 22px; align-items: center; }
.image-collection-policy h4 { margin: 3px 0 5px; font: 700 16px var(--serif); }
.image-collection-policy p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 10px; }
.image-collection-policy details { min-width: 0; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.55); font-size: 10px; }
.image-collection-policy summary { color: var(--burgundy); font-weight: 700; cursor: pointer; }
.image-collection-policy ul { margin: 9px 0 0; padding-left: 18px; color: var(--muted); }
.image-collection-policy li + li { margin-top: 4px; }
.collection-filter-panel { margin-bottom: 16px; }
.collection-filter-panel > summary { display: none; }
.collection-filter-panel:not([open]) > .filter-bar { display: flex; }
.filter-bar { padding: 14px 17px; border: 1px solid var(--line); border-radius: 15px; display: flex; align-items: end; gap: 12px; background: rgba(255,255,255,.4); }
.filter-bar label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; }
.filter-bar select { min-width: 132px; height: 36px; padding: 0 28px 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card-solid); color: var(--ink); font-size: 11px; }
.filter-bar .switch-filter { min-height: 36px; display: flex; flex-direction: row; gap: 7px; align-items: center; padding: 0 8px; color: var(--ink); font-size: 11px; }
.collection-summary { display: flex; justify-content: space-between; padding: 8px 3px 11px; color: var(--muted); font-size: 11px; }
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.note-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--card); cursor: pointer; transition: transform .2s, box-shadow .2s; }
.note-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.note-visual { aspect-ratio: 2.05 / 1; margin: 11px; border-radius: 10px; overflow: hidden; position: relative; background: var(--note-bg, #c7b77f); color: var(--ink); }
.note-visual::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(20,39,32,.4); background: repeating-radial-gradient(ellipse at 72% 50%, transparent 0 8px, rgba(20,39,32,.08) 9px 10px); }
.note-visual::after { content: ""; position: absolute; width: 30%; aspect-ratio: 1; left: 12%; top: 50%; transform: translateY(-50%); border: 2px solid rgba(20,39,32,.5); border-radius: 50%; box-shadow: 0 0 0 5px rgba(255,255,255,.12); }
.note-visual img { width: 100%; height: 100%; display: block; object-fit: contain; position: relative; z-index: 2; background: #eee7d8; }
.note-denom { position: absolute; right: 13px; bottom: 10px; z-index: 1; font: 700 clamp(18px,3vw,27px) var(--serif); }
.note-country-code { position: absolute; left: 12px; top: 9px; z-index: 1; font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.note-body { padding: 4px 17px 17px; }
.note-meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.country-label { color: var(--burgundy); font-size: 9px; font-weight: 700; }
.commemorative-label { color: #7a4b00; background: #fff1ca; border: 1px solid #e4c06b; border-radius: 999px; padding: 2px 7px; font-size: 9px; font-weight: 800; }
.rarity-label { color: var(--muted); font-size: 9px; }
.note-body h4 { margin: 5px 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 16px var(--serif); }
.note-body p { margin: 0; min-height: 35px; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--muted); font-size: 10px; }
.note-footer { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.qty-pill { color: var(--ink); font-weight: 700; }
.duplicate-pill { color: var(--burgundy); }
.empty-state { grid-column: 1 / -1; padding: 70px 20px; border: 1px dashed var(--line); border-radius: 18px; text-align: center; color: var(--muted); }
.collection-grid.is-table { display: block; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card); }
.collection-grid.is-table .note-card { border: 0; border-radius: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 125px 1fr; }
.collection-grid.is-table .note-card:first-child { border-top: 0; }
.collection-grid.is-table .note-visual { margin: 10px; }
.collection-grid.is-table .note-body { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; }
.collection-grid.is-table .note-meta { align-items: flex-start; flex-direction: column; }
.collection-grid.is-table .note-body h4 { margin: 0; }
.collection-grid.is-table .note-body p { min-height: 0; }
.collection-grid.is-table .note-footer { margin: 0; padding: 0; border: 0; align-items: flex-end; flex-direction: column; }

.trade-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 18px; }
.trade-stat { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.trade-stat span { color: var(--muted); font-size: 9px; }
.trade-stat strong { display: block; margin-top: 4px; font: 700 21px var(--serif); }
.trade-grid { grid-template-columns: 1.2fr .8fr; }
.trade-grid .panel { padding: 24px; min-width: 0; }
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.data-table th { padding: 9px 7px; color: var(--muted); font-size: 8px; letter-spacing: .08em; text-align: left; border-bottom: 1px solid var(--line); }
.data-table td { padding: 11px 7px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.sale-list { display: grid; }
.sale-row { padding: 13px 0; display: grid; grid-template-columns: 1fr auto; gap: 10px; border-top: 1px solid var(--line); }
.sale-row:first-child { border-top: 0; }
.sale-row strong { display: block; font-size: 11px; }
.sale-row span { color: var(--muted); font-size: 9px; }
.sale-row b { font: 700 13px var(--serif); }
.empty-mini { padding: 42px 18px; color: var(--muted); text-align: center; font-size: 11px; }

.storage-hero { min-height: 170px; padding: 28px; display: flex; align-items: center; gap: 28px; }
.storage-gauge { --coverage: 0deg; width: 105px; height: 105px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--burgundy) var(--coverage), var(--paper-deep) 0); position: relative; }
.storage-gauge::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--card); }
.storage-gauge span { position: relative; z-index: 1; font: 700 20px var(--serif); }
.storage-hero h3 { margin: 5px 0; font: 700 21px var(--serif); }
.storage-hero p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; }
.storage-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 18px; }
.binder-card { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.binder-head { display: flex; align-items: center; justify-content: space-between; }
.binder-icon { width: 34px; height: 43px; border-radius: 3px 7px 7px 3px; background: var(--ink-soft); border-left: 5px solid var(--gold); }
.binder-count { font: 700 21px var(--serif); }
.binder-card h4 { margin: 13px 0 6px; font: 700 15px var(--serif); }
.binder-card p { margin: 0; color: var(--muted); font-size: 10px; }
.binder-samples { margin-top: 13px; display: flex; }
.binder-samples span { width: 26px; height: 26px; margin-left: -5px; border: 2px solid var(--card); border-radius: 50%; display: grid; place-items: center; background: var(--paper-deep); color: var(--ink); font-size: 8px; }
.binder-samples span:first-child { margin-left: 0; }

.settings-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
.settings-card { padding: 26px; }
.settings-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 12px; background: var(--ink); color: var(--gold-light); font-size: 9px; font-weight: 700; letter-spacing: .06em; }
.settings-card h3 { margin: 15px 0 6px; font: 700 17px var(--serif); }
.settings-card > p { margin: 0 0 14px; color: var(--muted); font-size: 11px; }
.path-list { margin: 15px 0; display: grid; gap: 9px; }
.path-list div { display: grid; grid-template-columns: 72px 1fr; gap: 10px; }
.path-list dt { color: var(--muted); font-size: 10px; }
.path-list dd { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, monospace; font-size: 10px; }
.muted { color: var(--muted)!important; font-size: 9px!important; }
code { padding: 2px 5px; border-radius: 4px; background: var(--paper-deep); }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.source-link { display: block; padding: 8px 0; border-top: 1px solid var(--line); color: var(--burgundy); font-size: 11px; font-weight: 700; text-decoration: none; }
.security-note { margin-top: 18px; padding: 17px 20px; border-left: 3px solid var(--burgundy); background: var(--burgundy-soft); display: flex; align-items: baseline; gap: 12px; font-size: 10px; }
.security-note strong { color: var(--burgundy); white-space: nowrap; }
.app-footer { margin-top: 30px; padding: 15px 2px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 10px; }
.app-footer strong { color: var(--ink); font-weight: 700; }

.modal { width: min(920px, calc(100vw - 30px)); max-height: min(90vh, 920px); padding: 0; border: 0; border-radius: 20px; background: var(--card-solid); color: var(--ink); box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.note-modal { width: min(1180px, calc(100vw - 30px)); }
.modal::backdrop { background: rgba(12,25,21,.72); backdrop-filter: blur(4px); }
.modal-shell { display: flex; flex-direction: column; max-height: min(90vh, 920px); }
.modal-shell.compact { width: min(520px, calc(100vw - 30px)); }
.modal-header { flex: 0 0 auto; padding: 22px 26px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 3px 0 0; font: 700 22px var(--serif); }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; }
.modal-body { overflow-y: auto; padding: 8px 26px 22px; }
.note-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 430px); gap: 26px; align-items: start; }
.note-editor-fields { min-width: 0; }
.form-section { padding: 19px 0; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.form-section h3 { margin: 0 0 14px; font: 700 15px var(--serif); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); outline: 0; }
.form-grid textarea { resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(183,139,59,.1); }
.form-grid .span-2 { grid-column: span 2; }
.note-image-pane { min-width: 0; position: sticky; top: 8px; margin-top: 19px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.note-image-pane h3 { margin: 3px 0 14px; font: 700 17px var(--serif); }
.note-image-preview { display: grid; grid-template-columns: 1fr; gap: 12px; }
.note-image-preview[hidden] { display: none; }
.note-image-preview figure { margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-solid); }
.note-image-preview img { width: auto; max-width: 100%; height: auto; max-height: min(255px, 31vh); margin-inline: auto; display: block; object-fit: contain; }
.note-image-preview figcaption { margin-top: 6px; color: var(--muted); font-size: 10px; text-align: center; }
.note-image-empty { margin: 0; padding: 28px 14px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 10px; text-align: center; }
.modal-footer { flex: 0 0 auto; padding: 15px 26px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; background: var(--paper); }
.public-note-modal { width: min(1080px, calc(100vw - 30px)); }
.public-note-body { padding-top: 24px; display: grid; grid-template-columns: minmax(300px,.9fr) minmax(0,1.1fr); gap: 26px; }
.public-note-images { min-width: 0; display: grid; gap: 14px; align-content: start; }
.public-note-images figure { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.public-note-images img { width: 100%; max-height: 280px; display: block; object-fit: contain; }
.public-note-images figcaption { margin-top: 7px; color: var(--muted); font-size: 10px; text-align: center; }
.public-note-empty { margin: 0; padding: 40px 16px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.public-note-rights { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; text-align: center; }
.public-note-copy { min-width: 0; }
.public-note-rarity { display: inline-block; margin-bottom: 14px; padding: 5px 9px; border-radius: 999px; background: var(--burgundy-soft); color: var(--burgundy); font-size: 10px; font-weight: 700; }
.public-note-facts { margin: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-top: 1px solid var(--line); }
.public-note-facts div { min-width: 0; padding: 11px 0; border-bottom: 1px solid var(--line); }
.public-note-facts div:nth-child(odd) { padding-right: 14px; }
.public-note-facts dt { color: var(--muted); font-size: 9px; }
.public-note-facts dd { margin: 3px 0 0; font: 700 13px var(--serif); overflow-wrap: anywhere; }
.public-note-copy section { margin-top: 20px; }
.public-note-copy section h3 { margin: 4px 0 8px; font: 700 17px var(--serif); }
.public-note-copy section > p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.9; white-space: pre-line; }
.public-note-story { display: grid; gap: 11px; }
.public-note-story-block { padding: 11px 13px 12px; border-left: 2px solid var(--gold); background: var(--paper); }
.public-note-story-block h4 { margin: 0 0 4px; color: var(--ink); font: 700 12px var(--serif); }
.public-note-story-block p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.public-note-story-block:first-child { padding-top: 0; border-left: 0; background: transparent; }
.footer-spacer { flex: 1; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: min(380px, calc(100vw - 30px)); padding: 13px 17px; border-radius: 11px; background: var(--ink); color: #fff; box-shadow: var(--shadow); font-size: 11px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .22s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: var(--burgundy); }

@media (max-width: 1180px) {
  .main-content { padding-inline: 30px; }
  .metrics-grid { grid-template-columns: repeat(2,1fr); }
  .collection-grid { grid-template-columns: repeat(2,1fr); }
  .hero-panel { grid-template-columns: 1fr .75fr; }
  .specimen-front { padding: 20px; gap: 15px; }
  .specimen-seal { width: 58px; height: 58px; }
  .activity-strip { grid-template-columns: repeat(2,1fr); }
  .filter-bar { flex-wrap: wrap; }
  .atlas-stage { grid-template-columns: 1fr; }
  .atlas-heading, .atlas-primary-pickers, .country-picker, .atlas-next-step { padding-inline: 30px; }
  .map-copy { min-height: 205px; padding: 30px 30px 8px; }
  .map-copy > p:not(.map-overline) { max-width: 620px; }
  .currency-chronology { width: 100%; max-width: 720px; }
  .currency-chronology-list { max-height: 225px; }
  .map-collection-button { margin-top: 22px; }
  .world-map-wrap { padding: 0 24px 22px; }
}

@media (max-width: 880px) {
  .app-shell { grid-template-columns: 82px minmax(0,1fr); }
  .sidebar { padding: 22px 12px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > div:last-child, .nav-item span:last-child, .sidebar-foot p, .connection-line span:last-child { display: none; }
  .nav-item { justify-content: center; padding-inline: 0; }
  .sidebar-foot { display: grid; place-items: center; }
  .hero-panel { grid-template-columns: 1fr; }
  .specimen-stack { display: none; }
  .dashboard-grid, .trade-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; padding-block: 24px; }
  .topbar-actions { align-items: stretch; flex-direction: column-reverse; }
  .global-search { min-width: 250px; }
  .settings-grid { grid-template-columns: 1fr; }
  .note-editor-layout { grid-template-columns: 1fr; }
  .note-image-pane { position: static; grid-row: 1; }
  .note-image-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-note-body { grid-template-columns: 1fr; }
  .public-note-images { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .image-collection-policy { grid-template-columns: 1fr; gap: 12px; }
  .atlas-stage { grid-template-columns: 1fr; }
  .map-copy { min-height: 230px; padding: 32px 30px 10px; }
  .map-collection-button { margin-top: 24px; }
  .world-map-wrap { padding: 0 20px 20px; }
  .era-timeline { min-width: calc(var(--era-count) * 72px); }
}

@media (max-width: 680px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: 70px; padding: 7px 10px max(7px, env(safe-area-inset-bottom)); display: block; background: rgba(20,39,32,.98); backdrop-filter: blur(12px); }
  .sidebar::after, .brand, .sidebar-foot { display: none; }
  .primary-nav { height: 100%; margin: 0; grid-template-columns: repeat(5,1fr); gap: 2px; }
  .nav-item { height: 100%; padding: 5px 2px; flex-direction: column; gap: 1px; border-radius: 8px; font-size: 8px; }
  .nav-item span:last-child { display: inline; }
  .nav-icon { height: 25px; font-size: 17px; }
  .nav-item.is-active::before { inset: auto 25% 0; width: 50%; height: 2px; }
  .main-content { padding: 0 15px 100px; }
  .topbar { min-height: auto; padding: 15px 1px 17px; display: block; }
  .topbar > div:first-child { display: block; margin: 0 2px 10px; }
  .topbar > div:first-child .eyebrow { display: none; }
  .topbar h2 { margin: 0; font-size: 19px; line-height: 1.35; }
  .topbar-actions { flex-direction: row; gap: 8px; }
  .global-search { min-width: 0; flex: 1; height: 42px; }
  .topbar .button { padding-inline: 12px; font-size: 0; }
  .topbar .button span { font-size: 19px; }
  .hero-panel { min-height: 375px; padding: 35px 24px; border-radius: 19px; }
  .hero-copy h3 { font-size: 34px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 13px; }
  .metrics-grid { gap: 10px; }
  .metric-card { min-height: 112px; padding: 16px; }
  .metric-card strong { font-size: 21px; }
  .metric-icon { width: 30px; height: 30px; }
  .dashboard-grid { gap: 12px; }
  .country-panel, .rarity-panel, .activity-panel { padding: 19px; }
  .ranking-row { grid-template-columns: 100px 1fr 24px; }
  .activity-strip { grid-template-columns: 1fr; }
  .section-intro { min-height: auto; padding: 16px 1px; align-items: flex-start; }
  .section-intro h3 { font-size: 24px; }
  .section-intro > div > p:not(.eyebrow) { max-width: 230px; }
  .collection-filter-panel { margin: 0 0 12px; }
  .collection-filter-panel > summary { min-height: 44px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 11px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.55); color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
  .collection-filter-panel > summary small { color: var(--burgundy); font-size: 9px; font-weight: 700; }
  .collection-filter-panel:not([open]) > .filter-bar { display: none; }
  .collection-filter-panel[open] > summary { border-radius: 11px 11px 0 0; border-bottom-color: transparent; }
  .filter-bar { margin-top: 0; padding: 12px; border-radius: 0 0 11px 11px; align-items: stretch; gap: 8px; }
  .source-ribbon { align-items: flex-start; flex-direction: column; gap: 4px; }
  .has-active-search .image-collection-policy, .has-active-search .source-ribbon { display: none; }
  .collection-summary { align-items: flex-start; gap: 8px; padding: 4px 3px 9px; }
  .collection-summary span:last-child { max-width: 58%; text-align: right; font-size: 9px; }
  .filter-bar label:not(.switch-filter) { flex: 1 1 calc(50% - 8px); }
  .filter-bar select { width: 100%; min-width: 0; }
  .filter-bar .button { flex: 1 1 100%; }
  .collection-grid { grid-template-columns: 1fr; }
  .collection-grid.is-table .note-card { grid-template-columns: 90px 1fr; }
  .collection-grid.is-table .note-body { grid-template-columns: 1fr; padding: 9px; }
  .collection-grid.is-table .note-body p { display: none; }
  .collection-grid.is-table .note-footer { align-items: flex-start; }
  .trade-metrics { grid-template-columns: repeat(2,1fr); }
  .storage-hero { align-items: flex-start; }
  .storage-gauge { width: 82px; height: 82px; }
  .storage-grid { grid-template-columns: 1fr; }
  .settings-card { padding: 21px; }
  .security-note { align-items: flex-start; flex-direction: column; gap: 3px; }
  .modal { width: 100vw; max-width: none; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .modal-shell, .modal-shell.compact { width: 100%; max-height: 100dvh; height: 100%; }
  .modal-header, .modal-footer { padding-inline: 17px; }
  .modal-body { padding-inline: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .note-image-preview { grid-template-columns: 1fr; }
  .public-note-body { display: block; padding-top: 17px; }
  .public-note-images { grid-template-columns: 1fr; }
  .public-note-images img { max-height: 34vh; }
  .public-note-copy { padding-top: 18px; }
  .modal-footer .button { padding-inline: 11px; }
  .toast { right: 15px; bottom: 85px; }
  .atlas-hero { border-radius: 18px; }
  .atlas-heading { padding: 25px 20px 20px; align-items: flex-start; }
  .atlas-heading h3 { font-size: 29px; }
  .atlas-heading > div:first-child > p:last-child { font-size: 10px; }
  .atlas-count { min-width: 68px; padding-left: 12px; }
  .atlas-count strong { font-size: 26px; }
  .atlas-primary-pickers { padding: 10px 14px; gap: 7px; }
  .atlas-compact-trigger { min-height: 58px; padding: 7px 9px; gap: 7px; }
  .atlas-picker-step { font-size: 15px; }
  .atlas-compact-trigger strong { font-size: 12px; }
  .country-picker { grid-template-columns: 60px minmax(0,1fr); gap: 5px; padding: 9px 14px; }
  .country-picker > p { line-height: 1.35; }
  .country-picker > p span { display: block; margin: 0 0 2px; }
  .horizontal-picker { grid-template-columns: 30px minmax(0,1fr) 30px; gap: 5px; }
  .country-symbols { margin: 0; padding: 0; overflow-x: auto; }
  .country-symbol { min-width: 195px; }
  .atlas-choice-dialog .region-symbols { grid-template-columns: 1fr; }
  .atlas-next-step { padding: 9px 20px; }
  .map-copy { min-height: 250px; padding: 30px 20px 8px; }
  .currency-chronology-list { max-height: 285px; }
  .world-map-wrap { min-height: 250px; padding: 0 7px 18px; overflow: hidden; }
  .world-map { width: 128%; max-width: none; height: auto; margin-left: -14%; }
  .map-legend { justify-content: center; }
  .map-legend { margin-top: 14px; padding-top: 16px; }
  .map-secondary-actions { min-height: 42px; padding: 0 12px 12px; }
  .map-controls button { width: 40px; height: 36px; }
  .atlas-source-note p { position: fixed; top: auto; right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; transition-duration: .01ms!important; }
}
