/* Bloco a Bloco: a casa do Alexandre.
   Terra vermelha de Angola, cimento e areia. Sem fonte externa: a pilha de
   sistema carrega na hora em qualquer celular. */

:root {
  --fundo: #fbf7f0;
  --superficie: #ffffff;
  --superficie-2: #f4ede2;
  --texto: #2a2018;
  --texto-suave: #6b5c4e;
  --linha: #e6dccd;
  --terra: #b4532a;
  --terra-forte: #8f3d1b;
  --terra-suave: #f6e1d5;
  --sobre-terra: #ffffff;
  --anel: #8f3d1b;
  --ocre: #e2a12b;
  --ocre-suave: #fbeccd;
  --cimento: #8f8b83;
  --cimento-topo: #aaa69d;
  --vazio: #efe7da;
  --vazio-borda: #d9ccb9;
  --verde: #2e7a57;
  --sombra: 0 1px 2px rgba(60, 40, 20, 0.06), 0 8px 24px rgba(60, 40, 20, 0.07);
  --raio: 14px;
  --largura: 1120px;
  --fonte: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fundo: #17130f;
    --superficie: #221c17;
    --superficie-2: #2a231d;
    --texto: #f3ebe0;
    --texto-suave: #b9ab9b;
    --linha: #3a3129;
    --terra: #e0794a;
    --terra-forte: #f0956b;
    --terra-suave: #3b2419;
    --sobre-terra: #17130f;
    --anel: #f0b440;
    --ocre: #f0b440;
    --ocre-suave: #3a2c12;
    --cimento: #a7a298;
    --cimento-topo: #c4bfb4;
    --vazio: #2b241e;
    --vazio-borda: #4a3f34;
    --verde: #5cbf8f;
    --sombra: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --fundo: #17130f;
  --superficie: #221c17;
  --superficie-2: #2a231d;
  --texto: #f3ebe0;
  --texto-suave: #b9ab9b;
  --linha: #3a3129;
  --terra: #e0794a;
  --terra-forte: #f0956b;
  --terra-suave: #3b2419;
  --sobre-terra: #17130f;
  --anel: #f0b440;
  --ocre: #f0b440;
  --ocre-suave: #3a2c12;
  --cimento: #a7a298;
  --cimento-topo: #c4bfb4;
  --vazio: #2b241e;
  --vazio-borda: #4a3f34;
  --verde: #5cbf8f;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* O atributo hidden vence qualquer display de componente (.botao etc.). */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  /* ancora e foco param acima da barra de resumo grudada embaixo */
  scroll-padding-bottom: 200px;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

img,
svg,
video {
  max-width: 100%;
}

a {
  color: var(--terra-forte);
}

h1,
h2,
h3 {
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 1em;
}

.pular {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--texto);
  color: var(--fundo);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}

.pular:focus {
  left: 8px;
}

:focus-visible {
  outline: 3px solid var(--anel);
  outline-offset: 2px;
}

/* ---------- faixas ---------- */

.faixa-aviso {
  margin: 0;
  padding: 10px 16px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--ocre-suave);
  color: var(--texto);
  border-bottom: 1px solid var(--linha);
}

.faixa-preparacao {
  background: var(--terra-suave);
}

/* ---------- botoes ---------- */

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: 2px solid var(--terra);
  border-radius: 999px;
  background: var(--terra);
  color: var(--sobre-terra);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease;
}

.botao:hover {
  background: var(--terra-forte);
  border-color: var(--terra-forte);
}

.botao:active {
  transform: translateY(1px);
}

.botao[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.botao-contorno {
  background: transparent;
  color: var(--terra-forte);
}

.botao-contorno:hover {
  background: var(--terra-suave);
  color: var(--terra-forte);
}

.botao-texto {
  background: transparent;
  border-color: transparent;
  color: var(--texto-suave);
  padding-inline: 12px;
}

.botao-texto:hover {
  background: var(--superficie-2);
  border-color: transparent;
  color: var(--texto);
}

.botao-pequeno {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.95rem;
}

.botao-largo {
  width: 100%;
}

/* ---------- topo ---------- */

.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--largura);
  margin: 0 auto;
  padding: 14px 16px;
}

.marca {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--texto);
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  white-space: nowrap;
}

