/* Segunda Opinião — o mundo do funil do Portal (docs/funil-portal/DESIGN.md): lousa navy, papel, um
   acento coral. A planilha dele mora no papel; o que cada produto deixa, na lousa. */
:root {
  --navy: #000321;
  --paper: #F4F6FA;
  --white: #FFFFFF;
  --coral: #FF6240;
  --coral-hover: #EB5A3B;
  --coral-soft: rgba(255, 98, 64, 0.14);
  --muted-dark: rgba(255, 255, 255, 0.72);
  --faint-dark: rgba(255, 255, 255, 0.5);
  --muted-light: rgba(0, 3, 33, 0.68);
  --line-dark: rgba(255, 255, 255, 0.16);
  --line-light: rgba(0, 3, 33, 0.12);
  --borda: rgba(0, 3, 33, 0.28);
  --erro: #A3220A;
  --sans: Montserrat, "Segoe UI", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pontos: radial-gradient(rgba(255, 255, 255, 0.06) 0.75px, transparent 0.75px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: rgba(0, 3, 33, .35) var(--paper); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font: 500 17px/1.65 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(255, 98, 64, .28); color: var(--navy); }
a, button, input, select, textarea { font: inherit; color: inherit; }
a { text-decoration-color: var(--coral); text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; }
h1 em, h2 em, .serif { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.12em; letter-spacing: 0; }
i { font-style: normal; font-weight: 500; color: var(--muted-light); }
.pular { position: absolute; left: 12px; top: -60px; padding: 10px 14px; background: var(--white); border-radius: 8px; z-index: 10; }
.pular:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lousa { background-color: var(--navy); background-image: var(--pontos); background-size: 32px 32px; color: var(--white); }
.lousa ::selection { background: rgba(255, 98, 64, .4); color: var(--white); }

/* Faixa branca do logo oficial (assets/brand/logo.png). */
.marca {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--white); border-bottom: 1px solid var(--line-light);
  padding: 12px max(20px, calc((100% - 1200px) / 2 + 20px));
}
.logo { display: inline-block; line-height: 0; border-radius: 4px; }
.logo img { display: block; width: 160px; height: auto; }
.marca-nome { font-size: 14px; font-weight: 700; color: var(--muted-light); white-space: nowrap; }

.faixa { max-width: 1200px; margin: 0 auto; padding: 40px 20px 56px; }

/* ---------- Entrada ---------- */
.entrada > .lousa { padding-bottom: 72px; }
.tese { display: grid; gap: 22px; }
.tese h1 { margin: 0; font-size: 31px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; max-width: 22ch; }
.lede { margin: 0; color: var(--muted-dark); max-width: 36rem; text-wrap: pretty; }
.lede strong { color: var(--white); font-weight: 700; }
.promessa { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 8px; color: var(--muted-dark); font-size: 15px; }
.promessa li { display: flex; gap: 12px; align-items: baseline; }
.promessa li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--white); transform: translateY(-1px); }

