/* Previsibilidade: calendário e total cabem na largura disponível. */
body.forecast-mode main{max-width:none;padding-inline:20px}
body.forecast-mode .topbar{min-height:82px}
body.forecast-mode #importProgressBanner{padding:8px 12px;gap:12px;margin-bottom:12px;box-shadow:none}
body.forecast-mode .import-progress-copy small{font-size:.75rem}
body.forecast-mode .import-progress-track{width:110px}
#view-forecast.active{display:grid;grid-template-columns:minmax(260px,.85fr) minmax(0,1.3fr);column-gap:16px;row-gap:12px}
#view-forecast .report-switch{margin:0;min-width:0;align-self:start}
#view-forecast .report-switch label{width:100%;min-width:0;gap:4px}
#view-forecast .report-switch select,#view-forecast .live-toolbar select{width:100%;min-width:0;min-height:38px;padding:7px 9px;font-size:.875rem}
#view-forecast .report-source-note{font-size:.75rem;flex-basis:100%;line-height:1.3}
#history-live-forecast:not([hidden]){display:contents}
#history-live-forecast .live-toolbar{grid-column:2;grid-row:1;gap:8px;margin:0;min-width:0;align-self:start}
#history-live-forecast .live-toolbar label{flex:1;min-width:0;gap:4px}
#history-live-forecast .live-toolbar button{min-height:38px;padding:7px 10px;font-size:.875rem}
#history-live-forecast .live-toolbar>span{flex-basis:100%;font-size:.75rem;line-height:1.3}
#history-live-forecast [data-history-content],#history-reviewed-forecast{grid-column:1/-1;min-width:0}
#history-live-forecast .panel{padding:14px;border-radius:11px;box-shadow:0 4px 18px rgba(24,58,90,.05)}
#history-live-forecast .panel-head{margin-bottom:8px;gap:8px;align-items:center}
#history-live-forecast .panel-head h2{margin:0;font-size:1.125rem}
.recurrence-panel{container:recurrence / inline-size}
.recurrence-panel .panel-head p{margin:4px 0 0;font-size:.8125rem;color:var(--muted);line-height:1.4}
.recurrence-key{display:flex;gap:12px;flex-wrap:wrap;font-size:.75rem;color:var(--muted)}
.recurrence-key span{display:flex;align-items:center;gap:5px}
.recurrence-key i{width:12px;height:12px;border-radius:3px;display:inline-block}
.recurrence-key .r3{background:#2a5f9b}.recurrence-key .r1{background:#dceaf7}
.recurrence-caption{font-size:.8125rem;line-height:1.5;margin:0 0 10px;color:var(--muted)}
.recurrence-wrap{overflow:visible;border-color:#dce5ed;border-radius:8px}
.recurrence-table{width:100%;min-width:0;table-layout:fixed;border-collapse:separate;border-spacing:0;font-variant-numeric:tabular-nums}
.recurrence-name-col{width:18%}.recurrence-total-col{width:12%}
.recurrence-table thead th{padding:9px 2px;text-align:center;font-size:.75rem;line-height:1.3;letter-spacing:0;white-space:normal;background:#edf3f8;color:#52687b}
.recurrence-table thead th:first-child{text-align:left;padding-left:10px;border-radius:8px 0 0 0}
.recurrence-table thead th:last-child{border-radius:0 8px 0 0;background:#dfeaf4;color:var(--navy)}
.recurrence-table thead th small{display:block;font-size:.75rem;font-weight:500;text-transform:none}
.recurrence-table td,.recurrence-table tbody th{padding:7px 2px;border-top:1px solid #e4ebf1;vertical-align:middle;min-width:0}
.recurrence-table tbody th.recurrence-name{text-align:left;background:transparent;padding:7px 8px 7px 10px;text-transform:none;letter-spacing:0;white-space:normal;overflow-wrap:anywhere}
.recurrence-name>strong{display:block;font-size:.875rem;line-height:1.3;font-weight:700}
.recurrence-name>small{display:block;margin-top:2px;font-size:.75rem;line-height:1.3;font-weight:400;color:var(--muted)}
.recurrence-meta{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:4px;font-size:.75rem;font-weight:400;color:var(--muted)}
.recurrence-meta .badge{font-size:.75rem;line-height:1.2;padding:2px 6px;font-weight:650}
.recurrence-cell{display:grid;align-content:center;gap:2px;min-width:0;min-height:42px;padding:5px 1px;border-radius:5px;background:#f0f3f6;color:#697b8d;text-align:center}
.recurrence-cell.r1{background:#dceaf7;color:#244b70}.recurrence-cell.r2{background:#adcde9;color:#193f65}.recurrence-cell.r3{background:#2a5f9b;color:#fff}
.recurrence-cell b{font-size:.875rem;line-height:1.25;font-weight:700}
.recurrence-cell small{font-size:.75rem;line-height:1.3;white-space:normal;overflow-wrap:anywhere}
.recurrence-table .recurrence-total{padding:8px 5px;text-align:center;background:#edf4fa;border-left:1px solid #d3e1ed;color:var(--navy)}
.recurrence-total strong{display:block;font-size:.875rem;line-height:1.4;overflow-wrap:anywhere}
.recurrence-total-label,.recurrence-month-label{display:none}
.recurrence-table td:nth-child(4),.recurrence-table td:nth-child(7),.recurrence-table td:nth-child(10){border-right:1px solid #e0e8f0;padding-right:4px}
.recurrence-method{margin-top:10px;font-size:.8125rem;color:var(--muted)}
.recurrence-method summary{cursor:pointer;color:var(--blue);font-weight:650;width:fit-content}
.recurrence-method p{margin:8px 0 0;line-height:1.6;max-width:95ch}
.forecast-season-panel .bars{grid-template-columns:repeat(3,minmax(0,1fr));column-gap:24px;row-gap:12px}
.forecast-season-panel .bar-label{flex-wrap:wrap;gap:4px}
.recurrence-empty td{padding:20px!important;font-size:.875rem;text-align:center}
@container recurrence (max-width:60rem){
  .recurrence-wrap{border:0;border-radius:0}
  .recurrence-table,.recurrence-table tbody{display:block;width:100%}
  .recurrence-table colgroup{display:none}
  .recurrence-table thead{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .recurrence-table tbody tr{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;padding:10px;margin-bottom:10px;border:1px solid #d8e4ee;border-radius:8px;background:#fbfdff}
  .recurrence-table td,.recurrence-table tbody th.recurrence-name{border:0;padding:0}
  .recurrence-table tbody th.recurrence-name{grid-column:span 4;order:0}
  .recurrence-table .recurrence-total{grid-column:span 2;order:1;border:0;padding:6px;border-radius:6px;align-self:start}
  .recurrence-total-label{display:block;font-size:.75rem;line-height:1.4;font-weight:400;margin-bottom:3px}
  .recurrence-table .recurrence-month{order:2;border:0;padding:0}
  .recurrence-month-label{display:block;font-size:.75rem;font-weight:650;line-height:1.4;margin:2px 0 4px;text-align:center;color:#52687b}
  .recurrence-cell{padding:6px 3px}
  .recurrence-cell small{font-size:.8125rem}
  .recurrence-empty td{grid-column:1/-1}
}
@container recurrence (max-width:28rem){
  .recurrence-table tbody tr{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:8px}
  .recurrence-table tbody th.recurrence-name{grid-column:1/-1}
  .recurrence-table .recurrence-total{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;gap:8px;padding:7px}
  .recurrence-total-label{margin:0;text-align:left}
}
@media(max-width:1050px){
  #view-forecast.active{grid-template-columns:minmax(0,1fr)}
  #history-live-forecast .live-toolbar{grid-column:1;grid-row:auto}
  #view-forecast .report-switch{gap:5px}
  body.forecast-mode .import-progress-track{display:none}
  .forecast-season-panel .bars{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  body.forecast-mode main{padding-inline:12px}
  body.forecast-mode .topbar{min-height:88px}
  #history-live-forecast .panel{padding:10px}
  .forecast-season-panel .bars{grid-template-columns:minmax(0,1fr)}
  #view-forecast .live-detail .live-table table{min-width:0;table-layout:fixed}
  #view-forecast .live-detail .live-table th,#view-forecast .live-detail .live-table td{padding:7px 3px;font-size:.75rem;white-space:normal;overflow-wrap:anywhere}
}
/* Visão anual: os doze meses permanecem na tela, com previsão identificada. */
.annual-forecast{grid-column:1/-1;min-width:0}
#view-forecast #annualForecast{grid-row:1}
#view-forecast:has(#annualForecast:not([hidden])) .report-switch{grid-column:1;grid-row:2}
#view-forecast:has(#annualForecast:not([hidden])) #history-live-forecast .live-toolbar{grid-row:2}
.annual-panel{padding:16px;margin-bottom:0;container:annual / inline-size}
.annual-heading{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:12px}
.annual-eyebrow{font-size:.8125rem;color:var(--muted)}
.annual-heading h2{font-size:2rem;line-height:1;margin:3px 0 0;letter-spacing:-.04em;color:var(--navy)}
.annual-controls{display:flex;align-items:end;gap:10px;flex-wrap:wrap}
.annual-controls label{display:grid;gap:4px;font-size:.8125rem;color:var(--muted)}
.annual-controls select{min-height:38px;padding:7px 10px;border:1px solid var(--line);border-radius:7px;background:#fff;font-size:.875rem;color:var(--ink)}
.annual-controls button{min-height:38px;font-size:.875rem}
.annual-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px}
.annual-kpis>div{padding:10px 12px;border:1px solid #dce6ed;border-radius:8px;background:#f8fbfd;min-width:0}
.annual-kpis span,.annual-kpis small{display:block;font-size:.75rem;line-height:1.5;color:var(--muted)}
.annual-kpis strong{display:block;font-size:clamp(1rem,1.6vw,1.35rem);line-height:1.3;margin:4px 0;color:var(--navy);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.annual-kpis .annual-estimate-kpi{background:#edf8f4;border-color:#c2d9c9;border-top:2px solid #b98b32}
.annual-legend{display:flex;align-items:center;gap:8px 16px;flex-wrap:wrap;font-size:.75rem;color:#516a7d;margin-bottom:8px}
.annual-legend>span,.annual-legend label{display:flex;align-items:center;gap:5px;min-height:24px}
.annual-legend label{cursor:pointer}.annual-legend input{accent-color:var(--blue);margin:0 2px 0 0}
.annual-legend i{display:inline-block;width:14px;height:11px;border-radius:2px}
.annual-legend .actual{background:#2a5f9b}.annual-legend .estimated{background:#3a9c7c;border:2px solid #b98b32}
.annual-legend .predicted{height:0;border-top:2px dashed #ad7a1b;border-radius:0}
.annual-legend .reference{height:0;border-top:2px solid #6f8190;border-radius:0}
.annual-legend .ref-1{border-top-style:dashed;border-color:#85728e}.annual-legend .ref-2{border-top-style:dotted;border-color:#92745c}
.annual-scale{display:flex;justify-content:space-between;gap:12px;font-size:.75rem;color:var(--muted);margin-bottom:5px}
.annual-chart{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:4px;min-width:0}
.annual-month{display:flex;flex-direction:column;min-width:0;padding:6px 2px 8px;border:1px solid transparent;border-radius:7px;background:#fff;color:var(--ink);font:inherit;text-align:center}
.annual-month:hover{background:#f2f7fb}.annual-month.is-selected{border-color:#93b8d5;background:#f1f7fc}
.annual-month:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.annual-month-value{font-size:.8125rem;font-weight:650;line-height:20px;color:var(--navy);font-variant-numeric:tabular-nums}
.annual-plot{display:block;position:relative;width:100%;height:150px;margin:6px 0 7px;background:repeating-linear-gradient(to top,transparent 0 calc(25% - 1px),#e7edf2 calc(25% - 1px) 25%)}
.annual-zero{position:absolute;inset:auto 0 0;border-bottom:1px solid #acbdca}
.annual-bar{position:absolute;bottom:0;left:28%;width:44%;min-height:0;border-radius:4px 4px 0 0;background:linear-gradient(180deg,#467eaf,#244f78)}
.annual-bar.estimated{background:linear-gradient(180deg,#59b69b,#25866c);border:2px solid #b9903e;border-bottom:0}
.annual-band{position:absolute;left:15%;width:70%;background:rgba(208,171,76,.14);border:1px dashed #bb933f;border-radius:4px}
.annual-prediction-mark{position:absolute;left:17%;width:66%;height:0;border-top:2px dashed #ab791d;z-index:2}
.annual-reference-mark{position:absolute;left:6%;width:88%;height:0;border-top:2px solid #6f8190;opacity:.8;z-index:1}
.annual-reference-mark.ref-1{border-top-style:dashed;border-color:#85728e}.annual-reference-mark.ref-2{border-top-style:dotted;border-color:#92745c}
.annual-cloud{position:absolute;left:0;right:0;font-size:1.4rem;line-height:1;color:#23705f;text-shadow:0 1px 0 #fff;z-index:3}
.annual-no-data{position:absolute;inset:35% 0 auto;font-size:.75rem;color:var(--muted);font-style:normal;line-height:1.4}
.annual-month>strong{font-size:.875rem;line-height:1.4}.annual-month-status{font-size:.75rem;line-height:1.3;min-height:2.6em;margin-top:3px;overflow-wrap:anywhere}
.annual-month .estimate{color:#24765d}.annual-panel .hit{color:#19734d}.annual-panel .miss{color:#9b5d15}
.annual-detail{background:#edf3f8;border:1px solid #d4e2ec;border-radius:8px;padding:10px 12px;margin-top:10px}
.annual-detail-title{display:flex;align-items:baseline;gap:8px 14px;flex-wrap:wrap;margin-bottom:9px}
.annual-detail-title>strong{font-size:1rem;color:var(--navy)}.annual-detail-title>span,.annual-detail-title>a{font-size:.8125rem;color:var(--muted)}.annual-detail-title>a{margin-left:auto;color:var(--blue)}
.annual-detail-values{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.annual-detail-values>div{min-width:0}.annual-detail-values span{display:block;font-size:.75rem;color:var(--muted);line-height:1.4;margin-bottom:4px}
.annual-detail-values strong{font-size:.875rem;line-height:1.4;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.annual-references{display:flex;flex-wrap:wrap;gap:5px 18px;padding-top:9px;margin-top:9px;border-top:1px solid #d4e2ec;font-size:.75rem;color:var(--muted)}
.annual-references b{color:#456078;font-weight:600}.annual-detail-basis{margin:6px 0 0;font-size:.75rem;color:var(--muted);line-height:1.5}
.annual-footnote,.annual-sync{font-size:.75rem;line-height:1.5;color:var(--muted);margin:9px 0 0}
.annual-sync.error{color:#aa3827;background:#fff4ef;padding:7px 10px;border-radius:6px}
.annual-method{font-size:.8125rem;line-height:1.6;color:var(--muted);margin-top:8px}
.annual-method summary{color:var(--blue);cursor:pointer;font-weight:650}.annual-method p{margin:8px 0 0;max-width:100ch}
@container annual (max-width:48rem){
  .annual-chart{grid-template-columns:repeat(6,minmax(0,1fr));gap:8px 4px}
  .annual-plot{height:125px}.annual-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .annual-detail-values{grid-template-columns:repeat(2,minmax(0,1fr))}
  .annual-heading{align-items:flex-start}.annual-controls{gap:6px;justify-content:flex-end}
  .annual-reference-title{margin-left:0}
}
@container annual (max-width:28rem){
  .annual-heading{flex-direction:column;gap:8px}.annual-controls{width:100%;justify-content:flex-start}
  .annual-controls label{flex:1;min-width:0}.annual-controls select{max-width:100%}
  .annual-controls button{width:100%;min-height:32px;padding:5px 8px}
  .annual-kpis{gap:6px}.annual-kpis>div{padding:8px}.annual-kpis strong{font-size:1rem}
  .annual-chart{grid-template-columns:repeat(3,minmax(0,1fr))}.annual-plot{height:110px}
  .annual-scale{flex-direction:column;gap:2px}.annual-detail{padding:9px}
}
@media(max-width:1050px){
  #view-forecast:has(#annualForecast:not([hidden])) #history-live-forecast .live-toolbar{grid-row:3}
}
