@font-face {
    font-family: "Cormorant Garamond";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/cormorant-garamond-latin.woff2") format("woff2");
}

:root {
    color-scheme: light;
    --forest: #38200f;
    --ink: #22160e;
    --muted: #806c58;
    --bronze: #b87528;
    --paper: #fbf3e7;
    --canvas: #f5e8d7;
    --line: #d9bd99;
    --serif: "Cormorant Garamond", Georgia, serif;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6.5rem; }
body { min-width: 320px; margin: 0; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-decoration: none; touch-action: manipulation; }
button, input, select { border-radius: 5px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
button:disabled { cursor: wait; opacity: .65; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 4px; }
::selection { color: white; background: #6c5741; }
main:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.admin-icon { display: inline-block; width: 1.25rem; height: 1.25rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.skip-link { position: fixed; z-index: 100; top: 1rem; left: 1rem; padding: 1rem; color: white; background: var(--forest); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.small-label { display: block; margin-bottom: 1rem; color: var(--bronze); font-size: .6rem; font-weight: 600; line-height: 1.5; letter-spacing: .18em; }
.admin-brand { display: inline-flex; flex-direction: column; align-items: center; width: fit-content; max-width: 100%; }
.admin-brand > span { font-family: var(--serif); font-size: 1.65rem; font-weight: 600; line-height: 1; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.admin-brand > small { margin-top: .65rem; font-size: .39rem; font-weight: 600; letter-spacing: .22em; white-space: nowrap; }
.admin-brand--light { color: #f9f4e9; }
.admin-brand--light > span { font-size: 2rem; }
.admin-brand--light > small { font-size: .46rem; }
.admin-button { display: inline-flex; align-items: center; justify-content: center; gap: .9rem; min-height: 2.9rem; padding: .8rem 1.25rem; border: 1px solid transparent; border-radius: 5px; font-size: .8rem; font-weight: 500; line-height: 1.3; transition: background .2s, border-color .2s; }
.admin-button .admin-icon { width: 1rem; height: 1rem; }
.admin-button--primary { color: #fffdf7; background: var(--forest); }
.admin-button--primary:hover { background: #56351b; }
.admin-button--light { border-color: #e4ddd6; background: var(--surface, #fffaf2); }
.admin-button--light:hover { background: #f1ede9; border-color: #d5c8b9; }
.admin-button--cream { color: var(--forest); background: #f3eddc; }
.admin-button--cream:hover { background: #fffdf2; }
.admin-text-link { display: inline-flex; align-items: center; gap: .65rem; min-height: 2.5rem; padding: .3rem 0; border: 0; color: var(--forest); background: transparent; font-size: .75rem; font-weight: 600; }
.admin-text-link:hover { color: #7d5d35; }
.admin-text-link .admin-icon { width: 1rem; height: 1rem; }
.icon-action { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: .65rem; border: 0; color: var(--muted); background: transparent; }
.icon-action:hover { color: var(--forest); background: #f1ede8; }
.connection-state { display: inline-flex; align-items: center; gap: .45rem; font-size: .65rem; white-space: nowrap; }
.connection-state i, .public-badge i { width: .35rem; height: .35rem; flex: 0 0 auto; border-radius: 50%; background: #866d50; }
.connection-state.is-offline i { background: #af743c; }

.access-layout { display: grid; grid-template-columns: 46% 54%; min-height: 100svh; background: var(--paper); }
.access-art { position: sticky; isolation: isolate; top: 0; display: flex; flex-direction: column; align-items: flex-start; height: 100svh; min-height: 43rem; overflow: hidden; padding: clamp(2.5rem, 4.8vw, 5rem); color: #f7f3e9; background: var(--forest); }
.access-art > img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 43% center; }
.access-art::after { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(180deg, #2d1f10e8, #3b2b18b8 35%, #2d1f10d4 70%, #291b0be8); }
.access-art__copy { margin-block: auto; padding-block: 4rem; }
.access-art .small-label { margin-bottom: 1.5rem; color: #d8c5a1; font-size: .6rem; }
.access-art h2 { margin: 0 0 1.75rem; font-family: var(--serif); font-size: clamp(3.5rem, 5.9vw, 6rem); font-weight: 400; line-height: .98; letter-spacing: -.03em; }
.access-art__copy > p { margin: 0; color: #e4e4d7; font-size: .85rem; line-height: 1.85; }
.access-art__foot { color: #d9cfc4; font-size: .53rem; letter-spacing: .2em; }
.access-body { display: flex; flex-direction: column; min-width: 0; min-height: 100svh; }
.access-header { display: flex; align-items: center; justify-content: flex-end; min-height: 6rem; padding: 1.5rem 2.75rem; }
.back-link { display: inline-flex; align-items: center; gap: .65rem; min-height: 2.75rem; color: var(--muted); font-size: .72rem; }
.back-link .admin-icon { width: 1rem; height: 1rem; }
.back-link:hover { color: var(--forest); }
.mobile-wordmark { display: none; font-family: var(--serif); font-size: 1.65rem; font-weight: 600; letter-spacing: .01em; }
.access-main { display: grid; flex: 1; align-items: center; justify-items: center; padding: 1rem 2.5rem 2.5rem; }
.access-content { width: 100%; max-width: 24rem; }
.access-emblem { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; margin-bottom: 1.75rem; border: 1px solid #dfd7cd; border-radius: 50%; color: var(--forest); background: #f2eee9; }
.access-emblem .admin-icon { width: 1.15rem; height: 1.15rem; }
.access-content .small-label { margin-bottom: .85rem; font-size: .56rem; }
.access-content h1 { margin-bottom: 1.1rem; font-family: var(--serif); font-size: clamp(3.6rem, 4.5vw, 4.75rem); font-weight: 500; line-height: .92; letter-spacing: -.025em; }
.access-intro { margin-bottom: 2.1rem; color: var(--muted); font-size: .8rem; line-height: 1.8; }
.access-form { display: flex; flex-direction: column; gap: 1.15rem; }
.form-field { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.form-field > label { font-size: .76rem; font-weight: 600; }
.form-field input { width: 100%; min-height: 3.15rem; padding: .85rem 1rem; border: 1px solid #e2dbd2; color: var(--ink); background: #fffefb; font-size: .85rem; transition: border-color .2s, box-shadow .2s; }
.form-field input::placeholder { color: #ad9477; }
.form-field input:focus { border-color: #a88c6d; outline: 0; box-shadow: 0 0 0 3px #e8e0d680; }
.form-field small { color: var(--muted); font-size: .65rem; line-height: 1.6; }
.password-field { position: relative; }
.password-field input { padding-right: 3.25rem; }
.password-toggle { position: absolute; top: .2rem; right: .2rem; display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: .7rem; border: 0; color: #9f815f; background: transparent; }
.password-toggle[aria-pressed="true"] { color: var(--forest); background: #f1ece7; }
.form-field .caps-lock { color: #8e653b; }
.login-submit { justify-content: space-between; width: 100%; min-height: 3.15rem; margin-top: .35rem; padding-inline: 1.1rem; }
.access-help { margin: 1.25rem 0 0; color: var(--muted); font-size: .66rem; line-height: 1.7; text-align: center; }
.access-note { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .65rem; }
.access-note > .admin-icon { width: 1rem; height: 1rem; }
.access-note > button { min-height: 2rem; margin-left: auto; font-size: .65rem; }
.access-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.5rem 2.75rem; color: var(--muted); }
.access-footer > small { font-size: .6rem; }
.access-footer small > span { margin-inline: .5rem; }
.form-message { display: flex; align-items: flex-start; gap: .7rem; margin: 0 0 1.5rem; padding: .9rem; border: 1px solid #e4cfc3; border-radius: 5px; background: #fbf0e9; color: #87452e; font-size: .75rem; line-height: 1.6; }
.form-message .admin-icon { width: 1.1rem; height: 1.1rem; margin-top: .1rem; }
.form-message p { margin: 0; }
.offline-form-message { margin: 0; color: #8e653b; font-size: .75rem; line-height: 1.7; }
.first-access { margin-top: 1.75rem; padding: 1.35rem; border: 1px solid #e1dad1; border-radius: 6px; background: #f3eee9; }
.first-access h2 { margin-bottom: .7rem; font-family: var(--serif); font-size: 1.65rem; font-weight: 600; line-height: 1; }
.first-access p { margin-bottom: 1.25rem; color: var(--muted); font-size: .75rem; line-height: 1.7; }
.first-access .admin-button { width: 100%; }
.setup-back { margin-top: 1.25rem; font-size: .7rem; }
.admin-page-setup .access-emblem { margin-bottom: 1.25rem; }
.admin-page-setup .access-intro { margin-bottom: 1.5rem; }

.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 15.25rem; overflow-y: auto; padding: 2.2rem 1.3rem 1.5rem; border-right: 1px solid var(--line); background: var(--paper); scrollbar-width: thin; }
.sidebar .admin-brand { align-self: center; }
.nav-caption { margin: 2.6rem .75rem 1rem; color: #a48767; font-size: .52rem; font-weight: 600; letter-spacing: .14em; }
.sidebar-nav { display: flex; flex-direction: column; gap: .35rem; }
.nav-item { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 2.95rem; padding: .8rem .85rem; border: 0; border-radius: 5px; color: #8b7153; background: transparent; font-size: .8rem; text-align: left; }
.nav-item .admin-icon { width: 1.1rem; height: 1.1rem; }
.nav-item:hover { color: var(--forest); background: #f1ede8; }
.nav-item.is-active { color: var(--forest); background: #ede6df; font-weight: 600; }
.nav-chevron { margin-left: auto; }
.sidebar-install { margin-top: 2.75rem; padding: 1.1rem; border: 1px solid #e2e3d5; border-radius: 7px; background: #f1f0e6; }
.install-emblem { display: flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; margin-bottom: .9rem; border-radius: 50%; color: var(--bronze); background: #e8e6d7; }
.install-emblem .admin-icon { width: 1rem; height: 1rem; }
.sidebar-install h2 { margin-bottom: .5rem; font-family: var(--serif); font-size: 1.65rem; font-weight: 600; line-height: 1; }
.sidebar-install p { margin-bottom: .6rem; color: var(--muted); font-size: .69rem; line-height: 1.8; }
.sidebar-install .admin-text-link { font-size: .66rem; }
.sidebar-bottom { margin-top: auto; padding-top: 2rem; }
.sidebar-bottom > small { display: block; margin-top: 1.5rem; color: #a78c6d; font-size: .38rem; letter-spacing: .17em; text-align: center; }
.app-body { min-width: 0; margin-left: 15.25rem; }
.app-topbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 5rem; padding: 1rem clamp(1.5rem, 3.4vw, 3.5rem); border-bottom: 1px solid var(--line); background: #fdfdf9f5; backdrop-filter: blur(12px); }
.breadcrumb { margin: 0; color: #a5896a; font-size: .72rem; }
.breadcrumb span { margin-inline: .75rem; color: #d1c3b2; }
.breadcrumb strong { color: var(--ink); font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 1rem; }
.public-site-link { width: 2.25rem; height: 2.25rem; }
.user-menu { position: relative; }
.user-menu summary { display: flex; align-items: center; gap: .65rem; min-height: 2.75rem; cursor: pointer; list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary > .admin-icon { width: .8rem; height: .8rem; }
.user-avatar { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; flex: 0 0 auto; border: 1px solid #dfd6cc; border-radius: 50%; color: var(--forest); background: #ede6dd; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.user-menu__name { max-width: 12rem; overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__panel { position: absolute; z-index: 30; top: calc(100% + .5rem); right: 0; display: flex; flex-direction: column; gap: .25rem; width: 14rem; padding: .75rem; border: 1px solid var(--line); border-radius: 7px; background: var(--surface, #fffaf2); box-shadow: 0 .75rem 2.5rem #3b2b1814; }
.user-menu__panel > span { padding: .5rem; color: var(--muted); font-size: .65rem; }
.user-menu__panel a, .user-menu__panel button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 2.75rem; padding: .6rem .5rem; border: 0; background: transparent; font-size: .75rem; text-align: left; }
.user-menu__panel a:hover, .user-menu__panel button:hover { background: #f3eee9; }
.dashboard { width: 100%; max-width: 90rem; margin-inline: auto; padding: 2.5rem clamp(1.5rem, 3.4vw, 3.5rem) .5rem; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.8rem; }
.page-heading .small-label { margin-bottom: .6rem; font-size: .53rem; }
.page-heading h1 { margin: 0 0 .35rem; font-family: var(--serif); font-size: 2.85rem; font-weight: 500; line-height: 1.1; letter-spacing: -.025em; overflow-wrap: anywhere; }
.page-heading h1 > span { color: var(--bronze); }
.page-heading p:last-child { margin: 0; color: var(--muted); font-size: .77rem; line-height: 1.6; }
.page-heading > .admin-button { flex: 0 0 auto; min-height: 2.6rem; font-size: .7rem; }
.welcome-card { display: grid; grid-template-columns: 58% 42%; min-height: 20rem; overflow: hidden; border-radius: 9px; color: #f7f2e5; background: var(--forest); }
.welcome-card__copy { z-index: 1; padding: 2.25rem 2.6rem; }
.welcome-card .small-label { margin-bottom: 1rem; color: #d3c29e; font-size: .5rem; letter-spacing: .2em; }
.welcome-card h2 { margin-bottom: 1rem; font-family: var(--serif); font-size: clamp(2.75rem, 4vw, 4.1rem); font-weight: 400; line-height: .95; letter-spacing: -.02em; }
.welcome-card h2 em { color: #d9c59f; }
.welcome-card__copy > p:not(.small-label) { margin-bottom: 1.5rem; color: #ded6cc; font-size: .73rem; line-height: 1.8; }
.welcome-card .admin-button { min-height: 2.65rem; font-size: .7rem; }
.welcome-card__photo { position: relative; min-width: 0; }
.welcome-card__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 55% 35%; }
.welcome-card__photo::after { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg, var(--forest), #38200f10 40%, #2d1f1033); }
.welcome-card__photo > span { position: absolute; z-index: 1; right: 1.5rem; bottom: 1.4rem; color: #fff9ee; font-size: .45rem; letter-spacing: .17em; }
.overview-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.stat-card { display: flex; align-items: center; gap: 1rem; min-width: 0; padding: 1.4rem 1.2rem; border: 1px solid var(--line); border-radius: 7px; background: #fffefa; transition: border-color .2s; }
.stat-card:hover { border-color: #cdbeac; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.7rem; height: 2.7rem; flex: 0 0 auto; border-radius: 7px; color: #796248; background: #f1ece6; }
.stat-icon--bronze { color: #9e7b50; background: #f4edde; }
.stat-icon--sand { color: #8d8b5c; background: #f0efdf; }
.stat-number { display: block; font-family: var(--serif); font-size: 2.5rem; font-weight: 500; line-height: 1; }
.stat-card h2 { margin: .25rem 0; font-size: .68rem; font-weight: 600; line-height: 1.5; }
.stat-card p { margin: 0; color: var(--muted); font-size: .59rem; line-height: 1.6; }
.stat-card .stat-arrow { width: .9rem; height: .9rem; margin-left: auto; color: #a48868; }
.stat-kicker { display: block; margin-bottom: .4rem; color: var(--muted); font-size: .45rem; letter-spacing: .12em; }
.stat-card--company h2 { margin-block: .1rem .35rem; font-family: var(--serif); font-size: 1.4rem; line-height: 1; }
.catalog-section, .admin-collections, .account-section { margin-top: 2.75rem; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; }
.section-title .small-label { margin-bottom: .5rem; font-size: .5rem; }
.section-title h2 { margin-bottom: .35rem; font-family: var(--serif); font-size: 2.1rem; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.section-title p:last-child { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.6; }
.count-pill { flex-shrink: 0; padding: .45rem .75rem; border: 1px solid #e3dcd3; border-radius: 2rem; color: #7d664b; background: #f2ede7; font-size: .6rem; }
.catalog-toolbar { display: flex; gap: .75rem; margin-bottom: 1.3rem; }
.catalog-search { display: flex; align-items: center; gap: .7rem; flex: 1; min-width: 0; padding: .2rem .9rem; border: 1px solid #e3dcd4; border-radius: 6px; color: #a68a6b; background: #fffefa; }
.catalog-search > .admin-icon { width: 1rem; height: 1rem; }
.catalog-search input { width: 100%; min-width: 0; min-height: 2.5rem; padding: .5rem 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: .75rem; }
.catalog-search:focus-within { outline: 2px solid #b39b80; outline-offset: 1px; }
.catalog-search kbd { display: none; }
.catalog-category { max-width: 45%; }
.catalog-category select { width: 100%; min-height: 2.9rem; padding: .65rem 2rem .65rem .85rem; border: 1px solid #e3dcd4; color: #745f46; background: #fffefa; font-size: .7rem; }
.catalog-feedback { margin-bottom: 1rem; color: var(--muted); font-size: .7rem; }
.admin-piece-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.admin-piece { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fffefa; }
.admin-piece__photo { position: relative; overflow: hidden; background: #cfc3b0; }
.admin-piece__photo img { width: 100%; aspect-ratio: 174 / 220; object-fit: cover; }
.public-badge { position: absolute; left: .65rem; bottom: .65rem; display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .5rem; border-radius: 3px; color: #534332; background: #fffef2f0; font-size: .52rem; }
.public-badge i { width: .3rem; height: .3rem; }
.admin-piece__body { padding: 1rem; }
.admin-piece__body .piece-type { margin-bottom: .5rem; color: var(--bronze); font-size: .46rem; font-weight: 600; line-height: 1.5; letter-spacing: .1em; text-transform: uppercase; }
.admin-piece h3 { margin-bottom: .45rem; font-family: var(--serif); font-size: 1.4rem; font-weight: 600; line-height: 1; }
.admin-piece__body > p:not(.piece-type) { min-height: 2.8em; margin-bottom: .9rem; color: var(--muted); font-size: .62rem; line-height: 1.5; }
.piece-link { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 2.75rem; padding-top: .7rem; border-top: 1px solid #eee9e4; color: var(--forest); font-size: .62rem; font-weight: 500; }
.piece-link:hover { color: #9e7545; }
.piece-link .admin-icon { width: .8rem; height: .8rem; }
.catalog-no-results { padding: 3rem 1.5rem; border: 1px dashed #d8cdc1; border-radius: 6px; text-align: center; }
.catalog-no-results > .admin-icon { width: 2rem; height: 2rem; margin-bottom: 1rem; color: #ad9477; }
.catalog-no-results h3 { margin-bottom: .5rem; font-family: var(--serif); font-size: 1.9rem; font-weight: 500; }
.catalog-no-results p { color: var(--muted); font-size: .75rem; }
.admin-collection-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.admin-collection { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-width: 0; min-height: 10.5rem; overflow: hidden; border-radius: 7px; color: #fff9ec; background: var(--forest); }
.admin-collection > img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.admin-collection::after { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(180deg, #2e211310, #281a0aed); }
.admin-collection:hover > img { transform: scale(1.04); }
.admin-collection > div { width: 100%; padding: 1.25rem; }
.admin-collection h3 { margin-bottom: .5rem; font-family: var(--serif); font-size: 1.6rem; font-weight: 500; line-height: 1; }
.admin-collection span { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: #f0eddf; font-size: .55rem; }
.admin-collection .admin-icon { width: .8rem; height: .8rem; }
.account-card { display: flex; align-items: center; gap: 1.1rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: 8px; background: #fffefa; }
.user-avatar--large { width: 3.1rem; height: 3.1rem; font-size: 1.8rem; }
.account-card .small-label { margin-bottom: .4rem; font-size: .48rem; }
.account-card__identity { min-width: 0; }
.account-card h2 { margin: 0 0 .3rem; font-family: var(--serif); font-size: 1.6rem; font-weight: 600; overflow-wrap: anywhere; }
.account-card p:last-child { margin: 0; color: var(--muted); font-size: .69rem; }
.account-card > form { margin-left: auto; flex-shrink: 0; }
.account-card .admin-button { font-size: .7rem; }
.mobile-install-card { display: none; }
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding: 1.5rem clamp(1.5rem, 3.4vw, 3.5rem); border-top: 1px solid var(--line); color: var(--muted); }
.app-footer small { font-size: .6rem; }
.app-footer small > span { margin-inline: .5rem; }
.mobile-nav { display: none; }

.admin-dialog { width: min(27rem, calc(100% - 2.5rem)); max-height: calc(100svh - 3rem); padding: 2.5rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--paper); box-shadow: 0 1rem 5rem #2c1e0d33; }
.admin-dialog::backdrop { background: #2c1e0d8f; backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: .5rem; right: .5rem; }
.admin-dialog .access-emblem { margin-bottom: 1.25rem; }
.admin-dialog h2 { margin-bottom: 1.25rem; font-family: var(--serif); font-size: 2.5rem; font-weight: 500; line-height: 1; }
.admin-dialog > p:not(.small-label) { color: var(--muted); font-size: .85rem; line-height: 1.8; }
.admin-dialog .admin-button { margin-top: .75rem; }
.install-ios > .admin-icon { width: 1rem; height: 1rem; }
.update-banner { position: fixed; z-index: 50; right: 1.5rem; bottom: 1.5rem; display: flex; align-items: center; gap: 1.5rem; max-width: calc(100% - 3rem); padding: .9rem 1.25rem; border: 1px solid #dbd2c7; border-radius: 7px; background: #f9f4df; box-shadow: 0 .5rem 2.5rem #38200f22; font-size: .75rem; }
.app-toast { position: fixed; z-index: 60; bottom: 2rem; left: 50%; max-width: calc(100% - 2.5rem); margin: 0; padding: .9rem 1.25rem; border-radius: 6px; color: #fffef5; background: var(--forest); font-size: .8rem; transform: translateX(-50%); }

@media (max-width: 1200px) and (min-width: 981px) {
    .sidebar { width: 13.75rem; padding-inline: 1rem; }
    .sidebar .admin-brand > span { font-size: 1.45rem; }
    .app-body { margin-left: 13.75rem; }
    .dashboard { padding-inline: 1.5rem; }
    .welcome-card__copy { padding-inline: 1.8rem; }
    .overview-stats { gap: .75rem; }
    .stat-card { gap: .7rem; padding: 1rem .8rem; }
    .stat-icon { width: 2.2rem; height: 2.2rem; }
    .stat-card .stat-arrow { display: none; }
    .admin-piece-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-piece__photo img { aspect-ratio: 174 / 175; object-position: center 45%; }
    .admin-collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
    .access-layout { grid-template-columns: 40% 60%; }
    .access-art { padding: 2rem; }
    .access-art .admin-brand > span { font-size: 1.45rem; }
    .access-art .admin-brand > small { font-size: .34rem; }
    .access-art h2 { font-size: 3.5rem; }
    .access-main { padding-inline: 2rem; }
    .access-header, .access-footer { padding-inline: 2rem; }
    .sidebar { display: none; }
    .app-body { margin-left: 0; }
    .breadcrumb { display: none; }
    .mobile-wordmark { display: block; }
    .app-topbar { min-height: 4.5rem; padding: .8rem 1.5rem; }
    .dashboard { padding: 1.8rem 1.5rem .5rem; }
    .app-footer { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); }
    .mobile-nav { position: fixed; z-index: 30; inset: auto 0 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: .45rem 1rem calc(.55rem + env(safe-area-inset-bottom)); border-top: 1px solid #e3dcd3; background: #fffef9f7; backdrop-filter: blur(14px); }
    .mobile-nav > a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 3.1rem; padding: .35rem; border-radius: 7px; color: #9e815f; font-size: .58rem; }
    .mobile-nav .admin-icon { width: 1.25rem; height: 1.25rem; }
    .mobile-nav > a.is-active { color: var(--forest); background: #f2ede7; }
    .mobile-install-card { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; padding: 1.25rem; border: 1px solid #dfdfce; border-radius: 7px; background: #efeee1; }
    .mobile-install-card > .admin-icon { color: var(--bronze); }
    .mobile-install-card h2 { margin-bottom: .3rem; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1; }
    .mobile-install-card p { margin: 0; color: var(--muted); font-size: .67rem; line-height: 1.6; }
    .mobile-install-card > button { margin-left: auto; font-size: .7rem; }
    .update-banner { bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
}

@media (max-width: 650px) {
    html { scroll-padding-top: 6rem; }
    .access-layout { display: block; }
    .access-art { display: none; }
    .access-body { min-height: 100svh; }
    .access-header { justify-content: space-between; min-height: 5rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--line); }
    .access-header .mobile-wordmark { font-size: 1.4rem; }
    .back-link { gap: .4rem; font-size: .61rem; }
    .access-main { padding: 2.5rem 1.5rem 2rem; }
    .access-content { max-width: 25rem; }
    .access-content h1 { font-size: 4rem; }
    .access-content .small-label { font-size: .54rem; }
    .access-emblem { margin-bottom: 1.5rem; }
    .access-intro { font-size: .85rem; }
    .desktop-break { display: none; }
    .form-field input { min-height: 3.3rem; font-size: 1rem; }
    .form-field > label { font-size: .8rem; }
    .password-toggle { top: .3rem; }
    .login-submit { min-height: 3.3rem; font-size: .85rem; }
    .access-help { font-size: .68rem; }
    .access-note { gap: .5rem; margin-top: 1.75rem; font-size: .64rem; }
    .access-footer { padding: 1rem 1.5rem 1.5rem; }
    .access-footer > small, .connection-state { font-size: .57rem; }
    .access-footer small > span { margin-inline: .25rem; }
    .app-topbar { min-height: 4.25rem; padding-inline: 1.2rem; }
    .app-topbar .mobile-wordmark { font-size: 1.5rem; }
    .topbar-actions { gap: .3rem; }
    .user-menu__name { display: none; }
    .user-menu summary { gap: .4rem; }
    .user-avatar { width: 2rem; height: 2rem; font-size: 1.2rem; }
    .dashboard { padding: 1.6rem 1.15rem .5rem; }
    .page-heading { margin-bottom: 1.35rem; }
    .page-heading h1 { font-size: 2.4rem; }
    .page-heading .small-label { font-size: .45rem; }
    .page-heading p:last-child { max-width: 25em; font-size: .72rem; }
    .page-heading > .admin-button { display: none; }
    .welcome-card { grid-template-columns: 65% 35%; min-height: 17rem; border-radius: 7px; }
    .welcome-card__copy { padding: 1.6rem 0 1.6rem 1.5rem; }
    .welcome-card .small-label { margin-bottom: 1.1rem; font-size: .4rem; letter-spacing: .14em; white-space: nowrap; }
    .welcome-card h2 { font-size: 2.55rem; }
    .welcome-card__copy > p:not(.small-label) { margin-bottom: 1.25rem; font-size: .66rem; }
    .welcome-card .admin-button { gap: .6rem; padding-inline: .85rem; font-size: .62rem; }
    .welcome-card__photo img { object-position: 52% center; }
    .welcome-card__photo > span { display: none; }
    .welcome-card__photo::after { background: linear-gradient(90deg, var(--forest), #38200f20 55%, #38200f10); }
    .overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-top: .8rem; }
    .stat-card { gap: .65rem; padding: 1rem .8rem; }
    .stat-icon { width: 2rem; height: 2rem; border-radius: 5px; }
    .stat-icon .admin-icon { width: 1rem; height: 1rem; }
    .stat-number { font-size: 2.15rem; }
    .stat-card h2 { margin-block: .25rem; font-size: .61rem; line-height: 1.35; }
    .stat-card p { font-size: .54rem; line-height: 1.5; }
    .stat-card .stat-arrow { display: none; }
    .stat-card--company { grid-column: 1 / -1; padding-block: .85rem; }
    .stat-card--company h2 { font-size: 1.35rem; }
    .stat-card--company .stat-kicker { font-size: .42rem; }
    .stat-card--company .stat-arrow { display: inline-block; }
    .catalog-section, .admin-collections, .account-section { margin-top: 2.3rem; }
    .section-title h2 { font-size: 1.95rem; }
    .section-title .small-label { font-size: .44rem; }
    .section-title p:last-child { font-size: .68rem; }
    .count-pill { padding: .4rem .55rem; font-size: .53rem; }
    .catalog-toolbar { flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
    .catalog-search input { min-height: 2.75rem; font-size: 1rem; }
    .catalog-search input::placeholder { font-size: .75rem; }
    .catalog-category { max-width: 100%; }
    .catalog-category select { min-height: 2.75rem; font-size: .78rem; }
    .admin-piece-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
    .admin-piece__body { padding: .8rem .7rem .55rem; }
    .admin-piece__body .piece-type { font-size: .42rem; letter-spacing: .05em; }
    .admin-piece h3 { min-height: 2em; font-size: 1.3rem; line-height: 1; }
    .admin-piece__body > p:not(.piece-type) { font-size: .57rem; }
    .piece-link { min-height: 2.75rem; font-size: .57rem; }
    .public-badge { left: .45rem; bottom: .45rem; padding: .3rem .4rem; font-size: .46rem; }
    .admin-collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
    .admin-collection { min-height: 10rem; }
    .admin-collection > div { padding: .9rem; }
    .admin-collection h3 { font-size: 1.6rem; }
    .admin-collection span { font-size: .52rem; }
    .account-card { flex-wrap: wrap; gap: .9rem; padding: 1.15rem; }
    .account-card__identity { flex: 1; }
    .user-avatar--large { width: 2.8rem; height: 2.8rem; font-size: 1.6rem; }
    .account-card > form { width: 100%; margin: .5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
    .account-card .admin-button { width: 100%; font-size: .75rem; }
    .mobile-install-card { gap: .65rem; padding: 1rem; }
    .mobile-install-card > .admin-icon { display: none; }
    .mobile-install-card h2 { font-size: 1.4rem; }
    .mobile-install-card p { max-width: 20em; font-size: .6rem; }
    .mobile-install-card > button { font-size: .65rem; }
    .app-footer { align-items: flex-start; padding-inline: 1.15rem; }
    .app-footer small { max-width: 19em; font-size: .55rem; line-height: 1.7; }
    .app-footer small > span { margin-inline: .2rem; }
    .update-banner { right: 1rem; left: 1rem; gap: 1rem; max-width: none; padding: .75rem 1rem; font-size: .68rem; }
    .update-banner .admin-text-link { font-size: .68rem; }
    .admin-dialog { padding: 2rem 1.5rem; }
}

@media (max-width: 360px) {
    .dashboard { padding-inline: .9rem; }
    .app-topbar { padding-inline: 1rem; }
    .access-header, .access-footer, .access-main { padding-inline: 1.15rem; }
    .access-header .mobile-wordmark { font-size: 1.25rem; }
    .back-link { font-size: .55rem; }
    .welcome-card__copy { padding-left: 1.2rem; }
    .welcome-card h2 { font-size: 2.2rem; }
    .welcome-card .small-label { font-size: .35rem; }
    .welcome-card .admin-button { font-size: .56rem; }
    .stat-card { gap: .5rem; padding-inline: .65rem; }
    .stat-icon { width: 1.75rem; height: 1.75rem; }
    .section-title h2 { font-size: 1.8rem; }
    .admin-piece-grid { gap: .6rem; }
    .admin-piece__body { padding-inline: .6rem; }
    .admin-piece h3 { font-size: 1.2rem; }
    .piece-link { font-size: .53rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Grupo «Administración» del menú lateral: se despliega con <details>, sin JavaScript. */
.nav-group { display: flex; flex-direction: column; }
.nav-group > summary { cursor: pointer; list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group__chevron { width: .8rem; height: .8rem; margin-left: auto; transition: transform .2s; }
.nav-group[open] > summary .nav-group__chevron { transform: rotate(180deg); }
.nav-submenu { display: flex; flex-direction: column; gap: .2rem; margin: .2rem 0 .2rem 1.15rem; padding-left: .65rem; border-left: 1px solid var(--line); }
.nav-subitem { display: flex; align-items: center; gap: .65rem; min-height: 2.5rem; padding: .55rem .75rem; border-radius: 5px; color: #8b7153; font-size: .76rem; }
.nav-subitem .admin-icon { width: 1rem; height: 1rem; }
.nav-subitem:hover { color: var(--forest); background: #f1ede8; }
.nav-subitem.is-active { color: var(--forest); background: #ede6df; font-weight: 600; }