.mesa { padding: 0 12px 56px; margin-top: -56px; }
.porta {
  position: relative; max-width: 1200px; margin: 0 auto;
  background: var(--white); border-radius: 12px; padding: 22px 16px 22px;
  box-shadow: 0 1px 2px rgba(0, 3, 33, .08), 0 18px 44px rgba(0, 3, 33, .14);
}
.porta.estreita { max-width: 560px; }
.passo { display: grid; gap: 18px; }
.passo.entrando { animation: entra 320ms var(--ease) both; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.porta h2 { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 800; letter-spacing: -0.01em; }
.porta h2:focus { outline: none; }
.apoio { margin: 4px 0 0; color: var(--muted-light); font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.contato .apoio { margin-top: -10px; }
.atalhos { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; }

.campo { display: grid; gap: 6px; }
.campo > span:first-child { font-size: 15px; font-weight: 700; }
.campo input, .campo textarea, .com-moeda select {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid var(--borda); border-radius: 8px; background: var(--white);
  font-size: 16px; caret-color: var(--coral);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.campo textarea { min-height: 120px; resize: vertical; line-height: 1.5; font-size: 15px; }
input::placeholder, textarea::placeholder { color: rgba(0, 3, 33, 0.62); }
input:hover, textarea:hover, select:hover { border-color: rgba(0, 3, 33, 0.48); }
.campo input:focus, .campo textarea:focus, .prod input:focus, .com-moeda select:focus { outline: none; border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
[aria-invalid="true"] { border-color: var(--erro) !important; }
.campo-curto { max-width: 420px; }
.com-moeda { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; max-width: 420px; }
.com-moeda select { appearance: none; -webkit-appearance: none; padding-right: 10px; font-weight: 700; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%);
  background-position: calc(100% - 16px) 22px, calc(100% - 11px) 22px; background-size: 5px 5px; background-repeat: no-repeat; }
.ajuda { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted-light); max-width: 52rem; text-wrap: pretty; }
.ajuda strong { color: var(--navy); }

.colagem { display: grid; gap: 10px; padding: 14px; border-radius: 8px; background: var(--paper); }
.colagem-acoes { display: flex; gap: 18px; align-items: center; }

/* A grade de produtos: no celular, um cartão por produto; no desktop, a planilha. */
.grade { display: grid; gap: 10px; }
.grade-cabeca { display: none; }
.linhas-prod { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: prod; }
.prod {
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 10px;
  padding: 14px 12px 12px; border: 1px solid var(--line-light); border-radius: 10px; background: var(--white);
}
.cel { display: grid; gap: 4px; min-width: 0; }
.cel-nome { grid-column: 1 / -1; padding-right: 40px; }
.rot { font-size: 13px; font-weight: 700; color: var(--muted-light); line-height: 1.3; }
.prod input {
  width: 100%; min-height: 44px; padding: 9px 11px;
  border: 1.5px solid var(--borda); border-radius: 8px; background: var(--white);
  font-size: 16px; caret-color: var(--coral); font-variant-numeric: tabular-nums;
}
.prod input:not([name="nome"]):not([name="linha"]) { text-align: right; }
.cel-linha, .cel-min, .col-linha, .col-min { display: none; }
.com-linhas .cel-linha, .com-min .cel-min { display: grid; }
.tirar {
  position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: none; color: var(--muted-light); cursor: pointer;
}
.tirar svg { width: 18px; height: 18px; }
.tirar:hover { background: var(--paper); color: var(--navy); }
.acao-mais { justify-self: start; }

.margem-tipo { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 15px; }
.margem-tipo legend { float: left; padding: 0 6px 0 0; font-weight: 700; }
.margem-tipo label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; min-height: 36px; }
.margem-tipo input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }
.fixo { display: grid; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line-light); padding-top: 18px; }

.avancado { border-top: 1px solid var(--line-light); }
.avancado summary {
  display: flex; align-items: center; gap: 12px; padding: 16px 0; cursor: pointer; list-style: none;
  font-weight: 700; font-size: 16px;
}
.avancado summary::-webkit-details-marker { display: none; }
.avancado summary::after { content: ""; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy); transform: rotate(45deg) translateY(-3px); transition: transform 200ms var(--ease); }
.avancado[open] summary::after { transform: rotate(-135deg); }
.avancado-corpo { display: grid; gap: 16px; padding-bottom: 8px; }
.opcao { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 15px; line-height: 1.5; color: var(--muted-light); cursor: pointer; }
.opcao strong { color: var(--navy); }
.opcao input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--navy); }
.proprios { display: grid; gap: 12px; padding: 4px 0 4px 32px; }

.enviar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding-top: 4px; }
.contador { margin: 0; font-size: 14px; color: var(--muted-light); }
.contador strong { color: var(--navy); }

.consentimento { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--muted-light); }
.consentimento input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy); }
.isca { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 15px 26px; border: 0; border-radius: 8px;
  background: var(--coral); color: var(--navy); font-size: 17px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease);
}
.botao:hover { background: var(--coral-hover); }
.botao:active { transform: translateY(1px); }
.link {
  justify-self: start; padding: 4px 0; border: 0; background: none; cursor: pointer;
  font-size: 15px; font-weight: 700; color: var(--navy);
  text-decoration: underline; text-decoration-color: var(--coral); text-decoration-thickness: 2px; text-underline-offset: 5px;
}
.link:hover { text-decoration-thickness: 3px; }
.erro { margin: 0; font-size: 15px; line-height: 1.5; color: var(--erro); font-weight: 700; }
.acao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 14px; border: 1.5px solid var(--navy); border-radius: 8px;
  background: var(--white); color: var(--navy); font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.acao svg { width: 18px; height: 18px; flex: none; }
