/* =============================================================================
   Sommermarken — design system
   A restrained tribute palette: warm parchment, deep ink, antiqued gold rules.
   ============================================================================= */

:root {
    --bg: #fbf6ec;
    --bg-sunken: #f3ecd9;
    --bg-card: #fefaf2;
    --ink: #1c1a17;
    --ink-soft: #4a4036;
    --ink-mute: #7a6e60;
    --rule: #d8cfb9;
    --rule-strong: #b8aa8b;
    --gold: #9a7b3a;
    --gold-soft: #c7a55b;
    --accent-stamp: #6d3a2a;
    --shadow-card: 0 1px 2px rgba(28, 26, 23, 0.04), 0 4px 14px rgba(28, 26, 23, 0.06);
    --shadow-card-hover: 0 1px 2px rgba(28, 26, 23, 0.05), 0 10px 24px rgba(28, 26, 23, 0.09);
    --font-display: "Cormorant Garamond", "Hoefler Text", Georgia, serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --transition: 200ms ease;
    --radius-sm: 3px;
    --radius: 6px;
    --radius-lg: 10px;
    --max-content: 1100px;
    --max-grid: 1300px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.6;
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
    color: var(--accent-stamp);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}
a:hover { color: var(--ink); border-bottom-color: var(--gold-soft); }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--ink);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.005em;
    margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 500; letter-spacing: 0.01em; }
h2 { font-size: clamp(1.55rem, 2.8vw, 2.1rem); font-weight: 500; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }

p { margin: 0 0 1em; }
.lede { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.5; color: var(--ink-soft); font-weight: 500; }
.quiet { color: var(--ink-mute); }
.kicker {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--gold);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
}
.skip-link:focus {
    left: 1rem;
    top: 1rem;
    background: var(--bg-card);
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--rule);
    z-index: 100;
}

/* =============================================================================
   Header / footer
============================================================================= */
.site-header {
    border-bottom: 1px solid var(--rule);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(251, 246, 236, 0.92);
}
.site-header-inner {
    max-width: var(--max-grid);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border: 0;
    color: var(--ink);
}
.brand:hover { color: var(--ink); border-bottom-color: transparent; }
.brand-mark {
    width: 2.5rem;
    height: 3rem;
    display: block;
    flex: 0 0 auto;
}
.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(28, 26, 23, 0.16));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.brand-tag {
    font-size: 0.78rem;
    color: var(--ink-mute);
    font-weight: 400;
    margin-top: 0.15rem;
}

.primary-nav { margin-left: auto; }
.primary-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.primary-nav a {
    color: var(--ink-soft);
    font-size: 0.95rem;
    font-weight: 500;
    border: 0;
    padding: 0.25rem 0;
    border-bottom: 1px solid transparent;
}
.primary-nav a:hover { color: var(--ink); border-bottom-color: var(--gold-soft); }
.primary-nav a.active { color: var(--ink); border-bottom-color: var(--gold); }

.lang-toggle {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--ink-mute);
}
.lang-toggle a {
    color: var(--ink-mute);
    border: 0;
    padding: 0.15rem 0.25rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}
.lang-toggle a:hover { color: var(--ink); }
.lang-toggle a.active { color: var(--gold); }

main {
    flex: 1;
    width: 100%;
}

