@font-face {
    font-family: "Lato";
    src: url("/assets/fonts/Lato-Regular.ttf") format("truetype");
    font-display: swap;
}

:root {
    --ink: #172234;
    --muted: #617087;
    --line: #ced7e1;
    --paper: #ffffff;
    --canvas: #f2f5f7;
    --navy: #203a64;
    --blue: #356ca5;
    --teal: #187c7a;
    --coral: #bf5843;
    --gold: #c38a2f;
    --soft-blue: #e9f1f8;
    --soft-coral: #f8ece8;
    --success: #277751;
    --danger: #ad3f3f;
    --shadow: 0 10px 28px rgba(31, 52, 75, .09);
}

* { box-sizing: border-box; }
html { max-width: 100%; scroll-behavior: smooth; overflow-x: hidden; }
body {
    max-width: 100%;
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: "Lato", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0;
    overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 1000; padding: .7rem 1rem; background: var(--paper); }
.skip-link:focus { top: 1rem; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto minmax(240px, 1fr);
    align-items: center;
    min-height: 72px;
    padding: 0 clamp(1rem, 3vw, 3rem);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .98);
}
.brand { display: inline-flex; align-items: center; min-width: 0; gap: .7rem; color: var(--ink); text-decoration: none; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: white;
    background: var(--navy);
    font-family: Georgia, serif;
    font-weight: 700;
}
.brand-copy { display: grid; min-width: 0; line-height: 1.15; }
.brand small { margin-top: .2rem; color: var(--muted); font-size: .72rem; }
.brand-publisher-logo {
    width: 74px;
    height: 30px;
    margin-left: .4rem;
    object-fit: contain;
    object-position: left center;
}
.main-nav { display: flex; min-width: 0; align-self: stretch; }
.main-nav a {
    display: flex;
    align-items: center;
    padding: 0 .9rem;
    border-bottom: 3px solid transparent;
    color: #3f5068;
    font-size: .93rem;
    font-weight: 700;
    text-decoration: none;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--coral); }
.account-menu { display: flex; justify-content: flex-end; align-items: center; gap: .6rem; }
.account-name { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3f5068; font-size: .88rem; }
.icon-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--navy);
    background: var(--paper);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.icon-button:hover { border-color: var(--blue); background: var(--soft-blue); }
.icon-button.light { background: rgba(255,255,255,.9); }

