/* ItnaVerse UI V1.0.23 — global mobile/readability stabilization */
:root{--iv23-dock-clearance:max(112px,calc(92px + env(safe-area-inset-bottom,0px)))}
html{overflow-x:hidden} body{overflow-x:hidden}
img,video,canvas,svg{max-width:100%}
main,.container,.wrap,.page,.page-wrap,.content,.content-wrap,.main,.main-content,.dashboard-shell,.settings-shell{max-width:100%}
.card,.panel,.box,.content-card,.section-card,.admin-module,.metric{min-width:0}
.card p,.panel p,.box p,.admin-module span,.metric small,.muted,small{overflow-wrap:anywhere}
/* Keep generic global typography from making nested application headings enormous. */
.card h1,.panel h1,.box h1,.admin-center h1,.dashboard-shell h1{font-size:clamp(28px,5vw,48px)!important;line-height:1.05!important}
.card h2,.panel h2,.box h2,.admin-center h2,.dashboard-shell h2{font-size:clamp(22px,3.6vw,34px)!important;line-height:1.1!important}
/* Admin: use the server-rendered authoritative tool grid, not a DOM-generated duplicate. */
body:has(.admin-center) .admin-center{width:min(1400px,calc(100% - 28px))!important;margin:18px auto var(--iv23-dock-clearance)!important;padding:clamp(16px,2.5vw,26px)!important}
body:has(.admin-center) .admin-group{margin-top:24px!important}
body:has(.admin-center) .admin-group>h3{margin:0 0 11px!important;font-size:clamp(17px,2vw,21px)!important;line-height:1.2!important}
body:has(.admin-center) .admin-module-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important}
body:has(.admin-center) .admin-module{display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;gap:7px!important;min-height:128px!important;padding:16px!important;border-radius:20px!important;text-decoration:none!important;overflow:hidden!important}
body:has(.admin-center) .admin-module strong{font-size:15px!important;line-height:1.25!important;color:#f7fbff!important}
body:has(.admin-center) .admin-module span{font-size:12px!important;line-height:1.45!important;color:#9fb3cc!important;display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body:has(.admin-center) .admin-module b{margin-top:auto!important;font-size:11px!important;color:#8fc8ff!important}
/* Fixed navigation must never cover the last row. */
.mobile-nav,.bottom-nav,.bottom-navigation,.app-bottom-nav{max-width:calc(100vw - 20px)!important}
main:last-of-type,.dashboard-shell,.settings-shell,.marketing-dashboard,.marketing-factory,.factory-shell{padding-bottom:var(--iv23-dock-clearance)}
/* Inputs remain readable on iOS and do not trigger zoom. */
input,select,textarea{max-width:100%;font-size:max(16px,1em)}
@media(max-width:900px){
 body:has(.admin-center) .admin-module-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:640px){
 body:has(.admin-center) .admin-center{width:calc(100% - 20px)!important;margin-top:10px!important;padding:14px!important;border-radius:22px!important}
 body:has(.admin-center) .admin-module-grid{grid-template-columns:1fr!important;gap:9px!important}
 body:has(.admin-center) .admin-module{min-height:0!important;padding:14px 15px!important;border-radius:17px!important}
 body:has(.admin-center) .admin-module strong{font-size:15px!important}
 body:has(.admin-center) .admin-module span{font-size:11.5px!important;-webkit-line-clamp:2}
 .grid-2,.grid-3,.grid-4,.metric-grid{grid-template-columns:1fr!important}
 .admin-metrics.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .card,.panel,.box,.content-card,.section-card{max-width:100%!important}
}
@media(max-width:390px){
 body:has(.admin-center) .admin-center{width:calc(100% - 14px)!important;padding:11px!important}
 .admin-metrics.metric-grid{grid-template-columns:1fr!important}
}
