/* Shell queries have their own container so page layouts cannot change navigation breakpoints. */
html { scrollbar-gutter: stable; }
.skip-link { z-index: 80; }
.site-shell { container: shell / inline-size; min-height: 100dvh; }
.site-header.page-width, .site-footer.page-width { width: 100%; max-width: var(--page-width); padding-inline: var(--space-7); }
.site-header { font-size: 16px; line-height: 1.5; }
.brand { min-width: 0; }
.brand img { max-width: none; }
.nav-tray, .account-button { flex-shrink: 0; }
.nav-tray a, .account-button { white-space: nowrap; }
.account-button .avatar .icon { width: 18px; height: 18px; }
.account-button[aria-current="page"] { box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-1); }
/* Identity/availability notices belong to every shell, not a feature sheet. */
.site-feedback { padding: 12px 18px; margin-bottom: 16px; color: var(--teal-dark); background: var(--mint); border-radius: 18px; font-size: 13px; }
.account-layout-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; margin-bottom: 16px; background: #e0ece7; border-radius: 18px; font-size: 11px; color: var(--muted); }
.account-layout-notice strong { color: var(--teal-dark); }
.account-layout-notice a { display: inline-flex; align-items: center; gap: 8px; color: var(--teal); font-weight: 650; min-height: 44px; white-space: nowrap; }
.account-layout-notice .icon { width: 16px; height: 16px; }
.public-preview-notice { font-size: 14px; line-height: 1.5; color: var(--ink); }
@media (max-width: 700px) {
  .account-layout-notice { flex-wrap: wrap; gap: 0; padding: 14px 18px; }
}
.site-footer { position: relative; margin-top: var(--space-8); border-top: 0; }
.site-footer::before { content: ""; position: absolute; top: 0; left: var(--space-7); right: var(--space-7); border-top: 1px solid var(--line); }
.footer-line { margin-top: var(--space-4); }
.footer-links a { min-width: var(--target); }
/* Keyboard focus must not land under the fixed consent banner, the phone
   navigation or a task dock (WCAG 2.4.11). Browsers only scroll a focused
   control that lies outside the padded scrollport, so the padding lives on
   the scrolling root. 776px covers a 760px shell plus a desktop scrollbar. */
html { scroll-padding-bottom: max(24px, calc(var(--consent-clearance, 0px) + 8px)); }
html:has(.matcher-dock-host:not(:empty)) { scroll-padding-bottom: max(116px, calc(var(--consent-clearance, 0px) + 8px)); }
@media (max-width: 776px) {
  html { scroll-padding-bottom: max(108px, calc(var(--consent-clearance, 0px) + 8px)); }
  html:has(.matcher-dock-host:not(:empty)) { scroll-padding-bottom: max(208px, calc(var(--consent-clearance, 0px) + 8px)); }
}
/* Pages without their own layout container (concepts, admin, not found) share the header's edges. */
#main.page-width:not([class*="route-"]) { width: 100%; max-width: var(--page-width); padding-inline: var(--space-7); }
/* Keep the existing consent choice reachable above a running/finished task dock. */
.site-shell:has(.task-dock) .consent-banner { bottom: 148px; max-height: calc(100dvh - 172px); overflow-y: auto; }

/* Compact the tray before phone navigation takes over; retain the approved logo size. */
@container shell (min-width: 761px) and (max-width: 1080px) {
  .site-header { gap: 12px; }
  .nav-tray a { padding-inline: 10px; font-size: 14px; }
  .account-button { padding-right: 12px; font-size: 14px; }
}

@container shell (max-width: 760px) {
  .site-header.page-width, .site-footer.page-width { padding-inline: var(--space-4); }
  .site-header { min-height: 72px; }
  .brand img { width: 186px; margin: -16px 0 -16px -15px; }
  .nav-tray { display: none; }
  .account-button { min-width: var(--target); justify-content: center; padding: 0 6px; }
  .account-button .label { display: none; }
  /* Sticky stays in normal flow, leaving space for the last footer link. */
  .bottom-nav { display: flex; gap: 4px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); margin-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .site-footer { padding-bottom: var(--space-8); }
  .site-footer::before { left: var(--space-4); right: var(--space-4); }
  #main.page-width:not([class*="route-"]) { padding-inline: var(--space-4); }
  .site-shell :focus-visible { scroll-margin-block: 24px 100px; }
  /* First-visit privacy choices must leave the phone navigation reachable. */
  .consent-banner { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); max-height: calc(100dvh - 116px - env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
  .site-shell:has(.task-dock) .consent-banner { bottom: calc(252px + env(safe-area-inset-bottom, 0px)); max-height: calc(100dvh - 276px - env(safe-area-inset-bottom, 0px)); }
}
