html{scroll-padding-top:95px;-webkit-text-size-adjust:100%}body{padding-bottom:env(safe-area-inset-bottom,0)}.barida-native body{padding-top:env(safe-area-inset-top,0)}
#mobileStatus{position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0));z-index:100001;background:#123d2c;color:#f3fff7;border:1px solid #8be4ae;padding:13px 16px;border-radius:12px;box-shadow:0 8px 28px #0005;font:14px/1.5 system-ui;max-width:680px;margin:0 auto}
#authRecall,#authForget{display:block;width:100%;min-height:44px;margin-top:8px;font-size:13px}#authForget{opacity:.85}
@media(max-width:640px){html body #view{max-width:100%;min-width:0}html body .topbar{padding-left:max(12px,env(safe-area-inset-left,0));padding-right:max(12px,env(safe-area-inset-right,0))}html body :is(input,select,textarea){font-size:16px!important}html body :is(.btn,.navitem,.auth-tab){min-height:44px}html body dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);overflow:auto}html body #view :is(table,.table-wrap){max-width:100%}html body .board-studio-resizer{max-width:100%!important}html body .board .sq{touch-action:pan-y!important}html body .workspace{padding-left:0!important;padding-right:0!important}html body .home-board-frame{min-height:0!important}html body .ca-volume-panel{max-width:calc(100vw - 24px)}html body .club-hero .club-actions{gap:10px}}
@media(orientation:landscape) and (max-height:500px){html body .topbar{height:58px}html body .academy-topnav{position:relative!important}html body .entry{min-height:100dvh!important;padding-top:14px!important}}
#nativeBottomNav{position:fixed;inset:auto 0 0;z-index:9998;display:grid;grid-template-columns:repeat(4,1fr);padding:6px 8px calc(6px + env(safe-area-inset-bottom,0));background:#0b281fee;border-top:1px solid #46765c;backdrop-filter:blur(14px)}#nativeBottomNav button{display:flex;flex-direction:column;gap:2px;align-items:center;justify-content:center;min-height:52px;background:transparent;border:0;border-radius:10px;color:#c8e2d4;font:inherit}#nativeBottomNav span{font-size:23px;line-height:1.2}#nativeBottomNav small{font-size:11px}#nativeBottomNav [aria-current=page]{color:#a6f2b6;background:#23553c}html.native-signed-in body{padding-bottom:calc(75px + env(safe-area-inset-bottom,0))}html.native-signed-in #mobileStatus{bottom:calc(82px + env(safe-area-inset-bottom,0))}

/* Native menus use HTML buttons; Android's unstyled option popup is avoided. */
html.barida-native body #clubMobileNav,html.barida-native body #sidebar{display:none!important}
#nativeTopNav{display:grid;grid-template-columns:repeat(var(--native-menu-count,4),minmax(0,1fr));gap:5px;overflow:visible;padding:8px 10px;background:#0c2c20;border-block:1px solid #315943;scrollbar-width:none;position:relative;z-index:80}
#nativeTopNav button{min-width:0;min-height:46px;overflow-wrap:anywhere;border:1px solid #3c6a4c;border-radius:10px;background:#173f2a!important;color:#effff3!important;padding:8px 3px;font:700 clamp(10px,2.8vw,12px)/1.25 system-ui}
#nativeMenuDialog{padding:0;border:1px solid #4b9860;border-radius:17px;background:#0e3021!important;color:#effff3!important;width:calc(100vw - 24px);max-width:480px;max-height:75dvh;box-shadow:0 18px 50px #0008}
#nativeMenuDialog::backdrop{background:#020c08b3}#nativeMenuDialog header{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid #3a6346;font-weight:800}#nativeMenuDialog button{background:#19462d!important;color:#f1fff4!important;border:1px solid #3b704a;border-radius:10px;min-height:46px;padding:12px;font:inherit}#nativeMenuDialog .native-menu-items{display:grid;gap:8px;padding:12px;overflow-y:auto}#nativeMenuDialog header button{min-height:36px;padding:5px 12px}
#nativeQuickActions,#nativePublicShortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:12px 0 20px;padding:0 10px}#nativeQuickActions button,#nativePublicShortcuts a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:88px;border:1px solid #3b7951;border-radius:14px;background:linear-gradient(145deg,#174a30,#0c2b20)!important;color:#eaffee!important;text-decoration:none;font:700 12px system-ui;text-align:center;padding:10px 7px}#nativeQuickActions span{font-size:25px;color:#7dffae}#nativePublicShortcuts{max-width:700px;margin:15px auto}
html.barida-native body #studentPanelMenu,html.barida-native body #caAdminBellPanel{background:#0f3022!important;color:#effff4!important;border-color:#3f7651!important}
html.barida-native body .barida-smoke-overlay,html.barida-native body .barida-smoke-filter,html.barida-native body .barida-smoke-sprite,html.barida-native body .barida-logo-light{display:none!important}html.barida-native body #entry .auth-card,html.barida-native body #entry .auth-card::before{animation:none!important;backdrop-filter:none!important;filter:none!important}
html.barida-native body #nativeBottomNav{backdrop-filter:none;background:#0b281f}
@media(max-width:640px){
 html body.embedded-studio .ca-analysis-layout{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;margin:0!important}
 html body.embedded-studio .ca-analysis-layout .chess-board-frame{width:100%!important;max-width:100%!important;margin:0!important;padding:7px!important}
 html body.embedded-studio .ca-board-resize-hit{display:none!important;pointer-events:none!important}
 html body.embedded-studio .ca-analysis-layout .ca-captured-rails{position:static!important;display:flex!important;justify-content:space-between!important;align-items:start;gap:12px;width:100%!important;min-height:31px;margin-top:6px;pointer-events:auto!important}
 html body.embedded-studio .ca-analysis-layout .ca-captured-rail{position:static!important;display:flex!important;flex-flow:row wrap!important;width:48%!important;height:auto!important;max-height:70px!important;gap:1px!important;overflow:auto!important;pointer-events:auto!important}
 html body.embedded-studio #caEngineEvalBar{display:none!important}
 html body.embedded-studio .ca-analysis-layout #caAnalysisSide{height:350px!important;min-height:0!important;max-width:100%!important}
 html body.embedded-studio .board .piece-3d,html body.embedded-studio .board .piece-3d img{filter:none!important;transition:none!important}
 html body.embedded-studio .board .sq{transition:none!important}html body.embedded-studio .chess-board-frame{box-shadow:0 0 0 1px #b99561!important}
 html body.embedded-studio .board .sq:hover .piece-3d{transform:var(--barida-optical-transform,none)!important}
 html body.embedded-studio .boardcontrols{gap:6px!important;margin:10px 0!important}
}

html.barida-native body.embedded-studio .ca-board-resize-hit{display:none!important;pointer-events:none!important}
/* Tablet controls stay touch-sized; layout follows viewport and density, not inches. */
@media(min-width:768px){
 html.barida-native body{font-size:16px}
 html.barida-native #nativeTopNav{justify-content:center;flex-wrap:wrap;overflow:visible;gap:10px}
 html.barida-native #nativeTopNav button{min-height:48px;font-size:14px;padding:11px 17px}
 html.barida-native #nativeBottomNav{max-width:1100px;margin:0 auto;border-radius:15px 15px 0 0}
 html.barida-native #nativeBottomNav button{min-height:60px}html.barida-native #nativeBottomNav small{font-size:13px}
 html.barida-native #nativeQuickActions{max-width:1200px;margin:18px auto 25px;gap:14px}
 html.barida-native #nativeQuickActions button{min-height:106px;font-size:15px}
 html.barida-native #nativeQuickActions span{font-size:30px}
 html.barida-native #nativePublicShortcuts{max-width:900px}
 html.barida-native body.embedded-studio .ca-notation-row button{font-size:16px;min-height:43px}
 html.barida-native body.embedded-studio .ca-analysis-caption{font-size:12px!important}
 html.barida-native body.embedded-studio #caAnalysisPV{font-size:14px}
}
@media(min-width:1200px){html.barida-native #nativeQuickActions{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(min-width:641px){
 html.barida-native[data-native-aspect=portrait] body.embedded-studio .ca-analysis-layout{grid-template-columns:minmax(0,1fr)!important;gap:18px!important}
 html.barida-native[data-native-aspect=portrait] body.embedded-studio .ca-analysis-layout .chess-board-frame{width:100%!important;max-width:1100px!important;margin:0 auto!important}
 html.barida-native[data-native-aspect=portrait] body.embedded-studio .ca-captured-rails{position:static!important;display:flex!important;justify-content:space-between!important;width:100%!important;margin-top:7px;min-height:32px;pointer-events:auto!important}
 html.barida-native[data-native-aspect=portrait] body.embedded-studio .ca-captured-rail{position:static!important;display:flex!important;flex-flow:row wrap!important;width:48%!important;height:auto!important;max-height:90px!important;gap:2px!important;overflow:auto!important;pointer-events:auto!important}
 html.barida-native[data-native-aspect=portrait] body.embedded-studio #caEngineEvalBar{display:none!important}
 html.barida-native[data-native-aspect=portrait] body.embedded-studio .ca-analysis-layout #caAnalysisSide{width:100%!important;max-width:1100px!important;height:420px!important;margin:0 auto!important}
}
@media(min-width:900px){
 html.barida-native[data-native-aspect=landscape] body.embedded-studio .ca-analysis-layout{grid-template-columns:minmax(0,min(66%,calc(var(--native-screen-height,1080px) - 190px))) minmax(280px,1fr)!important;gap:22px!important}
}
@media(min-width:1800px){html.barida-native body .workspace{max-width:2200px!important;margin:0 auto}}

/* Finger swipes scroll the page; chess moves use two taps on touchscreens. */
@media(pointer:coarse){html body #board,html body #board .sq{touch-action:pan-y!important}}
html.barida-native body #board,html.barida-native body #board .sq{touch-action:pan-y!important}
@media(max-width:800px),(pointer:coarse){
 html body .ca-grid .board{box-shadow:0 0 0 2px #b18b53!important}
 html body .ca-grid .board::before{box-shadow:none!important}
 html body .ca-grid .board>.sq,html body .ca-grid .board>.sq .piece-3d{transition:none!important;filter:none!important}
 html body .ca-grid .board>.sq .piece img.barida-approved-piece{filter:none!important}
}

html body:has(.barida-touch-zooming){overflow-x:clip!important}

html.barida-native{scroll-behavior:auto!important}
