/* Layout fluido do painel. O zoom manual do navegador permanece disponível. */
html{max-width:100%;scroll-padding-top:92px}
body{width:100%;max-width:100%;overflow-x:clip}
.shell,.shell main,.shell main>*,.panel,.dashboard-grid,.dash-section,.management-card,.library-card{min-width:0;max-width:100%}
img,video,canvas,svg{max-width:100%}
.panel,.dash-section,.management-card,.library-card{overflow-wrap:anywhere}
.library-card img,.library-cover img,img.library-cover,#result .library-card img{
 display:block;width:100%;height:clamp(165px,19vw,250px);object-fit:contain;object-position:center;
 background:#eef3fa;border-radius:10px;padding:8px
}
.library-cover{width:100%;max-width:100%;overflow:hidden}
@media(max-width:1024px){
 .dashboard-grid{grid-template-columns:1fr}
 .metrics-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .library-card img,.library-cover img,img.library-cover{height:clamp(170px,27vw,230px)}
}
@media(max-width:850px){
 .shell{width:100%;grid-template-columns:minmax(0,1fr)}
 .shell main{min-width:0;width:100%;max-width:100%;padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
 .shell main>header{position:sticky;top:0;z-index:30;min-width:0;max-width:100%;background:#031b4e;align-items:center}
 .shell main>header>div{min-width:0}
 .shell main>header h1,.shell main>header .eyebrow{overflow-wrap:anywhere}
 #menuToggle{flex:none;min-width:44px;min-height:44px}
 body.menu-open{overflow:hidden}
 .menu-open #sidebar{height:100dvh;max-height:100dvh;overflow-y:auto;overscroll-behavior:contain;padding-bottom:env(safe-area-inset-bottom)}
 #result,.worship-panel,.table-wrap,.report-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
 .table,.worship-calendar{max-width:none}
 .fields,.dashboard-grid,.worship-grid{min-width:0}
 .library-card img,.library-cover img,img.library-cover{height:clamp(175px,42vw,240px)}
 input,select,textarea{font-size:16px}
}
@media(max-width:480px){
 .metrics-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .library-card img,.library-cover img,img.library-cover{height:190px}
 .panel,.dash-section,.management-card{max-width:100%}
}
/* Biblioteca: capa proporcional e legível em cada tamanho de tela. */
.library-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,310px),1fr))}
.library-card{grid-template-columns:110px minmax(0,1fr);align-items:start}
.library-card .library-cover{display:grid;place-items:center;width:110px;height:158px;max-width:100%;padding:4px;border-radius:10px;background:#eef3fa;color:#153c70;text-align:center;font-size:.78rem;letter-spacing:normal}
#result .library-card .library-cover img{display:block;width:100%;height:100%;padding:0;object-fit:contain;object-position:center;background:transparent;border-radius:6px}
.library-card>div:last-child{min-width:0;overflow-wrap:anywhere}
@media(max-width:480px){.library-card{grid-template-columns:94px minmax(0,1fr)}.library-card .library-cover{width:94px;height:136px}}