.acao:hover, .acao.feito { background: var(--navy); color: var(--white); }

.processando { min-height: 220px; align-content: center; justify-items: center; text-align: center; }
.processando p { margin: 0; font-weight: 700; max-width: 26ch; }
.pulso { display: flex; gap: 12px; }
.pulso span { width: 12px; height: 12px; border-radius: 50%; background: var(--line-light); animation: acende 1.5s var(--ease) infinite; }
.pulso span:nth-child(2) { animation-delay: .15s; } .pulso span:nth-child(3) { animation-delay: .3s; }
.pulso span:nth-child(4) { animation-delay: .45s; } .pulso span:nth-child(5) { animation-delay: .6s; }
@keyframes acende { 0%, 100% { background: var(--line-light); } 40% { background: var(--navy); } }

/* =================== Resultado =================== */
.visitante {
  display: flex; gap: 4px 16px; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto; padding: 10px 20px; font-size: 14px; border-bottom: 1px solid var(--line-light);
}
.visitante p { margin: 0; color: var(--muted-light); }
.visitante a { font-weight: 700; }
.visitante .curto, .acao .longo { display: none; }

.res-topo { padding: 28px 20px 22px; max-width: 1200px; margin: 0 auto; }
.manchete { margin: 0; font-size: 31px; line-height: 1.1; font-weight: 800; letter-spacing: -0.025em; max-width: 24ch; }
.manchete:focus { outline: none; }
.manchete em { font-size: 1.1em; }
.manchete .num { position: relative; white-space: nowrap; }
.manchete .num::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.02em; height: 0.12em; background: var(--coral);
  transform-origin: left; animation: sublinha 700ms 1500ms var(--ease) both;
}
@keyframes sublinha { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.leitura { margin: 14px 0 0; max-width: 46rem; color: var(--muted-light); font-size: 16px; line-height: 1.6; text-wrap: pretty; }
.leitura strong { color: var(--navy); }
.aviso { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted-light); padding-left: 14px; position: relative; max-width: 46rem; }
.aviso::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; border-radius: 50%; background: var(--navy); }
.acoes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 22px; }
.acoes .acao { padding: 8px 6px; font-size: 14px; gap: 6px; }
.salvo-nota { grid-column: 1 / -1; margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted-light); }
.salvo-nota:empty { display: none; }
.so-impresso { display: none; }

/* A dobra: a planilha (papel) e o corte (lousa). */
.dobra { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: 1200px; margin: 0 auto; padding: 0 0 8px; }
.col-tabela { padding: 8px 12px 0; min-width: 0; }
.col-corte { margin: 0 12px; padding: 24px 20px 26px; border-radius: 12px; order: -1; }
.col-titulo { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 800; letter-spacing: -0.015em; }
.col-sub { margin: 6px 0 0; font-size: 15px; line-height: 1.55; color: var(--muted-light); max-width: 40rem; text-wrap: pretty; }
.tab-topo { display: grid; gap: 16px; padding: 0 8px 16px; }

.ordem { display: inline-grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--navy); border-radius: 8px; padding: 3px; gap: 3px; justify-self: start; background: var(--white); }
.ordem button {
  min-height: 40px; padding: 6px 14px; border: 0; border-radius: 6px; background: none; cursor: pointer;
  font-size: 14px; font-weight: 700; line-height: 1.25; color: var(--navy);
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}
.ordem button[aria-checked="true"] { background: var(--navy); color: var(--white); }
.ordem button:not([aria-checked="true"]):hover { background: var(--paper); }

