/* Final screen layout layer shared by public pages and the private member area. */
@media screen {
  body.device-optimized :is(main,section,article,form,fieldset,nav){min-inline-size:0}
  body.device-optimized :is(.activity-grid,.agenda-grid,.garage-grid,.club-shop-grid,.club-product-grid,.public-partner-grid,.registration-fields,.vehicle-fields)>*{min-width:0}
  body.device-optimized :is(h1,h2,h3,h4,h5,.button,.member-button){overflow-wrap:break-word}
  body.device-optimized :is(input,select,textarea){scroll-margin-block:110px 140px}
  body.device-optimized :is(.button,.member-button)>:is(span,svg){flex-shrink:0}
  body.device-optimized .theme-trigger .theme-trigger-compact{display:none!important}
  body.device-optimized .menu-lines{display:grid;gap:5px;width:20px;height:12px;margin:0;background:none;transform:none}
  body.device-optimized .menu-lines>i{display:block;height:1px;width:20px;background:var(--ink);transition:transform .18s}
  body.device-optimized .menu-button>small{display:block;font-size:10px;line-height:1.2;font-weight:500}
  body.device-optimized .menu-button[aria-expanded="true"] .menu-lines{transform:none}
  body.device-optimized .menu-button[aria-expanded="true"] .menu-lines>i:first-child{transform:translateY(3px) rotate(45deg)}
  body.device-optimized .menu-button[aria-expanded="true"] .menu-lines>i:last-child{transform:translateY(-3px) rotate(-45deg)}
  body.device-optimized :is(.site-footer a,.member-header-actions>a){display:inline-flex;align-items:center;min-height:44px}
  body.device-optimized .site-footer .brand{display:flex}
  body.device-optimized :is(.public-page-title,.member-welcome h1){text-wrap:balance}
}