.site-footer {
    border-top: 1px solid var(--rule);
    margin-top: 5rem;
    padding: 2rem 1.5rem;
    background: var(--bg);
    color: var(--ink-mute);
    font-size: 0.88rem;
}
.site-footer-inner {
    max-width: var(--max-grid);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* =============================================================================
   Layout containers
============================================================================= */
.container {
    max-width: var(--max-content);
    margin: 0 auto;
    padding: 3rem 1.5rem;
}
.container-wide {
    max-width: var(--max-grid);
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.section-rule {
    height: 1px;
    background: var(--rule);
    margin: 3rem 0;
    border: 0;
}

/* =============================================================================
   Hero (homepage)
============================================================================= */
.hero {
    max-width: var(--max-grid);
    margin: 0 auto;
    padding: 4rem 1.5rem 2rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
}
@media (min-width: 800px) {
    .hero { grid-template-columns: 0.9fr 1.1fr; padding-top: 5rem; }
}
.hero-portrait {
    aspect-ratio: 4/5;
    background: var(--bg-sunken);
    border: 1px solid var(--rule);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    position: relative;
    display: grid;
    place-items: center;
    color: var(--ink-mute);
    font-family: var(--font-display);
    font-size: 1.05rem;
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; }
.hero-portrait-image {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    overflow: visible;
}
.hero-portrait-image img {
    object-fit: contain;
    filter: drop-shadow(0 1.4rem 1.2rem rgba(28, 26, 23, 0.14));
}
.hero-portrait-empty {
    text-align: center;
    padding: 1.5rem;
    line-height: 1.4;
}
.hero-portrait-empty::before {
    content: "";
    display: block;
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    border: 1px solid var(--rule-strong);
    border-radius: 50%;
    background: var(--bg);
}

.hero-text .kicker { display: block; margin-bottom: 0.8rem; }
.hero-text h1 { margin: 0 0 0.7rem; }
.hero-subtitle {
    font-family: var(--font-display);
    font-size: 1.45rem;
    color: var(--ink-soft);
    font-weight: 500;
    margin: 0 0 1.5rem;
}
.hero-text p { color: var(--ink-soft); font-size: 1.05rem; max-width: 36rem; }
.hero-text p[lang] + p[lang] { margin-top: 0.7rem; }

/* =============================================================================
   Stats strip
============================================================================= */
.stats {
    max-width: var(--max-grid);
    margin: 3rem auto 0;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1px;
    background: var(--rule);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}
.stat {
    background: var(--bg);
    padding: 1.5rem 1rem;
    text-align: center;
}
.stat-value {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    line-height: 1.05;
}
.stat-label {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.7rem;
    color: var(--ink-mute);
    margin-top: 0.6rem;
    font-weight: 500;
}

/* =============================================================================
   Family photographs
============================================================================= */
.memory-strip {
    max-width: var(--max-grid);
    margin: 2rem auto 1.5rem;
    padding: 0 1.5rem;
}
.memory-strip-inner {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1rem, 2.5vw, 2rem);
    align-items: center;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 1.1rem 0;
}
.memory-thumb {
    margin: 0;
    overflow: visible;
}
.memory-thumb img {
    width: 100%;
    height: auto;
    opacity: 1;
    filter: drop-shadow(0 0.7rem 0.75rem rgba(28, 26, 23, 0.12));
}
.memory-thumb img,
.memory-gallery img {
    transition: transform var(--transition), filter var(--transition);
}
.memory-thumb img:hover,
.memory-gallery img:hover {
    filter: drop-shadow(0 1rem 1.1rem rgba(28, 26, 23, 0.16));
}
.memory-thumb-wide { grid-column: span 1; }

.memory-gallery {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(0.85rem, 2vw, 1.35rem);
    align-items: end;
}
.memory-gallery-item {
    margin: 0;
    grid-column: span 2;
}
.memory-gallery-item-wide { grid-column: span 3; }
.memory-gallery-item-portrait {
    grid-column: span 2;
    max-width: 18rem;
    justify-self: center;
}
.memory-gallery img {
    width: 100%;
    height: auto;
    opacity: 1;
    filter: drop-shadow(0 0.65rem 0.75rem rgba(28, 26, 23, 0.12));
}
@media (max-width: 760px) {
    .memory-strip-inner {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .memory-thumb {
        max-width: 24rem;
        width: 100%;
        justify-self: center;
    }
    .memory-gallery { grid-template-columns: 1fr; }
    .memory-gallery-item,
    .memory-gallery-item-wide,
    .memory-gallery-item-portrait {
        grid-column: auto;
        max-width: 28rem;
        width: 100%;
        justify-self: center;
    }
}

/* =============================================================================
   CTA button
============================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    background: var(--ink);
    color: var(--bg);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid var(--ink);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.btn:hover { background: var(--gold); border-color: var(--gold); color: var(--bg); border-bottom-color: var(--gold); }
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--rule-strong);
}
.btn-ghost:hover { background: var(--bg-sunken); color: var(--ink); }

/* =============================================================================
   Grids: albums, pages, stamps
============================================================================= */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.grid-stamps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1.5rem 1.25rem;
    margin-top: 2rem;
}
@media (min-width: 700px) {
    .grid-stamps { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
    .grid-stamps { grid-template-columns: repeat(2, 1fr); gap: 1rem 0.75rem; }
}

/* ---- Album card ---- */
.album-card {
    background: var(--bg-card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--rule);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
}
.album-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--rule-strong);
    color: inherit;
}
.album-card-cover {
    aspect-ratio: 4/5;
    background: var(--bg-sunken);
    display: grid;
    place-items: center;
    color: var(--ink-mute);
    overflow: hidden;
    border-bottom: 1px solid var(--rule);
    position: relative;
}
.album-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-card-reprocessed-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(34, 122, 64, 0.92);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(2px);
}
.badge-reprocessed {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    color: #227a40;
    font-weight: 600;
}
.album-card-cover-empty {
    font-family: var(--font-display);
    font-size: 2.4rem;
    color: var(--gold-soft);
    letter-spacing: 0.05em;
}
.album-card-body {
    padding: 1.25rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.album-card-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    color: var(--ink);
}
.album-card-era {
    color: var(--ink-mute);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.album-card-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
}
.album-card-meta-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    font-size: 0.85rem;
}
.album-card-meta-text strong {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.album-card-meta-text span { color: var(--ink-mute); }

.ring {
    --size: 3rem;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    flex-shrink: 0;
}
.ring::after {
    content: "";
    position: absolute;
    inset: 0.35rem;
    border-radius: 50%;
    background: var(--bg-card);
}
.ring-label {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

/* ---- Stamp tile ---- */
.stamp-tile {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 0;
    transition: transform var(--transition);
}
.stamp-tile:hover { transform: translateY(-2px); color: inherit; border-bottom-color: transparent; }
.stamp-tile-frame {
    aspect-ratio: 4/5;
    background: var(--bg-card);
    border: 1px solid var(--rule);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    position: relative;
    display: grid;
    place-items: center;
    transition: box-shadow var(--transition), border-color var(--transition);
}
.stamp-tile:hover .stamp-tile-frame {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--rule-strong);
}
.stamp-tile-frame img { width: 100%; height: 100%; object-fit: contain; padding: 8% 10%; }
.stamp-tile-frame.missing {
    border-style: dashed;
    border-color: var(--rule-strong);
    background: var(--bg-sunken);
    box-shadow: none;
    color: var(--ink-mute);
}
.stamp-tile-frame.missing::before {
    content: "∅";
    position: absolute;
    top: 0.4rem;
    right: 0.55rem;
    font-size: 1.1rem;
    color: var(--ink-mute);
    line-height: 1;
}
.stamp-tile-frame .missing-label {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--ink-mute);
    letter-spacing: 0.05em;
    text-transform: lowercase;
}
.stamp-tile-frame .stamp-placeholder {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--gold-soft);
}
.stamp-tile-info {
    padding: 0 0.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.stamp-tile-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.2;
}
.stamp-tile-meta {
    font-size: 0.8rem;
    color: var(--ink-mute);
    font-variant-numeric: tabular-nums;
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}
.stamp-tile-value {
    margin-left: auto;
    color: var(--ink);
    font-weight: 500;
}
.stamp-tile-frame.featured {
    border-color: var(--gold-soft);
    box-shadow: 0 0 0 1px var(--gold-soft), var(--shadow-card);
}