/* A tabela. Celular: um cartão por produto. */
.tabela-rolo { min-width: 0; }
.tabela { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.col-tabela .tabela thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.col-tabela .tabela tbody { display: grid; gap: 8px; }
.col-tabela .tabela tr {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "pos nome nome" "pos margem mes" "pos mov corte";
  gap: 6px 10px; align-items: center; padding: 12px 12px 12px 10px; border-radius: 10px; background: var(--white);
  border: 1px solid var(--line-light); will-change: transform;
}
.col-tabela .t-pos { grid-area: pos; align-self: start; }
.col-tabela .t-nome { grid-area: nome; text-align: left; }
.col-tabela .t-margem { grid-area: margem; }
.col-tabela .t-mov { grid-area: mov; }
.col-tabela .t-un { display: none; }
.col-tabela .t-mes { grid-area: mes; justify-self: end; }
.col-tabela .t-corte { grid-area: corte; justify-self: end; }
.pos {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--navy); font-size: 13px; font-weight: 800; transition: background-color 300ms var(--ease), color 300ms var(--ease);
}
.pelo-caixa .pos { background: var(--navy); color: var(--white); }
.t-nome { font-weight: 700; line-height: 1.35; }
.nome-txt { overflow-wrap: anywhere; }
.marca-txt { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--muted-light); }
.e-patinho .nome-txt { text-decoration: underline; text-decoration-color: var(--coral); text-decoration-thickness: 3px; text-underline-offset: 5px; text-decoration-skip-ink: none; }
.e-patinho .marca-txt.patinho { color: var(--navy); }
.t-margem { color: var(--muted-light); font-weight: 600; }
.margem-num { text-decoration: line-through; text-decoration-color: transparent; text-decoration-thickness: 1.5px; transition: text-decoration-color 400ms var(--ease), color 400ms var(--ease); }
.pela-margem .t-margem { color: var(--navy); font-weight: 800; }
.pelo-caixa .margem-num { text-decoration-color: rgba(0, 3, 33, 0.5); color: rgba(0, 3, 33, 0.55); }
.mov { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted-light); white-space: nowrap; transition: opacity 300ms var(--ease); }
.mov svg { width: 12px; height: 12px; }
.mov.sobe { color: var(--navy); }
.pela-margem .mov { opacity: 0; }
.lousa-col { font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-tabela .t-mes { background: var(--navy); background-image: var(--pontos); background-size: 32px 32px; color: var(--white); padding: 6px 10px; border-radius: 8px; text-align: right; }
.col-tabela .t-mes strong { font-weight: 800; }
.rot-m { display: block; font-size: 11px; font-weight: 700; color: var(--faint-dark); line-height: 1.2; }
/* A conta à vista: preço − o que sai. */
.conta { display: none; }
.conta-m { display: block; margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--muted-dark); line-height: 1.3; white-space: nowrap; }

/* Celular: faixa fixa com o lucro antes → depois, quando a tabela está na tela e o painel não. */
.barrinha {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 5;
  display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 10px; font-size: 14px; color: var(--muted-dark);
  box-shadow: 0 8px 24px rgba(0, 3, 33, .3);
  transform: translateY(140%); transition: transform 320ms var(--ease);
}
.barrinha.visivel { transform: none; }
.barrinha .bb-rot { font-size: 12px; font-weight: 700; color: var(--faint-dark); margin-right: auto; }
.barrinha .bb-antes { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .45); }
.barrinha:not(.com-corte) .bb-antes, .barrinha:not(.com-corte) .lucro-seta { display: none; }
.barrinha strong { color: var(--white); font-size: 18px; font-weight: 800; }
.tira .t-un, .tira .t-mes strong { color: #FFD5CB; }

.cortar {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px;
  border: 1.5px solid var(--borda); border-radius: 8px; background: var(--white); cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--navy); white-space: nowrap;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}