/* One consistent navigation breakpoint, including tablets in landscape. */
@media screen and (max-width:1440px) {
  body.device-optimized .site-header{height:auto;min-height:82px;padding:0;display:block}
  body.device-optimized .site-header .header-inner{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px;min-height:82px;padding-block:10px}
  body.device-optimized .site-header .brand{justify-self:start;max-width:100%}
  body.device-optimized .site-header .header-actions{gap:12px;flex-shrink:0}
  body.device-optimized .site-header .menu-button{display:flex;width:48px;height:52px;padding:8px 4px;gap:4px;flex-direction:column}
  body.device-optimized .site-header #main-nav{display:none;position:absolute;left:max(18px,env(safe-area-inset-left,0px));right:max(18px,env(safe-area-inset-right,0px));top:calc(100% + 8px);padding:10px;gap:4px;border-radius:14px;border:1px solid var(--line);background:var(--paper);box-shadow:0 18px 42px #10241e26;flex-direction:column;align-items:stretch;max-height:calc(100dvh - 106px);max-height:calc(var(--visible-viewport-height,100dvh) - var(--site-header-height,82px) - 24px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scroll-padding-block:10px}
  body.device-optimized .site-header #main-nav.open{display:flex}
  body.device-optimized .site-header #main-nav a{min-height:48px;padding:12px 16px;font-size:15px;line-height:1.5;white-space:normal}
  body.device-optimized .site-header #main-nav a[aria-current="page"]{box-shadow:inset 3px 0 0 var(--club-link)}
  body.device-optimized .site-header #main-nav .member-entry-link{margin-top:5px;border-top:1px solid var(--line);border-radius:0 0 7px 7px}
  body.device-optimized.menu-open:before{content:'';position:fixed;inset:0;z-index:45;background:#10241e66}
  body.device-optimized.menu-open .c-mobile-quote{visibility:hidden}
}
@media screen and (min-width:651px) and (max-width:1440px) {
  body.device-optimized .site-header #main-nav{left:auto;right:max(32px,env(safe-area-inset-right,0px));width:min(420px,calc(100vw - 64px))}
}

@media screen and (max-width:1100px) {
  body.device-optimized{--device-gutter:32px}
  body.device-optimized :is(.activity-grid,.agenda-grid,.garage-grid,.member-page .garage-grid){grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
  body.device-optimized .activity-card{min-height:410px}
  body.device-optimized .activity-copy{margin:90px 25px 26px}
  body.device-optimized .activity-copy strong{font-size:32px}
  body.device-optimized .activity-description{display:block;font-size:14px;min-height:0}
  body.device-optimized .agenda-featured{grid-column:auto;display:flex;flex-direction:column}
  body.device-optimized :is(.agenda-photo,.agenda-featured .agenda-photo){height:auto;min-height:0;aspect-ratio:16/10;flex-shrink:0}
  body.device-optimized :is(.agenda-content,.agenda-featured .agenda-content){padding:24px}
  body.device-optimized :is(.agenda-content h3,.agenda-featured h3){font-size:29px}
  body.device-optimized .event-filters{gap:8px}
  body.device-optimized .event-filters button{min-height:46px;font-size:13px;padding:10px 16px}
  body.device-optimized .garage-add-tile{min-height:260px}
  body.device-optimized .garage-empty-copy{padding:30px}
  body.device-optimized .registration-layout{grid-template-columns:minmax(0,1fr)}
  body.device-optimized .registration-summary{position:static}
  body.device-optimized .registration-card{padding:30px}
  body.device-optimized :is(.home-section-heading,.club-shop-heading,.club-shop-subheading){gap:24px}
  body.device-optimized .public-page-title{font-size:clamp(36px,5vw,48px)}
}

@media screen and (max-width:900px) {
  body.device-optimized .member-overview{grid-template-columns:minmax(0,1fr);gap:28px}
  body.device-optimized .member-overview>div:first-child{width:100%;max-width:520px;justify-self:center}
  body.device-optimized .member-overview-copy{max-width:650px}
  body.device-optimized .garage-empty{grid-template-columns:minmax(0,1fr)}
  body.device-optimized .garage-empty-photo{min-height:240px;max-height:300px}
  body.device-optimized .garage-empty-copy{padding:30px}
  body.device-optimized .garage-heading{align-items:flex-start;flex-wrap:wrap;gap:20px}
  body.device-optimized .garage-heading-actions{padding:0;flex-direction:row;flex-wrap:wrap;align-items:center;gap:12px}
  body.device-optimized .garage-content,body.device-optimized .garage-loading{min-height:240px}
  body.device-optimized .member-nav{flex-wrap:nowrap;overflow-x:auto;gap:8px;padding:4px 2px 12px;overscroll-behavior-inline:contain;scrollbar-width:thin;scroll-padding-inline:4px}
  body.device-optimized .member-nav a{flex-shrink:0;white-space:nowrap;padding:10px 14px;background:var(--white);border:1px solid var(--line);border-radius:7px;font-size:13px}
  body.device-optimized :is(.registration-fields,.vehicle-fields){grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 18px}
  body.device-optimized .theme-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.device-optimized .theme-dialog-footer{position:static;box-shadow:none}
  body.device-optimized .theme-dialog-footer>div{flex-wrap:wrap;width:100%}
  body.device-optimized .theme-dialog-footer .button{flex:1 1 240px}
}

@media screen and (max-width:650px) {
  body.device-optimized{--device-gutter:18px}
  body.device-optimized .site-header .header-inner{gap:8px;min-height:84px;padding-block:10px}
  body.device-optimized .site-header .brand{gap:8px}
  body.device-optimized .site-header .brand-mark{width:34px;height:36px;min-width:34px;font-size:22px;border-radius:6px}
  body.device-optimized .site-header .brand-copy{width:auto;max-width:190px;gap:3px}
  body.device-optimized .site-header .brand-copy strong{font-size:11px;line-height:1.35;letter-spacing:.025em;text-wrap:balance}
  body.device-optimized .site-header .brand-copy small{font-size:10px;line-height:1.4}
  body.device-optimized .site-header .header-actions{gap:6px}
  body.device-optimized .site-header .theme-trigger{width:48px;min-width:48px;height:52px;min-height:52px;max-width:48px;flex-direction:column;justify-content:center;gap:4px;padding:6px 3px}
  body.device-optimized .theme-trigger .theme-trigger-copy{display:none!important}
  body.device-optimized .theme-trigger .theme-trigger-compact{display:block!important;font-size:10px;line-height:1.2;font-weight:500}
  body.device-optimized .theme-trigger .theme-trigger-colour{width:18px;height:18px}
  body.device-optimized .site-header .menu-button{height:52px;gap:4px}
  body.device-optimized .public-page-title{font-size:36px;line-height:1.15}
  body.device-optimized.public-page:not([data-public-page="club"]):not([data-public-page="event"]) #club-home>section:first-child{padding-top:32px}
  body.device-optimized :is(.section,.agenda-section,.registration-section){padding-block:44px}
  body.device-optimized .club-hero{min-height:0;display:flex;flex-direction:column;align-items:stretch;gap:28px;padding-block:42px 24px}
  body.device-optimized .club-hero .hero-content{padding-block:0}
  body.device-optimized .club-hero h1{font-size:clamp(36px,10vw,48px);line-height:1.1}
  body.device-optimized .club-hero .hero-description{font-size:16px!important;line-height:1.75;max-width:100%;margin-top:22px}
  body.device-optimized .club-hero .eyebrow{font-size:11px!important;margin-bottom:20px}
  body.device-optimized .club-hero .hero-actions{flex-direction:column;align-items:stretch;gap:10px;margin-top:26px}
  body.device-optimized .club-hero .hero-actions>.button{width:100%;justify-content:space-between;padding:15px 18px;min-height:52px}
  body.device-optimized .club-hero .hero-secondary{align-self:flex-start;min-height:44px;padding-block:10px}
  body.device-optimized .club-hero .hero-footer{position:relative;inset:auto;align-items:flex-start}
  body.device-optimized .club-hero .hero-footer p{max-width:none;font-size:12px!important;line-height:1.7}
  body.device-optimized :is(.activity-grid,.agenda-grid,.garage-grid,.member-page .garage-grid){grid-template-columns:minmax(0,1fr);gap:22px}
  body.device-optimized .activity-card{min-height:350px}
  body.device-optimized .activity-copy{margin:90px 24px 25px}
  body.device-optimized .activity-copy strong{font-size:32px;line-height:1.15}
  body.device-optimized .activity-description{display:block;line-height:1.75;margin-top:14px}
  body.device-optimized .activity-action{margin-top:20px}
  body.device-optimized :is(.home-section-heading,.club-shop-heading,.club-shop-subheading){margin-bottom:26px}
  body.device-optimized :is(.agenda-content,.agenda-featured .agenda-content){padding:24px}
  body.device-optimized .agenda-month{top:15px;left:15px;font-size:21px}
  body.device-optimized .agenda-description{margin-bottom:18px}
  body.device-optimized .agenda-cta{font-size:14px!important;min-height:50px}
  body.device-optimized .agenda-prices>div{flex-wrap:wrap;font-size:13px}
  body.device-optimized .event-filters{display:flex;flex-wrap:nowrap;overflow-x:auto;padding:3px 2px 12px;scrollbar-width:thin;overscroll-behavior-inline:contain}
  body.device-optimized .event-filters button{flex-shrink:0;white-space:nowrap}
  body.device-optimized .garage-heading-actions{width:100%;justify-content:space-between;margin-top:18px}
  body.device-optimized .garage-heading-actions>.button{flex:1 1 210px}
  body.device-optimized .garage-empty-photo{min-height:200px}
  body.device-optimized .garage-empty-copy{padding:26px 23px}
  body.device-optimized .garage-empty-copy h3{font-size:32px}
  body.device-optimized .garage-add-tile{min-height:190px}
  body.device-optimized .garage-car-photo{aspect-ratio:16/10}
  body.device-optimized :is(.garage-car-copy,.club-shop-card-copy,.club-product-card-copy){padding:24px}
  body.device-optimized .garage-car-tools{flex-wrap:wrap}
  body.device-optimized .garage-car-tools button{padding-inline:5px;font-size:13px}
  body.device-optimized :is(.registration-fields,.vehicle-fields){grid-template-columns:minmax(0,1fr);gap:20px}
  body.device-optimized :is(.reg-field-wide,.v-field-wide){grid-column:auto}
  body.device-optimized .registration-card{padding:25px 20px}
  body.device-optimized .registration-summary{display:block}
  body.device-optimized .registration-summary>img{width:100%;height:190px;min-height:0}
  body.device-optimized .reg-consent{align-items:flex-start;gap:12px}
  body.device-optimized .reg-consent input{flex-shrink:0;min-width:20px;min-height:20px;margin-top:4px}
  body.device-optimized .registration-card>form>.button,body.device-optimized :is(#membership-form,#partner-form)>.button{width:100%;justify-content:space-between}
  body.device-optimized .event-hero{min-height:0}
  body.device-optimized .event-hero-content{padding-block:28px 38px}
  body.device-optimized .event-hero h1{font-size:clamp(35px,9vw,45px)}
  body.device-optimized .event-hero .hero-actions{flex-wrap:wrap;align-items:stretch}
  body.device-optimized .event-hero .hero-actions>.button{width:100%;justify-content:space-between}
  body.device-optimized .c-panel{padding:24px 19px}
  body.device-optimized .c-progress button{flex-direction:column;gap:4px;min-height:68px;padding:8px 3px}
  body.device-optimized .c-progress button>span:last-child{font-size:12px;line-height:1.5}
  body.device-optimized .c-panel-actions{gap:12px;flex-wrap:wrap}
  body.device-optimized .c-panel-actions>.button{flex:1 1 180px;margin:0;justify-content:space-between}
  body.device-optimized .c-mobile-quote:not([hidden]){gap:10px;padding:12px 14px}
  body.device-optimized .c-mobile-quote button{font-size:13px;flex:1 1 120px}
  body.device-optimized .partner-invitation{padding:27px 24px}
  body.device-optimized .partner-universe-nav{display:grid;grid-template-columns:minmax(0,1fr)}
  body.device-optimized .partner-universe-nav>a{width:100%}
  body.device-optimized .partner-opportunity{padding:24px}
  body.device-optimized .club-partner-content>strong{font-size:29px}
  body.device-optimized .member-main{padding-top:28px}
  body.device-optimized .member-welcome{margin-bottom:24px}
  body.device-optimized .member-welcome h1{font-size:34px}
  body.device-optimized .member-overview-copy h2{font-size:32px}
  body.device-optimized .member-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
  body.device-optimized .member-header>.wrap{gap:10px;padding-block:14px}
  body.device-optimized .member-brand{gap:10px;min-width:0;flex-shrink:1}
  body.device-optimized .member-brand-icon{width:42px;height:42px}
  body.device-optimized .member-brand-copy{min-width:0;max-width:235px}
  body.device-optimized .member-header-actions{border-top:1px solid var(--line);padding-top:10px}
  body.device-optimized .member-header-actions>a{font-size:12px;line-height:1.6}
  body.device-optimized .member-nav{margin-bottom:26px}
  body.device-optimized .member-section-heading h2{font-size:32px}
  body.device-optimized .member-empty{padding:24px}
  body.device-optimized .site-footer{padding-block:28px}
  body.device-optimized .footer-main{display:flex;align-items:flex-start;flex-direction:column;gap:22px}
  body.device-optimized .footer-tools{width:100%;align-items:flex-start;gap:6px}
  body.device-optimized .footer-bottom{display:flex;flex-direction:column;gap:8px;margin-top:22px;font-size:12px;line-height:1.8}
}

/* Fit the visible keyboard viewport; only the dialog scrolls, with no clipped fields. */
@media screen and (max-width:760px) {
  body.device-optimized dialog,
  body.device-optimized dialog.garage-editor.vehicle-v8.vehicle-card{width:calc(100% - 20px);max-width:calc(100% - 20px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px));max-height:calc(var(--visible-viewport-height,100dvh) - 20px);top:calc(var(--visible-viewport-top,0px) + 10px);padding:24px 20px;border-radius:14px;scrollbar-gutter:auto;scroll-padding-block:24px 100px}
  body.device-optimized .dialog-heading{align-items:flex-start;gap:14px}
  body.device-optimized .dialog-heading h2{font-size:30px;line-height:1.15}
  body.device-optimized .dialog-heading>.close-button{position:sticky;top:0;background:var(--white);z-index:5;align-self:flex-start}
  body.device-optimized .garage-editor .vehicle-journey-actions{position:static;gap:12px;flex-wrap:wrap;padding-bottom:0}
  body.device-optimized .vehicle-journey-actions>.button{flex:1 1 190px;min-height:50px;justify-content:space-between}
  body.device-optimized .vehicle-back{min-height:44px}
  body.device-optimized .vehicle-photo-tools{gap:10px}
  body.device-optimized .vehicle-progress button{flex-direction:column;gap:2px;min-height:60px}
  body.device-optimized .vehicle-progress button>strong{font-size:12px}
  body.device-optimized .vehicle-portrait{min-height:170px}
  body.device-optimized .vehicle-portrait-top{font-size:9px;letter-spacing:.04em;flex-wrap:wrap;padding:18px;gap:6px}
  body.device-optimized .vehicle-portrait-copy{padding:18px}
  body.device-optimized .vehicle-portrait-copy>strong{font-size:28px}
  body.device-optimized .garage-editor .vehicle-year{width:100%;max-width:none}
  body.device-optimized .garage-editor .vehicle-body-choice>span{padding:14px 12px;gap:8px}
  body.device-optimized .garage-editor .body-choice-copy>strong{font-size:14px}
  body.device-optimized .garage-editor .body-choice-copy>small{font-size:11px}
  body.device-optimized dialog.club-product-dialog{padding:0}
  body.device-optimized .club-product-dialog-copy{padding:26px 22px}
  body.device-optimized .club-product-dialog-copy>h2{font-size:32px}
  body.device-optimized .club-product-dialog-close{position:sticky;display:block;margin:12px 12px -56px auto;top:12px;right:auto}
}
@media screen and (max-width:420px) {
  body.device-optimized .theme-grid{grid-template-columns:minmax(0,1fr)}
  body.device-optimized .garage-editor .vehicle-body-grid{grid-template-columns:minmax(0,1fr)}
  body.device-optimized .garage-editor .vehicle-body-choice>span{min-height:66px;padding:14px 16px}
  body.device-optimized .c-access{grid-template-columns:minmax(0,1fr)}
  body.device-optimized .c-access label{align-items:flex-start;text-align:left;padding:13px 16px;min-height:66px}
  body.device-optimized .c-access strong{font-size:14px}
  body.device-optimized .c-access label>span{font-size:12px}
  body.device-optimized .reg-garage-actions{flex-direction:column;gap:8px}
}
@media screen and (max-height:600px) and (max-width:1100px) {
  body.device-optimized .club-hero{min-height:0}
  body.device-optimized .club-hero .hero-content{padding-block:35px 30px}
  body.device-optimized .club-hero .hero-footer{position:relative;inset:auto;padding-bottom:24px}
  body.device-optimized .club-hero{flex-direction:column;align-items:stretch}
  body.device-optimized .theme-dialog-footer{position:static}
}
@media screen and (prefers-reduced-motion:reduce) {
  body.device-optimized .menu-lines>i{transition:none}
}
