/* Daily working views: phone/tablet overrides, never printed reports. */
@media screen and (max-width:999px){
 body .app main{max-width:100%;min-width:0}
 body .app main :is(.screen,.screen>section,.screen>div){min-width:0;max-width:100%}
 body .app main :is([class$='-shell'],[class$='-layout']){min-width:0;max-width:100%}
 body main .sc-mobile-columns{grid-template-columns:minmax(0,1fr)!important;grid-auto-rows:auto!important}
 body main .sc-mobile-columns>*{min-width:0;grid-column:auto!important}
 body :is(main,dialog) .sc-mobile-data-table{min-width:var(--sc-table-min,640px)!important;table-layout:auto!important;width:100%!important}
 .sc-responsive-table.sc-mobile-scroll{position:relative;border:1px solid #dce7e8;border-radius:10px;overflow:auto;touch-action:pan-x pan-y}
 .sc-responsive-table.sc-mobile-scroll::before{content:'↔ Deslizá la tabla para ver todas las columnas';display:block;position:sticky;left:0;width:100%;padding:7px 10px;background:#f0f7f6;color:#53716e;font-size:11px;line-height:1.4;white-space:normal;box-sizing:border-box}
 body :is(main,dialog) .sc-mobile-tabs{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;gap:7px!important;max-width:100%;padding:5px!important;scroll-snap-type:x proximity;scrollbar-width:thin}
 body :is(main,dialog) .sc-mobile-tabs>button{flex:0 0 auto!important;min-width:125px;max-width:230px;min-height:42px!important;font-size:12px!important;line-height:1.3!important;padding:9px 12px!important;scroll-snap-align:start;white-space:normal}
 body main :is(.ic-grid,.ic-grid.is-performance,.sub-chart-grid,.sub-evolution-grid,.sub-evo-donut-layout,.pgc-summary-layout,.cso-grid-2){grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
 body :is(main,dialog) :is(.sc-mobile-form-grid,.form-grid,[class$='-form-grid'],.sso-catalog-edit,.sso-hazard-grid,.sso-relation-list,.private-catalog-grid,.pgm-dialog-grid,.pfa-dialog-grid,.pfe-form-grid,.bp-form,.peb-person-editor,.pgd-form-grid,.pga-form-grid,.pgdt-general,.pme-form-grid,.pe9-form,.pcm-form-grid,.pra-general,.pra-risk,.pra-measure,.settings-logos>div){grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
 body :is(main,dialog) .sc-mobile-form-grid>*{min-width:0;grid-column:auto!important}
 body dialog{max-width:calc(100vw - 20px)!important;max-height:calc(100dvh - 24px)!important;overflow:auto!important;overscroll-behavior:contain;scroll-padding:14px}
 body dialog :is(form,.modal,[class$='-body'],[class$='-content']){min-width:0;max-width:100%;box-sizing:border-box}
 body dialog :is(.modal,[class$='-body']){padding:16px!important}
 body dialog :is(input,select,textarea){max-width:100%;min-width:0;font-size:16px!important}
 body dialog :is(.modal-actions,[class$='-footer']){position:static!important;display:flex;flex-wrap:wrap;gap:8px;padding-bottom:max(8px,env(safe-area-inset-bottom))}
 body dialog :is(.modal-actions,[class$='-footer'])>button{flex:1 1 120px;min-height:42px;white-space:normal}
 body dialog :is(h2,h3){font-size:20px!important;line-height:1.25!important}
 body dialog :is(label,p){font-size:13px;line-height:1.45}
 body dialog :is(img,canvas,video){max-width:100%;object-fit:contain}
 body dialog :is(.settings-logo-preview,.equipment-photo-preview,.collaborator-photo-preview){max-width:100%}
}
@media screen and (max-width:600px){
 body .app main{padding:12px!important}
 body .app main :is(h2,.section-title h2){font-size:21px!important;line-height:1.25!important;margin-bottom:8px}
 body .app main h3{font-size:17px!important;line-height:1.3!important}
 body .app main :is(p,[class$='-subtitle']){font-size:13px;line-height:1.45}
 body main :is(.card,[class$='-card'],.ic-panel,.pgm-card,.inventory-card){height:auto!important;min-height:0!important;padding:14px!important;border-radius:14px!important}
 body main :is(.section-title,[class$='-heading'],[class$='-head']){gap:10px!important;flex-wrap:wrap;min-width:0}
 body main :is(.section-title,[class$='-heading'],[class$='-head'])>div{min-width:0;max-width:100%}
 body main :is(.pgm-title,.pfe-card .pgm-title,.pgpro-training-header){gap:10px;align-items:flex-start}
 body main :is(.pgm-title,.pgpro-training-header) h2{font-size:19px!important}
 body main :is(.pgm-title,.pgpro-training-header)>:is(i,span,div):has(>svg){width:34px;height:34px;flex:0 0 34px}
 body main :is(.pgm-title,.pgpro-training-header) svg{max-width:25px;max-height:25px}
 body main :is(button,.sc-button,.sc-create-primary){font-size:13px!important;line-height:1.3;min-height:40px;max-width:100%}
 body main :is(input,select,textarea){font-size:16px!important;min-width:0;max-width:100%}
 body main :is([class$='-filters'],[class$='-filter-bar'],.ic-filters,.ic-filters.is-alerts,.ic-filters.is-performance,.ai-filters,.accident-chart-filters){display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:10px!important;max-width:100%!important}
 body main :is([class$='-filters'],.ic-filters)>*{min-width:0;max-width:100%}
 body main :is(.ic-toolbar,.ai-head,.ai-table-head){display:flex;flex-direction:column;align-items:stretch;gap:10px}
 body main :is(.ic-actions,[class$='-heading-actions'],.ai-actions){width:100%;display:flex;flex-wrap:wrap;gap:8px}
 body main :is(.ic-actions,[class$='-heading-actions'],.ai-actions)>button{flex:1 1 140px}
 body #intelligence-control .ic-tabs{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;overflow:visible!important}
 body #intelligence-control .ic-tabs>button{min-width:0;max-width:none;min-height:48px!important;font-size:12px!important;padding:9px!important;flex:unset!important}
 body #intelligence-control .ic-tabs svg{width:17px;height:17px;flex:0 0 17px}
 body main :is(.sc-mobile-kpis,.ic-kpis,.ic-kpis.is-four,.ic-kpis.is-management,.sub-kpi-grid,.ai-kpis,#corr-kpis,#pd-kpis,#formats-kpis,.epp-kpis,.measure-kpis,.pga-kpis,.pgdt-kpis-main,.pgdt-kpis-drugs,.pme-kpis,.pgd-kpis,.cso-kpis,.cso-campaign-kpis,.pcm-kpis,.st-kpis){display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:auto!important;gap:9px!important;align-items:start}
 body main :is(.sc-mobile-kpis,.ic-kpis,.sub-kpi-grid,.ai-kpis,#corr-kpis,#pd-kpis,.epp-kpis,.measure-kpis,.pga-kpis,.pgdt-kpis-main,.pme-kpis,.pgd-kpis,.cso-kpis,.pcm-kpis,.st-kpis)>*{grid-column:auto!important;min-width:0;max-width:100%;min-height:0!important;height:auto!important;padding:12px!important}
 body #intelligence-control .ic-kpi{grid-template-columns:minmax(0,1fr)!important;gap:7px!important;align-content:start;overflow:visible!important;min-height:132px!important}
 body #intelligence-control .ic-kpi-icon{width:30px;height:30px}
 body #intelligence-control .ic-kpi span{font-size:11px!important;line-height:1.35!important;overflow-wrap:normal!important}
 body #intelligence-control .ic-kpi strong{font-size:23px!important;line-height:1.1!important;overflow-wrap:normal!important}
 body #intelligence-control .ic-kpi.is-long-value strong{font-size:15px!important;line-height:1.3!important}
 body #intelligence-control .ic-kpi small{font-size:10px!important;line-height:1.35!important;overflow-wrap:normal!important}
 body main .ai-kpi .metric-value{font-size:24px!important;line-height:1.2;margin:7px 0}
 body main .ai-kpi .metric-label{font-size:12px!important}
 body main .ai-kpi :is(.ai-kpi-note,.ai-kpi-period,.ai-kpi-change){font-size:11px!important;margin:6px 0;line-height:1.4}
 body main .ai-kpi .secondary{margin:8px 0 0;width:100%;font-size:11px!important}
 body main :is(.metric-value,.sc-kpi-value){font-size:26px!important;line-height:1.2}
 body main :is(.sc-kpi-card,.pga-kpi,.pgd-kpi,.pme-kpis article){min-height:0!important;height:auto!important;gap:8px!important}
 body main :is(.sc-kpi-icon,[class$='-kpi-icon']){width:34px!important;height:34px!important;flex-basis:34px!important}
 body main :is(.sc-kpi-icon,[class$='-kpi-icon']) svg{width:19px!important;height:19px!important}
 body main :is(.ai-chart-card,.ic-panel,.cc-panel){min-height:0!important}
 body main .ai-line-chart{height:230px!important;min-height:230px!important}
 body main :is(.cso-directory,.cso-global,.cso-grid-2,.cso-plan-detail-layout,.sub-detail-grid,.sub-detail-layout,.sub-filter-strip,.collaborator-detail-layout,.settings-project-grid,.settings-catalog-grid,.settings-personalization-grid,.settings-appearance-grid,.settings-system-grid,.settings-system-bottom,.settings-work-catalog-grid){grid-template-columns:minmax(0,1fr)!important}
 body main :is(.pfe-gallery-grid,.pfa-gallery-grid,.pgm-gallery,.pe9-gallery,.pcm-gallery,.bp-gallery,.cso-campaign-gallery){grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
 body main :is(.pfe-gallery-empty,.pfa-gallery-empty,[class$='-empty']){min-height:0;max-height:none;padding:20px 12px;font-size:13px;line-height:1.5}
 body main :is(.pgd-year,.pe9-year,.ai-period-options){display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
 body #accidents .pyramid-layout{height:auto!important;margin:14px 0!important}
 body #accidents .pyramid{height:auto!important;clip-path:none!important;filter:none;width:100%;gap:4px!important;overflow:visible!important}
 body #accidents .pyramid-row{clip-path:none!important;height:58px!important;flex-basis:58px!important;margin:0 auto!important;border:0!important;border-radius:7px!important;padding:4px!important;overflow:visible}
 body #accidents .pyramid-row .pyramid-content{display:flex!important;flex-direction:column!important;gap:3px!important;align-items:center!important;justify-content:center!important;width:100%!important;text-align:center!important}
 body #accidents .pyramid-row .pyramid-content span{font-size:23px!important;line-height:1!important;margin:0!important;padding:0!important;text-align:center!important;align-self:center!important}
 body #accidents .pyramid-row .pyramid-content small{font-size:10px!important;line-height:1.15!important;white-space:normal!important;max-width:100%!important;padding:0!important;text-align:center!important;align-self:center!important;letter-spacing:0}
 body #accidents .pyramid-mortal{width:48%!important}body #accidents .pyramid-grave{width:61%!important}body #accidents .pyramid-moderate{width:74%!important}body #accidents .pyramid-light{width:87%!important}body #accidents .pyramid-danger{width:100%!important}
 /* Compact the fixed welcome strip on phones; keep project switching available. */
 body .app>.top.sc-welcome-hero{min-height:112px!important;padding:10px 12px!important}
 body .app>.top.sc-welcome-hero .toprow{min-height:92px!important;gap:10px}
 body .app>.top.sc-welcome-hero #greeting{font-size:16px!important;margin-bottom:3px}
 body .app>.top.sc-welcome-hero .sc-welcome-subtitle{font-size:11px!important;margin:4px 0}
 body .app>.top.sc-welcome-hero #date-label{font-size:10px!important}
 body .app>.top.sc-welcome-hero .sc-welcome-project{padding:8px!important}
 body .app>.top.sc-welcome-hero #top-project-name{font-size:11px!important;line-height:1.25}
 body .app>.top.sc-welcome-hero #sc-hero-company{display:none}
 body .app>.top.sc-welcome-hero .sc-change-project{font-size:9px!important;min-height:29px;margin-top:5px}
 body.sc-mobile-reading .app>.top.sc-welcome-hero{min-height:64px!important;padding:7px 12px!important}
 body.sc-mobile-reading .app>.top.sc-welcome-hero .toprow{min-height:50px!important}
 body.sc-mobile-reading .app>.top.sc-welcome-hero #greeting{font-size:13px!important}
 body.sc-mobile-reading .app>.top.sc-welcome-hero :is(.sc-welcome-subtitle,#date-label,.sc-welcome-project small){display:none!important}
 body.sc-mobile-reading .app>.top.sc-welcome-hero .sc-welcome-project{display:flex!important;align-items:center;max-width:62%;flex-basis:62%;gap:7px;padding:6px!important}
 body.sc-mobile-reading .sc-welcome-project .top-project-indicator{display:flex;align-items:center;gap:7px;min-width:0;text-align:left}
 body.sc-mobile-reading .sc-welcome-project #top-project-name{font-size:10px!important;flex:1;min-width:0}
 body.sc-mobile-reading .sc-change-project{width:auto;flex:0 0 auto;font-size:0!important;margin:0!important;padding:5px 8px}
 body.sc-mobile-reading .sc-change-project::after{content:'Cambiar';font-size:9px}
}
@media screen and (max-width:360px){body #intelligence-control .ic-tabs>button{font-size:11px!important;gap:5px}body #intelligence-control .ic-tabs svg{display:none}body main .sc-mobile-kpis{gap:7px!important}body #intelligence-control .ic-kpi{padding:10px!important}}
@media screen and (max-height:500px) and (max-width:999px){
 body .app>.top.sc-welcome-hero{min-height:64px!important;padding:6px 14px!important}
 body .app>.top.sc-welcome-hero .toprow{min-height:50px!important}
 body .app>.top.sc-welcome-hero :is(.sc-welcome-subtitle,#date-label,.sc-welcome-project small,#sc-hero-company){display:none!important}
 body .app>.top.sc-welcome-hero #greeting{font-size:14px!important}
 body .app>.top.sc-welcome-hero .sc-welcome-project{padding:6px 10px!important}
}
@media screen and (max-width:600px){
 body main .pgpro-element-header{grid-template-columns:44px minmax(0,1fr)!important;padding:14px!important;gap:10px!important;min-height:0!important}
 body main .pgpro-element-header .pgpro-back{grid-column:1/-1;width:auto!important;justify-self:start;min-height:36px!important;height:36px!important;font-size:12px!important;padding:7px 11px!important}
 body main .pgpro-element-header .pgpro-element-badge{width:44px!important;height:44px!important;font-size:20px!important;border-radius:10px}
 body main .pgpro-element-header .pgpro-element-copy h2{font-size:18px!important;line-height:1.25!important;margin:0!important}
 body main .pgpro-element-header .pgpro-element-copy p{font-size:12px!important;line-height:1.35!important}
 body main .pgpro-element-header .pgpro-element-copy>span{font-size:11px!important}
}
@media screen and (max-width:600px){
 body .app>.top.sc-welcome-hero .toprow{display:flex!important;flex-direction:row!important;align-items:center!important;width:100%}
 body .app>.top.sc-welcome-hero .toprow>div:first-child{flex:1 1 0;min-width:0}
 body .app>.top.sc-welcome-hero .sc-welcome-project{width:45%!important;flex:0 0 45%!important;max-width:45%!important}
 body.sc-mobile-reading .app>.top.sc-welcome-hero .sc-welcome-project{width:62%!important;flex:0 0 62%!important;max-width:62%!important}
 body.sc-mobile-reading .app>.top.sc-welcome-hero .top-project-indicator{width:100%;display:flex!important;flex-direction:row;gap:7px;align-items:center;min-width:0}
 body.sc-mobile-reading .app>.top.sc-welcome-hero #top-project-name{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-width:0;font-size:10px!important;margin:0;flex:1}
 body.sc-mobile-reading .app>.top.sc-welcome-hero .sc-change-project{font-size:0!important;min-height:30px!important;width:auto!important;max-width:54px;margin:0!important;padding:5px 7px!important;flex:0 0 auto}
 body.sc-mobile-reading .app>.top.sc-welcome-hero .sc-change-project::after{font-size:9px}
}