/* =============================================================================
   Album detail
============================================================================= */
.album-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
    max-width: var(--max-grid);
    margin: 2rem auto 0;
    padding: 0 1.5rem;
}
@media (min-width: 800px) {
    .album-header { grid-template-columns: 0.8fr 1.2fr; }
}
.album-header-cover {
    aspect-ratio: 4/5;
    border: 1px solid var(--rule);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    background: var(--bg-sunken);
}
.album-header-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-header-info h1 { margin-top: 0; }
.album-header-era {
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.03em;
    margin-bottom: 1.5rem;
    font-variant-numeric: tabular-nums;
}
.album-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    margin: 1.5rem 0 2rem;
}
.album-stats .stat-value { font-size: 1.5rem; }

.completeness-bar {
    width: 100%;
    height: 6px;
    background: var(--rule);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.75rem;
}
.completeness-bar-fill {
    height: 100%;
    background: var(--gold);
    transition: width var(--transition);
}

.section-heading {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 500;
    margin: 0 0 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--rule);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.section-heading-count {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--ink-mute);
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* =============================================================================
   Page detail with overlays
============================================================================= */
.page-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    max-width: var(--max-grid);
    margin: 0 auto;
    padding: 0 1.5rem;
}
@media (min-width: 900px) {
    .page-detail { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
}
.page-image-wrap {
    position: relative;
    background: var(--bg-sunken);
    border: 1px solid var(--rule);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.page-image-wrap img {
    display: block;
    width: 100%;
    height: auto;
}
.page-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.page-overlay .stamp-box {
    fill: transparent;
    stroke: var(--gold);
    stroke-width: 0.4;
    stroke-opacity: 0.55;
    pointer-events: all;
    cursor: pointer;
    transition: fill 200ms ease, stroke-opacity 200ms ease;
}
.page-overlay .stamp-box:hover,
.page-overlay .stamp-box.active {
    fill: rgba(154, 123, 58, 0.18);
    stroke-opacity: 1;
}
.page-overlay .stamp-box.missing {
    stroke: var(--rule-strong);
    stroke-dasharray: 1.2 0.9;
}

.page-sidebar {
    font-size: 0.9rem;
}
.page-sidebar ol {
    list-style: none;
    margin: 0;
    padding: 0;
}
.page-sidebar li {
    border-bottom: 1px solid var(--rule);
    padding: 0.55rem 0;
}
.page-sidebar li:last-child { border-bottom: 0; }
.page-sidebar a {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    color: inherit;
    border: 0;
    padding: 0.1rem 0;
}
.page-sidebar a:hover { color: var(--ink); }
.position-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--rule-strong);
    margin-right: 0.4rem;
    display: inline-block;
    transform: translateY(-0.05rem);
}
.position-dot.filled { background: var(--gold); }
.position-ord {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--ink-mute);
    width: 1.4rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.position-title {
    font-weight: 500;
    color: var(--ink);
    flex: 1;
}
.position-meta {
    color: var(--ink-mute);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

/* =============================================================================
   Sammlung filters
============================================================================= */
.filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem 2rem;
    align-items: end;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
@media (min-width: 800px) {
    .filters { grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(160px, 1fr)); }
}
.filters label {
    display: block;
    font-size: 0.75rem;
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.4rem;
    font-weight: 500;
}
.filters input[type="search"],
.filters input[type="number"],
.filters select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--ink);
    transition: border-color var(--transition);
}
.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--gold);
}
.filters-era {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.filters-era input { width: 5rem; text-align: center; }
.filters-era span { color: var(--ink-mute); font-size: 0.85rem; }

.filters select[multiple] {
    height: auto;
    padding: 0.3rem;
}
.filters select[multiple] option {
    padding: 0.25rem 0.4rem;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.4rem;
}
.chip {
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    user-select: none;
}
.chip:hover { border-color: var(--rule-strong); }
.chip.active {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.toolbar-count {
    font-size: 0.9rem;
    color: var(--ink-mute);
    font-variant-numeric: tabular-nums;
}
.toolbar select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--rule);
    background: var(--bg-card);
    font-family: var(--font-body);
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
    font-variant-numeric: tabular-nums;
}
.pagination a {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    color: var(--ink);
    background: var(--bg-card);
}
.pagination a:hover { background: var(--bg-sunken); border-color: var(--rule-strong); }
.pagination .current {
    color: var(--ink-mute);
    font-size: 0.9rem;
}