.page-shell { min-width: 0; min-height: calc(100vh - 240px); }
.collection-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(360px, .8fr);
    gap: 4rem;
    align-items: end;
    padding: clamp(2.4rem, 5vw, 5rem) clamp(1.2rem, 5vw, 5rem);
    color: white;
    background: var(--navy);
    border-bottom: 8px solid var(--gold);
}
.collection-hero h1 {
    max-width: 900px;
    margin: .3rem 0 1rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.6rem, 6vw, 5.5rem);
    font-weight: 500;
    line-height: .98;
}
.collection-hero > div > p:last-child { max-width: 760px; margin: 0; color: #d9e5f1; font-size: 1.15rem; }
.eyebrow {
    margin: 0 0 .35rem;
    color: var(--coral);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.collection-hero .eyebrow { color: #f1c56d; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border: 1px solid rgba(255,255,255,.25); }
.hero-stats div { min-width: 0; padding: 1rem; border-right: 1px solid rgba(255,255,255,.25); }
.hero-stats div:last-child { border-right: 0; }
.hero-stats dt { color: #c9d7e7; font-size: .72rem; text-transform: uppercase; }
.hero-stats dd { margin: .2rem 0 0; font-family: Georgia, serif; font-size: 1.55rem; white-space: nowrap; }

.research-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 0;
    max-width: 1700px;
    margin: 0 auto;
}
.filter-panel {
    position: sticky;
    top: 72px;
    align-self: start;
    min-height: calc(100vh - 72px);
    padding: 2rem 1.4rem;
    border-right: 1px solid var(--line);
    background: var(--paper);
}
.filter-title { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: 1.6rem; }
.filter-title h2 { margin: 0; font-size: 1.2rem; }
.text-button { padding: 0; border: 0; color: var(--blue); background: none; font-size: .78rem; cursor: pointer; }
.filter-panel > label:not(.check-row), .filter-row label {
    display: block;
    margin: 1rem 0 .35rem;
    color: #46566d;
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}
input, select, textarea {
    width: 100%;
    min-height: 44px;
    padding: .65rem .75rem;
    border: 1px solid #bfcbd7;
    border-radius: 3px;
    background: white;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #8fb4da; outline-offset: 1px; border-color: var(--blue); }
.search-input-wrap { display: grid; grid-template-columns: 1fr 44px; }
.search-input-wrap input { border-radius: 3px 0 0 3px; }
.search-input-wrap button { border: 1px solid var(--navy); border-radius: 0 3px 3px 0; color: white; background: var(--navy); font-size: 1.25rem; cursor: pointer; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.check-row { display: flex; align-items: center; gap: .55rem; margin: 1rem 0; cursor: pointer; }
.check-row input { width: 18px; min-height: 18px; margin: 0; }
.source-note { margin-top: 2rem; padding: 1rem; border-left: 4px solid var(--gold); background: #f7f3e9; font-size: .83rem; }
.source-note p { margin: .4rem 0 0; color: #596474; }

.results-panel { min-width: 0; padding: 1.5rem clamp(1rem, 2.5vw, 2.5rem) 3rem; }
.results-toolbar { display: flex; justify-content: space-between; align-items: center; min-height: 50px; margin-bottom: 1rem; }
.results-toolbar > div:first-child { display: flex; align-items: baseline; gap: .55rem; }
.results-toolbar span { color: var(--muted); font-size: .9rem; }
.view-switch { display: flex; border: 1px solid var(--line); }
.view-switch button { width: 38px; height: 36px; border: 0; border-right: 1px solid var(--line); background: var(--paper); cursor: pointer; }
.view-switch button:last-child { border-right: 0; }
.view-switch button.is-active { color: white; background: var(--navy); }
.postcard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    transition: opacity .15s;
}
.postcard-grid.is-loading { opacity: .58; }
.postcard-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    box-shadow: 0 3px 12px rgba(31, 52, 75, .05);
}
.postcard-image {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1.38;
    padding: .65rem;
    overflow: hidden;
    background: #e6ebef;
}
.postcard-image img { width: 100%; height: 100%; object-fit: contain; transition: transform .25s ease; }
.postcard-card:hover .postcard-image img { transform: scale(1.025); }
.side-badge { position: absolute; right: .5rem; bottom: .5rem; padding: .2rem .45rem; color: white; background: rgba(23,34,52,.86); font-size: .67rem; }
.postcard-content { padding: .9rem 1rem 1rem; }
.card-kicker { min-height: 1.1rem; margin: 0 0 .3rem; overflow: hidden; color: var(--coral); font-size: .68rem; font-weight: 800; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.postcard-content h2 { min-height: 3.55rem; margin: 0; font-family: Georgia, serif; font-size: 1.04rem; font-weight: 600; line-height: 1.28; }
.postcard-content h2 a { display: -webkit-box; overflow: hidden; color: var(--ink); text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.card-publisher { min-height: 2.45rem; margin: .55rem 0; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.card-meta { display: flex; justify-content: space-between; align-items: center; padding-top: .65rem; border-top: 1px solid #e2e7ec; color: #526178; font-size: .75rem; }
.favorite-mini { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: white; cursor: pointer; }
.favorite-mini.is-active { color: var(--gold); border-color: var(--gold); }
.postcard-grid.is-list { grid-template-columns: 1fr; }
.postcard-grid.is-list .postcard-card { display: grid; grid-template-columns: 240px 1fr; }
.postcard-grid.is-list .postcard-image { aspect-ratio: 1.55; }
.postcard-grid.is-list .postcard-content h2 { min-height: 0; font-size: 1.2rem; }
.postcard-grid.is-list .card-publisher { min-height: 0; }
.load-more { display: block; margin: 2rem auto 0; }
.loading-state { grid-column: 1 / -1; padding: 5rem 1rem; text-align: center; color: var(--muted); }

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    padding: .6rem 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.button-primary { color: white; border-color: var(--navy); background: var(--navy); }
.button-primary:hover { background: #2f5589; }
.button-secondary { color: var(--navy); border-color: #afbecd; background: white; }
.button-secondary:hover { border-color: var(--blue); background: var(--soft-blue); }
.button-danger { color: white; background: var(--danger); }
.button-full { width: 100%; }
.notice { margin: 1rem 0; padding: .85rem 1rem; border: 1px solid; border-radius: 4px; }
.notice-error { color: #792d2d; border-color: #e4b0aa; background: #fff1ef; }
.notice-success { color: #215f43; border-color: #abd6c1; background: #edf9f2; }

.breadcrumb { display: flex; gap: .5rem; max-width: 1500px; margin: 1.2rem auto; padding: 0 1.5rem; color: var(--muted); font-size: .82rem; }
.card-detail { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(380px, .7fr); gap: 2rem; max-width: 1500px; margin: 0 auto; padding: 0 1.5rem 2rem; }
.image-viewer { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #e8ecef; }
.image-toolbar { display: flex; justify-content: space-between; align-items: center; padding: .65rem; border-bottom: 1px solid var(--line); background: white; }
.segmented { display: flex; border: 1px solid var(--line); }
.segmented button { min-height: 36px; padding: .4rem .8rem; border: 0; border-right: 1px solid var(--line); background: white; cursor: pointer; }
.segmented button:last-child { border-right: 0; }
.segmented button.is-active { color: white; background: var(--navy); }
.image-viewer figure { display: grid; place-items: center; min-height: 620px; margin: 0; padding: 1.5rem; }
.image-viewer figure img { min-width: 0; max-width: 100%; max-height: 72vh; width: auto; height: auto; object-fit: contain; }
.detail-sidebar { align-self: start; padding: 1.2rem 0; }
.detail-sidebar h1 { margin: .3rem 0 1rem; font-family: Georgia, serif; font-size: clamp(2rem, 3.4vw, 3.5rem); font-weight: 500; line-height: 1.04; overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.4rem 0; }
.metadata-list { margin: 1rem 0 1.5rem; border-top: 1px solid var(--line); }
.metadata-list div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.metadata-list dt { color: var(--muted); font-size: .78rem; }
.metadata-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.detail-section { padding: 1rem 0; border-top: 1px solid var(--line); }
.detail-section h2, .rights-box h2 { margin: 0 0 .45rem; font-size: .9rem; text-transform: uppercase; }
.detail-section p { margin: 0; color: #3e4d61; }
.transcription blockquote { margin: 0; padding-left: 1rem; border-left: 3px solid var(--gold); color: #38475b; font-family: Georgia, serif; font-size: 1.05rem; }
.rights-box { padding: 1rem; border-left: 4px solid var(--teal); background: #e8f3f2; font-size: .85rem; }
.rights-box p { margin: 0 0 .65rem; }
.citation-section {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    max-width: 1450px;
    margin: 1rem auto 3rem;
    padding: 1.5rem;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.citation-section h2 { margin: 0; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; }
.citation-section > p { margin: 0; color: #435168; }
.related-section, .themes-section { max-width: 1500px; margin: 0 auto; padding: 0 1.5rem 3rem; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 1rem; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.section-heading > p { max-width: 600px; color: var(--muted); }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.related-grid a { display: grid; grid-template-columns: 110px 1fr; gap: .8rem; min-width: 0; padding: .7rem; border: 1px solid var(--line); color: var(--ink); background: white; text-decoration: none; }
.related-grid img { width: 110px; height: 82px; object-fit: contain; background: #e9edef; }
.related-grid span { display: grid; align-content: center; min-width: 0; }
.related-grid strong { display: -webkit-box; overflow: hidden; font-family: Georgia, serif; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.related-grid small { margin-top: .35rem; color: var(--muted); }
.zoom-dialog { width: 96vw; max-width: 1500px; height: 94vh; padding: 3rem 1rem 1rem; border: 0; background: #111820; }
.zoom-dialog::backdrop { background: rgba(8, 14, 22, .88); }
.zoom-dialog img { width: 100%; height: 100%; object-fit: contain; }
.zoom-close { position: absolute; top: .5rem; right: .7rem; width: 42px; height: 42px; border: 1px solid #6c7784; color: white; background: #1e2935; font-size: 1.7rem; cursor: pointer; }

.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 3rem; max-width: 1450px; margin: 0 auto; padding: 3rem 1.5rem 2rem; border-bottom: 1px solid var(--line); }
.page-heading.compact { padding-top: 2rem; }
.page-heading h1 { max-width: 850px; margin: 0; font-family: Georgia, serif; font-size: clamp(2.2rem, 4.5vw, 4.5rem); font-weight: 500; line-height: 1; }
.page-heading > p { max-width: 500px; color: var(--muted); }
.empty-state { max-width: 680px; margin: 4rem auto; padding: 3rem; text-align: center; }
.empty-state > span { color: var(--gold); font-size: 3rem; }
.empty-state h2 { margin: .3rem 0; font-family: Georgia, serif; font-size: 2rem; }
.empty-state p { color: var(--muted); }
.empty-state.inline { grid-column: 1 / -1; margin: 1rem auto; }
.favorites-grid { max-width: 1450px; margin: 2rem auto 4rem; padding: 0 1.5rem; }
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
.theme-card { display: grid; min-height: 120px; padding: 1rem; border: 1px solid var(--line); border-top: 4px solid var(--coral); color: var(--ink); background: white; text-decoration: none; }
.theme-card:nth-child(3n+2) { border-top-color: var(--gold); }
.theme-card:nth-child(3n+3) { border-top-color: var(--teal); }
.theme-card strong { align-self: end; font-family: Georgia, serif; font-size: 1.1rem; }
.theme-card span { color: var(--muted); font-size: .8rem; }
.info-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) 360px; gap: 4rem; max-width: 1250px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }
.info-layout article h2 { margin: 2rem 0 .5rem; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 500; }
.info-layout article h2:first-child { margin-top: 0; }
.info-layout article p { color: #405065; font-size: 1.05rem; }
.info-layout aside { display: grid; align-content: start; gap: .75rem; }
.fact-box { display: grid; padding: 1rem; border: 1px solid var(--line); background: white; }
.fact-box strong { font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.fact-box span { color: var(--muted); }
.not-found { max-width: 900px; margin: 8vh auto; padding: 4rem 1.5rem; }
.not-found h1 { max-width: 720px; margin: .3rem 0 1rem; font-family: Georgia, serif; font-size: clamp(3rem, 7vw, 6rem); font-weight: 500; line-height: .98; }
.not-found p:not(.eyebrow) { color: var(--muted); font-size: 1.1rem; }
.not-found div { display: flex; gap: .6rem; }

.diagnose-page { max-width: 1180px; margin: 0 auto; }
.status-pill { padding: .4rem .65rem; border: 1px solid; border-radius: 2px; font-size: .8rem; font-weight: 700; }
.status-pill.success { color: var(--success); border-color: #9bcab3; background: #eaf6ef; }
.diagnose-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1.5rem; }
.diagnose-grid > section { padding: 1.3rem; border: 1px solid var(--line); background: white; }
.diagnose-grid h2 { margin-top: 0; font-family: Georgia, serif; font-weight: 500; }
.check-list > div { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: .65rem; padding: .72rem 0; border-bottom: 1px solid #e3e8ed; }
.check-list > div:last-child { border-bottom: 0; }
.check-list span:last-child { color: var(--muted); font-size: .85rem; }
.check-dot { width: 9px; height: 9px; border-radius: 50%; background: #8b98a8; }
.check-dot.ok { background: var(--success); }
.check-dot.warn { background: var(--gold); }
.check-dot.error { background: var(--danger); }

.admin-layout { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 1rem; max-width: 1600px; margin: 0 auto; padding: 1.5rem; }
.admin-list, .admin-editor { min-width: 0; border: 1px solid var(--line); background: white; }
.admin-search { display: grid; grid-template-columns: 1fr auto; gap: .5rem; padding: .8rem; border-bottom: 1px solid var(--line); }
.admin-records { max-height: 75vh; overflow: auto; }
.admin-records a { display: grid; grid-template-columns: 64px 1fr; gap: .75rem; padding: .7rem; border-bottom: 1px solid #e3e8ed; color: var(--ink); text-decoration: none; }
.admin-records a:hover, .admin-records a.is-active { background: var(--soft-blue); }
.admin-records img { width: 64px; height: 52px; object-fit: contain; background: #e9edef; }
.admin-records span { display: grid; min-width: 0; align-content: center; }
.admin-records strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-records small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-editor { padding: 1.2rem; }
.editor-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.editor-head h2 { margin: 0; font-family: Georgia, serif; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; padding: 1rem 0; }
.form-grid label { display: grid; gap: .3rem; color: #46566d; font-size: .78rem; font-weight: 700; }
.form-grid .wide { grid-column: 1 / -1; }
.admin-empty { display: grid; place-items: center; min-height: 500px; text-align: center; color: var(--muted); }
.admin-empty h2, .admin-empty p { margin: 0; }

.app-footer { border-top: 1px solid var(--line); background: #fff; color: var(--muted); }
.footer-inner {
    display: grid;
    grid-template-columns: 1.15fr 1fr .75fr 1.15fr;
    gap: clamp(1.5rem, 4vw, 4rem);
    max-width: 1520px;
    margin: 0 auto;
    padding: 2.5rem clamp(1rem, 4vw, 4rem);
}
.footer-inner section, .footer-inner nav { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }
.footer-inner strong { margin-bottom: .4rem; color: var(--ink); }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--navy); text-decoration: underline; }
.footer-inner p { margin: 0 0 .35rem; }
.footer-publisher img { width: 112px; height: 48px; object-fit: contain; object-position: left center; }
.footer-action { margin-top: .45rem; border-bottom: 2px solid var(--navy); color: var(--navy) !important; font-weight: 700; }
.footer-bottom { padding: .9rem clamp(1rem, 4vw, 4rem); border-top: 1px solid var(--line); background: var(--canvas); font-size: .78rem; text-align: center; }

.login-body { min-height: 100vh; background: white; }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(480px, .85fr); min-height: 100vh; }
.login-story {
    position: relative;
    display: grid;
    align-content: center;
    overflow: hidden;
    padding: clamp(2rem, 6vw, 7rem);
    color: white;
    background: var(--navy);
}
.login-story::after { content: ""; position: absolute; right: -80px; bottom: -150px; width: 420px; height: 420px; border: 70px solid rgba(255,255,255,.07); border-radius: 50%; }
.login-logo { width: 120px; margin-bottom: 2rem; padding: .45rem; background: white; }
.login-story .eyebrow { color: #f1c56d; }
.login-story h1 { margin: .3rem 0 1rem; font-family: Georgia, serif; font-size: clamp(3.2rem, 6vw, 6.7rem); font-weight: 500; line-height: .9; }
.login-lead { max-width: 720px; color: #dbe5ef; font-size: 1.1rem; }
.login-collage { display: grid; grid-template-columns: 1.15fr .85fr .95fr; gap: .55rem; max-width: 700px; margin: 1.4rem 0; }
.login-collage img { width: 100%; height: 130px; padding: .4rem; object-fit: contain; background: rgba(255,255,255,.92); }
.login-collage img:nth-child(2) { transform: translateY(10px); }
.login-benefits { margin: 1rem 0; padding-left: 1.2rem; color: #e2eaf2; }
.login-benefits li { margin: .35rem 0; }
.login-ip { position: absolute; left: clamp(2rem, 6vw, 7rem); bottom: 1.2rem; color: #b9c7d6; }
.login-form-panel { display: grid; place-items: center; padding: 3rem; }
.login-form-wrap { width: min(520px, 100%); }
.login-form-wrap h2 { margin: .2rem 0 .5rem; font-family: Georgia, serif; font-size: 3rem; font-weight: 500; }
.login-form-wrap > p:not(.eyebrow) { color: var(--muted); }
.stack-form { display: grid; gap: .45rem; margin-top: 1.5rem; }
.stack-form label { margin-top: .45rem; font-weight: 700; }
.stack-form button { margin-top: .8rem; }
.intranet-button { margin-top: .65rem; }
.login-divider { display: flex; align-items: center; gap: .8rem; margin: 1rem 0; color: var(--muted); font-size: .78rem; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.free-version-form { margin: 0; }
.button-free {
    border: 1px solid var(--navy);
    color: white;
    background: var(--navy);
}
.button-free:hover { border-color: var(--blue); background: var(--blue); }
.free-version-note { margin: .65rem 0 0; color: var(--muted); font-size: .8rem; text-align: center; }
.login-links { display: flex; justify-content: space-between; margin-top: 1.2rem; font-size: .9rem; }

@media (max-width: 1260px) {
    .site-header { grid-template-columns: auto 1fr auto; }
    .main-nav a { padding: 0 .55rem; }
    .account-name { display: none; }
    .postcard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .collection-hero { grid-template-columns: 1fr; gap: 2rem; }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
    .site-header { grid-template-columns: 1fr auto; min-height: 64px; }
    .main-nav { grid-column: 1 / -1; order: 3; overflow-x: auto; min-height: 50px; border-top: 1px solid var(--line); }
    .main-nav a { flex: 0 0 auto; }
    .research-layout { grid-template-columns: 230px minmax(0, 1fr); }
    .postcard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-detail { grid-template-columns: 1fr; }
    .image-viewer figure { min-height: 420px; }
    .info-layout { grid-template-columns: 1fr; gap: 2rem; }
    .theme-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-layout { grid-template-columns: 300px 1fr; }
    .login-shell { grid-template-columns: 1fr; }
    .login-story { min-height: 70vh; }
    .login-form-panel { min-height: 70vh; }
}
@media (max-width: 700px) {
    .site-header { grid-template-columns: minmax(0, 1fr); padding: 0 1rem; }
    .brand-publisher-logo { display: none; }
    .account-menu { display: none; }
    .main-nav { width: calc(100vw - 2rem); max-width: calc(100vw - 2rem); }
    .main-nav a { padding: 0 .55rem; font-size: .82rem; }
    .brand small { display: none; }
    .brand strong { overflow: hidden; font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
    .collection-hero { padding-top: 2.2rem; }
    .hero-stats { grid-template-columns: 1fr; }
    .hero-stats div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.25); }
    .hero-stats div:last-child { border-bottom: 0; }
    .research-layout { display: block; }
    .filter-panel { position: static; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
    .results-panel { padding: 1rem; }
    .postcard-grid { grid-template-columns: 1fr; }
    .postcard-grid.is-list .postcard-card { grid-template-columns: 120px 1fr; }
    .postcard-grid.is-list .card-publisher { display: none; }
    .card-detail { width: 100%; min-width: 0; padding: 0 .75rem 1.5rem; }
    .card-detail > * { width: 100%; min-width: 0; }
    .image-viewer figure { width: 100%; min-width: 0; min-height: 280px; padding: .65rem; overflow: hidden; }
    .image-viewer figure img { width: auto; max-width: 100%; height: auto; max-height: 62vh; }
    .detail-sidebar h1 { font-size: 2.3rem; overflow-wrap: break-word; }
    .citation-section { grid-template-columns: 1fr; margin: 1rem .75rem 2rem; }
    .related-grid { grid-template-columns: 1fr; }
    .page-heading { display: block; padding-top: 2rem; }
    .page-heading > p { margin-bottom: 0; }
    .theme-grid, .diagnose-grid { grid-template-columns: 1fr; }
    .admin-layout { grid-template-columns: 1fr; padding: .75rem; }
    .admin-records { max-height: 340px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .wide { grid-column: auto; }
    .footer-inner { grid-template-columns: 1fr; }
    .login-story { min-height: 85vh; padding: 2rem 1.4rem 4rem; }
    .login-story h1 { font-size: 3.5rem; }
    .login-collage img { height: 90px; }
    .login-ip { left: 1.4rem; }
    .login-form-panel { padding: 3rem 1.4rem; }
    .login-links { display: grid; gap: .6rem; }
}

@media print {
    .site-header, .app-footer, .breadcrumb, .detail-actions, .image-toolbar, .related-section { display: none !important; }
    body { background: white; font-size: 11pt; }
    .card-detail { display: block; max-width: none; padding: 0; }
    .image-viewer { float: left; width: 45%; margin: 0 2rem 1rem 0; border: 0; }
    .image-viewer figure { min-height: 0; padding: 0; }
    .image-viewer figure img { max-height: 45vh; }
    .detail-sidebar { padding: 0; }
    .detail-sidebar h1 { font-size: 26pt; }
    .citation-section { clear: both; display: block; margin: 2rem 0 0; padding: 1rem 0; }
}
