/* Contenção e reflow; mantém a composição do desktop largo. */
.shell,main,main>*,.table-wrap{min-width:0;max-width:100%}
.table-wrap{overscroll-behavior-inline:contain}
@media(max-width:1100px){
 main :is(.an-home-top,.an-three,.an-bottom,.an-two,.an-inspector,.an-planner,.an-kpis,.settings-grid,.form-grid)>*{min-width:0}
 details.an-info:not([open])>.an-info-content{display:none}
 .an-heading,.intro,.section-head,.dialog-heading{gap:12px;flex-wrap:wrap}
 .an-heading>div,.intro>div,.section-head>div{min-width:0;max-width:100%}
 .an-heading :is(h1,p),.intro :is(h1,p),.summary-line :is(span,b){overflow-wrap:anywhere}
 .table-wrap{width:100%;overflow:auto}
 .an-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
 .ah-reference .an-three{grid-template-columns:repeat(2,minmax(0,1fr))}.ah-reference .an-three>section:last-child{grid-column:1/-1}
 .moment-layout{grid-template-columns:minmax(0,1fr)}.moment-visual svg{max-height:220px}
 .an-columns{max-width:100%;overflow-x:auto}.an-columns>div{flex:1 0 36px;min-width:36px}
 .theme-tabs [aria-selected=true]{color:#fff!important}
}
@media(min-width:761px) and (max-width:1100px){
 .hc-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.hc-kpis>section.hc-banner{grid-column:1/-1;grid-template-columns:44px minmax(0,1fr) 24px;gap:16px}
 .hc-banner .hc-trophy{width:44px;height:44px;font-size:24px}.hc-banner-copy{grid-column:2;min-width:0}.hc-banner>.text-button{grid-column:3;grid-row:1}
 .hc-banner-stat{grid-column:1/3;grid-row:2;justify-self:start;width:50%;padding:0;border:0}.hc-banner-cdi{grid-column:1/3;justify-self:end;padding-left:18px;border-left:1px solid #e6e8f1}.hc-banner-advantage{grid-column:1/-1;grid-row:3}
 .hc-heading{flex-wrap:wrap}.hc-heading h2{white-space:normal}.hc-period-controls{max-width:100%}
}
@media(max-width:900px){
 .ah-reference .an-home-top,.ah-reference .an-bottom,.an-two{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:760px){
 html{scroll-padding-block:90px 110px}
 body header{height:auto;min-height:68px;padding:12px 16px;gap:12px;align-items:center}
 body .breadcrumb{flex:1 1 100px;min-width:0;max-width:180px;white-space:normal;overflow-wrap:anywhere;line-height:1.5}
 .header-actions{flex:0 0 auto;gap:8px}.header-actions #new-trade{flex:none}
 body .shell{padding-bottom:0}body main{padding-bottom:calc(100px + env(safe-area-inset-bottom))!important}
 body footer{flex-wrap:wrap;gap:10px;padding-bottom:calc(100px + env(safe-area-inset-bottom))}
 .an-card,.panel,.wealth-goal{scroll-margin-top:88px}
 body .form-grid,body .settings-grid,body .simulation-controls,body .assessment-top,.an-inspector,.an-planner{grid-template-columns:minmax(0,1fr)}
 .an-planner>aside{position:static;order:-1}.simulation-controls>*{min-width:0}
 .an-heading{align-items:flex-start;flex-direction:column;gap:10px}.an-heading h1,body .intro h1{font-size:clamp(22px,6vw,27px)!important}
 .section-head{align-items:flex-start}.section-head h2{min-width:0}.section-head .text-button{white-space:normal;text-align:left}
 .summary-line{flex-wrap:wrap;gap:8px}.summary-line>*{min-width:0;max-width:100%}
 .an-toolbar>*{max-width:100%;min-width:0}.an-toolbar input{flex:1 1 100%}
 body :is(input,select,textarea){max-width:100%;min-width:0;font-size:16px;min-height:44px}
 body :is(input[type=checkbox],input[type=radio]){min-height:0;flex:none}
 .an-tabs,.theme-tabs{max-width:100%;overflow-x:auto;flex-shrink:1}.an-tabs button{flex-shrink:0;min-height:40px}
 .hc-heading{min-width:0}.hc-legend{max-width:100%;flex-wrap:wrap}.hc-period-controls{min-width:0;max-width:100%}
 .hc-kpis>section>strong,.hc-position-result>strong{max-width:100%;overflow-wrap:anywhere;white-space:normal}
 .hc-position-result{flex-wrap:wrap}.hc-banner-copy h3{overflow-wrap:anywhere}.hc-banner-advantage{flex-wrap:wrap;gap:8px 12px}.hc-banner-advantage>span{text-align:center}
 .hc-banner-stat{min-width:0;padding-inline:4px}.hc-banner-cdi{padding-left:16px}.hc-banner-stat>strong{font-size:clamp(23px,7vw,28px);max-width:100%;overflow-wrap:anywhere}
 .ah-reference .an-three{grid-template-columns:minmax(0,1fr)}.ah-reference .an-three>section:last-child{grid-column:auto}
 .table-wrap{max-height:70dvh}.table-wrap table{width:max-content;min-width:100%}
 .hp-full-link{position:static;margin:0 0 12px}.ah-positions h2{padding-right:0}
 .an-info[open]>.an-info-content,.wg-info[open]>p{position:fixed;inset:auto 16px 105px!important;width:auto!important;max-width:none!important;max-height:55dvh;overflow:auto;z-index:80}
 .an-info[open],.wg-info[open]{z-index:81}
 .wealth-goal{margin:0 0 24px}.wg-head{flex-wrap:wrap;justify-content:flex-start;gap:10px}.wg-head h2{flex:1 1 140px;min-width:0;margin:0!important}.wg-edit{margin-left:auto}
 .wg-form{display:grid;gap:14px}.wg-form h3{margin:0;overflow-wrap:anywhere}.wg-form label{min-width:0}.wg-form .wg-estimate,.wg-form .wg-error{margin:0}.wg-form .wg-primary{margin:0;white-space:normal}.wg-actions{display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px}.wg-actions .wg-subtle{margin:0;text-align:left}
 .wg-index{flex-wrap:wrap;gap:8px 12px}.wg-index strong{font-size:clamp(34px,12vw,48px)}.wg-values{flex-wrap:wrap;gap:14px}.wg-values>div{min-width:0;flex:1 1 100px}.wg-values strong{overflow-wrap:anywhere}
 body dialog{width:min(540px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);padding:20px;overflow:auto;overscroll-behavior:contain}
 body .dialog-heading h2{margin:0;flex:1;min-width:0}.dialog-heading button{flex:none}.answers label{flex:1 1 auto;justify-content:center;min-height:44px}
 .theme-options{grid-template-columns:minmax(0,1fr)}.theme-option{min-width:0}.setting-row{grid-template-columns:minmax(0,1fr) minmax(65px,90px);gap:12px}
 .notice{flex-wrap:wrap;gap:8px}.notice span{min-width:0;overflow-wrap:anywhere}.notice button{white-space:normal}
 #toast{left:16px;right:16px;bottom:calc(94px + env(safe-area-inset-bottom));width:auto;max-width:none;z-index:90;line-height:1.5}
 .sticky-actions{bottom:calc(84px + env(safe-area-inset-bottom));display:flex;flex-wrap:wrap;gap:10px}.mobile-nav button{min-width:0;flex:1;padding:9px 4px}.mobile-nav{gap:4px}
}
@media(max-width:359px){.an-kpis{grid-template-columns:minmax(0,1fr)}.hc-kpis>section,.wealth-goal{padding:16px}.hc-kpis>section.hc-banner{padding:16px;gap:16px 10px}.hc-banner-copy h3{font-size:15px}.hc-banner-advantage>strong{font-size:34px}}
/* Ritmo compacto entre cards; respiro reservado ao conteúdo. */
@media(max-width:760px){
 .an-home.ah-reference{display:flex;flex-direction:column;gap:12px}
 .ah-reference :is(.hc-kpis,.an-home-top,.an-three,.an-bottom){gap:12px;margin-block:0}
 .ah-reference :is(.an-card,.wealth-goal){margin-block:0}
 body main{padding-inline:16px!important}
 .ah-reference .an-card,.ah-reference .wealth-goal,.ah-reference .hc-kpis>section{padding:20px;border-radius:16px}
 .ah-reference .hc-kpis>section:first-child{border-radius:22px}
}
/* Desktop rhythm approved from the prototype. Keep the production chart untouched. */
@media(min-width:1101px){
 .an-home.ah-reference{display:flex;flex-direction:column;gap:24px}
 .ah-reference :is(.hc-kpis,.an-home-top,.an-three,.an-bottom){margin-block:0;gap:16px}
 .ah-reference .an-card{margin-block:0;padding:22px;border-radius:16px}
 .ah-reference .hc-kpis>section{border-radius:16px}
 .ah-reference .an-bottom{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}
}
