/* Desafios de Lógica · Nunn&Sander
   Tokens do handoff (tokens.css). Tema via data-tema no <html>,
   densidade via data-dispositivo e data-nivel. */

/* ================================ TOKENS ================================ */

:root, [data-tema="claro"] {
  --papel: #F4F1EB;
  --papel-2: #EBE6DC;
  --cartao: #FDFAF5;
  --tinta: #0E0E0C;
  --tinta-2: #4A4842;
  --tinta-3: #8A867D;
  --linha: rgba(14, 14, 12, .14);
  --linha-forte: #2E2D29;
  --acento: #7A5614;
  --acento-suave: #EAD9AE;
  --ok: #1E3A5F;
  --ok-suave: #DCE5EF;
  --erro: #861D22;
  --erro-suave: #F2DCDC;
  --mira: #F1E8D3;
  --veu: rgba(244, 241, 235, .88);
  --sombra-rgb: 14, 14, 12;
  color-scheme: light;
}
[data-tema="escuro"] {
  --papel: #121210;
  --papel-2: #0A0A09;
  --cartao: #1C1B18;
  --tinta: #F4F1EB;
  --tinta-2: #BAB6AD;
  --tinta-3: #837F77;
  --linha: rgba(244, 241, 235, .13);
  --linha-forte: #9C988F;
  --acento: #D2A33F;
  --acento-suave: #3B3120;
  --ok: #A7BFD6;
  --ok-suave: #1B2A3B;
  --erro: #E58C84;
  --erro-suave: #3D1B1C;
  --mira: #27231A;
  --veu: rgba(10, 10, 9, .86);
  --sombra-rgb: 0, 0, 0;
  color-scheme: dark;
}
:root {
  --f-titulo: "Playfair Display", Georgia, serif;
  --f-texto: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Chivo Mono", ui-monospace, Menlo, monospace;
  --casa: 32px;
  --raio: 2px;
  --rotulo-cat: 24px;
  --rotulo-item: 96px;
  --rotulo-col: 88px;
  --teto-item: 150px;
  --teto-col: 150px;
  --curva: cubic-bezier(0.16, 1, 0.3, 1);
}
[data-dispositivo="celular"] { --casa: 30px; --rotulo-cat: 22px; --rotulo-item: 70px; --rotulo-col: 76px; --teto-item: 104px; --teto-col: 120px; }
[data-dispositivo="celular"] [data-zoom="grande"] { --casa: 38px; --rotulo-col: 84px; }
[data-dispositivo="celular"][data-nivel="facil"] { --casa: 34px; --rotulo-item: 88px; }
[data-dispositivo="celular"][data-nivel="facil"] [data-zoom="grande"] { --casa: 38px; }
[data-dispositivo="desktop"][data-nivel="facil"] { --casa: 40px; }
[data-dispositivo="desktop"][data-nivel="medio"] { --casa: 34px; }

/* ================================ BASE ================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--papel); }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--f-texto);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }

@keyframes dl-corre { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes dl-sobe { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes dl-traco { from { stroke-dashoffset: 280; } to { stroke-dashoffset: 0; } }
@keyframes dl-some { from { opacity: 0; } to { opacity: 1; } }

/* ---------- peças de texto ---------- */

.marca {
  font-weight: 600; font-size: 19px; letter-spacing: -0.01em;
  text-transform: uppercase; line-height: 1; white-space: nowrap;
}
.marca em, .titulo em, .carregando-tit em {
  font-family: var(--f-titulo); font-style: italic; font-weight: 700;
  text-transform: none; color: var(--acento); letter-spacing: 0;
}
.marca em { font-size: 1.3em; }
.marca-14 { font-size: 14px; margin-right: auto; }

.eyebrow, .eyebrow-10 {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--tinta-2);
}
.eyebrow-10 { letter-spacing: .14em; }
.ac { color: var(--acento) !important; }
.tinta { color: var(--tinta) !important; }
.mono-11 { font-family: var(--f-mono); font-size: 11px; color: var(--tinta-2); }

.titulo {
  font-family: var(--f-texto); font-weight: 500; text-transform: uppercase;
  letter-spacing: -0.02em; color: var(--tinta);
}
.titulo em { font-size: 1.22em; }
.titulo-34 { font-size: 34px; line-height: 1.08; margin: 28px 0 14px; }
.titulo-34 em { line-height: .8; }
.titulo-18 { font-size: 18px; line-height: 1.1; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titulo-18 em { font-size: 1.2em; }
.titulo-26 { font-size: 26px; line-height: 1.08; margin: 0 0 14px; }

.sec-cab {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--linha-forte); padding-bottom: 10px;
}
.sec-tit { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; line-height: 1.6; }

/* ---------- botões ---------- */

.btn-pri {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--tinta); border-radius: var(--raio);
  background: var(--tinta); color: var(--papel);
  font-family: var(--f-texto); font-size: 12px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; line-height: 1;
  cursor: pointer; white-space: nowrap;
  transition: background 250ms, border-color 250ms, letter-spacing 250ms;
}
.btn-pri:hover { background: var(--acento); border-color: var(--acento); letter-spacing: .16em; }
.btn-pri-36 { height: 36px; padding: 0 16px; }
.btn-pri-40 { height: 40px; padding: 0 18px; }
.btn-pri-44 { width: 100%; height: 44px; gap: 6px; letter-spacing: .1em; border: 0; }
.btn-pri-44:hover { letter-spacing: .1em; }
.btn-pri-46 { height: 46px; flex: 1; gap: 10px; padding: 0 20px; font-size: 13px; }
.btn-pri-52 { height: 52px; gap: 10px; font-size: 13px; width: 100%; }

