/* Compact responsive web refinements. Shared colours remain in --experience-*. */
@media (max-width: 768px) {
  html { scroll-padding-block: 80px 100px; }
  body .site-header__inner {
    width: 100%; max-width: none; min-height: 64px; box-sizing: border-box;
    padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
    gap: 8px;
  }
  body .brand-mark { min-width: 0; flex-shrink: 1; }
  body .header-actions { flex-shrink: 0; gap: 6px; }
  body:is(.discovery-page,.directory-page) .header-actions { gap: 6px; }
  body .discovery-students-entry { display: inline-flex; align-items: center; min-height: 44px; font-size: .8125rem; white-space: nowrap; }
  body .experience-theme-toggle,
  body:is(.discovery-page,.directory-page) .discovery-header-search { width: 44px; height: 44px; min-width: 44px; min-height: 44px; flex-shrink: 0; }
  body .experience-account-menu summary { min-width: 44px; min-height: 44px; }
  body .experience-account-links { max-width: calc(100vw - 24px); max-height: calc(100dvh - 100px); overflow-y: auto; }
  body .mobile-bottom-nav { padding-bottom: max(8px,env(safe-area-inset-bottom)); }
  body .mobile-bottom-nav__item { min-height: 48px; white-space: normal; line-height: 1.25; }
  body .main-shell { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  body .site-footer { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  body :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { font-size: 1rem; min-width: 0; max-width: 100%; }
  body :is(input:not([type=checkbox]):not([type=radio]),select,textarea):not([type=hidden]) { border-color: var(--experience-control-line,var(--experience-muted)); }
  body :is(button,a,summary,input,select,textarea):focus-visible { outline-width: 3px; outline-offset: 3px; }
  body :is(.discovery-back,.discovery-map,.discovery-reset,.discovery-filter-apply,.discovery-students-entry) { min-height: 44px; display: inline-flex; align-items: center; }
  body .discovery-popup-close,body .account-auth-close { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
  body .account-auth-browse { min-height: 44px; }
  body .discovery-popup { max-height: calc(100dvh - 32px); padding: 24px 20px; }
  body .discovery-popup h2 { padding-right: 30px; }
  body .discovery-popup :is(.discovery-filter-footer,.discovery-search-field) { gap: 12px; flex-wrap: wrap; }
  body .discovery-popup .discovery-past-toggle { min-height: 44px; align-items: center; }
  body .discovery-popup .discovery-past-toggle input { width: 20px; height: 20px; flex-shrink: 0; }
  body .discovery-row__head > div:first-child { min-width: 0; }
  body .discovery-row__head h3 { overflow-wrap: anywhere; }
  body .discovery-row__controls { flex-shrink: 0; }
  body .collection-explanation summary { min-height: 44px; font-size: .8125rem; }
  body .collection-explanation p { font-size: .8125rem; line-height: 1.5; }
  body .discovery-card__date { font-size: .75rem; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
  body .discovery-card__location { font-size: .8125rem; line-height: 1.4; color: var(--experience-muted); margin: 4px 0 0; overflow-wrap: anywhere; }
  body .discovery-card__body { min-width: 0; }
  body .discovery-card__link:focus-visible { outline-offset: -3px; }
  body .discovery-rail { scroll-padding-inline: 16px; overscroll-behavior-x: contain; }
  body .discovery-rail:focus-visible { outline-offset: -3px; }
  body .discovery-detail :is(h1,dd,a,p),body[data-page=society] :is(h1,.detail-meta__item,.detail-copy) { overflow-wrap: anywhere; }
  body .discovery-detail :is(.discovery-detail__actions,.discovery-detail__info) { box-sizing: border-box; min-width: 0; }
  body .discovery-detail__info :is(dt,dd) { font-size: .875rem; }
  body .discovery-detail :is(.discovery-caption,.event-detail-plans p) { font-size: .8125rem; line-height: 1.5; }
  body .discovery-copy p { font-size: 1rem; }
  body .discovery-detail__actions :is(button,a) { white-space: normal; }
  body .event-plan-actions { flex-wrap: wrap; }
  body .event-plan-actions :is(button,a) { min-height: 44px; }
  body .directory-card-actions :is(button,a) { min-height: 44px; }
  body .directory-filter-toggles label { min-height: 44px; display: flex; align-items: center; }
  body .directory-filter-toggles input { width: 20px; height: 20px; }
  body .auth-public-nav { gap: 8px 12px; padding-inline: 16px; box-sizing: border-box; }
  body .auth-public-nav a { min-height: 44px; }
  body .login-link { min-height: 44px; }
  body .university-access-card { overflow-wrap: anywhere; }
  body .university-access-card :is(button,.btn) { max-width: 100%; white-space: normal; min-height: 44px; }
}
@media (max-width: 640px) {
  body.discovery-page #eventSections,body.discovery-page #pageFilters { width: calc(100% - 32px); }
  body.discovery-page .discovery-rail {
    width: 100vw; max-width: none; margin-inline: calc(50% - 50vw);
    padding: 4px 16px 12px; box-sizing: border-box;
    grid-auto-columns: clamp(164px,52vw,256px); gap: 12px;
  }
  body.discovery-page .discovery-rail .discovery-card h3 { font-size: .9375rem; line-height: 1.35; }
  body.discovery-page .discovery-card__image { aspect-ratio: 1.5; }
  body.discovery-page .discovery-row { margin-bottom: 24px; }
  body.discovery-page .discovery-row__head { gap: 8px; margin-bottom: 4px; align-items: start; }
  body.discovery-page .discovery-row__head h3 { font-size: 1.375rem; line-height: 1.2; }
  body.discovery-page .discovery-view-all { min-height: 44px; padding-block: 0; font-size: .8125rem; }
  body.discovery-page .discovery-results__head { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
  body.discovery-page .discovery-results__head p { font-size: .8125rem; }
  body.discovery-page .discovery-view-switch { width: auto; max-width: 100%; margin-left: auto; }
  body.discovery-page .discovery-view-switch button { font-size: .8125rem; min-height: 44px; padding-inline: 12px; }
  body.discovery-page .discovery-compact-tools { margin: 8px 0 12px; gap: 8px; }
  body.discovery-page .discovery-compact-tools > button { min-height: 44px; font-size: .875rem; }
  body.discovery-page .discovery-active-search { min-width: 0; font-size: .8125rem; }
  body.discovery-page .discovery-active-search > button { min-height: 44px; white-space: normal; }
  body.discovery-page .discovery-featured { min-height: 0; }
  body.discovery-page .discovery-featured-copy { padding: 112px 16px 52px; width: 100%; }
  body.discovery-page .discovery-featured-copy h1 { font-size: 2rem; margin-block: 8px 12px; }
  body.discovery-page .discovery-featured-copy :is(.discovery-featured-timing,.discovery-featured-synopsis) { font-size: .875rem; }
  body.discovery-page .discovery-featured-copy > small { font-size: .75rem; }
  body.discovery-page .discovery-featured .discovery-area-nav { left: 16px; right: 16px; top: 8px; flex-wrap: wrap; }
  body.discovery-page .discovery-area-nav a { min-height: 44px; display: inline-flex; align-items: center; box-sizing: border-box; font-size: .8125rem; }
  body.discovery-page .discovery-featured-dots { bottom: 2px; right: 16px; gap: 0; }
  body.discovery-page .discovery-featured-dots button { width: 44px; height: 44px; background: transparent; }
  body.discovery-page .discovery-featured-dots button::before { inset: 20px 7px; background: #c3ccbd; }
  body.discovery-page .discovery-featured-dots button[aria-current=true]::before { background: #fff; }
  body.discovery-page .discovery-card--ranked { padding-left: 28px; }
  body.discovery-page .discovery-card--ranked .event-rank-number { font-size: 4.25rem; }
  body .discovery-detail__layout { gap: 16px; }
  body .discovery-detail__info dl { grid-template-columns: 64px minmax(0,1fr); gap: 12px; }
  body .discovery-detail h1 { font-size: 1.875rem; }
  body .discovery-detail__actions,body .discovery-detail__info { padding: 16px; }
  body .discovery-popup .discovery-filters { grid-template-columns: 1fr; }
  body .discovery-filter-footer { grid-column: 1; }
}
@media (max-width: 359px) {
  body .brand-mark,body .brand-mark img:first-child { width: 80px; min-width: 0; }
  body .site-header__inner { gap: 6px; padding-inline: 10px; }
  body .header-actions,body:is(.discovery-page,.directory-page) .header-actions { gap: 4px; }
  body .discovery-students-entry { font-size: .75rem; }
  body.discovery-page .discovery-featured-copy h1 { font-size: 1.875rem; }
  body .account-auth-popup { width: calc(100vw - 24px); padding: 28px 18px; }
}
@media (max-width: 768px) and (prefers-reduced-transparency: reduce) {
  body :is(dialog,.discovery-popup)::backdrop { backdrop-filter: none; }
  body .mobile-bottom-nav { backdrop-filter: none; background: var(--experience-surface); }
}
@media (max-width:768px) {
  body .site-header__inner { display: flex; flex-wrap: wrap; }
  body .header-actions { min-width: 0; max-width: 100%; flex-wrap: wrap; }
  body .discovery-feature-options { min-width: 0; padding: 12px; border: 1px solid var(--experience-control-line,var(--experience-muted)); border-radius: 6px; }
  body .discovery-feature-options .event-feature-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  body .discovery-feature-options .event-feature-chip { min-height: 44px; white-space: normal; max-width: 100%; font-size: .875rem; }
  body .discovery-feature-options legend { font-size: .875rem; padding-inline: 4px; }
  body.discovery-page .discovery-featured::after { display: none; background: none; }
  body.discovery-page .discovery-featured-copy { position: relative; isolation: isolate; }
  body.discovery-page .discovery-featured-copy::before { content: ""; position: absolute; inset: 80px 12px 60px; z-index: -1; background: var(--experience-hero-surface); border-radius: 5px; }
  body.discovery-page .discovery-featured-copy h1,
  body.discovery-page .discovery-featured-timing { color: var(--experience-hero-text); }
  body.discovery-page .discovery-featured-copy :is(.discovery-eyebrow,.discovery-featured-synopsis,small) { color: var(--experience-hero-muted); }
  body.discovery-page .discovery-featured-actions button { background: var(--experience-hero-surface); color: var(--experience-hero-text); border-color: #85917f; }
  body.discovery-page .discovery-featured .discovery-area-nav { z-index: 2; }
  body.discovery-page .discovery-featured .discovery-area-nav a:not([aria-current=page]) { background: var(--experience-hero-surface); color: var(--experience-hero-text); border-color: #85917f; }
  body.discovery-page .discovery-featured-ambient { opacity: .12; }
  body .discovery-featured-dots { gap: 0; }
  body.discovery-page .discovery-featured-dots button { width: 44px; height: 44px; background: var(--experience-hero-surface); }
  body .discovery-featured-dots button::before { inset: 20px 7px; background: #c3ccbd; }
  body .discovery-featured-dots button[aria-current=true]::before { background: #fff; }
  body .discovery-featured-dots button[aria-current=true] { transform: none; }
  body .mobile-bottom-nav__item span { white-space: normal; overflow-wrap: anywhere; }
  body .mobile-bottom-nav,body:is(.discovery-page,.directory-page) .mobile-bottom-nav { grid-template-columns: repeat(auto-fit,minmax(min(100%,4em),1fr)); }
  body .main-shell { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
  body #discoveryFiltersDialog .discovery-filters :is(input,select) { background: var(--experience-surface); color: var(--experience-text); border-color: var(--experience-control-line,var(--experience-muted)); }
}
@media (max-width:640px) {
  body.discovery-page .discovery-featured-copy::before { inset: 100px 8px 42px; }
  body.discovery-page[data-page=events] .discovery-featured { min-height: 0; max-height: none; }
  body.discovery-page .discovery-compact-tools .event-feature-filters { flex: 1 1 auto; }
  body.discovery-page .discovery-compact-tools .event-feature-chips { gap: 6px; }
  body.discovery-page .discovery-compact-tools .event-feature-chip { padding-inline: 10px; }
  body.discovery-page .discovery-card__date { font-size: .75rem; }
  body #discoveryFiltersDialog .discovery-filters { grid-template-columns: minmax(0,1fr); }
  body .discovery-feature-options { grid-column: 1 / -1; }
}
/* Reserve mobile navigation space once, after the compact footer. */
@media(max-width:760px){body .main-shell{padding-bottom:0}body .site-footer{min-height:0;padding:20px 0 calc(var(--mobile-nav-h,72px) + env(safe-area-inset-bottom) + 20px);margin-top:24px}body .site-footer__inner{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px 20px;text-align:center}body .site-footer__links{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 16px}body .site-footer__copyright{width:100%;margin:0}body .discovery-detail{padding-bottom:0}}
@media(max-width:760px){body:not([data-page=landing]) .page-shell,body[data-page=event] .page-shell{padding-bottom:0}body .site-footer__contact{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;width:100%;margin:0}body .site-footer__inner{width:calc(100% - 32px);max-width:calc(100% - 32px)}}