.marca-icone {
  width: 30px;
  height: 30px;
  fill: var(--terra);
}

.topo-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topo-nav a:not(.botao) {
  color: var(--texto-suave);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.topo-nav a:not(.botao):hover {
  color: var(--texto);
}

@media (max-width: 720px) {
  .topo-nav a:not(.botao) {
    display: none;
  }
}

/* ---------- abertura ---------- */

/* No celular o muro vem logo depois do titulo, antes dos numeros: e ele que
   faz a pessoa querer colocar um bloco. */
.abertura {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "titulo"
    "muro"
    "numeros";
  gap: 22px;
  max-width: var(--largura);
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.abertura-titulo {
  grid-area: titulo;
}

.abertura-numeros {
  grid-area: numeros;
}

.muro-figura {
  grid-area: muro;
}

.abertura-titulo .linha-fina {
  margin-bottom: 0;
}

@media (min-width: 960px) {
  .abertura {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    grid-template-areas:
      "titulo muro"
      "numeros muro";
    align-items: end;
    column-gap: 48px;
    row-gap: 0;
    padding-top: 40px;
    padding-bottom: 72px;
  }

  .abertura-numeros {
    align-self: start;
  }

  .muro-figura {
    align-self: center;
  }
}

.sobretitulo {
  margin-bottom: 12px;
  color: var(--terra-forte);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2rem, 5.2vw, 3.3rem);
  font-weight: 850;
  letter-spacing: -0.025em;
}

.linha-fina {
  font-size: 1.12rem;
  color: var(--texto-suave);
  max-width: 34em;
}

.linha-fina strong {
  color: var(--texto);
}

.placar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

@media (min-width: 960px) {
  .placar {
    margin-top: 24px;
  }
}

.placar > div {
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  padding: 12px 14px;
  min-width: 0;
}

.placar dt {
  color: var(--texto-suave);
  font-size: 0.8rem;
  font-weight: 600;
}

.placar dd {
  margin: 2px 0 0;
  font-size: clamp(1.25rem, 3.5vw, 1.6rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

/* Celular estreito: dois cartoes em cima e a contagem de doacoes numa
   faixa so embaixo, para "R$ 12.583" nao quebrar no meio. */
@media (max-width: 479px) {
  .placar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .placar > div:last-child {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }

  .placar > div:last-child dd {
    margin: 0;
    font-size: 1.15rem;
  }
}

.placar small {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--texto-suave);
}

.barra {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: var(--vazio);
  border: 1px solid var(--vazio-borda);
  overflow: hidden;
}

.barra-cheia {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, var(--terra), var(--ocre));
  border-radius: inherit;
  transition: width 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.barra-legenda {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--texto-suave);
}

.abertura-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* ---------- muro ---------- */

.muro-figura {
  position: relative;
  margin: 0;
  padding: 18px 14px 14px;
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: 20px;
  box-shadow: var(--sombra);
}

.muro {
  display: block;
  width: 100%;
  height: auto;
  touch-action: manipulation;
}

.muro .telhado {
  fill: none;
  stroke: var(--vazio-borda);
  stroke-width: 3;
  stroke-dasharray: 10 8;
  stroke-linejoin: round;
}

.muro .chao {
  stroke: var(--vazio-borda);
  stroke-width: 4;
  stroke-linecap: round;
}

.muro .bloco {
  fill: var(--vazio);
  stroke: var(--vazio-borda);
  stroke-width: 1.4;
  stroke-dasharray: 4 3;
  transition: fill 0.25s ease, stroke 0.25s ease;
  cursor: pointer;
}

.muro .bloco.cheio {
  fill: var(--cimento);
  stroke: var(--cimento-topo);
  stroke-dasharray: none;
}

.muro .bloco.cheio.chegando {
  animation: cair 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}

.muro .bloco.previa {
  fill: var(--ocre);
  stroke: var(--terra);
  stroke-dasharray: none;
  animation: pulsar 1.6s ease-in-out infinite;
}

.muro .bloco.ativo {
  stroke: var(--texto);
  stroke-width: 2.4;
  stroke-dasharray: none;
}

@keyframes cair {
  from {
    transform: translateY(-26px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes pulsar {
  50% {
    opacity: 0.55;
  }
}

.muro-dica {
  position: absolute;
  z-index: 5;
  max-width: 220px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--texto);
  color: var(--fundo);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  box-shadow: var(--sombra);
}

.muro-figura figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--texto-suave);
}

.legenda {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.amostra {
  display: inline-block;
  width: 18px;
  height: 10px;
  border-radius: 2px;
}

.amostra-cheio {
  background: var(--cimento);
}

.amostra-previa {
  background: var(--ocre);
}

.amostra-vazio {
  background: var(--vazio);
  border: 1px dashed var(--vazio-borda);
}

.amostra-telhado {
  height: 0;
  border-top: 2px dashed var(--vazio-borda);
  border-radius: 0;
}

.aviso-escopo {
  padding: 12px 16px;
  border-left: 4px solid var(--ocre);
  border-radius: 0 var(--raio) var(--raio) 0;
  background: var(--superficie);
  color: var(--texto);
}

/* ---------- secoes ---------- */

.secao {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 56px 16px;
  border-top: 1px solid var(--linha);
}

.secao-cabeca {
  max-width: 46em;
  margin-bottom: 28px;
}

.secao-cabeca p {
  color: var(--texto-suave);
}

.ajuda {
  font-size: 0.88rem;
  color: var(--texto-suave);
}

.vazio {
  padding: 18px;
  border: 1px dashed var(--vazio-borda);
  border-radius: var(--raio);
  color: var(--texto-suave);
  text-align: center;
  background: var(--superficie);
}

/* ---------- historia ---------- */

.historia {
  display: grid;
  gap: 32px;
}

@media (min-width: 960px) {
  .historia {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: start;
  }
}

.historia-texto p {
  font-size: 1.08rem;
  max-width: 38em;
}

.assinatura {
  font-weight: 800;
  color: var(--terra-forte);
}

.historia-video video {
  display: block;
  width: 100%;
  border-radius: var(--raio);
  background: #000;
  box-shadow: var(--sombra);
}

.historia-video .link-externo {
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
}

/* ---------- itens ---------- */

.aviso-fechado {
  padding: 14px 18px;
  border-radius: var(--raio);
  background: var(--terra-suave);
  font-weight: 600;
}

.itens {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

@media (min-width: 680px) {
  .itens {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1020px) {
  .itens {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.item.escolhido {
  border-color: var(--ocre);
  box-shadow: 0 0 0 2px var(--ocre-suave);
}

.item.completo {
  opacity: 0.8;
}

.item-cabeca {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.item-icone {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--terra-suave);
  color: var(--terra-forte);
}

.item-icone svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.item-titulo {
  flex: 1;
  min-width: 0;
  align-self: center;
}

.item-titulo h3 {
  margin: 0;
  font-size: 1.05rem;
}

.item-descricao {
  margin: -4px 0 0;
  font-size: 0.85rem;
  color: var(--texto-suave);
}

.item-preco {
  flex: none;
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.item-preco small {
  display: block;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--texto-suave);
}

.pecas {
  display: grid;
  gap: 3px;
}

.peca {
  aspect-ratio: 2 / 1;
  border-radius: 2px;
  background: var(--vazio);
  border: 1px dashed var(--vazio-borda);
}

.peca.cheia {
  background: var(--cimento);
  border: 1px solid var(--cimento-topo);
}

.peca.previa {
  background: var(--ocre);
  border: 1px solid var(--terra);
}

.item-barra {
  height: 10px;
}

.item-barra .barra-previa {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--ocre);
  transition: width 0.3s ease, left 0.3s ease;
}

.item-situacao {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--texto-suave);
  font-variant-numeric: tabular-nums;
}

.item-situacao .feito {
  color: var(--verde);
  font-weight: 700;
}

.item-controles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.contador {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--linha);
  border-radius: 999px;
  background: var(--superficie-2);
}

.contador button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--texto);
  font: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
}

.contador button:hover:not([disabled]) {
  background: var(--terra-suave);
  color: var(--terra-forte);
}

.contador button[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.contador output {
  min-width: 2.6ch;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.atalho {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--linha);
  border-radius: 999px;
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.atalho:hover:not([disabled]) {
  border-color: var(--terra);
  color: var(--terra-forte);
}

.atalho[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- valor livre ---------- */

.livre {
  margin-top: 22px;
  padding: 16px;
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
}

.livre label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.livre-campo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--vazio-borda);
  border-radius: 12px;
  background: var(--superficie-2);
}

.livre-campo span {
  font-weight: 700;
  color: var(--texto-suave);
}

.livre-campo input {
  width: 9em;
  min-height: 46px;
  border: 0;
  background: transparent;
  color: var(--texto);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.livre-campo input:focus {
  outline: none;
}

.livre-campo:focus-within {
  outline: 3px solid var(--anel);
  outline-offset: 2px;
}

.livre .ajuda {
  margin: 8px 0 0;
}

/* ---------- resumo ---------- */

.resumo {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px -16px 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--superficie);
  border-top: 1px solid var(--linha);
  box-shadow: 0 -8px 24px rgba(60, 40, 20, 0.08);
}

@media (min-width: 720px) {
  .resumo {
    margin-inline: 0;
    border: 1px solid var(--linha);
    border-radius: var(--raio);
    bottom: 12px;
  }
}

.resumo-texto {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 200px;
}

.resumo-rotulo {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--texto-suave);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.resumo-total {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.resumo-itens {
  font-size: 0.88rem;
  color: var(--texto-suave);
}

.resumo-acoes {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- mural ---------- */

.mural-lista {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.mural-lista li {
  padding: 14px 16px;
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
}

.mural-nome {
  display: block;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.mural-nivel {
  display: inline-block;
  margin: 4px 0 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--terra-suave);
  color: var(--terra-forte);
  font-size: 0.75rem;
  font-weight: 800;
}

.mural-resumo,
.mural-data {
  display: block;
  font-size: 0.85rem;
  color: var(--texto-suave);
}

.mural-mensagem {
  margin: 8px 0 0;
  font-style: italic;
  overflow-wrap: anywhere;
}

.mural-anonimas {
  color: var(--texto-suave);
}

.niveis {
  margin-top: 28px;
  padding: 18px;
  border-radius: var(--raio);
  background: var(--superficie-2);
}

.niveis ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.niveis li {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--superficie);
  border: 1px solid var(--linha);
  font-size: 0.88rem;
}

.niveis li strong {
  color: var(--terra-forte);
}

/* ---------- transparencia ---------- */

.caminho {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  counter-reset: passo;
}

@media (min-width: 640px) {
  .caminho {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .caminho {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.caminho li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
}

.caminho-passo {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--terra);
  color: var(--sobre-terra);
  font-weight: 800;
  font-size: 0.85rem;
}

.caminho-numero {
  font-size: 1.45rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.caminho-legenda {
  font-size: 0.85rem;
  color: var(--texto-suave);
}

.saldo {
  padding: 12px 16px;
  border-radius: var(--raio);
  background: var(--superficie-2);
}

.tabelas {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
}

.tabela-bloco {
  min-width: 0;
}

.tabela-bloco h3 {
  margin-bottom: 10px;
}

.tabela-rolagem {
  overflow-x: auto;
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  background: var(--superficie);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--linha);
  white-space: nowrap;
}

th {
  font-size: 0.8rem;
  color: var(--texto-suave);
  background: var(--superficie-2);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.tabela-rolagem:has(tbody:empty) {
  display: none;
}

.entradas summary {
  cursor: pointer;
  font-weight: 700;
  padding: 6px 0;
}

/* ---------- diario ---------- */

.diario-lista {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.diario-lista li {
  padding: 18px;
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
}

.diario-data {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--terra-forte);
}

.diario-fotos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 10px;
  margin-top: 12px;
}

.diario-fotos figure {
  margin: 0;
}

.diario-fotos img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
}

.diario-fotos figcaption {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--texto-suave);
}

/* ---------- perguntas ---------- */

.perguntas details {
  max-width: 46em;
  border-bottom: 1px solid var(--linha);
}

.perguntas summary {
  padding: 16px 0;
  font-weight: 700;
  cursor: pointer;
  list-style-position: outside;
}

.perguntas details p {
  color: var(--texto-suave);
}

/* ---------- rodape ---------- */

.rodape {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 36px 16px 120px;
  border-top: 1px solid var(--linha);
  color: var(--texto-suave);
  font-size: 0.95rem;
}

/* ---------- dialogos ---------- */

.dialogo {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 22px 20px 20px;
  border: 0;
  border-radius: 20px;
  background: var(--superficie);
  color: var(--texto);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
}

.dialogo::backdrop {
  background: rgba(23, 19, 15, 0.6);
}

.dialogo h2 {
  font-size: 1.5rem;
  padding-right: 36px;
}

.dialogo-fechar-form {
  position: absolute;
  top: 10px;
  right: 10px;
  margin: 0;
}

.dialogo-fechar {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--superficie-2);
  color: var(--texto);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.pix-itens {
  color: var(--texto-suave);
}

.pix-corpo {
  display: grid;
  gap: 16px;
  margin: 8px 0 16px;
}

@media (min-width: 560px) {
  .pix-corpo {
    grid-template-columns: 200px minmax(0, 1fr);
    align-items: start;
  }
}

.pix-qr {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-width: 220px;
  width: 100%;
  margin: 0 auto;
  padding: 8px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--linha);
}

.pix-qr img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.pix-qr .ajuda {
  margin: 0;
  color: #6b5c4e;
  text-align: center;
}

/* No celular o QR fica depois do botao: ninguem escaneia a propria tela. */
@media (max-width: 559px) {
  .pix-qr {
    order: 2;
    max-width: 170px;
  }
}

.pix-instrucao {
  font-size: 0.95rem;
}

.pix-codigo-rotulo {
  display: block;
  margin-top: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--texto-suave);
}

.pix-codigo {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--linha);
  border-radius: 10px;
  background: var(--superficie-2);
  color: var(--texto);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.75rem;
  resize: none;
  word-break: break-all;
}