.cortar svg { width: 15px; height: 15px; }
.cortar:hover { border-color: var(--navy); }
.cortar[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
tr.cortado .nome-txt, tr.cortado .t-mes strong { text-decoration: line-through; text-decoration-thickness: 2px; }
tr.cortado .t-nome, tr.cortado .t-margem, tr.cortado .t-mov { opacity: 0.55; }
tr.cortado .t-mes { background: transparent; color: var(--muted-light); box-shadow: inset 0 0 0 1.5px var(--line-light); }
tr.cortado .rot-m { color: var(--muted-light); }

/* O painel do corte: a barra do mês contra a linha do gasto fixo. */
.barra { position: relative; margin-top: 44px; padding-bottom: 8px; }
.trilho { display: flex; height: 34px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--line-dark); overflow: hidden; }
/* O pedaço cortado encolhe onde está; o contorno hachurado do que saiu cresce no fim, logo depois. */
.seg { flex: 0 0 var(--w); background: var(--white); border-right: 1px solid var(--navy); min-width: 0; transition: flex-basis 620ms var(--ease), border-right-width 620ms var(--ease); }
.seg.saiu { flex-basis: 0; border-right-width: 0; }
.seg.fantasma {
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 7px);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.5);
  border: 0; border-radius: 0 4px 4px 0;
  transition: flex-basis 620ms 420ms var(--ease);
}
/* A linha do gasto fixo atravessa a barra; o rótulo fica acima, encostado nela. */
.fixo-linha { position: absolute; top: -10px; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: var(--white); }
.fixo-linha span {
  position: absolute; bottom: calc(100% + 4px); right: -1px; white-space: nowrap;
  font-size: 12px; font-weight: 700; color: var(--muted-dark);
}
.fixo-linha.cedo span { right: auto; left: -1px; }
.barra-leg { display: flex; justify-content: space-between; gap: 12px; margin: 2px 0 0; font-size: 13px; color: var(--muted-dark); }
.barra-leg strong { color: var(--white); font-weight: 800; }
.corte-nada, .corte-frase, .corte-nota { margin: 18px 0 0; font-size: 15px; line-height: 1.55; color: var(--muted-dark); text-wrap: pretty; }
.corte-frase strong, .corte-frase b { color: var(--white); font-weight: 700; }
.corte-nota { font-size: 13px; color: var(--faint-dark); }
.lucro-par {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px;
  margin-top: 18px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line-dark);
}
.lucro-rot, .lucro-queda { flex-basis: 100%; }
.lucro-rot { font-size: 13px; font-weight: 700; color: var(--faint-dark); }
.lucro-antes { font-size: 16px; font-weight: 700; color: var(--muted-dark); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.45); white-space: nowrap; }
.lucro-seta { width: 22px; height: 12px; color: var(--faint-dark); flex: none; }
.lucro-depois { font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.lucro-queda { font-size: 14px; font-weight: 700; color: var(--white); }

/* Seções de papel: linhas e fábrica cheia */
.secao { max-width: 1200px; margin: 0 auto; }
.faixa-sec { padding: 48px 20px 8px; }
.sec-titulo { margin: 0; font-size: 25px; line-height: 1.15; font-weight: 800; letter-spacing: -0.015em; max-width: 30ch; }
.sec-lede { margin: 12px 0 0; max-width: 46rem; color: var(--muted-light); font-size: 16px; text-wrap: pretty; }
.sec-lede strong { color: var(--navy); }
.mix { margin: 16px 0 0; max-width: 46rem; font-size: 17px; line-height: 1.6; text-wrap: pretty; }
.tabela-simples { margin-top: 22px; background: var(--white); border-radius: 10px; box-shadow: 0 0 0 1px var(--line-light); }
.secao .tabela-rolo { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabela-simples th, .tabela-simples td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--line-light); white-space: nowrap; }
.tabela-simples th:first-child, .tabela-simples td:first-child { text-align: left; }
.tabela-simples thead th { font-size: 13px; font-weight: 700; color: var(--muted-light); }
.tabela-simples tbody th { font-weight: 700; white-space: normal; min-width: 9rem; }
.tabela-simples tfoot th, .tabela-simples tfoot td { border-bottom: 0; font-weight: 800; }
.tabela-simples tbody tr:last-child th, .tabela-simples tbody tr:last-child td { border-bottom: 0; }
.tabela-simples tfoot tr th, .tabela-simples tfoot tr td { border-top: 1.5px solid var(--navy); }
.queda { font-size: 13px; font-weight: 600; color: var(--muted-light); }
.neg { color: var(--erro); }
/* Ocupação do recurso: o navy é o que cabe; o hachurado, o que passa da capacidade. */
.ocupa { position: relative; height: 14px; margin-top: 16px; max-width: 46rem; border-radius: 4px; overflow: hidden;
  background: repeating-linear-gradient(135deg, rgba(0, 3, 33, 0.22) 0 2px, transparent 2px 7px); box-shadow: inset 0 0 0 1px rgba(0, 3, 33, 0.3); }
.ocupa .cabe { display: block; height: 100%; width: var(--w); background: var(--navy); }
.ocupa.folga { background: var(--line-light); box-shadow: none; }