.empty-state {
    padding: 4rem 1rem;
    text-align: center;
    color: var(--ink-mute);
    font-family: var(--font-display);
    font-size: 1.15rem;
    border: 1px dashed var(--rule-strong);
    border-radius: var(--radius);
    background: var(--bg-card);
}

/* =============================================================================
   Stamp detail
============================================================================= */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--ink-mute);
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.breadcrumb a { color: var(--ink-mute); border-bottom-color: transparent; }
.breadcrumb a:hover { color: var(--ink); border-bottom-color: var(--gold-soft); }
.breadcrumb-sep { color: var(--rule-strong); }

.stamp-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}
@media (min-width: 800px) {
    .stamp-detail { grid-template-columns: 1fr 1.2fr; }
}
.stamp-detail-image {
    aspect-ratio: 4/5;
    background: var(--bg-card);
    border: 1px solid var(--rule);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: grid;
    place-items: center;
    position: relative;
}
.stamp-detail-image img { width: 100%; height: 100%; object-fit: contain; padding: 6%; }
.stamp-detail-image.missing {
    border-style: dashed;
    border-color: var(--rule-strong);
    background: var(--bg-sunken);
}
.stamp-detail-image.missing::before {
    content: "∅";
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    font-size: 1.6rem;
    color: var(--ink-mute);
}

.stamp-detail-info h1 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}
.stamp-detail-info .kicker { margin-bottom: 0.5rem; display: block; }

.dl-grid {
    display: grid;
    grid-template-columns: minmax(8rem, auto) 1fr;
    gap: 0.6rem 1.5rem;
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}
.dl-grid dt {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-mute);
    font-weight: 500;
    padding-top: 0.2rem;
}
.dl-grid dd {
    margin: 0;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.tabs {
    border-bottom: 1px solid var(--rule);
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.tabs button {
    background: transparent;
    border: 0;
    padding: 0.6rem 0;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--ink-mute);
    cursor: pointer;
    border-bottom: 1px solid transparent;
    margin-bottom: -1px;
    letter-spacing: 0.02em;
}
.tabs button.active {
    color: var(--ink);
    border-bottom-color: var(--gold);
}
.tabs button:hover { color: var(--ink); }
.tab-panel { display: none; line-height: 1.6; color: var(--ink-soft); }
.tab-panel.active { display: block; }

.chart-wrap {
    background: var(--bg-card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}
.chart-wrap h3 { margin-top: 0; }
.chart-legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--ink-mute);
    flex-wrap: wrap;
}
.chart-legend .swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid var(--gold);
    margin-right: 0.4rem;
    vertical-align: middle;
    border-radius: 50%;
}
.chart-legend .swatch.measured { background: var(--gold); }
.chart-legend .swatch.interpolated { background: transparent; }

.chart-canvas {
    width: 100%;
    height: 280px;
}

/* =============================================================================
   Utility
============================================================================= */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2.5rem; }
.center { text-align: center; }
.tabular { font-variant-numeric: tabular-nums; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after { transition-duration: 0.001s !important; animation-duration: 0.001s !important; scroll-behavior: auto !important; }
}