.btn-sec {
  height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  border: 1px solid var(--linha); border-radius: var(--raio);
  background: var(--cartao); color: var(--tinta); font-size: 14px; cursor: pointer;
  transition: border-color 150ms;
}
.btn-sec:hover { border-color: var(--linha-forte); }
.btn-ter {
  height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  border: 1px solid var(--linha-forte); border-radius: var(--raio);
  background: transparent; color: var(--tinta); font-size: 14px; cursor: pointer;
  transition: background 150ms;
}
.btn-ter:hover { background: var(--mira); }
.btn-out {
  height: 36px; padding: 0 14px;
  border: 1px solid var(--linha-forte); border-radius: var(--raio);
  background: transparent; color: var(--tinta);
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
}
.btn-out:hover { background: var(--mira); }
.btn-out-48 { height: 48px; padding: 0 16px; }
.btn-link {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0;
  border: 0; background: transparent; color: var(--tinta); font-size: 14px; cursor: pointer;
  transition: color 150ms;
}
.btn-link:hover { color: var(--acento); }
.btn-sub {
  border: 0; background: transparent; padding: 0; height: 36px;
  color: var(--tinta); font-size: 14px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--linha-forte);
}
.btn-sub:hover { text-decoration-color: var(--acento); }
.btn-44, .btn-40 {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--tinta); cursor: pointer; padding: 0;
}
.btn-40 { width: 40px; height: 40px; }
.btn-tema {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--linha); border-radius: var(--raio);
  background: transparent; color: var(--tinta); cursor: pointer;
}
.btn-tema:hover { border-color: var(--linha-forte); }
.btn-imprimir {
  height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  border: 1px solid var(--linha); border-radius: var(--raio);
  background: transparent; color: var(--tinta); font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: border-color 150ms;
}
.btn-imprimir:hover { border-color: var(--linha-forte); }

/* segmentado de níveis */
.seg { display: flex; border: 1px solid var(--linha-forte); border-radius: var(--raio); overflow: hidden; }
.seg button {
  height: 34px; padding: 0 13px; border: 0; border-right: 1px solid var(--linha);
  font-size: 13px; cursor: pointer; background: transparent; color: var(--tinta); font-weight: 400;
}
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--tinta); color: var(--papel); font-weight: 600; }
.seg button:not([aria-pressed="true"]):hover { background: var(--mira); }
.seg button:focus-visible { outline-offset: -3px; }
.seg-44 button { height: 44px; padding: 0 14px; font-size: 14px; }
.seg-grande { display: grid; grid-template-columns: repeat(4, 1fr); }
.seg-grande button { height: 48px; font-size: 14px; border-right: 0; box-shadow: inset -1px 0 0 var(--linha); padding: 0; }

/* chave (switch) */
.chave {
  margin-left: auto; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 4px;
  border: 0; background: transparent; color: var(--tinta); font-size: 14px; cursor: pointer;
}
.sw {
  width: 34px; height: 20px; flex: none; border-radius: 999px; border: 1px solid var(--linha-forte);
  position: relative; display: block; background: transparent; transition: background 250ms;
}
.sw-k {
  position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 999px;
  background: var(--tinta-2); transition: left 250ms var(--curva), background 250ms;
}
[aria-checked="true"] .sw { background: var(--tinta); }
[aria-checked="true"] .sw-k { left: 16px; background: var(--papel); }
.sw-grande { width: 40px; height: 24px; }
.sw-grande .sw-k { top: 3px; left: 3px; width: 16px; height: 16px; }
[aria-checked="true"] .sw-grande .sw-k { left: 19px; }

.pill {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--acento); border: 1px solid var(--acento); border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.relogio { display: flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.relogio-15 { margin-left: auto; font-size: 15px; }
.relogio-14 { gap: 5px; padding: 0 8px; font-size: 14px; }

/* ================================ GRADE ================================ */

.grade-rolagem { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.grade {
  display: inline-flex; flex-direction: column; vertical-align: top;
  font-family: var(--f-texto); color: var(--tinta); background: var(--papel);
  user-select: none; -webkit-user-select: none;
  --larg-item: min(max(var(--rotulo-item), var(--m-item, 0px)), var(--teto-item));
  --alt-col: min(max(var(--rotulo-col), var(--m-col, 0px)), var(--teto-col));
}
.g-cab { display: flex; position: sticky; top: 0; z-index: 3; background: var(--papel); }
.g-canto { flex: none; width: calc(var(--rotulo-cat) + var(--larg-item)); position: sticky; left: 0; z-index: 4; background: var(--papel); }
.g-cab-blocos { display: flex; border-left: 2px solid var(--linha-forte); border-bottom: 2px solid var(--linha-forte); }
.g-cab-bloco { display: flex; flex-direction: column; border-right: 2px solid var(--linha-forte); border-top: 2px solid var(--linha-forte); }
.g-cat {
  height: 26px; display: flex; align-items: center; padding: 0 6px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--tinta-2); border-bottom: 1px solid var(--linha); white-space: nowrap; overflow: hidden;
}
.g-itens-col { display: flex; }
.rot-col {
  width: var(--casa); height: var(--alt-col); flex: none;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px;
  border-right: 1px solid var(--linha); overflow: hidden;
}
.rot-col:last-child { border-right: 0; }
.rot-col span {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 12.5px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-height: calc(var(--alt-col) - 12px);
}
.g-faixa { display: flex; }
.g-faixa-rot {
  flex: none; display: flex; position: sticky; left: 0; z-index: 2;
  background: var(--papel); border-bottom: 2px solid var(--linha-forte);
}
.g-cat-v {
  width: var(--rotulo-cat); display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--linha); overflow: hidden;
}
.g-cat-v span {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--tinta-2); white-space: nowrap;
}
.g-itens-lin { width: var(--larg-item); display: flex; flex-direction: column; }
.rot-lin {
  height: var(--casa); display: flex; align-items: center; justify-content: flex-end;
  padding: 0 10px 0 4px; font-size: 13px; white-space: nowrap; overflow: hidden;
  border-bottom: 1px solid var(--linha);
}
.rot-lin:last-child { border-bottom: 0; }
.rot-lin span { overflow: hidden; text-overflow: ellipsis; }
.g-blocos { display: flex; border-left: 2px solid var(--linha-forte); }
.g-bloco { display: flex; flex-direction: column; border-right: 2px solid var(--linha-forte); border-bottom: 2px solid var(--linha-forte); }
.g-hachura {
  width: calc(var(--casa) * var(--n)); height: calc(var(--casa) * var(--n));
  background-color: var(--papel-2);
  background-image: repeating-linear-gradient(-45deg, var(--linha) 0 1px, transparent 1px 8px);
}
.g-linha { display: flex; }