/* A ponte */
.ponte { margin-top: 56px; }
.ponte .faixa { padding: 64px 20px 72px; }
.ponte h2 { margin: 0; font-size: 30px; line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; max-width: 22ch; }
.ponte p { margin: 18px 0 0; max-width: 40rem; color: var(--muted-dark); text-wrap: pretty; }
.ponte .botao { margin-top: 30px; }
.ponte .nota-ponte { margin-top: 14px; font-size: 14px; color: var(--faint-dark); }
.ponte .assinatura { margin: 20px 0 0; font-family: var(--serif); font-style: italic; font-size: 28px; line-height: 1.2; color: var(--white); }
.tab-topo .sec-titulo { margin: 0; }

/* Celular: as tabelas de baixo viram cartões; cada número com o seu rótulo. */
@media (max-width: 899px) {
  .tabela-simples { box-shadow: none; background: none; }
  .tabela-simples thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tabela-simples, .tabela-simples tbody, .tabela-simples tfoot { display: block; }
  .tabela-simples tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 14px; margin-bottom: 8px; padding: 12px 14px; border-radius: 10px; background: var(--white); border: 1px solid var(--line-light); }
  .tabela-simples th, .tabela-simples td { padding: 0; border: 0 !important; text-align: left !important; white-space: normal; }
  .tabela-simples tbody th { grid-column: 1 / -1; font-size: 16px; min-width: 0; }
  .tabela-simples td[data-rot]::before { content: attr(data-rot); display: block; font-size: 11px; font-weight: 700; color: var(--muted-light); line-height: 1.25; }
  .tabela-simples td.destaque { font-weight: 700; }
  .tabela-simples tfoot tr { border: 1.5px solid var(--navy); }
  .tabela-simples tfoot th, .tabela-simples tfoot td { grid-column: auto; }
  .secao .tabela-rolo { overflow: visible; }
}
.recomecar { text-align: center; margin: 28px 0 8px; }

.rodape { padding: 28px 20px 36px; text-align: center; font-size: 13px; line-height: 1.6; color: var(--muted-light); border-top: 1px solid var(--line-light); }
.rodape p { margin: 0; }
.rodape p + p { margin-top: 4px; }
.sem-js { padding: 20px; text-align: center; font-weight: 700; }

/* Raiz: seletor de idioma */
.idiomas { min-height: calc(100vh - 66px); }
.idiomas h1 { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; max-width: 20ch; }
.idiomas .lede { margin-top: 18px; }
.idiomas-botoes { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.botao-claro { background: var(--white); }
.botao-claro:hover { background: rgba(255, 255, 255, 0.86); }

/* ---------- Tablet e desktop ---------- */
@media (min-width: 900px) {
  .marca { padding: 14px max(32px, calc((100% - 1200px) / 2 + 32px)); }
  .logo img { width: 190px; }
  .faixa { padding: 72px 32px 64px; }
  .entrada > .lousa { padding-bottom: 104px; }
  .tese { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; align-items: end; }
  .tese h1 { font-size: 50px; }
  .lede { font-size: 18px; }
  .mesa { padding: 0 32px 72px; margin-top: -88px; }
  .porta { padding: 32px 32px 30px; }
  .porta-topo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 32px; align-items: end; }
  .porta-topo .atalhos { grid-row: 1 / 3; grid-column: 2; margin: 0; }

  .grade { --c: minmax(0, 2.3fr) minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, .95fr) minmax(0, 1fr) 40px; }
  .com-linhas .grade { --c: minmax(0, 2.1fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, .95fr) minmax(0, 1.1fr) 40px; }
  .com-min .grade { --c: minmax(0, 2.1fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, .95fr) minmax(0, .95fr) 40px; }
  .com-linhas.com-min .grade { --c: minmax(0, 1.8fr) minmax(0, .95fr) minmax(0, 1.1fr) minmax(0, .85fr) minmax(0, .9fr) minmax(0, 1fr) minmax(0, .9fr) 40px; }
  .grade-cabeca, .prod { display: grid; grid-template-columns: var(--c); gap: 8px; align-items: end; }
  .grade-cabeca { padding: 0 0 2px; font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--muted-light); }
  .grade-cabeca span { padding: 0 2px; }
  .grade-cabeca b { color: var(--navy); font-weight: 700; }
  .grade-cabeca span:nth-child(n+2):not(:last-child) { text-align: right; }
  .com-linhas .col-linha { display: block; text-align: left !important; }
  .com-min .col-min { display: block; }
  .linhas-prod { gap: 6px; }
  .prod { padding: 0; border: 0; border-radius: 0; align-items: center; }
  .cel-nome { grid-column: auto; padding-right: 0; }
  .rot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tirar { position: static; }
  .proprios { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .proprios .ajuda { grid-column: 1 / -1; }

  .res-topo { padding: 52px 32px 32px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "h a" "l a"; gap: 18px 56px; align-items: start; }
  .res-topo .manchete { grid-area: h; font-size: 48px; }
  .res-topo .res-leitura { grid-area: l; }
  .res-topo .acoes { grid-area: a; margin-top: 6px; grid-template-columns: minmax(0, 1fr); }
  .res-topo .acao { justify-content: flex-start; padding: 9px 16px; font-size: 15px; }
  .acao .longo { display: inline; }
  .acao .curto { display: none; }
  .leitura { font-size: 18px; margin-top: 0; }
  .visitante { padding: 14px 32px; }
  .visitante .longo { display: inline; }
  .faixa-sec { padding: 64px 32px 8px; }
  .sec-titulo { font-size: 32px; }
  .ponte .faixa { padding: 88px 32px 96px; }
  .ponte h2 { font-size: 40px; }
  .ponte { margin-top: 72px; }
}
@media (max-width: 899px) {
  .visitante .longo { display: none; }
  .visitante .curto { display: inline; }
  .visitante { white-space: nowrap; }
}

