/* USAGI v1.3 — mobile safety/centered splash, fully clickable rabbit gallery. */
:root,html{max-width:100%;overflow-x:clip}
html{width:100%;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{width:100%;min-width:0;max-width:100%;overflow-x:clip!important;margin:0}
body .topbar,body main,body #appPanel,body .hero,body .usagi-friends,
body .usagi-live-preview,body .usagi-calc-grid,body .usagi-calc-heading,
body .panel,body .workspace,body .quick-tabs,body .snapshot-panel,
body #dashboardStart{box-sizing:border-box;min-width:0;max-width:100%}
body .topbar{width:100%!important;max-width:100vw!important;margin:0!important}
body main{width:100%!important;max-width:1200px!important;margin-left:auto!important;margin-right:auto!important}
body #appPanel{width:100%;margin:0}
body .topbar .brand-wrap{min-width:0!important}
body .topbar .brand{overflow-wrap:anywhere}
body .usagi-friends-grid{min-width:0;max-width:100%}
body .usagi-friend{font:inherit;cursor:pointer;appearance:none;-webkit-appearance:none;position:relative;box-shadow:0 2px 8px #66525a0c;transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease;touch-action:manipulation;}
body .usagi-friend:focus-visible{outline:3px solid #f3904f;outline-offset:2px}
body .usagi-friend.is-selected{border:2px solid #ed894d;background:linear-gradient(180deg,#ffebdf,#fff8f3);box-shadow:0 0 0 3px #ffd8c54d,0 6px 15px #dc9a7330;transform:translateY(-2px)}
body .usagi-friend.is-selected:after{content:'✓';position:absolute;right:7px;top:7px;display:grid;place-items:center;color:#fff;background:#ed8747;border-radius:50%;font-size:13px;font-weight:900;width:22px;height:22px}
body .usagi-friend:hover{border-color:#eb9a7a}
body .usagi-hero-bunny{will-change:opacity;transition:opacity .17s ease!important}
body .usagi-hero-bunny.is-changing{opacity:.28}
/* Reset the splash container and its transform against legacy Shinobi theme overrides.
   Fix the center to the actual screen rather than to content/scroll dimensions. */
html body .ninja-splash{position:fixed!important;inset:0!important;top:0!important;left:0!important;right:0!important;bottom:0!important;width:100vw!important;width:100dvw!important;height:100vh!important;height:100dvh!important;max-width:100vw!important;max-height:100dvh!important;overflow:hidden!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:18px!important;box-sizing:border-box!important;transform:none!important;overscroll-behavior:contain}
html body .ninja-splash .splash-center{position:relative!important;inset:auto!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;margin:auto!important;transform:none!important;animation:usagiSplashFade .38s ease-out both!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;width:min(100%,340px)!important;max-width:calc(100dvw - 36px)!important;box-sizing:border-box!important;flex-shrink:1!important;gap:0!important}
html body .ninja-splash .splash-art{width:min(65dvw,272px)!important;max-width:100%!important;min-width:0!important;height:auto!important;aspect-ratio:1!important;flex-shrink:1!important;overflow:hidden!important;animation:none!important;box-shadow:0 10px 24px #b78e8626!important;border-radius:24%!important}
html body .ninja-splash .splash-art img{display:block!important;width:100%!important;height:100%!important;object-fit:contain!important}
html body .ninja-splash .splash-title{width:100%!important;max-width:100%!important;text-align:center!important;overflow-wrap:anywhere!important;white-space:normal!important;font-size:clamp(23px,6vw,31px)!important;line-height:1.3!important;margin-top:18px!important}
html body .ninja-splash .splash-subtitle{font-size:clamp(9px,2.6vw,12px)!important;text-align:center!important;letter-spacing:.1em!important;max-width:100%!important}
html body .ninja-splash .splash-progress{max-width:60vw!important;margin-top:20px!important}
@keyframes usagiSplashFade{from{opacity:0}to{opacity:1}}
@media(max-width:600px){
 body .topbar{padding:12px 11px!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;}
 body .topbar .brand-wrap{max-width:100%!important;grid-column:1/-1!important}
 body .topbar .theme-control,body .topbar .language-control{max-width:100%!important;min-width:0!important;}
 body .topbar select{width:100%!important;max-width:100%!important;min-width:0!important}
 body main{width:100%!important;max-width:100vw!important;padding:0 11px!important;}
 body .hero{width:100%!important;min-width:0!important;max-width:100%!important}
 body .usagi-friends-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;overflow:visible!important;gap:8px!important;padding:0!important;}
 body .usagi-friend{width:100%!important;min-width:0!important;max-width:100%!important;padding:6px 5px 9px!important;min-height:0!important;}
 body .usagi-friend img{width:100%!important;height:auto!important;aspect-ratio:1.16!important;object-fit:cover!important;}
 body .usagi-friend strong{font-size:10px!important;line-height:1.3!important;overflow-wrap:anywhere}
 body .usagi-friend span{font-size:9px!important;line-height:1.25!important}
 body .usagi-friends{padding:13px 10px!important;overflow:hidden!important}
 body .quick-tabs{max-width:100%!important;min-width:0!important;}
 body .quick-tabs a{min-width:0!important;flex:1 1 0!important;white-space:nowrap!important;font-size:11px!important;padding:10px 1px!important;}
 body .usagi-preview-grid{width:100%!important;max-width:100%!important;min-width:0!important}
 body .usagi-calc-grid{grid-template-columns:minmax(0,1fr)!important}
 body .usagi-calc-inputs,body .usagi-calc-output{width:100%!important;min-width:0!important}
 body .workspace-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 body .workspace-grid>*{min-width:0!important}
 body .workspace .toolbar{min-width:0!important;max-width:100%!important}
 body .field-grid>label{min-width:0!important}
 body .result-panel strong,body .metric strong{overflow-wrap:anywhere}
}
@media(max-width:340px){body .usagi-friends-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(prefers-reduced-motion:reduce){body .usagi-friend,body .usagi-hero-bunny{transition:none!important}}
