/* R78 — Revisão transversal para smartphones. CSS aditivo, sem alterar APIs/dados.
   Páginas: início, eleições, moldura de apoio, notícias, páginas auxiliares,
   moderação e estatísticas. Escopo intencional por componente. */
:root { --r78-touch:44px; }
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body { max-width:100%; overflow-x:clip; }
img,video,canvas,iframe { max-width:100%; }
button,select,input,textarea { max-width:100%; }
:where(.shell,.site-header__shell,.res-shell,.res-toolbar,.res-results,.res-overview,.apoio-main,.apoio-grid,.apoio-adjust-card,.filtergrid,.cards,.card,.dashboard-content,.panel-view,.metric-card,.campaign-footer__shell) { min-width:0; }
:where(.site-menu-toggle,.menu-toggle,#reload,.res-refresh,.res-modebar button,.res-filter-help button,.res-candidate__detail,.res-load-more,.apoio-main button,.dialogtop button,.dashboard-mobile-top button) { min-height:var(--r78-touch); }
:where(.res-main,.apoio-main,.privacy-main,.news-main,.dashboard-content) :where(p,h1,h2,h3,strong,span,small) { overflow-wrap:break-word; }
@media(max-width:800px) {
  /* Navegação comum — folga lateral, menu rolável sem avançar sobre a tela. */
  .site-header__shell{min-width:0}
  .site-brand{flex:0 1 auto;min-width:0;max-width:calc(100% - 62px)}
  .site-brand__identity{min-width:0}
  .site-brand__wordmark{max-width:100%;height:auto}
  .site-menu-toggle{flex:0 0 46px;min-width:46px;min-height:46px}
  .site-header .site-menu{box-sizing:border-box;max-width:calc(100vw - 30px);max-height:calc(100dvh - 130px);overflow-y:auto;overscroll-behavior:contain}
  .site-header .site-menu a{white-space:normal;overflow-wrap:anywhere;min-height:44px}
  .site-ticker{max-width:100vw}
  /* Conteúdo da home e páginas auxiliares */
  .hero__copy>p,.heading p,.brand-banner__copy p,.legal-card p {text-align:left!important;text-align-last:auto!important;word-spacing:normal!important;hyphens:none!important}
  .hero__copy,.hero__layout,.hero__actions,.hero__proof,.section .shell,.support__actions {min-width:0;max-width:100%}
  .hero__actions .button,.support__actions .button{min-width:0;white-space:normal;text-align:center}
  .campaign-footer__bottom,.campaign-footer__grid{min-width:0}
  /* Eleições: campos e resultados dimensionados por conteúdo. */
  .res-toolbar{min-width:0;max-width:100%}
  .res-filter,.res-uf-picker,.res-uf-picker>button{min-width:0;max-width:100%}
  .res-section-head,.res-stat,.res-candidate__info,.res-candidate__numbers{min-width:0}
  .res-candidate h3 .res-state-flag,.res-dialog h2 .res-state-flag{margin-left:10px;vertical-align:middle}
  .res-candidate__name-text{overflow-wrap:anywhere}
  .res-electorate__card{min-width:0;overflow-wrap:anywhere}
  .res-electorate__card b{font-variant-numeric:tabular-nums}
  .res-list-actions{display:flex;flex-wrap:wrap;gap:8px}
  .res-dialog{max-width:calc(100vw - 24px)}
  /* Área de geração de moldura: editor, prévia e ações visíveis na tela. */
  .apoio-main,.apoio-grid,.apoio-grid>*,.apoio-adjust-card,.apoio-stage-card,.apoio-preview-wrap{min-width:0;max-width:100%}
  .apoio-main :where(input,select,button,textarea){min-width:0}
  .apoio-main :where(.apoio-actions,.apoio-fit-options,.apoio-toolbar){flex-wrap:wrap}
  /* Notícias: filtro, conteúdo e visualizador incorporado. */
  .top .head,.top nav,.filtergrid,.cards,.row,.editorial{min-width:0}
  .top nav a{min-height:44px;display:inline-flex;align-items:center}
  .filtergrid>*{min-width:0}
  .card h3,.card p,.card .source{overflow-wrap:anywhere}
  .dialog{max-width:100%;max-height:calc(100dvh - 20px)}
  .embedplace,.embedplace iframe{min-width:0;max-width:100%}
  /* Painel administrativo de estatísticas (tabelas mantêm rolagem própria). */
  .dashboard-content,.dashboard-titlebar,.dashboard-app,.panel-view,.period-strip,.dashboard-overview-grid{min-width:0;max-width:100%}
  .dashboard-mobile-top{min-width:0}
  .dashboard-content :where(input,select,textarea){min-width:0;max-width:100%}
  .table-scroll,.r67-parties__tablewrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
}
@media(max-width:590px) {
  /* Margens consistentes: as seções ocupam toda a área útil sem escorregar. */
  .shell{max-width:100%}
  .site-header__shell{width:calc(100% - 24px);gap:10px}
  .site-brand__wordmark{width:min(126px,100%)}
  .hero__actions .button,.support__actions .button{width:100%;justify-content:center}
  .hero__copy>p{line-height:1.65}
  .res-toolbar,.res-results,.res-overview,.res-info{width:100%;box-sizing:border-box}
  .res-filter select,.res-filter input,.res-uf-picker>button{min-height:46px}
  .res-region-selector,.res-stats,.res-electorate__grid{min-width:0}
  .res-candidate__detail{min-width:44px;line-height:1.4;padding:9px 2px}
  .res-candidate__numbers,.res-candidate__vote-total{font-variant-numeric:tabular-nums}
  .res-candidate__vote-total .res-candidate__percent{line-height:1.15}
  .res-dialog{padding:18px 12px;max-height:calc(100dvh - 30px)}
  .res-dialog-fields>div{min-width:0}
  .res-dialog-fields dd{overflow-wrap:anywhere}
  .top .head{gap:8px}
  .top .brand{min-width:0;font-size:clamp(13px,4vw,18px);overflow-wrap:anywhere}
  .top .brand small{font-size:11px}
  .top nav{width:100%;flex-wrap:wrap;gap:4px}
  .top nav a{white-space:normal;text-align:center}
  .filtergrid{grid-template-columns:minmax(0,1fr)}
  .filtergrid input,.filtergrid select,#reload{width:100%;min-width:0}
  .listing .row{flex-wrap:wrap;align-items:flex-start}
  .listing .row h2{font-size:clamp(19px,5vw,25px);margin:0}
  .cards{grid-template-columns:minmax(0,1fr)}
  .editorial{padding-inline:16px}
  .overlay{padding:8px}
  .dialog{width:100%;height:min(96dvh,850px);padding:12px}
  .dialogtop{gap:10px}
  .dialogtop h2{min-width:0;font-size:16px;overflow-wrap:anywhere}
  .dialogtop button{flex:0 0 44px}
  .embedplace .instagram-media{min-width:0!important;width:min(100%,440px)!important}
  .embedplace iframe{width:100%;max-width:100%}
  .foot{flex-wrap:wrap;gap:12px}
  .privacy-main .heading h2,.support .heading h2{font-size:clamp(26px,8vw,40px)}
  .privacy-main .heading p{font-size:15px;line-height:1.65}
  .dashboard-mobile-top .mobile-brand{min-width:0}
  .dashboard-mobile-top .mobile-brand strong{overflow-wrap:anywhere}
  .dashboard-titlebar,.period-strip,.metric-grid,.dashboard-kpi-grid,.dashboard-overview-grid,.tech-grid{max-width:100%;min-width:0}
  .period-strip :where(input,select,button){max-width:100%;min-width:0}
  .quick-ranges{max-width:100%;overflow-x:auto}
}
@media(max-width:360px){
  .site-brand__mark{width:40px;height:40px}
  .site-brand__wordmark{width:min(104px,100%)}
  .site-header__shell{gap:8px}
  .res-candidate{gap:7px!important;padding-inline:8px!important}
  .res-candidate__ballot small{line-height:1.25}
  .res-electorate__card span{font-size:9px;line-height:1.4}
  .res-electorate__card strong{font-size:clamp(14px,4.5vw,17px)}
  .res-map-legend{flex-wrap:wrap;justify-content:center}
  .dashboard-content{padding-inline:8px}
}
@media(prefers-reduced-motion:reduce){
  .ticker .ticker__track,.site-ticker .site-ticker__track{animation:none!important;transform:none!important}
}
/* Alvos móveis com área útil de toque, inclusive quando o CSS anterior define altura menor. */
.res-candidate__detail{min-height:44px!important;display:inline-flex;align-items:center}
@media(max-width:800px){
  .res-main section[id],.res-main #electorateSummary,.apoio-main section[id],.section[id]{scroll-margin-top:130px}
}
/* Fila e formulários de moderação — protegidos por classe específica da página. */
@media(max-width:600px){
  .news-admin header{padding:16px 14px}
  .news-admin header h1{font-size:clamp(19px,6vw,26px);line-height:1.3;margin:0 0 9px}
  .news-admin header nav{font-size:13px;line-height:1.7;overflow-wrap:anywhere}
  .news-admin main{width:100%;max-width:100%;padding:18px 12px 70px}
  .news-admin form{padding:14px;min-width:0}
  .news-admin :where(input,textarea){min-width:0;max-width:100%;font-size:16px}
  .news-admin article{padding:14px;grid-template-columns:minmax(0,1fr)}
  .news-admin article>*{min-width:0;overflow-wrap:anywhere}
  .news-admin article form.actions{display:flex;flex-wrap:wrap;gap:8px;padding:0}
  .news-admin article form.actions button{flex:1 1 90px;min-height:44px}
  .news-admin button[type="submit"]{min-height:44px}
}