/* rótulos sob mira ou citados na dica */
.rot-col, .rot-lin { transition: background 120ms; }
.rot-col.is-mira, .rot-lin.is-mira { background: var(--mira); }
.rot-col.is-realce, .rot-lin.is-realce { background: var(--acento-suave); }
.rot-col.is-mira span, .rot-lin.is-mira span,
.rot-col.is-realce span, .rot-lin.is-realce span { font-weight: 600; color: var(--acento); }

/* casa */
.casa {
  width: var(--casa); height: var(--casa); flex: none;
  padding: 0; margin: 0; border: 0; border-radius: 0; appearance: none; -webkit-appearance: none;
  display: grid; place-items: center; cursor: pointer;
  border-right: 1px solid var(--linha); border-bottom: 1px solid var(--linha);
  background: var(--cartao); color: var(--tinta);
  transition: background 160ms var(--curva), box-shadow 160ms var(--curva);
}
.casa:last-child { border-right: 0; }
.g-linha:last-child .casa, .b-linha:last-child .casa { border-bottom: 0; }
.casa:focus-visible { outline: 2px solid var(--acento); outline-offset: -3px; }
.casa svg { display: block; }
.casa .s-x { width: 54%; height: 54%; }
.casa .s-ax { width: 40%; height: 40%; }
.casa .s-o { width: 58%; height: 58%; }
.casa .s-rev { width: 68%; height: 68%; }
.casa.is-x { color: var(--tinta-2); }
.casa.is-ax { color: var(--tinta-3); }
.casa.is-mira { background: var(--mira); }
.casa.is-o { background: var(--acento-suave); }
.casa.is-aqui { box-shadow: inset 0 0 0 2px var(--acento); }
.casa.is-erro {
  background: linear-gradient(135deg, var(--erro) 0 7px, transparent 7px), var(--erro-suave);
  box-shadow: inset 0 0 0 2px var(--erro); color: var(--erro);
}
.casa.is-rev {
  background: linear-gradient(225deg, var(--ok) 0 7px, transparent 7px), var(--ok-suave);
  box-shadow: inset 0 0 0 2px var(--ok); color: var(--ok); cursor: default;
}
@media (hover: hover) {
  .casa:hover:not(.is-o):not(.is-erro):not(.is-rev) { background: var(--mira); }
}

/* ============================== COMPUTADOR ============================== */

.desk { min-height: 100vh; display: flex; flex-direction: column; }
.d-topo {
  min-height: 76px; flex: none; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px 24px; padding: 0 40px; border-bottom: 1px solid var(--linha-forte);
}
.d-marca { display: flex; align-items: baseline; gap: 16px; }
.d-topo-dir { display: flex; align-items: center; gap: 12px; }
.proximo {
  display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px;
  border: 1px solid var(--linha); border-radius: var(--raio); background: var(--papel-2);
}

.d-corpo { flex: 1; display: grid; grid-template-columns: 440px minmax(0, 1fr); }
.ficha { border-right: 1px solid var(--linha-forte); padding: 32px 40px 40px; min-width: 0; }
.ficha-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cod { font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; color: var(--tinta-2); }
.intro { font-size: 16px; line-height: 1.65; color: var(--tinta-2); margin: 0 0 30px; text-wrap: pretty; }

.d-dicas { list-style: none; margin: 0; padding: 0; }
.d-dica {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) 18px; gap: 6px;
  width: 100%; text-align: left; padding: 11px 4px 11px 0;
  border: 0; border-bottom: 1px solid var(--linha); background: transparent;
  color: var(--tinta); cursor: pointer; transition: background 150ms;
}
.d-dica:hover { background: var(--mira); }
.d-dica-n { font-family: var(--f-mono); font-size: 12px; padding-top: 4px; color: var(--tinta-2); line-height: 1.5; }
.dica-txt {
  font-size: 16px; line-height: 1.5; text-wrap: pretty;
  text-decoration-color: var(--acento); text-decoration-thickness: 1.5px;
}
.riscada .dica-txt { color: var(--tinta-3); text-decoration-line: line-through; }
.d-dica-ok { padding-top: 5px; color: var(--acento); opacity: 0; }
.d-dica.riscada .d-dica-ok { opacity: 1; }
.nota { margin: 12px 0 0; font-family: var(--f-mono); font-size: 11px; color: var(--tinta-2); }

