/* Shared device layout. Use CSS viewport sizes, never OS/user-agent detection. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-block:24px}body{min-width:0}*,*::before,*::after{box-sizing:border-box}
:where(main,section,article,form,fieldset,nav,header,footer){min-width:0;max-width:100%}
:where(h1,h2,h3,p,label,legend,a,button){overflow-wrap:anywhere}
:where(input,select,textarea){min-width:0;max-width:100%;font-size:16px;scroll-margin-block:100px}
:where(button,.button-link,summary){min-height:44px;touch-action:manipulation;white-space:normal}
:where(img,video){max-width:100%}dialog{max-width:calc(100% - 24px);max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overflow:auto}
:where(.guest-jump,.header-actions,.section-heading,.frame-head,.camera-actions,.reportrow){flex-wrap:wrap;gap:10px}
:where(.cols,.stats,.cards,.stage-grid,.middle,.bottom,.form)>*{min-width:0}
:where(.guest-table,.table-wrap,.club-table-wrap){max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}
/* The performance app has its own theme; scope these repairs to its shell. */
.shell .top{flex-wrap:wrap;padding-top:max(16px,env(safe-area-inset-top,0px))}
.shell .brand{flex:1 1 260px}.shell .brand>div{min-width:0}.shell .header-actions{max-width:100%;flex:0 1 auto}
.shell #nav{flex-wrap:wrap;overflow:visible}.shell #nav>:where(a,button){flex:1 1 120px;min-width:0;min-height:48px;white-space:normal;text-align:center}
.shell .actions{flex-wrap:wrap}.shell .actions>:where(a,button){min-width:0;flex:1 1 140px;max-width:100%}
.shell .page iframe{height:78vh;height:78dvh;min-height:320px;width:100%}
.shell :where(.member-details,.member-card,.training-model-card){min-width:0;overflow-wrap:anywhere}
.shell :where(input,select,textarea),.app :where(input,select,textarea){font-size:16px!important}
.app .filterrow>:where(input,select){min-width:0;flex:1 1 180px}
.app header{flex-wrap:wrap}.app header>div{min-width:0}.app header h1{overflow-wrap:anywhere}
.judo-return{display:flex;flex-wrap:wrap;gap:12px;padding-left:max(12px,env(safe-area-inset-left,0px));padding-right:max(12px,env(safe-area-inset-right,0px))}
@media(max-width:760px){
 .shell{padding:8px max(10px,env(safe-area-inset-right,0px)) calc(32px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px))}
 .shell .top{padding:16px;gap:14px}.shell .brand{flex-basis:100%}.shell .header-actions{width:100%;justify-content:space-between}
 .shell .hero{margin:16px 0;padding:22px 18px;min-height:0}.shell .hero h2{font-size:clamp(25px,7vw,36px)}.shell .hero-icon{display:none}
 .shell #nav{margin:0;gap:6px}.shell main{padding:20px 0 32px}.shell .cols{grid-template-columns:minmax(0,1fr)}
 .shell .section-heading{align-items:flex-start}.shell .page-tools{flex-wrap:wrap}.shell .local-badge{margin-left:0}
 .shell .stat{padding:14px;flex-wrap:wrap;gap:6px}.shell .emblem{flex-shrink:0;width:70px;font-size:28px;padding-right:10px;margin-right:0}
 .shell .brand h1{font-size:clamp(16px,4.8vw,20px);letter-spacing:1px}
 .guest-main .guest-jump a{min-height:44px;display:flex;align-items:center}.guest-main{padding-bottom:calc(80px + env(safe-area-inset-bottom,0px))}
 .app .camera-actions,.app .actions{flex-wrap:wrap}.app .camera-actions button,.app .actions button{flex:1 1 110px;min-height:44px}
}
@media(max-width:380px){.shell .stats{gap:8px}.shell .stat span{font-size:12px}.shell .header-actions select{max-width:180px}.app .stage{grid-template-columns:minmax(0,1fr)}.app .stage .stage-title{grid-column:auto}}
@media(orientation:landscape) and (max-height:500px){.shell .page iframe{height:90vh;height:90dvh}.shell .top{position:static}.shell .hero{padding:18px;margin-block:12px}.shell .hero h2{font-size:28px}}
@media(pointer:coarse){:where(button,.button-link,select,input:not([type=checkbox]):not([type=radio])){min-height:44px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* Education photography: the page and photo surround share one pure-white surface.
   Keep original image pixels, natural shadows, aspect ratios and technical details. */
body.judo-white-gallery,body.judo-white-gallery :is(.main,#library,#reader,.reader-content,.page-wrap,.article-body,.article-figure,.section-gallery,.section-gallery figure,.guest-main,#guest-reader,#guest-content,.guest-images){background:#fff;background-image:none}
body.judo-white-gallery :is(.article-body,.article-figure,.section-gallery,.section-gallery figure,#guest-reader,.guest-images){border:0;border-radius:0;box-shadow:none}
body.judo-white-gallery :is(.article-figure img,.section-gallery img,.guest-images img,.page-wrap img){background:#fff;border:0;border-radius:0;box-shadow:none;outline:0;object-fit:contain}
/* Blend the photograph's outer edge into the white reading surface. The narrow
   feather does not brighten the whole photo or wash out white judogi detail. */
body.judo-white-gallery :is(.article-figure img,.section-gallery img,.guest-images img,.page-wrap img){
 --photo-edge:min(10px,2%);
 -webkit-mask-image:linear-gradient(to right,transparent,#000 var(--photo-edge),#000 calc(100% - var(--photo-edge)),transparent),linear-gradient(to bottom,transparent,#000 var(--photo-edge),#000 calc(100% - var(--photo-edge)),transparent);
 -webkit-mask-composite:source-in;
 mask-image:linear-gradient(to right,transparent,#000 var(--photo-edge),#000 calc(100% - var(--photo-edge)),transparent),linear-gradient(to bottom,transparent,#000 var(--photo-edge),#000 calc(100% - var(--photo-edge)),transparent);
 mask-composite:intersect;
 mask-repeat:no-repeat;
}
