/* Sticky controls replace tall navigation grids on compact screens. */
.filters { position:sticky; top:0; z-index:10; background:#f7f4ebf5; box-shadow:0 4px 12px #002d3710; }
.filter-options { display:contents; }
.filter-panel-trigger,.profile-section-control { display:none; }
.profile-tabs { display:none!important; }
.profile-sidebar { top:12px; max-height:calc(100dvh - 24px); overflow-y:auto; overscroll-behavior:contain; }
.profile-sidebar button { text-align:start; min-height:44px; white-space:normal; overflow-wrap:anywhere; }
.control-panel { padding:0; width:min(540px,calc(100% - 24px)); max-height:calc(100dvh - 32px); border:1px solid #bd9b53; border-radius:16px; background:var(--cream); color:var(--navy); overflow:auto; overscroll-behavior:contain; }
.control-panel::backdrop { background:#002d3799; }
.control-panel-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; position:sticky; top:0; background:var(--cream); padding:14px 18px; border-bottom:1px solid #ccd8ce; z-index:1; }
.control-panel-heading h2 { font:600 22px/1.35 'Source Serif 4',Georgia,serif; margin:0; }
.control-close { width:44px; height:44px; flex-shrink:0; border:0; border-radius:8px; background:transparent; font-size:28px; }
.control-panel-body { padding:18px; }
.control-panel-open { overflow:hidden; }
.control-panel .filter-options { display:grid; gap:18px; }
.control-panel .categories { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; border:0; padding:0; margin:0; overflow:visible; }
.control-panel .categories button:first-child { grid-column:1/-1; }
.control-panel .categories button { min-height:48px; white-space:normal; overflow-wrap:anywhere; }
.control-panel .filter-options select { width:100%; min-width:0; min-height:48px; border:1px solid #b9c9c1; border-radius:8px; padding:10px; background:#fff9; }
.filter-panel-footer { padding:16px 18px; position:sticky; bottom:0; background:var(--cream); border-top:1px solid #ccd8ce; }
.filter-panel-footer p { font-size:13px; margin:0 0 10px; }
.filter-panel-footer button { width:100%; min-height:48px; border:0; border-radius:8px; color:#fff; background:var(--teal); padding:12px; }
.section-menu-list { display:grid; gap:6px; }
.section-menu-list button { min-height:48px; padding:12px; border:1px solid #cbd8ce; border-radius:8px; background:#fff7; text-align:start; white-space:normal; overflow-wrap:anywhere; }
.section-menu-list button.selected { background:#dfede6; border-color:#00544e; color:#004e50; font-weight:600; }
@media(max-width:1000px),(max-height:500px) {
 .filters { display:grid; grid-template-columns:minmax(0,1fr) auto; padding:10px; gap:8px; margin-inline:0; border-radius:0 0 10px 10px; }
 .filters .search { grid-column:auto; min-width:0; }
 .filter-panel-trigger { display:block; min-height:48px; max-width:130px; padding:10px 14px; border:1px solid #b9c9c1; border-radius:8px; color:#004e50; background:#fff9; white-space:normal; overflow-wrap:anywhere; }
 .profile-layout { grid-template-columns:minmax(0,1fr); }
 .profile-sidebar { position:static; order:2; max-height:none; overflow:visible; }
 .profile-sidebar>h2,.profile-sidebar>nav { display:none; }
 .profile-section-control { display:block; position:sticky; top:0; z-index:10; padding:10px 0; margin-bottom:14px; background:var(--cream); }
 .profile-section-control>button { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:48px; padding:10px 14px; border:1px solid #b9c9c1; border-radius:10px; background:#e8efe8; text-align:start; color:#004e50; }
 .profile-section-control small { display:block; font-size:11px; font-weight:400; margin-bottom:3px; }
 .profile-section-control strong { display:block; font-size:14px; white-space:normal; overflow-wrap:anywhere; }
 .profile-section-control .section-chevron { flex-shrink:0; font-size:18px; }
}
@media print { .profile-section-control,.control-panel,.filter-panel-trigger { display:none!important; } .control-panel-open { overflow:visible; } }
/* Source and era browsing share the same compact navigation and filter panels. */
.source-tabs,.reference-filters,.era-navigation { position:sticky; top:0; z-index:10; background:var(--cream); }
.page-section-control { margin-top:0; }
.era-sidebar { position:sticky; top:calc(var(--era-navigation-height,100px) + 12px); align-self:start; max-height:calc(100dvh - var(--era-navigation-height,100px) - 24px); overflow-y:auto; overscroll-behavior:contain; }
.era-sidebar .filter-options>select { width:100%; min-height:48px; }
.era-sidebar .search { min-width:0; }
.era-browse-controls { display:none; }
.control-panel .filter-options h2 { margin:0; font:600 16px/1.4 'Source Serif 4',Georgia,serif; }
.control-panel .era-checkboxes { display:grid; grid-template-columns:1fr; gap:8px; }
.control-panel .era-checkboxes label { min-height:44px; display:flex; align-items:center; gap:10px; font-size:14px; white-space:normal; }
.control-panel .era-note { display:none; }
.control-panel .era-periods { display:contents; }
.control-panel [data-era] { display:block; width:100%; }
.control-panel [data-era]>.icon { display:none; }
.control-panel [data-era] strong { display:block; font-size:14px; }
.control-panel [data-era] small { display:block; margin-top:4px; font-size:12px; font-weight:400; }
@media(max-width:1000px),(max-height:500px) {
 .source-tabs,.reference-tabs,.era-navigation { display:none!important; }
 .reference-filters { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:10px; background:var(--cream); }
 .reference-filters .search { grid-column:auto; min-width:0; }
 .era-browse-controls { display:grid; gap:8px; position:sticky; top:0; z-index:10; background:var(--cream); padding:10px 0; margin-bottom:18px; }
 .era-browse-controls .page-section-control { position:static; padding:0; margin:0; }
 .era-searchbar { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
 .era-searchbar .search { min-width:0; width:100%; min-height:48px; }
 .era-sidebar { display:none; }
 .eras-layout { grid-template-columns:minmax(0,1fr); }
 .era-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .era-results-row { gap:8px; flex-wrap:wrap; }
 .era-results-row button { min-height:44px; padding-inline:12px; }
 .book-card-body { min-width:0; }
 .book-card-body>div { min-width:0; }
 .book-card h2,.book-card .book-author { overflow-wrap:anywhere; }
 .book-actions { gap:8px; flex-wrap:wrap; }
 .book-actions button,.book-actions a { min-height:44px; padding:10px; }
 .source-panel-heading { align-items:flex-start; }
 .source-panel h2,.resource-links strong { overflow-wrap:anywhere; }
 .resource-links>a { min-height:44px; }
}
@media(max-width:360px) {
 .era-cards { grid-template-columns:minmax(0,1fr); }
 .book-card-body { gap:12px; }
 .book-card-body>img { width:72px; height:118px; }
}
@media print { .page-section-control,.era-browse-controls { display:none!important; } }

/* Filter labels remain clear after selecting a non-default value. */
.filter-field { min-width:0; }
.filter-field>span { display:none; }
.filter-field select { width:100%; min-width:0; }
.control-panel .filter-field>span { display:block; font-size:12px; font-weight:600; margin-bottom:7px; }