/* Desktop largo: a planilha de verdade e o corte fixo ao lado. */
@media (min-width: 1180px) {
  .dobra { grid-template-columns: minmax(0, 7fr) minmax(320px, 3fr); gap: 28px; padding: 0 32px; align-items: start; }
  .col-tabela { padding: 0; }
  .tab-topo { padding: 0 0 18px; }
  /* Larguras fixas para os números; o nome do produto fica com o resto. */
  .col-tabela .tabela { table-layout: fixed; }
  .col-tabela .tabela thead .t-pos { width: 46px; }
  .col-tabela .tabela thead .t-margem { width: 96px; }
  .col-tabela .tabela thead .t-mov { width: 100px; }
  .col-tabela .tabela thead .t-un { width: 108px; }
  .col-tabela .tabela thead .t-mes { width: 128px; }
  .col-tabela .tabela thead .t-corte { width: 112px; }
  .col-tabela .tabela td.t-corte { padding-right: 8px; padding-left: 8px; }
  .col-tabela .tabela thead th { white-space: normal; }
  .col-corte { margin: 0; position: sticky; top: 16px; padding: 26px 24px 26px; }
  .col-tabela .tabela thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; display: table-header-group; }
  .col-tabela .tabela tbody { display: table-row-group; }
  .col-tabela .tabela tr { display: table-row; padding: 0; border: 0; background: none; border-radius: 0; }
  .col-tabela .tabela th, .col-tabela .tabela td { display: table-cell; padding: 13px 10px; border-bottom: 1px solid var(--line-light); vertical-align: middle; }
  .col-tabela .tabela tbody tr { background: var(--white); }
  .col-tabela .tabela thead th { padding-top: 12px; padding-bottom: 12px; font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--muted-light); text-align: right; vertical-align: bottom; border-bottom: 1.5px solid var(--navy); }
  .col-tabela .tabela thead .t-nome { text-align: left; }
  .col-tabela .t-pos { padding-left: 14px !important; }
  .col-tabela .t-margem, .col-tabela .t-un, .col-tabela .t-mes { text-align: right; }
  .col-tabela .t-corte { text-align: right; }
  .col-tabela .t-un { display: table-cell; }
  /* As duas colunas novas: uma faixa de lousa que atravessa a planilha. */
  .col-tabela .lousa-col { background: var(--navy); background-image: var(--pontos); background-size: 32px 32px; color: var(--white); border-bottom-color: var(--line-dark) !important; }
  .col-tabela .tabela thead .lousa-col { color: var(--white); border-bottom-color: var(--white) !important; }
  .col-tabela .tabela thead .t-un { border-top-left-radius: 12px; }
  .col-tabela .tabela thead .t-mes { border-top-right-radius: 12px; }
  .col-tabela .tabela tbody tr:last-child .t-un { border-bottom-left-radius: 12px; }
  .col-tabela .tabela tbody tr:last-child .t-mes { border-bottom-right-radius: 12px; }
  .col-tabela .tabela tbody tr:last-child > * { border-bottom: 0; }
  .col-tabela .t-mes { padding: 13px 16px 13px 10px !important; border-radius: 0; }
  .col-tabela .t-un { padding-left: 16px !important; }
  .rot-m { display: none; }
  .col-tabela .tabela tbody tr:first-child > :not(.lousa-col) { border-top: 0; }
  .col-tabela .tabela tbody > tr > :first-child { border-left: 1px solid var(--line-light); }
  .col-tabela .tabela tbody > tr > :last-child { border-right: 1px solid var(--line-light); }
  tr.cortado .t-mes, tr.cortado .t-un { box-shadow: none; background: var(--navy); background-image: var(--pontos); background-size: 32px 32px; color: rgba(255, 255, 255, 0.45); }
  .marca-txt { font-size: 12px; }
  .col-corte { order: 0; }
  .conta { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--muted-dark); }
  .conta-m, .barrinha { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .passo.entrando, .manchete .num::after, .pulso span, .seg { animation: none; }
  .seg, .seg.fantasma, .barrinha { transition: none; }
  .margem-num, .mov, .pos { transition: none; }
}

