/* GBR Racing Lab — Mobile Premium 4.0 (iPhone-first).
   No gameplay/storage/auth logic changed. Official chest images remain in assets/chests. */
.help-trigger{display:grid;place-items:center;flex:0 0 auto;width:36px;height:36px;border-radius:50%;border:1px solid #21887f;color:#00e3d1;background:#0b2425;font:800 16px/1 system-ui;transition:background .15s}
.help-trigger:hover,.help-trigger:focus-visible{background:#12403e}
.help-trigger-login{width:30px;height:30px;margin-left:auto}
.mobile-more-panel,.mobile-more-backdrop{display:none}
[hidden]{display:none!important}
.help-overlay{position:fixed;inset:0;z-index:150;display:grid;place-items:center;padding:16px;background:rgba(2,7,10,.72);backdrop-filter:blur(7px)}
.help-underlay{position:absolute;inset:0}
.help-dialog{position:relative;z-index:1;width:min(660px,100%);max-height:min(740px,calc(100dvh - 32px));display:flex;flex-direction:column;overflow:hidden;border:1px solid #26665f;border-radius:16px;background:linear-gradient(160deg,#182127,#11161c 75%);box-shadow:0 24px 80px #000d}
.help-dialog-head{padding:19px 22px 15px;border-bottom:1px solid #293a3b;display:flex;align-items:start;justify-content:space-between;gap:18px}
.help-eyebrow{color:#17e1d2;font-weight:800;letter-spacing:1.4px;font-size:10px}
.help-dialog h2{font:900 29px/1.12 'Barlow Condensed',Impact,sans-serif;margin:7px 0 0;color:#eefbf8}
#helpClose,#mobileMoreClose{display:grid;place-items:center;width:44px;height:44px;flex-shrink:0;background:#222c31;border:1px solid #455358;color:#f5f6f8;border-radius:11px;font-size:26px}
.help-dialog-scroll{overflow-y:auto;overscroll-behavior:contain;padding:16px 22px 24px}
.help-intro{font-size:13px;line-height:1.6;color:#b6c5c8;margin:0 0 18px}
.help-steps{display:grid;gap:10px}
.help-step{display:flex;align-items:start;gap:12px;background:#0f2928;border:1px solid #2a5c55;border-radius:10px;padding:12px}
.help-step>span{display:grid;place-items:center;width:27px;height:27px;flex:none;border:1px solid #20887b;border-radius:8px;color:#24e5d3;font-weight:800;font-size:11px}
.help-step p{font-size:13px;line-height:1.5;margin:2px 0 0;color:#e0e9e9}
.help-faq-head{display:flex;align-items:center;justify-content:space-between;margin:24px 0 10px}
.help-faq-head h3{font-size:16px;margin:0}.help-faq-head span{color:#96a7aa;font-size:11px}
.help-search-label{font-size:11px;display:block;color:#a9c8c4;margin:0 0 7px}
#helpSearch{width:100%;min-height:44px;font-size:16px;color:#fff;border:1px solid #3f585a;border-radius:9px;padding:10px 13px;background:#0d151b;outline-offset:3px}
.help-faq{display:grid;gap:7px;margin-top:13px}
.help-item{border:1px solid #344549;border-radius:9px;background:#172128;overflow:hidden}
.help-item summary{padding:13px;cursor:pointer;color:#eef9f8;font-size:13px;font-weight:700;list-style:none;position:relative;padding-right:38px}
.help-item summary::-webkit-details-marker{display:none}
.help-item summary:after{content:'+';position:absolute;right:14px;top:50%;transform:translateY(-50%);color:#00d2be;font-size:21px}
.help-item[open] summary:after{content:'−'}
.help-item p{color:#bac9cb;font-size:12.5px;line-height:1.65;margin:0;padding:0 13px 13px}
.help-empty{padding:18px;border:1px dashed #455358;border-radius:9px;color:#b6c7c9;font-size:12px}
.help-tip{border-top:1px solid #334248;color:#8da5a4;margin-top:20px;padding-top:13px;line-height:1.6;font-size:11px}
body.gbr-help-open{overflow:hidden}
@media(max-width:820px){
 :root{--gbr-mobile-pad:13px}
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:68px}
 body{font-size:13px;line-height:1.5}
 .app-shell{min-width:0}
 .topbar{position:sticky;z-index:42;top:0;height:calc(56px + env(safe-area-inset-top));padding:env(safe-area-inset-top) var(--gbr-mobile-pad) 0;background:#0e131aee;backdrop-filter:blur(16px);border-bottom:1px solid #2b393d}
 .topbar-breadcrumb{display:flex;align-items:center;gap:7px;letter-spacing:.5px;font-size:12px}
 .topbar-breadcrumb:before{content:'GBR';display:grid;place-items:center;background:#00d2be;color:#051011;border-radius:4px;font:900 13px 'Barlow Condensed',Impact,sans-serif;width:32px;height:29px;margin-right:2px}
 .topbar-breadcrumb span{margin:0 1px}.topbar-breadcrumb b{max-width:150px;overflow:hidden;text-overflow:ellipsis}
 .topbar-right{gap:9px}.account-avatar{width:30px;height:30px;font-size:11px}
 .help-trigger{width:34px;height:34px}
 .content{padding:13px var(--gbr-mobile-pad) calc(90px + env(safe-area-inset-bottom));max-width:560px}
 .content-topline{display:none}
 .hero{padding:22px 20px;min-height:0;margin:0;border-radius:13px;background:radial-gradient(circle at 120% 30%,#08796b65,transparent 60%),linear-gradient(120deg,#112325,#121720);border-color:#24635b}
 .hero h1{font-size:clamp(29px,8.2vw,37px);line-height:1;margin:13px 0 9px;letter-spacing:0;text-transform:none}
 .hero p{font-size:12px;line-height:1.55;max-width:320px;margin:0}
 .hero .eyebrow{letter-spacing:1.4px;font-size:9px}
 .hero-copy{max-width:100%}
 .hero-circuit{opacity:.14;right:-116px;top:-17px;pointer-events:none}
 .hero-actions{gap:8px;margin-top:17px}
 .hero-actions .btn{font-size:11px;min-height:43px;padding:9px 12px}
 .section-heading{margin:18px 0 10px;align-items:center}
 .section-heading h2{font-size:23px;margin:3px 0 0}
 .panel{padding:14px;border-radius:12px;margin-bottom:11px;border-color:#303b43}
 .panel h2{font-size:22px;line-height:1.1;margin:6px 0 10px}
 .panel h3{font-size:14px}
 .panel p{font-size:12px;line-height:1.55}
 .page-head{margin:5px 0 14px}
 .page-head h1{font-size:29px;line-height:1;margin:7px 0 9px}
 .page-head p{font-size:12px;line-height:1.5}
 .stats{gap:8px}
 .stat{padding:13px 12px;min-height:87px;border-radius:10px}
 .stat:after{left:12px;width:31px;height:2px}
 .stat b{font-size:29px;margin-top:7px}
 .stat small{font-size:11px;line-height:1.35;display:block}
 .stats-dashboard{grid-template-columns:repeat(2,minmax(0,1fr))}
 .two,.grid{gap:11px}
 .two.dashboard-two{margin-top:11px!important}
 .kicker,.tinycaps{font-size:9px;letter-spacing:1.15px}
 .eyebrow{font-size:9px;letter-spacing:1.1px}
 .btn{min-height:44px;font-size:11px;padding:10px 12px;border-radius:8px;white-space:normal}
 .field input,.field select{font-size:16px;min-height:44px;border-radius:9px;padding:10px 12px}
 .field label{font-size:10px;line-height:1.35;letter-spacing:.5px}
 .row{gap:9px}
 .mobile-nav{z-index:45;min-height:calc(63px + env(safe-area-inset-bottom));align-items:stretch;justify-content:space-between;gap:0;padding:3px max(4px,env(safe-area-inset-left)) max(5px,env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-right));border-top:1px solid #28464a;background:#101920f5;backdrop-filter:blur(18px);box-shadow:0 -10px 24px #0007}
 .mobile-nav button{flex:1;min-width:0;min-height:57px;display:flex;align-items:center;justify-content:center;gap:1px;padding:3px 1px 5px;transition:color .2s}
 .mobile-nav button .nav-icon{display:grid;place-items:center;font-size:22px;line-height:24px;height:25px}.mobile-nav button .nav-icon svg{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
 .mobile-nav button small{font-size:10px;line-height:1.2;font-weight:700;white-space:nowrap}
 .mobile-nav button.active{color:#0bedd8}
 .mobile-nav button.active .nav-icon{filter:drop-shadow(0 0 5px #00d2be6a)}
 .mobile-more-backdrop{display:block;position:fixed;inset:0;background:#0009;z-index:43}
 .mobile-more-panel{display:grid;position:fixed;z-index:44;bottom:calc(65px + env(safe-area-inset-bottom));left:12px;right:12px;max-width:540px;margin:0 auto;padding:12px;gap:6px;border:1px solid #32665e;border-radius:14px;background:#121d23;box-shadow:0 17px 50px #000b}
 .more-title{display:flex;justify-content:space-between;align-items:center;margin:1px 2px 6px;color:#f3f6f8;font-size:14px}
 #mobileMoreClose{width:34px;height:34px;font-size:22px;border-radius:8px}
 .mobile-more-panel>button{display:grid;grid-template-columns:37px 1fr 27px;grid-template-rows:auto auto;align-items:center;text-align:left;column-gap:12px;padding:11px 12px;min-height:60px;background:#1b282c;border:1px solid #304c4a;border-radius:10px;color:#f1faf8}
 .mobile-more-panel>button>span{grid-row:1/3;display:grid;place-items:center;width:36px;height:36px;border-radius:9px;color:#08dfcd;background:#07302e;font-size:19px}
 .mobile-more-panel>button>b{font-size:13px;grid-column:2;grid-row:1}
 .mobile-more-panel>button>small{color:#9aafb0;font-size:11px;grid-column:2;grid-row:2}
 .mobile-more-panel>button>i{font-style:normal;color:#2be5d4;font-size:23px;grid-column:3;grid-row:1/3;text-align:right}
 .toast{bottom:calc(82px + env(safe-area-inset-bottom));left:10px;right:10px;max-width:none;pointer-events:none;font-size:12px;z-index:48}
 .access-gate{padding:calc(15px + env(safe-area-inset-top)) 14px calc(15px + env(safe-area-inset-bottom))}
 .gate-copy{padding:6px 0 0}.gate-brand{margin-bottom:5px}
 .gate-copy h1{font-size:30px;line-height:1.05;margin:12px 0}
 .gate-copy p{font-size:12px;line-height:1.5;margin:6px 0}
 .gate-metrics{margin-top:12px;gap:15px;padding-top:10px}
 .gate-metrics b{font-size:23px}.gate-metrics small{font-size:8px}
 .auth-card{padding:19px 17px}.auth-card h2{font-size:29px;margin:11px 0 6px}
 .auth-card .field input{font-size:16px}
 .track-controls>.row{gap:9px;margin-bottom:10px}
 .track-controls .field{flex:1 1 100%;min-width:0}
 .track-controls .track-search{flex:1 1 100%}
 .track-directory{max-height:148px;gap:6px;grid-template-columns:repeat(2,minmax(0,1fr))}
 .track-tile{min-height:49px;padding:8px 9px}
 .track-tile-body b{font-size:11px}.track-tile-body small{font-size:9px}
 .tracks-head{margin:0 0 11px;padding:13px 14px;gap:8px}
 .tracks-head h1{font-size:30px;margin:6px 0 5px}
 .tracks-head p{font-size:11px;line-height:1.45}
 .tracks-count{padding:7px;min-width:53px}.tracks-count strong{font-size:29px}
 .tracks-count span{font-size:9px}
 .track-hero-grid{grid-template-columns:1fr;grid-template-areas:'title' 'map' 'priorities' 'source';gap:10px}
 .track-copy-stack{display:contents}
 .track-spotlight-top{grid-area:title;display:flex;flex-direction:row;justify-content:space-between;align-items:start;gap:8px}
 .track-spotlight h2{font-size:29px;margin:6px 0 4px}
 .track-spotlight-top p{font-size:11px;margin:0}
 .track-flag{font-size:10px;padding:6px 8px;max-width:100px;min-width:0}
 .track-map-panel{grid-area:map;padding:9px;min-height:0}
 .track-map-kicker{font-size:9px;margin-bottom:6px}
 .track-map-visual{min-height:166px}
 .track-map-visual svg{max-height:184px}
 .track-priorities{grid-area:priorities;display:flex;flex-direction:column;gap:8px;margin:0}
 .track-priority{padding:10px 12px;border-radius:9px}
 .track-priority small{font-size:9px;letter-spacing:.7px}
 .track-priority strong{font-size:22px;margin:3px 0}
 .track-priority span{font-size:10px}
 .track-source-note{grid-area:source;font-size:10px;margin:0}
 .track-section-heading{gap:8px}
 .track-section-heading h2{font-size:22px}
 .track-section-heading .btn{width:auto;flex:0 1 150px}
 .track-tyre-inputs{gap:7px;margin:10px 0}
 .track-setup-metrics{gap:7px}
 .track-metric{padding:10px}.track-metric small{font-size:10px}.track-metric strong{font-size:24px}
 .track-setup-parts{gap:7px}.track-part{padding:10px}.track-part b{margin:5px 0 3px}
 .track-driver-card{padding:11px}.track-driver-card b{font-size:14px}
 .chest-head{margin-bottom:12px}.chest-head h1{font-size:29px}
 .chest-entry{border-color:#30625c;background:linear-gradient(150deg,#152625,#15171d)}
 .chest-entry-top{gap:8px;margin:10px 0;align-items:end}
 .chest-entry-top .field:first-child{flex:1 1 45%}
 .chest-position-field strong{font-size:34px}
 .chest-number-control{gap:7px}
 .chest-number-control input{min-width:0;font-size:24px;min-height:46px}
 .chest-number-control .btn{min-width:102px;padding:8px 10px;font-size:11px}
 .chest-entry-actions{margin-top:10px;gap:8px}
 .chest-stats{gap:8px;margin-bottom:11px}
 .chest-stat{padding:12px 10px;min-height:83px;border-radius:10px}
 .chest-stat span{font-size:9px;letter-spacing:.55px}
 .chest-stat b{font-size:29px;margin-top:7px}
 .chest-stat.has-photo{padding-right:62px}
 .chest-stat .chest-stat-photo{width:49px;height:49px;right:6px}
 .chest-next-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:11px}
 .chest-next{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;min-width:0;padding:9px 8px;border-radius:9px}
 .chest-next .chest-photo{width:48px;height:48px;flex-basis:48px}
 .chest-next b{font-size:14px}
 .chest-next small{font-size:10px}
 .chest-map-title h2{font-size:20px}.chest-map-title h2 span{font-size:14px}
 .chest-map-panel{padding:12px 9px}
 .chest-map{min-width:600px}
 .chest-pattern-add{gap:6px;margin:12px 0}
 .chest-pattern-add button{min-height:87px;padding:8px 3px;font-size:10px;touch-action:manipulation}
 .chest-pattern-add img{width:43px;height:43px}
 .chest-photo{object-fit:contain}
 .chest-candidate{padding:12px}
 .chest-candidate h3{font-size:18px}
 .chest-pattern-toolbar .btn{min-height:44px}
 .tablewrap{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;border-radius:8px;border:1px solid #333e43}
 .tablewrap table{min-width:670px}
 .tablewrap input,.tablewrap select{min-height:38px;font-size:13px}
 .backup-controls{margin-bottom:20px}
 .footer{font-size:10px;line-height:1.4}
 .help-overlay{padding:0;align-items:end;place-items:end center}
 .help-dialog{width:100%;max-width:none;max-height:calc(93dvh - env(safe-area-inset-top));border-radius:18px 18px 0 0;border-bottom:0}
 .help-dialog-head{padding:17px 16px 12px}
 .help-dialog-scroll{padding:15px 16px calc(24px + env(safe-area-inset-bottom))}
 .help-dialog h2{font-size:26px}
}
@media(max-width:390px){
 .content{--gbr-mobile-pad:11px}
 .hero{padding:18px 16px}.hero h1{font-size:29px}
 .topbar-breadcrumb b{max-width:120px}
 .chest-number-control .btn{min-width:92px;font-size:10px}
 .track-map-visual{min-height:148px}
 .track-priority strong{font-size:21px}
 .chest-next .chest-photo{width:42px;height:42px;flex-basis:42px}
 .chest-next{gap:6px}
}
@media(prefers-reduced-motion:reduce){.help-trigger,.mobile-nav button{transition:none}}