.copiado {
  margin: 8px 0 0;
  color: var(--verde);
  font-weight: 700;
  font-size: 0.9rem;
}

.pix-conferir {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ocre-suave);
  font-size: 0.92rem;
}

.pix-conferir p:last-child {
  margin-bottom: 0;
}

.pix-conferir code {
  font-weight: 700;
}

.obrigado-nome,
.obrigado-cartao {
  margin-top: 18px;
}

.cartao-previa {
  display: block;
  width: min(100%, 260px);
  margin: 0 auto 14px;
  border-radius: 12px;
  box-shadow: var(--sombra);
}

.cartao-previa:not([src]) {
  display: none;
}

#dialogo-cartao .botao + .botao {
  margin-top: 10px;
}

/* ---------- ajustes da revisao ---------- */

[tabindex="-1"]:focus {
  outline: none;
}

.livre-aviso {
  margin: 8px 0 0;
  color: var(--terra-forte);
  font-weight: 700;
  font-size: 0.9rem;
}

.livre-aviso:empty {
  display: none;
}

.livre-campo:has(input[aria-invalid="true"]) {
  border-color: var(--terra);
}

.copiado:empty {
  margin: 0;
}

/* Botao travado sem perder o foco (aria-disabled em vez de disabled). */
.contador button[aria-disabled="true"],
.atalho[aria-disabled="true"] {
  opacity: 0.35;
  cursor: not-allowed;
}