/* ---------- Impressão: a análise numa folha A4 ---------- */
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 10.5pt; }
  .marca { padding: 0 0 8px; border: 0; }
  .marca-nome { color: #000321; }
  .entrada, .acoes, .recomecar, .visitante, .ordem, .t-corte, .ponte .botao, .ponte .nota-ponte, .pular, .rodape, .corte-nada, .barrinha, .conta-m { display: none !important; }
  .so-impresso { display: block; }
  .res-topo { padding: 4mm 0; display: block; }
  .manchete { font-size: 20pt; max-width: none; }
  .manchete .num::after { animation: none; }
  .dobra { display: block; padding: 0; }
  .col-tabela .tabela thead { position: static; width: auto; height: auto; clip: auto; display: table-header-group; }
  .col-tabela .tabela tbody { display: table-row-group; }
  .col-tabela .tabela tr { display: table-row; border: 0; padding: 0; }
  .col-tabela .tabela th, .col-tabela .tabela td { display: table-cell; padding: 4px 6px; border-bottom: 1px solid rgba(0, 3, 33, .15); text-align: right; }
  .col-tabela .t-nome { text-align: left !important; }
  .col-tabela .lousa-col, .col-tabela .t-mes { background: #EEF0F6 !important; color: #000321 !important; }
  .rot-m { display: none; }
  .col-corte { position: static; margin: 6mm 0 0; padding: 4mm; border: 1px solid rgba(0, 3, 33, .25); background: #fff !important; color: #000321; break-inside: avoid; }
  .col-corte .col-titulo, .corte-frase strong, .corte-frase b, .lucro-depois, .lucro-queda, .barra-leg strong { color: #000321; }
  .corte-frase, .corte-nota, .barra-leg, .lucro-rot, .lucro-antes, .fixo-linha span { color: rgba(0, 3, 33, .7); }
  .trilho { background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 3, 33, .3); }
  .seg { background: #000321; box-shadow: inset -1px 0 0 #fff; }
  .seg.fora { background: repeating-linear-gradient(135deg, rgba(0, 3, 33, .2) 0 2px, transparent 2px 7px); box-shadow: inset 0 0 0 1px rgba(0, 3, 33, .5); }
  .fixo-linha { background: #000321; }
  .lucro-par { border-color: rgba(0, 3, 33, .25); }
  .secao { break-inside: avoid; }
  .faixa-sec { padding: 6mm 0 0; }
  .ponte { background: #fff !important; color: #000321; margin: 0; }
  .ponte .faixa { padding: 6mm 0 0; }
  .ponte p { color: rgba(0, 3, 33, .7); }
  a { text-decoration: none; }
}
