/* Collection shell v2: reading area owns its heading; options never shrink it. */
html[data-fixed-shell] { height: auto; min-height: 100%; overflow: auto; }
body[data-fixed-shell] { height: auto; min-height: 100dvh; display: block; overflow: visible; }
body[data-fixed-shell].fixed-shell-ready:not(.fixed-shell-fallback) {
  height: var(--shell-viewport-height, 100dvh); min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden;
}
body[data-fixed-shell] > header { min-width: 0; min-height: 0; gap: .5rem; padding-block: .375rem; }
body[data-fixed-shell] .brand { min-width: 0; max-width: 100%; white-space: normal; gap: .625rem; }
body[data-fixed-shell] .brand img { flex-shrink: 0; width: 90px; height: 32px; }
body[data-fixed-shell] .brand > span { margin: 0; min-width: 0; font-size: 1rem; line-height: 1.25; overflow-wrap: anywhere; }
body[data-fixed-shell] .brand .brand-descriptor > span { font-size: .75rem; line-height: 1.3; }
body[data-fixed-shell] > .toolbar { max-height: none; overflow: visible; min-width: 0; padding-block: .375rem; }
body[data-fixed-shell] #filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: .5rem; align-items: end; }
body[data-fixed-shell] #filters > :is(.search, .search-label) { grid-column: auto; grid-row: auto; min-width: 0; }
body[data-fixed-shell] #filters :is(input, select, button), body[data-fixed-shell] .shell-options > summary {
  min-height: 44px; font-size: 1rem; line-height: 1.35; white-space: normal; overflow-wrap: anywhere;
}
body[data-fixed-shell] #filters label { min-width: 0; font-size: .875rem; }
body[data-fixed-shell] #filters label > span { margin-bottom: .25rem; }
body[data-fixed-shell] #filters > :is(.search, .search-label) > span {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
body[data-fixed-shell] #filters input, body[data-fixed-shell] #filters select { padding: .5rem; }
body[data-fixed-shell] #filters .tabs { display: flex; flex-wrap: wrap; gap: .5rem; grid-column: auto; }
body[data-fixed-shell] #filters .tabs button { flex: 1 1 5rem; padding: .5rem; }
body[data-fixed-shell] #filters #surprise { grid-column: auto; grid-row: auto; padding: .5rem; }
body[data-fixed-shell][data-shell-kind="motors"] #filters { grid-template-columns: minmax(0, 1fr) auto; }
body[data-fixed-shell] > main[data-article-pane] { display: block; min-width: 0; min-height: 20rem; overflow: visible; padding-block: 0 .75rem; }
body[data-fixed-shell].fixed-shell-ready:not(.fixed-shell-fallback) > main[data-article-pane] {
  min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scroll-padding-block: .75rem;
}
body[data-fixed-shell] > main > .scroll-pane { min-height: 0; overflow: visible; padding-bottom: 1rem; }
body[data-fixed-shell] .list-heading { min-height: 0; flex-wrap: wrap; gap: .25rem .75rem; padding-block: .625rem; }
body[data-fixed-shell] .list-heading h1 { font-size: 1.25rem; line-height: 1.3; overflow-wrap: anywhere; }
body[data-fixed-shell] .list-heading :is(.result-count, #result-count) { font-size: .875rem; text-align: start; }
body[data-fixed-shell] .intro { font-size: 1rem; line-height: 1.55; }
body[data-fixed-shell] .collection-intro > summary { display: flex; align-items: center; min-height: 44px; font-size: 1rem; cursor: pointer; }
body[data-fixed-shell] .collection-intro { margin-bottom: .5rem; }
body[data-fixed-shell] :is(.summary, .card-body p, .story-copy, .detail-content p, dialog p, dialog li) { font-size: 1rem; line-height: 1.65; }
body[data-fixed-shell] :is(.card-photo-caption, .story-photo figcaption, .credit) { font-size: .75rem !important; line-height: 1.5; }
body[data-fixed-shell] :is(.meta, .story-sources, .collection-note) { font-size: .875rem; }
body[data-fixed-shell] > footer {
  position: relative; z-index: 5; display: grid; grid-template-columns: minmax(0, 1fr) minmax(44px, auto);
  align-items: center; gap: .5rem; height: auto; min-height: 0; padding: .25rem .75rem;
  padding-bottom: max(.25rem, env(safe-area-inset-bottom, 0px));
}
.shell-options { min-width: 0; }
.shell-options > summary {
  display: flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer;
  padding: .5rem .625rem; border: 1px solid #aebdc8; border-radius: 6px; background: #fff; color: #243542;
}
.shell-options > summary::after { content: "+"; flex: 0 0 auto; }
.shell-options[open] > summary::after { content: "−"; }
.shell-options > summary::-webkit-details-marker { display: none; }
.shell-options > summary:focus-visible { outline: 3px solid #057abe; outline-offset: 2px; }
.shell-options-panel {
  position: fixed; z-index: 30; top: calc(var(--shell-viewport-top, 0px) + .5rem); left: 0; right: 0; margin: 0 auto;
  width: min(28rem, calc(100vw - 1.5rem)); max-height: calc(var(--shell-viewport-height, 100dvh) - 1rem);
  overflow: auto; overscroll-behavior: contain; padding: 1rem; border: 1px solid #aebdc8; border-radius: .5rem;
  box-shadow: 0 .5rem 2rem #182a3540; background: #fff; color: #182a35;
}
.shell-options-panel > * + * { margin-top: .75rem; }
.shell-options-panel .shell-dismiss { display: block; width: 100%; min-height: 44px; font: inherit; padding: .5rem; }
body[data-fixed-shell] > footer > .shell-options { max-width: 8rem; }
body[data-fixed-shell] > footer > .shell-options > summary { min-height: 44px; font-size: .875rem; line-height: 1.3; }
body[data-fixed-shell] .footer-content { display: block; height: auto; min-height: 0; padding: 0; white-space: normal; }
body[data-fixed-shell] .shell-options-panel > :is(.edition, .preview-label) { display: block; font-size: .875rem; white-space: normal; }
body[data-fixed-shell] .footer-content :is(.footer-brand, .private-label) { display: block; font-size: .875rem; margin-bottom: .5rem; white-space: normal; }
body[data-fixed-shell] .footer-content nav { display: flex; flex-direction: column; align-items: stretch; gap: .25rem; max-width: 100%; overflow: visible; white-space: normal; }
body[data-fixed-shell] .footer-content nav :is(a, button) { display: flex; align-items: center; min-height: 44px; font-size: 1rem; white-space: normal; overflow-wrap: anywhere; padding: .375rem .5rem; }
body[data-fixed-shell] > dialog {
  position: fixed; inset: auto; top: calc(var(--shell-viewport-top, 0px) + .5rem); left: 0; right: 0; margin: 0 auto;
  box-sizing: border-box; width: min(800px, calc(100vw - 1rem));
  height: min(820px, calc(var(--shell-viewport-height, 100dvh) - var(--shell-footer-height, 0px) - 1rem));
  max-height: calc(var(--shell-viewport-height, 100dvh) - var(--shell-footer-height, 0px) - 1rem);
}
body[data-fixed-shell] .modal-header { min-height: 52px; font-size: .875rem; }
body[data-fixed-shell] .modal-header button { min-width: 44px; min-height: 44px; }
body[data-fixed-shell] > dialog::backdrop { background: transparent; inset: 0; }
.shell-rem-probe { position: absolute; width: 1rem; height: 1rem; inset: 0; visibility: hidden; pointer-events: none; }
@media (max-width: 600px) {
  body[data-fixed-shell] #filters { grid-template-columns: minmax(0, 1fr) minmax(44px, auto); }
  body[data-fixed-shell] #filters > .search { grid-column: 1; grid-row: 1; }
  body[data-fixed-shell] #filters > label:not(.search):not(.search-label) { grid-column: 1 / -1; grid-row: 2; }
  body[data-fixed-shell] #filters > .shell-options { grid-column: 2; grid-row: 1; }
  body[data-fixed-shell] #filters > .shell-options { max-width: 9rem; }
  body[data-fixed-shell] .brand .brand-descriptor > span { display: none; }
}
@media print {
  body[data-fixed-shell].fixed-shell-ready:not(.fixed-shell-fallback) { display: block; height: auto; overflow: visible; }
  body[data-fixed-shell].fixed-shell-ready:not(.fixed-shell-fallback) > main[data-article-pane] { display: block; overflow: visible; }
  body[data-fixed-shell] > footer, .shell-options { display: none; }
  body[data-fixed-shell] > dialog[open] { position: static; height: auto; max-height: none; overflow: visible; }
}

/* Menu-first successor: one unmistakable text trigger, articles visible on arrival. */
body[data-fixed-shell].fixed-shell-ready:not(.fixed-shell-fallback) { grid-template-rows: auto minmax(0, 1fr) auto; }
body[data-fixed-shell] > header {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .625rem;
  padding: .375rem .75rem; border-bottom-width: 1px;
}
body[data-fixed-shell] > header > .brand { display: flex; flex-wrap: wrap; gap: .2rem .625rem; }
body[data-fixed-shell] > header .shell-main-menu { max-width: 11rem; }
body[data-fixed-shell] .shell-main-menu > summary {
  min-width: 132px; min-height: 48px; padding: .5rem .75rem; font-size: 1rem; font-weight: 750;
  line-height: 1.3; text-align: center; color: #fff; background: #173f37; border: 2px solid #173f37;
}
body[data-fixed-shell] .shell-main-menu > summary::after { content: "▾"; }
body[data-fixed-shell] .shell-main-menu[open] > summary::after { content: "▴"; }
body[data-fixed-shell] .shell-main-menu > summary:focus-visible { outline: 3px solid #b86b00; outline-offset: 3px; }
body[data-fixed-shell] .shell-main-menu .shell-options-panel { padding: 0 1rem 1rem; }
body[data-fixed-shell] .shell-menu-heading {
  position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem; padding: .75rem 0; margin: 0; border-bottom: 1px solid #d4dfe3; background: #fff;
}
body[data-fixed-shell] .shell-menu-heading h2 { margin: 0; font-size: 1.25rem; line-height: 1.3; }
body[data-fixed-shell] .shell-menu-heading .shell-dismiss { width: auto; min-height: 44px; margin: 0; font-size: 1rem; }
body[data-fixed-shell] .shell-main-menu .toolbar { max-height: none; overflow: visible; padding: .75rem 0 0; margin: 0; border: 0; }
body[data-fixed-shell] .shell-main-menu #filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: .875rem; align-items: stretch; }
body[data-fixed-shell] .shell-main-menu #filters > * { grid-column: 1; grid-row: auto; max-width: none; }
body[data-fixed-shell] .shell-main-menu #filters > :is(.search, .search-label) > span {
  display: block; position: static; width: auto; height: auto; margin: 0 0 .25rem; padding: 0; overflow: visible; clip: auto; white-space: normal;
}
body[data-fixed-shell] .shell-main-menu #filters :is(input, select, button) { min-height: 44px; font-size: 1rem; }
body[data-fixed-shell] .shell-main-menu .collection-intro { margin-top: .75rem; }
body[data-fixed-shell] #shell-selection-summary { margin: 0 0 .625rem; font-size: .875rem; line-height: 1.45; overflow-wrap: anywhere; }
@media(max-width: 380px) {
  body[data-fixed-shell] > header { grid-template-columns: minmax(0, 1fr) minmax(132px, 46%); }
  body[data-fixed-shell] .shell-main-menu > summary { min-width: 0; }
}

/* Brand supplies visible collection identity; no marketing prelude above cards. */
body[data-fixed-shell] .list-heading .shell-collection-title {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
body[data-fixed-shell] .list-heading { padding-block: .5rem; }
body[data-fixed-shell] .list-heading :is(.result-count, #result-count) { margin: 0; line-height: 1.45; }

/* Information footer only. There is no footer ad placement or reserved ad space. */
body[data-fixed-shell] > footer { grid-template-columns: minmax(0, 1fr); }
body[data-fixed-shell] > footer > .shell-options { justify-self: end; }
@media screen {
  html[data-fixed-shell] { height: 100%; overflow: hidden; }
  body[data-fixed-shell] { height: var(--shell-viewport-height, 100dvh); min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
  body[data-fixed-shell] > header { grid-row: 1; }
  body[data-fixed-shell] > main[data-article-pane] { grid-row: 2; min-height: 0; overflow: auto; overscroll-behavior: contain; }
  body[data-fixed-shell] > footer { grid-row: 3; }
}
/* Let enlarged phone text move the obvious menu button to its own row,
   rather than squeezing the brand underneath an oversized auto grid column. */
@media(max-width: 600px) {
  body[data-fixed-shell] > header { display: flex; flex-wrap: wrap; }
  body[data-fixed-shell] > header > .brand { flex: 1 1 7.5rem; }
  body[data-fixed-shell] > header > .shell-main-menu { flex: 1 1 auto; min-width: 0; max-width: 100%; }
  body[data-fixed-shell] .shell-main-menu > summary { display: block; width: 100%; min-width: 0; }
  body[data-fixed-shell] .shell-main-menu > summary::after { content: none; }
}
/* Width/height HTML attributes must not leave a 450px-tall phone thumbnail. */
body[data-fixed-shell] .card-image { height: auto; aspect-ratio: 16 / 10; }
/* Closed options expose neither a painted panel nor stale focusable geometry. */
body[data-fixed-shell] .shell-options:not([open]) > .shell-options-panel { display: none; }

/* Menu field placement must beat the older two-column mobile toolbar rule. */
body[data-fixed-shell] .shell-main-menu #filters > label:not(.search):not(.search-label) {
  grid-column: 1;
  grid-row: auto;
}
/* Keep zoomed phone controls wide without reducing the user's text size. */
@media(max-width: 600px) {
  body[data-fixed-shell] .shell-main-menu .shell-options-panel { width: calc(100vw - 16px); padding-inline: 12px; }
  body[data-fixed-shell] .shell-main-menu #filters :is(input, select) { padding-inline: 8px; }
}
body[data-fixed-shell] .shell-main-menu #filters .shell-selected-value {
  display: block; margin: .3rem 0 0; font-size: 1rem; line-height: 1.4;
  white-space: normal; overflow-wrap: anywhere; color: inherit;
}

/* Smooth chrome releases the actual grid rows over 180ms while natural
   element heights stay measurable. Only closed, unfocused chrome can hide. */
body[data-fixed-shell] > :is(header, footer) {
  transition: margin-bottom .18s ease-out, margin-top .18s ease-out, transform .18s ease-out, opacity .18s ease-out, visibility 0s;
}
body[data-fixed-shell].shell-chrome-hidden > :is(header, footer) {
  pointer-events: none; opacity: 0; visibility: hidden;
  transition: margin-bottom .18s ease-out, margin-top .18s ease-out, transform .18s ease-out, opacity .18s ease-out, visibility 0s .18s;
}
body[data-fixed-shell].shell-chrome-hidden > header { margin-bottom: calc(-1 * var(--shell-shown-header-height)); transform: translateY(-100%); }
body[data-fixed-shell].shell-chrome-hidden > footer { margin-top: calc(-1 * var(--shell-shown-footer-height)); transform: translateY(100%); }
body[data-fixed-shell].shell-chrome-immediate > :is(header, footer) { transition: none; }
body[data-fixed-shell] > footer { padding-block: 2px max(2px, env(safe-area-inset-bottom, 0px)); }
body[data-fixed-shell] .shell-footer-nav {
  display: flex; flex-wrap: wrap; align-items: stretch; justify-content: space-evenly;
  gap: 4px; width: 100%; max-width: 1180px; margin-inline: auto;
}
body[data-fixed-shell] .shell-footer-nav > :is(a, button),
body[data-fixed-shell] .shell-footer-nav > .shell-options > summary {
  display: flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px;
  margin: 0; padding: 6px 2px; border: 0; border-radius: 4px; font-size: .875rem;
  line-height: 1.4; text-align: center; text-decoration: none; overflow-wrap: anywhere; background: transparent; color: inherit;
}
body[data-fixed-shell] .shell-footer-nav > :is(a, button, .shell-options) { flex: 1 0 auto; max-width: 100%; width: auto; }
body[data-fixed-shell] .shell-footer-nav > .shell-options > summary::after { content: none; }
body[data-fixed-shell] .shell-footer-nav > :is(a, button):focus-visible { outline: 3px solid #057abe; outline-offset: -3px; }
@media(prefers-reduced-motion: reduce) {
  body[data-fixed-shell] > :is(header, footer) { transition: none !important; }
}
