/* Conta do lote (#/lote), reconstruída na onda 2. Ordem: o todo, a conta do mês, o custo do kit,
   o resultado, o que protege, os riscos e os pontos em definição. Texto sempre >= 12 px, alvos >= 44 px. */
.lote-vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 1. o todo ---------- */
.lote-topo { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px 28px; align-items: start; padding-top: 4px; }
.lote-topo-texto { min-width: 0; }
.lote-topo h1 { max-width: 22ch; }
.lote-todo { margin: 12px 0 0 !important; font-size: clamp(18px, 1.5vw, 22px); line-height: 1.35; color: var(--t1) !important; }
.lote-todo strong { color: var(--sol-texto); }
.lote-topo-apoio { min-width: 0; align-self: stretch; display: flex; }
.lote-apoio { list-style: none; margin: 0; padding: 14px 16px; display: grid; gap: 10px; background: var(--sup-2); border-radius: var(--raio-m); border-inline-start: 3px solid var(--sol); width: 100%; align-content: center; }
.lote-apoio li { margin: 0; line-height: 1.45; font-size: var(--fs-texto); color: var(--t2); }
.lote-apoio strong { color: var(--t1); }
.lote-acoes { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; min-width: 0; }
.lote-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-width: 0; margin-inline-start: auto; }
.lote-links .link { white-space: normal; }
.lote-links .botao { white-space: normal; }

/* ---------- parte da Charge (só depois do clique) ---------- */
.lote-charge-slot:empty { display: none; }
.lote-charge { border: 1px solid var(--sol); }

/* ---------- kpis (resultado, parte da Charge) ---------- */
.lote-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; margin: 0 0 14px; padding: 0; }
.lote-kpis > div { background: var(--sup-2); border-radius: var(--raio-m); padding: 14px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lote-kpis dt { margin: 0; font-size: var(--fs-nota); font-weight: 600; color: var(--t2); }
.lote-kpis dd { margin: 0; font-size: clamp(20px, 1.8vw, 26px); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--t1); }
.lote-kpis small { display: block; color: var(--t2); font-size: var(--fs-nota); line-height: 1.4; }

/* ---------- 2. a conta do mês ---------- */
.lote-conta { display: flex; flex-direction: column; gap: 14px; }
.lote-conta h2 { margin: 0; }
.lote-fluxo { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; counter-reset: passo; }
.lote-passo { position: relative; margin: 0 !important; padding: 14px; background: var(--sup-2); border-radius: var(--raio-m); display: flex; flex-direction: column; gap: 4px; min-width: 0; justify-content: center; }
.lote-passo small { font-size: var(--fs-nota); font-weight: 600; color: var(--t2); }
.lote-passo b { font-size: clamp(22px, 2.1vw, 30px); font-weight: 700; line-height: 1.1; letter-spacing: -.015em; font-variant-numeric: tabular-nums; color: var(--t1); overflow-wrap: anywhere; }
.lote-passo span { font-size: var(--fs-nota); line-height: 1.4; color: var(--t2); }
.lote-passo-renda { background: var(--destaque-fundo); }
.lote-passo-renda small, .lote-passo-renda span { color: var(--destaque-apoio); }
.lote-passo-renda b { color: var(--destaque-numero); }
.lote-passo + .lote-passo::before { content: "→"; position: absolute; left: -12px; top: 50%; width: 12px; transform: translate(-50%, -50%); text-align: center; color: var(--t2); font-weight: 700; }
.lote-passo-reserva::before { content: "+" !important; }
.lote-barra { display: flex; gap: 3px; height: 40px; border-radius: var(--raio-m); overflow: hidden; font-size: var(--fs-nota); font-weight: 700; }
.lote-barra span { display: flex; align-items: center; padding: 0 12px; min-width: 0; flex-basis: 0; white-space: nowrap; overflow: hidden; }
.lote-barra-renda { background: var(--destaque-fundo); color: var(--destaque-numero); }
.lote-barra-reserva { background: var(--dado-instalado-suave); color: var(--t1); }
.lote-taxa, .lote-reforco { margin: 0 !important; padding: 12px 14px; background: var(--sup-2); border-radius: var(--raio-m); line-height: 1.5; font-size: var(--fs-texto); color: var(--t2); }
.lote-taxa strong, .lote-reforco strong { color: var(--t1); }