.contador button[aria-disabled="true"]:hover {
  background: transparent;
  color: var(--texto);
}

.atalho[aria-disabled="true"]:hover {
  border-color: var(--linha);
  color: var(--texto);
}

/* Celular: a barra de resumo nao cresce com o carrinho. */
@media (max-width: 719px) {
  .resumo-itens {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Tela de 320 px: o preco encolhe e quebra, o titulo nao e atropelado. */
.item-preco {
  flex: 0 1 auto;
  max-width: 48%;
}

.item-preco small {
  white-space: normal;
}

.item-titulo h3 {
  overflow-wrap: anywhere;
}

/* ---------- estimativa e rascunho (some quando o Danilo confirma) ---------- */

.item.estimado {
  border-style: dashed;
}

.item-estimado {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--terra-forte);
}

.item-premissa {
  font-size: 0.82rem;
  color: var(--texto-suave);
}

.item-premissa summary {
  cursor: pointer;
  color: var(--texto);
}

.item-premissa p {
  margin: 6px 0 0;
}

.rascunho::before,
.selo-rascunho,
.selo-confirmar {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--ocre-suave);
  color: var(--texto);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.rascunho::before {
  content: "Rascunho";
  margin-right: 8px;
}

.selo-rascunho {
  margin: 0 0 8px;
}

.recebedor {
  margin: 16px 0 0;
}