.d-main { padding: 24px 40px 28px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.d-barra { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-barra-sep { width: 1px; height: 24px; background: var(--linha); margin: 0 6px; }
.d-mesa { display: flex; gap: 40px; align-items: flex-start; flex-wrap: wrap; }
.d-grade-col { display: flex; flex-direction: column; gap: 14px; max-width: 100%; min-width: 0; }
.legenda { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--tinta-2); line-height: 1.4; }
.leg-i { display: flex; align-items: center; gap: 6px; }
.leg-vazio { width: 18px; height: 18px; border: 1px solid var(--linha-forte); background: var(--cartao); }
.leg-o { width: 18px; height: 18px; display: grid; place-items: center; background: var(--acento-suave); }
.leg-tec { margin-left: 6px; }

.d-quadro { flex: 1; min-width: 250px; max-width: 330px; }
.quadro { display: grid; }
.quadro .q-h {
  padding: 10px 6px 6px 0; font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--tinta-2); border-bottom: 1px solid var(--linha);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quadro .q-c {
  padding: 9px 6px 9px 0; font-size: 14px; line-height: 1.4; border-bottom: 1px solid var(--linha);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quadro .q-nome { font-weight: 600; }
.quadro .q-vazio { color: var(--tinta-3); }
.quadro-nota { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--tinta-2); }

.d-rodape {
  margin-top: auto; padding-top: 16px; border-top: 1px solid var(--linha);
  display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; font-size: 14px;
}
.d-codigo { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.d-codigo input {
  width: 118px; height: 36px; padding: 0 10px;
  border: 1px solid var(--linha-forte); border-radius: var(--raio);
  background: var(--cartao); color: var(--tinta);
  font-family: var(--f-mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
}
.d-codigo input::placeholder, .f-codigo input::placeholder { color: var(--tinta-3); text-transform: none; }

/* carregando */
.d-carregando { flex: 1; display: grid; place-items: center; padding: 80px 40px; }
.carregando-caixa { width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px; }
.carregando-tit { margin: 0; font-weight: 500; font-size: 28px; line-height: 1.12; letter-spacing: -0.02em; text-transform: uppercase; }
.carregando-tit em { font-size: 1.22em; }
.carregando-tit-26 { font-size: 26px; line-height: 1.14; }
.carregando-txt { margin: 0; font-size: 14px; line-height: 1.6; color: var(--tinta-2); }
.carregando-txt-15 { font-size: 15px; }
.barra-corre { height: 2px; background: var(--linha); overflow: hidden; position: relative; }
.barra-corre span {
  position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: var(--acento);
  animation: dl-corre 1400ms cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

/* larguras intermediárias */
@media (max-width: 1180px) {
  .d-topo { padding: 12px 28px; }
  .d-corpo { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
  .ficha { padding: 28px 28px 32px; }
  .d-main { padding: 24px 28px 28px; }
  .titulo-34 { font-size: 30px; }
}
@media (max-width: 960px) {
  .por { display: none; }
  .btn-imprimir { padding: 0 11px; font-size: 0; gap: 4px; }
  .btn-cont { font-size: 10px; }
  .d-codigo { margin-left: 0; }
}

/* =============================== CELULAR =============================== */

.cel { display: none; }

@media screen and (max-width: 760px) {
  .desk { display: none; }
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
  body { line-height: 1.5; }
  .cel {
    position: relative; height: 100vh; height: 100dvh;
    display: flex; flex-direction: column; overflow: hidden;
  }
}

.c-topo {
  height: 52px; flex: none; display: flex; align-items: center; gap: 4px;
  padding: 0 4px 0 16px; border-bottom: 1px solid var(--linha-forte);
  padding-top: env(safe-area-inset-top);
  height: calc(52px + env(safe-area-inset-top));
}
.c-jogo { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.c-faixa {
  flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 12px 10px 16px; border: 0; border-bottom: 1px solid var(--linha);
  background: transparent; text-align: left; color: var(--tinta); cursor: pointer; width: 100%;
}
.c-faixa-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.c-pill {
  display: flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px;
  border: 1px solid var(--linha); border-radius: 999px; font-size: 12px; color: var(--tinta-2);
}

.c-modo { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cel[data-modo="bloco"] .c-modo-escada, .cel[data-modo="escada"] .c-modo-bloco { display: none; }

.btn-modo {
  height: 36px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 10px;
  border: 1px solid var(--linha-forte); border-radius: var(--raio);
  background: transparent; color: var(--tinta); font-size: 12px; cursor: pointer;
}
.c-barra-bloco {
  flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) 44px 44px; align-items: center;
  height: 48px; border-bottom: 1px solid var(--linha); padding: 0 4px 0 8px; gap: 6px;
}
.c-bloco-tit { display: flex; flex-direction: column; align-items: center; line-height: 1.15; min-width: 0; }
.c-bloco-nome {
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.c-bloco-nome em { font-family: var(--f-titulo); font-style: italic; font-weight: 700; text-transform: none; color: var(--acento); letter-spacing: 0; }

.c-area {
  flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column;
  justify-content: space-between; gap: 12px; padding: 12px 16px 10px; touch-action: pan-y;
  container-type: size;
}

/* bloco em foco */
.bloco { display: flex; flex-direction: column; width: 100%; max-width: 352px; align-self: center; user-select: none; -webkit-user-select: none; }
/* o bloco encolhe para caber com o mapa na altura disponível */
@container (min-height: 1px) {
  .bloco { max-width: min(352px, max(250px, calc(104px + 100cqh - var(--b-alt-col, 76px) - var(--mapa-alt) - 60px))); }
}
.b-cab { display: flex; align-items: flex-end; }
.b-lin-tit {
  width: 100px; flex: none; padding: 0 10px 6px 0; text-align: right;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--tinta-2);
  line-height: 1.3;
}
.b-col-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.b-col-tit { font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--tinta-2); padding-bottom: 4px; }
.b-cols { display: flex; padding: 0 2px; }
.bloco .rot-col {
  flex: 1; min-width: 0; width: auto; height: var(--b-alt-col, 76px); border-right: 0;
  padding: 0 0 6px; border-radius: var(--raio) var(--raio) 0 0;
}
.bloco .rot-col span { font-size: 14px; max-height: calc(var(--b-alt-col, 76px) - 8px); }
.b-corpo { display: flex; }
.b-lins { width: 100px; flex: none; display: flex; flex-direction: column; border-top: 2px solid transparent; border-bottom: 2px solid transparent; }
.bloco .rot-lin {
  flex: 1; height: auto; border-bottom: 0; white-space: normal;
  padding: 0 10px 0 4px; text-align: right; font-size: 14px; line-height: 1.2;
  border-radius: var(--raio) 0 0 var(--raio);
}
.bloco .rot-lin span { overflow: visible; }
.b-casas { flex: 1; min-width: 0; display: flex; flex-direction: column; border: 2px solid var(--linha-forte); background: var(--cartao); }
.b-linha { display: flex; }
.bloco .casa { flex: 1; min-width: 0; width: auto; height: auto; aspect-ratio: 1; }
.bloco .casa .s-x { width: 46%; height: 46%; }
.bloco .casa .s-x path { stroke-width: 2.1; }
.bloco .casa .s-ax { width: 32%; height: 32%; }
.bloco .casa .s-o { width: 50%; height: 50%; }
.bloco .casa .s-rev { width: 58%; height: 58%; }

/* mapa */
.c-mapa-linha { display: flex; align-items: flex-end; gap: 16px; padding-top: 10px; border-top: 1px solid var(--linha); }
.c-area { --mapa-b: 30px; --mapa-alt: calc(var(--mapa-l, 3) * (var(--mapa-b) + 3px) + 14px); }
.mapa { display: flex; flex-direction: column; gap: 3px; flex: none; }
.mapa-l { display: flex; gap: 3px; }
.mapa button {
  width: var(--mapa-b); height: var(--mapa-b); padding: 0; border-radius: var(--raio);
  display: grid; place-items: center; font-family: var(--f-mono); font-size: 9px; cursor: pointer;
  border: 1px solid var(--linha-forte); background: var(--cartao); color: var(--tinta);
}
.mapa button:disabled { border: 1px dashed var(--linha); background: transparent; cursor: default; }
.mapa button.is-feito { background: var(--acento-suave); }
.mapa button.is-citado { border: 2px solid var(--acento); }
.mapa button.is-atual { border: 2px solid var(--tinta); background: var(--tinta); color: var(--papel); }
.mapa-leg { display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.35; color: var(--tinta-2); }
.mapa-leg-i { display: flex; align-items: center; gap: 6px; }
@media screen and (max-height: 720px) {
  .c-area { --mapa-alt: -12px; padding-top: 8px; justify-content: center; }
  .c-mapa-linha { display: none; }
  .gaveta-dica { min-height: 64px; }
  .gaveta-txt > span { font-size: 16px; }
}
.ponto-ac { width: 8px; height: 8px; border-radius: 999px; background: var(--acento); flex: none; }

/* modo escada */
.c-barra-escada { flex: none; display: flex; align-items: center; height: 44px; border-bottom: 1px solid var(--linha); padding: 0 4px 0 8px; gap: 4px; }
.chips { display: flex; gap: 4px; flex: 1; min-width: 0; overflow: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  height: 30px; padding: 0 10px; flex: none; border-radius: 999px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
  border: 1px solid var(--linha); background: transparent; color: var(--tinta-2);
}
.chips button[aria-selected="true"] { border-color: var(--tinta); background: var(--tinta); color: var(--papel); }
.c-escada { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; background: var(--papel); padding-bottom: 12px; }
.btn-40[aria-pressed="true"] .zoom-mais { display: none; }

/* gaveta da dica */
.gaveta {
  flex: none; background: var(--cartao); border-top: 1px solid var(--linha-forte);
  box-shadow: 0 -10px 28px -18px rgba(var(--sombra-rgb), .4);
}
.gaveta-cab { display: flex; align-items: center; gap: 10px; padding: 10px 4px 0 16px; }
.ticks { display: flex; gap: 3px; flex: 1; }
.ticks span { flex: 1; max-width: 22px; height: 3px; border-radius: 2px; background: var(--linha); }
.ticks span.is-riscada { background: var(--tinta-3); }
.ticks span.is-atual { background: var(--acento); }
.btn-todas {
  height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 12px;
  border: 0; background: transparent; color: var(--tinta);
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
}
.btn-todas > span { font-family: var(--f-mono); font-weight: 400; color: var(--tinta-2); letter-spacing: .04em; }
.gaveta-dica { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: stretch; min-height: 78px; touch-action: pan-y; }
.gaveta-seta { border: 0; background: transparent; color: var(--tinta-2); display: grid; place-items: center; cursor: pointer; padding: 0; }
.gaveta-txt {
  width: 100%; min-width: 0; display: flex; align-items: center; text-align: left;
  border: 0; background: transparent; padding: 6px 2px 12px; cursor: pointer; color: var(--tinta);
}
.gaveta-txt > span {
  flex: 1; font-size: 17px; line-height: 1.42; text-wrap: pretty;
  text-decoration-color: var(--acento); text-decoration-thickness: 1.5px;
}
.gaveta-txt[aria-pressed="true"] > span { color: var(--tinta-3); text-decoration-line: line-through; }
.c-acoes {
  display: grid; grid-template-columns: 1fr 1fr 1.35fr 1fr 1fr; border-top: 1px solid var(--linha);
  height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
}
.c-acoes > button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: transparent; color: var(--tinta); font-size: 11px; line-height: 1.2; cursor: pointer; padding: 0;
}
.c-acoes-pri { display: grid; place-items: center; padding: 8px 4px; }

/* carregando no celular */
.c-carregando { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 0 28px 80px; }

/* folhas */
.folha-veu { position: fixed; inset: 0; z-index: 25; background: var(--veu); display: flex; flex-direction: column; justify-content: flex-end; }
.folha-fora { flex: 1; min-height: 120px; border: 0; background: transparent; cursor: default; }
.folha {
  max-height: 78%; display: flex; flex-direction: column; background: var(--cartao);
  border-top: 1px solid var(--linha-forte); padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -10px 28px -18px rgba(var(--sombra-rgb), .4);
  animation: dl-sobe 320ms var(--curva) both;
}
.folha-cab { height: 52px; flex: none; display: flex; align-items: center; padding: 0 4px 0 16px; border-bottom: 1px solid var(--linha); }
.folha-cab .mono-11 { margin-left: 10px; }
.folha-x { margin-left: auto; }
.folha-corpo { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.folha-corpo > [data-folha] { display: none; }
.folha-corpo > [data-folha].is-ativa { display: block; }
.folha-corpo > .f-mais.is-ativa { display: flex; }
.f-item > svg { flex: none; }
@media screen and (min-width: 761px) {
  .folha-veu:not(.folha-central) { display: none !important; }
  .folha-veu.folha-central { justify-content: center; align-items: center; padding: 24px; }
  .folha-central .folha-fora { position: absolute; inset: 0; min-height: 0; }
  .folha-central .folha {
    position: relative; width: min(620px, 100%); max-height: min(80vh, 760px);
    border: 1px solid var(--linha-forte); border-radius: var(--raio);
    box-shadow: 0 30px 80px -30px rgba(var(--sombra-rgb), .5); padding-bottom: 0;
  }
}
.folha-corpo > .f-concluidos.is-ativa { display: block; }
.f-concluidos { padding: 0 0 20px; }
.conc-resumo { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--linha); }
.conc-resumo > div { padding: 12px 16px; border-right: 1px solid var(--linha); }
.conc-resumo > div:last-child { border-right: 0; }
.conc-resumo dt { font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--tinta-2); }
.conc-resumo dd { margin: 2px 0 0; font-family: var(--f-mono); font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.conc-lista { list-style: none; margin: 0; padding: 0; }
.conc-i {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 16px; border: 0; border-bottom: 1px solid var(--linha); background: transparent;
  color: var(--tinta); text-align: left; cursor: pointer; transition: background 150ms;
}
.conc-i:hover { background: var(--mira); }
.conc-i.is-atual { background: var(--acento-suave); }
.conc-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.conc-tit { font-size: 16px; line-height: 1.15; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conc-tit em { font-size: 1.15em; }
.conc-meta { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .06em; color: var(--tinta-2); line-height: 1.4; }
.conc-meta b { font-weight: 500; color: var(--acento); }
.conc-num { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--f-mono); font-size: 15px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.conc-num small { font-size: 10.5px; color: var(--tinta-2); }
.conc-vazio { padding: 24px 16px; font-size: 15px; color: var(--tinta-2); line-height: 1.5; }
.conc-nota { margin: 14px 16px 0; font-size: 12.5px; line-height: 1.5; color: var(--tinta-2); }
.btn-cont {
  font-family: var(--f-mono); font-size: 11px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  display: inline-grid; place-items: center; background: var(--papel-2); border: 1px solid var(--linha); color: var(--tinta-2);
}

.f-lista { list-style: none; margin: 0; padding: 0 0 16px; }
.f-lista-i { display: grid; grid-template-columns: minmax(0, 1fr) 52px; border-bottom: 1px solid var(--linha); }
.f-lista-i.is-foco { background: var(--mira); }
.f-lista-ir {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px; text-align: left;
  padding: 12px 0 12px 16px; border: 0; background: transparent; color: var(--tinta); cursor: pointer;
}
.f-lista-ir .d-dica-n { padding-top: 3px; line-height: 1.45; }
.f-lista-ir .dica-txt { font-size: 16px; line-height: 1.45; }
.f-lista-chk { border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; }
.f-lista-chk > span {
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--raio);
  border: 1px solid var(--linha-forte); background: transparent; color: var(--papel);
}
.f-lista-chk > span svg { opacity: 0; }
.riscada .f-lista-chk > span { border-color: var(--acento); background: var(--acento); }
.riscada .f-lista-chk > span svg { opacity: 1; }

.f-quadro { padding: 4px 16px 24px; }
.quadro-15 .q-h { padding: 12px 6px 6px 0; border-bottom-color: var(--linha-forte); }
.quadro-15 .q-c { padding: 11px 6px 11px 0; font-size: 15px; }
.f-quadro .quadro-nota { margin-top: 12px; font-size: 14px; }
.f-historia { padding: 20px 16px 28px; }
.f-historia p { margin: 0; font-size: 17px; line-height: 1.65; color: var(--tinta-2); text-wrap: pretty; }
.f-mais { padding: 16px 16px 28px; flex-direction: column; gap: 16px; }
.f-mais-cab { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 8px; }
.f-mais-obs { font-size: 12px; color: var(--tinta-2); }
.f-mais-lista { display: flex; flex-direction: column; border-top: 1px solid var(--linha); }
.f-item {
  width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; text-align: left;
  border: 0; border-bottom: 1px solid var(--linha); background: transparent; color: var(--tinta);
  font-size: 15px; line-height: 1.35; cursor: pointer; padding: 6px 0;
}
.f-item-txt { flex: 1; }
.f-item-txt small { display: block; font-size: 12px; color: var(--tinta-2); }
.f-codigo { display: flex; gap: 8px; align-items: center; }
.f-codigo input {
  flex: 1; min-width: 0; height: 48px; padding: 0 12px;
  border: 1px solid var(--linha-forte); border-radius: var(--raio);
  background: var(--papel); color: var(--tinta); font-family: var(--f-mono); font-size: 15px; text-transform: uppercase;
}

/* ================================ VITÓRIA ================================ */

.vit-veu { position: fixed; inset: 0; z-index: 30; background: var(--veu); display: grid; place-items: center; padding: 16px; overflow: auto; }
.vit {
  width: min(600px, 100%); background: var(--cartao); border: 1px solid var(--linha-forte);
  border-radius: var(--raio); box-shadow: 0 30px 80px -30px rgba(var(--sombra-rgb), .5);
  animation: dl-sobe 700ms var(--curva) both;
}
.vit-topo { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: center; padding: 40px 44px 32px; }
.vit-carimbo { position: relative; width: 132px; height: 132px; }
.vit-carimbo svg { display: block; width: 100%; height: 100%; }
.vit-carimbo .c1 { animation: dl-traco 1100ms var(--curva) both; }
.vit-carimbo .c2 { animation: dl-some 600ms 500ms both; }
.vit-carimbo .c3 { animation: dl-traco 700ms 450ms var(--curva) both; }
.vit-tit { margin: 10px 0 0; font-size: 34px; line-height: 1.06; }
.vit-dl { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--linha-forte); border-bottom: 1px solid var(--linha); }
.vit-dl > div { padding: 18px 0 18px 24px; border-right: 1px solid var(--linha); }
.vit-dl > div:first-child { padding-left: 44px; }
.vit-dl > div:last-child { border-right: 0; }
.vit-dl dt { font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--tinta-2); }
.vit-dl dd { margin: 4px 0 0; }
.vit-num { font-family: var(--f-mono); font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.vit-nivel { font-size: 24px; line-height: 1.25; font-weight: 500; }
.vit-dim { font-family: var(--f-mono); font-size: 14px; color: var(--tinta-2); font-weight: 400; }
.vit-acoes { padding: 24px 44px 32px; display: flex; flex-direction: column; gap: 14px; }
.vit-txt { font-size: 15px; color: var(--tinta-2); }
.vit-linha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vit-links { display: flex; gap: 20px; font-size: 14px; }

@media screen and (max-width: 760px) {
  .vit-veu { padding: 0; background: var(--cartao); display: block; }
  .vit {
    width: 100%; min-height: 100%; border: 0; box-shadow: none; animation: none;
    display: flex; flex-direction: column; padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  }
  .vit-topo { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding: 0; margin-top: auto; }
  .vit-carimbo { width: 104px; height: 104px; }
  .vit-tit { font-size: 32px; line-height: 1.05; margin-top: 20px; }
  .vit-dl { margin-top: 20px; }
  .vit-dl > div, .vit-dl > div:first-child { padding: 14px 0 14px 14px; }
  .vit-dl > div:first-child { padding-left: 0; }
  .vit-num { font-size: 24px; }
  .vit-nivel { font-size: 19px; line-height: 1.3; }
  .vit-dim { display: none; }
  .vit-acoes { display: contents; }
  .vit-txt { font-size: 16px; margin-top: 20px; }
  .vit-linha { flex-direction: column; align-items: stretch; gap: 10px; margin-top: auto; padding-top: 28px; }
  .vit-links { margin-top: 10px; }
  .vit-linha .seg { display: grid; grid-template-columns: repeat(4, 1fr); }
  .vit-linha .seg button { height: 48px; border-right: 0; box-shadow: inset -1px 0 0 var(--linha); padding: 0; }
  .vit-linha .btn-pri-46 { height: 54px; flex: none; }
  .vit-links { justify-content: space-between; }
  .vit-links .btn-sub { height: 44px; }
  .so-desk { display: none; }
}

/* ================================ TOAST ================================ */

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: min(560px, calc(100% - 32px));
  padding: 14px 18px 14px 20px; background: var(--tinta); color: var(--papel);
  border-radius: var(--raio); box-shadow: 0 12px 32px -12px rgba(var(--sombra-rgb), .45);
  font-size: 15px; line-height: 1.45; animation: dl-sobe 320ms var(--curva) both;
}
.toast-ponto { width: 6px; height: 6px; border-radius: 999px; background: var(--acento-suave); flex: none; }
@media screen and (max-width: 760px) {
  .toast {
    left: 12px; right: 12px; transform: none; width: auto; max-width: none;
    bottom: calc(188px + env(safe-area-inset-bottom)); gap: 12px; padding: 13px 16px; line-height: 1.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================== IMPRESSÃO A4 ==============================
   Folha própria (#a4), montada pelo app.js e fora da tela.
   Tokens fixos do tema claro, fundo branco, hachura impressa. */

@page { size: A4; margin: 0; }

.a4 {
  position: absolute; left: -10000px; top: 0; width: 210mm; padding: 12mm 14mm 8mm;
  visibility: hidden; pointer-events: none;
  --pc: 28px; --pf: 12px; --pl: 90px; --ph: 84px;
  --p-tinta: #0E0E0C; --p-tinta-2: #4A4842; --p-linha: #B9B5AC; --p-forte: #2E2D29; --p-acento: #7A5614;
  background: #fff; color: var(--p-tinta);
  font-family: var(--f-texto); font-size: 12px; line-height: 1.4;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.a4 .titulo, .a4 .marca { color: var(--p-tinta); }
.a4 .titulo em, .a4 .marca em, .a4 .ac { color: var(--p-acento) !important; }
.a4 .eyebrow { font-size: 9px; color: var(--p-tinta-2); }
.a4-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--p-forte); padding-bottom: 8px; }
.a4 .marca { font-size: 15px; }
.a4-meta { display: block; margin-top: 10px; }
.a4-tit { font-size: 26px; line-height: 1.05; margin: 6px 0 6px; }
.a4-intro { margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; color: var(--p-tinta-2); }
.a4 .sec-cab { padding-bottom: 5px; border-bottom-color: var(--p-forte); }
.a4 .sec-tit { font-size: 10px; }
.a4-dicas { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 26px; }
.a4-dicas li {
  break-inside: avoid; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px;
  padding: 3px 0; border-bottom: 1px solid var(--p-linha); font-size: var(--pf); line-height: 1.36;
}
.a4-dicas .n { font-family: var(--f-mono); font-size: 10px; color: var(--p-tinta-2); padding-top: 1px; }
.a4-mesa { margin-top: 12px; }

/* grade impressa */
.pg { border-collapse: collapse; table-layout: fixed; font-family: var(--f-texto); color: var(--p-tinta); }
.pg th, .pg td { padding: 0; }
.pg-canto { border: 0; width: calc(22px + var(--pl)); }
.pg-cat {
  height: 22px; padding: 0 6px !important; text-align: left; font-weight: 400;
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--p-tinta-2);
  border: 1.5px solid var(--p-forte); border-bottom: 1px solid var(--p-linha);
}
.pg-col {
  width: var(--pc); height: var(--ph); vertical-align: bottom; font-weight: 400;
  border-left: 1px solid var(--p-linha); border-bottom: 1.5px solid var(--p-forte);
}
.pg-col span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 11.5px; line-height: 1; padding: 6px 0; }
.pg-catv {
  width: 22px; font-weight: 400; border-left: 0; border-bottom: 1.5px solid var(--p-forte); border-right: 1px solid var(--p-linha);
}
.pg-catv span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-family: var(--f-mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--p-tinta-2); }
.pg-lin {
  width: var(--pl); height: var(--pc); text-align: right; font-weight: 400; font-size: 12px; white-space: nowrap;
  padding: 0 8px 0 4px !important; border-bottom: 1px solid var(--p-linha); border-right: 1.5px solid var(--p-forte);
}
.pg-c { width: var(--pc); height: var(--pc); border: 1px solid var(--p-linha); background: #fff; }
.pg .pg-b { border-left: 1.5px solid var(--p-forte); }
.pg tr.pg-t > td, .pg tr.pg-t > th.pg-lin { border-top: 1.5px solid var(--p-forte); }
.pg td:last-child, .pg-col:last-child, .pg-cat:last-child { border-right: 1.5px solid var(--p-forte); }
.pg tbody tr:last-child > td, .pg tbody tr:last-child > th { border-bottom: 1.5px solid var(--p-forte); }
.pg-h {
  border: 1.5px solid var(--p-forte);
  background-color: #EFEBE3;
  background-image: repeating-linear-gradient(-45deg, #C9C4B9 0 1px, transparent 1px 8px);
}

/* quadro-resposta impresso */
.a4-quadro { margin-top: 12px; }
.pq { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 2px; }
.pq th, .pq td { text-align: left; border-bottom: 1px solid var(--p-linha); padding: 0 6px 0 0; }
.pq thead th {
  height: 24px; font-weight: 400; font-family: var(--f-mono); font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--p-tinta-2);
}
.pq tbody th, .pq tbody td { height: 25px; font-size: 12px; }
.pq tbody th { font-weight: 600; }
.pq tbody td { border-left: 1px solid var(--p-linha); }

.a4-rodape {
  display: flex; justify-content: space-between; gap: 16px; margin-top: 14px; padding-top: 8px;
  border-top: 1px solid var(--p-linha); font-family: var(--f-mono); font-size: 9px;
  letter-spacing: .08em; color: var(--p-tinta-2);
}
.a4-rodape b { font-weight: 500; color: var(--p-tinta); }
.a4-campo { display: inline-block; width: 90px; border-bottom: 1px solid var(--p-forte); margin-left: 6px; }

@media print {
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body > *:not(.a4) { display: none !important; }
  .a4 { position: static; left: auto; visibility: visible; max-height: 297mm; overflow: hidden; }
}