/* ---------- 3. o kit ---------- */
.lote-kit .fato-kit { margin: 0 0 14px; }
.lote-simula { margin: 0; align-items: end; }
.lote-simula p { margin: 0; }

/* ---------- 4. o resultado ---------- */
.lote-resultado h2 small { font-size: var(--fs-nota); font-weight: 600; color: var(--t2); margin-inline-start: 6px; letter-spacing: 0; }
.lote-resultado > details.lote-ano { margin-top: 8px; border: 1px solid var(--borda); border-radius: var(--raio-m); padding: 0 12px; }
.lote-ano > summary { min-height: 48px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.lote-links-linha { margin: 4px 0 8px; }
.lote-rol { overflow-x: auto; border-radius: var(--raio-m); border: 1px solid var(--borda); }
.lote-ano-tab { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); font-variant-numeric: tabular-nums; }
.lote-ano-tab :is(th, td) { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--borda); white-space: nowrap; line-height: 1.3; }
.lote-ano-tab thead th { background: var(--sup-2); color: var(--t2); font-weight: 600; white-space: normal; vertical-align: bottom; }
.lote-ano-tab :is(thead th:first-child, tbody th) { text-align: left; font-weight: 700; }
.lote-ano-tab tbody tr:last-child :is(th, td) { border-bottom: 0; }

/* ---------- 5. o que protege ---------- */
.lote-protege .lote-protecoes { margin: 0; }
.lote-protege .lote-protecoes li { gap: 6px; }
.lote-protecoes span { color: var(--t2); line-height: 1.45; }

/* ---------- 6. como reduzimos os riscos ---------- */
.lote-riscos > ul.lote-riscos { margin: 0; }
ul.lote-riscos { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lote-riscos li { margin: 0 !important; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--borda); border-radius: var(--raio-m); overflow: hidden; min-width: 0; }
.lote-riscos li > div { padding: 14px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lote-risco-teste { background: var(--sup-2); }
.lote-risco-resposta { background: var(--cartao); border-inline-start: 3px solid var(--bom); }
.lote-riscos li small { font-size: var(--fs-nota); font-weight: 600; color: var(--t2); letter-spacing: .02em; }
.lote-riscos li h3 { margin: 0; font-size: var(--fs-18); line-height: 1.25; }
.lote-riscos li p { margin: 0; font-size: var(--fs-ui); line-height: 1.5; color: var(--t2); }
.lote-risco-teste p strong { color: var(--t1); font-size: var(--fs-18); }
.lote-riscos > p:last-child { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 4px 0 0; }

/* ---------- 7. pontos em definição ---------- */
.lote-def-notas { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; color: var(--t2); }
.lote-def-item { border-top: 1px solid var(--borda); margin-top: 0 !important; }
.lote-def-item > summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 600; padding-block: 6px; }
.lote-def-item[open] > summary { color: var(--t1); }
.lote-respostas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lote-respostas article { background: var(--sup-2); border-radius: var(--raio-m); padding: 14px; min-width: 0; }
.lote-respostas h3 { margin: 6px 0; font-size: var(--fs-18); }
.lote-respostas p { margin: 0; }
.lote-mercado > summary, .lote-historico > summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }

/* ---------- tablet e celular ---------- */
@media (max-width: 1099px) {
  .lote-fluxo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lote-passo:nth-child(3)::before { content: none; }
  ul.lote-riscos { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .lote-topo { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .lote-topo h1 { max-width: none; }
  .lote-links { margin-inline-start: 0; }
}
@media (max-width: 767px) {
  .lote-topo { padding-top: 0; }
  .lote-todo { font-size: 19px; margin-top: 8px !important; }
  .lote-apoio { padding: 12px 14px; gap: 8px; }
  .lote-apoio li { font-size: var(--fs-ui); }
  .lote-acoes { gap: 8px; }
  .lote-acoes .res-interruptor { width: 100%; }
  .lote-links { width: 100%; gap: 0 14px; }
  .lote-links .botao { width: 100%; justify-content: center; margin-top: 6px; white-space: normal; text-align: center; }
  .lote-fluxo { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .lote-passo { padding: 12px 14px; }
  .lote-passo:nth-child(n)::before, .lote-passo-reserva::before { content: none !important; }
  .lote-passo + .lote-passo::after { content: "↓"; position: absolute; left: 50%; top: -17px; width: 18px; height: 18px; transform: translateX(-50%); display: grid; place-items: center; color: var(--t2); font-weight: 700; line-height: 1; }
  .lote-passo-reserva::after { content: "+" !important; }
  .lote-barra { height: 36px; }
  .lote-barra span { padding: 0 8px; }
  .lote-taxa, .lote-reforco { font-size: var(--fs-ui); padding: 10px 12px; }
  .lote-kpis { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lote-kpis > div { padding: 12px; }
  .lote-riscos li { grid-template-columns: minmax(0, 1fr); }
  .lote-risco-resposta { border-inline-start: 0; border-top: 3px solid var(--bom); }
  .lote-respostas { grid-template-columns: minmax(0, 1fr); }
  .lote-resultado > details.lote-ano { padding: 0 10px; }
  /* ano a ano: um cartão por ano, sem rolagem lateral */
  .lote-rol { overflow: visible; border: 0; }
  .lote-ano-tab, .lote-ano-tab tbody { display: block; }
  .lote-ano-tab thead { display: none; }
  .lote-ano-tab tbody { display: grid; gap: 10px; padding-bottom: 8px; }
  .lote-ano-tab tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; background: var(--sup-2); border-radius: var(--raio-m); padding: 10px 12px; }
  .lote-ano-tab :is(th, td) { display: block; padding: 0; border: 0; text-align: left; white-space: normal; }
  .lote-ano-tab tbody th { grid-column: 1 / -1; font-size: var(--fs-texto); padding-bottom: 4px; border-bottom: 1px solid var(--borda); }
  .lote-ano-tab td::before { content: attr(data-r); display: block; font-size: var(--fs-12); font-weight: 500; color: var(--t2); }
  .lote-ano-tab td { font-weight: 700; font-size: var(--fs-texto); }
}
@media (max-width: 380px) {
  .lote-passo b { font-size: 22px; }
  .lote-todo { font-size: 18px; }
}
.lote-resultado .lote-links { margin: 14px 0 0; }

/* o que abre e fecha: sinal de + / − à direita, 48 px de altura */
.lote-def-item > summary, .lote-ano > summary, .lote-mercado > summary, .lote-historico > summary, .lote-charge details > summary { list-style: none; display: flex; align-items: center; min-height: 48px; cursor: pointer; font-weight: 600; justify-content: space-between; gap: 12px; }
.lote-def-item > summary::-webkit-details-marker, .lote-ano > summary::-webkit-details-marker, .lote-mercado > summary::-webkit-details-marker, .lote-historico > summary::-webkit-details-marker, .lote-charge details > summary::-webkit-details-marker { display: none; }
.lote-def-item > summary::after, .lote-ano > summary::after, .lote-mercado > summary::after, .lote-historico > summary::after, .lote-charge details > summary::after { content: "+"; flex: none; font-size: 22px; font-weight: 500; line-height: 1; color: var(--t2); }
.lote-def-item[open] > summary::after, .lote-ano[open] > summary::after, .lote-mercado[open] > summary::after, .lote-historico[open] > summary::after, .lote-charge details[open] > summary::after { content: "−"; }
.lote-kit .fato-kit { background: none; padding: 0; margin: 0 0 14px; }
.lote-kit .fato-kit h3 { font-size: var(--fs-cartao); }
.lote-mercado { padding-block: 0; }
.lote-def-item, #riscos-do-lote, #lote-ano-a-ano { scroll-margin-top: calc(var(--topo) + 16px); }
.lote-kpis dd.longo { font-size: clamp(16px, 1.3vw, 19px); line-height: 1.25; }
@media (min-width: 768px) and (max-width: 1099px) {
  .lote-ano-tab { font-size: var(--fs-nota); }
  .lote-ano-tab :is(th, td) { padding: 8px 5px; }
  .lote-ano-tab thead th { font-size: var(--fs-12); }
  .lote-resultado > details.lote-ano { padding: 0 8px; }
}
