/* Estudar por voz (site/js/voz.js) no visual do Zero DP (docs/design.md): o mini-player de leitura (flutua embaixo,
   no alcance do polegar, acima da barra de baixo: é o único com sombra) e o revisar falando (#/voz): o começo com os
   passos, a sessão de foco (contador, barra, estado "ouvindo", o cartão da vez, botões grandes presos embaixo) e o fim
   (destaque com o Zero, números e notas). As notas da sessão usam .fc-notas/.fc-nota (css/flashcards.css). Só tokens. */

/* ===== botão "Ouvir" ===== */
.vz-ouvir.vz-ativo { border-color: var(--vinho); background: var(--acento-suave); color: var(--texto); }

/* ===== mini-player ===== */
body.vz-com-player { padding-bottom: calc(var(--vz-alt, 0px) + var(--abas-alt, 0px)); }
body.vz-com-player .aviso { bottom: calc(var(--vz-alt, 0px) + var(--abas-alt, 0px) + 8px + env(safe-area-inset-bottom)); }

.vz-player {
  position: fixed;
  bottom: calc(var(--abas-alt, env(safe-area-inset-bottom)) + 12px);
  left: 50%;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(100% - 24px, 560px);
  padding: 14px 16px 14px;
  border: var(--bw) solid var(--linha-media);
  border-radius: var(--raio-cartao);
  background: var(--superficie-elevada);
  box-shadow: var(--sombra-flutua);
  color: var(--texto);
  transform: translateX(-50%);
  animation: vz-sobe .28s var(--ease) both;
}
@keyframes vz-sobe { from { opacity: 0; transform: translate(-50%, 16px); } }

.vz-p-topo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vz-p-ic { width: 40px; height: 40px; border-radius: 12px; }
.vz-p-ic .ic { width: 20px; height: 20px; }
.vz-tocando .vz-p-ic .ic { animation: vz-pulsa 1.2s var(--ease) infinite; }
@keyframes vz-pulsa { 50% { transform: scale(1.12); } }
.vz-p-tit { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.vz-p-tit b { overflow: hidden; font-family: var(--fonte-titulo); font-size: 15.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.vz-pos { color: var(--texto-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.vz-pos:empty { display: none; }
.vz-fechar { flex: none; }

.vz-corpo { display: grid; gap: 8px; }
.vz-fechado .vz-corpo { display: none; }
.vz-texto {
  position: relative; /* o scrollTop do destaque conta a partir daqui */
  max-height: min(26vh, 180px);
  padding: 12px 14px;
  overflow-y: auto;
  border-radius: var(--raio-3);
  background: var(--superficie-2);
  font-size: 16px;
  line-height: 1.6;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
}
.vz-texto p + p { margin-top: 4px; }
.vz-t-tit { margin-bottom: 4px; font-size: 15.5px; font-weight: 600; }
.vz-t-tit.vz-lendo { display: inline; border-radius: 4px; background: var(--acento-suave); color: var(--texto); }
.vz-marca {
  border-radius: 4px;
  background: var(--acento-suave);
  color: var(--texto);
  text-decoration: underline;
  text-decoration-color: var(--rubi);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.vz-parado .vz-marca { text-decoration: none; }
.vz-prepara, .vz-fim-leitura { color: var(--texto-3); font-weight: 600; }
.vz-alerta { padding: 8px 12px; border-radius: var(--raio-2); background: var(--atencao-suave); font-size: 13.5px; line-height: 1.4; }
.vz-alerta[hidden] { display: none; }
.vz-voz { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--texto-2); font-size: 13.5px; font-weight: 600; }
.vz-voz[hidden] { display: none; }
.vz-voz-sel {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 4px 10px;
  border: var(--bw) solid var(--linha-forte);
  border-radius: var(--raio-2);
  background: var(--campo);
  color: var(--texto);
  font-size: 16px; /* 16px: o iPhone não dá zoom */
}

/* barra de trechos (arrastar pra ir a outro trecho): trilho fino, a parte lida em rubi (corte seco, sem degradê) */
.vz-barra {
  --p: 0%;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: pan-y;
}
.vz-barra[hidden] { display: none; }
.vz-barra::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--raio-pilula);
  background: linear-gradient(to right, var(--rubi) var(--p), var(--superficie-3) var(--p));
}
.vz-barra::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 3px solid var(--superficie-elevada);
  border-radius: 50%;
  background: var(--rubi);
  -webkit-appearance: none;
}
.vz-barra::-moz-range-track { height: 6px; border-radius: var(--raio-pilula); background: var(--superficie-3); }
.vz-barra::-moz-range-progress { height: 6px; border-radius: var(--raio-pilula); background: var(--rubi); }
.vz-barra::-moz-range-thumb { width: 16px; height: 16px; border: 3px solid var(--superficie-elevada); border-radius: 50%; background: var(--rubi); }
.vz-barra:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; }

.vz-ctls { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 4px; }
.vz-ctl { flex: none; }
.vz-ctl:disabled { opacity: .4; }
.vz-tocar { width: 56px; min-height: 56px; }
.vz-tocar .ic { width: 24px; height: 24px; }
.vz-vel {
  flex: none;
  min-width: 56px;
  min-height: 44px;
  padding: 4px 10px;
  border: var(--bw) solid var(--linha-media);
  border-radius: var(--raio-pilula);
  background: transparent;
  color: var(--texto);
  font-family: var(--fonte-titulo);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  touch-action: manipulation;
  cursor: pointer;
}
@media (hover: hover) { .vz-vel:hover { background: var(--superficie-2); } }
.vz-vel:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; }
.vz-abrir[aria-expanded="true"] { background: var(--superficie-2); }
@media (max-width: 360px) { .vz-ctls { gap: 4px; } .vz-vel { min-width: 48px; } .vz-tocar { width: 52px; min-height: 52px; } }

/* ===== revisar falando: começo ===== */
.vz-intro { display: grid; gap: 16px; }
.vz-passos { display: grid; gap: 12px; margin: 4px 0 0; padding: 0; list-style: none; counter-reset: vz; }
.vz-passos li { display: flex; align-items: flex-start; gap: 12px; line-height: 1.45; counter-increment: vz; }
.vz-passos li::before {
  content: counter(vz);
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--acento-suave);
  color: var(--acento);
  font-family: var(--fonte-titulo);
  font-size: 13.5px;
  font-weight: 700;
}
.vz-comandos { color: var(--texto-2); font-size: 15px; }
.vz-comandos b { color: var(--texto); }
.vz-privacidade { display: flex; align-items: flex-start; gap: 8px; color: var(--texto-3); font-size: 13.5px; line-height: 1.45; }
.vz-privacidade .ic { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.vz-intro-acoes { display: grid; justify-items: center; gap: 6px; padding-bottom: 4px; }
.vz-link-botoes { justify-self: center; }

/* ===== revisar falando: sessão (tela de foco) ===== */
.vz-sessao { gap: 14px; }
.vz-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.vz-conta { font-family: var(--fonte-titulo); font-weight: 600; font-variant-numeric: tabular-nums; }
.vz-ferramentas { display: flex; flex: none; align-items: center; gap: 6px; }
.vz-maos[aria-pressed="true"] { border-color: var(--vinho); background: var(--acento-suave); color: var(--texto); }
.vz-maos[aria-pressed="false"] { color: var(--texto-3); }
.vz-maos[hidden] { display: none; }

/* o recado pode quebrar em duas linhas no celular ("Não ouvi a nota…"): canto de bloco, não de pílula */
.vz-estado {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 16px;
  border-radius: var(--raio-3);
  background: var(--superficie-2);
  color: var(--texto-2);
  font-family: var(--fonte-titulo);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}
.vz-estado .ic { width: 18px; height: 18px; flex: none; }
.vz-estado.ouvindo { background: var(--acento-suave); color: var(--texto); }
.vz-estado.ouvindo .ic { color: var(--acento); animation: vz-pulsa 1s var(--ease) infinite; }
.vz-estado.pausado { background: var(--superficie-3); }

.vz-cartao {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: min(40vh, 340px);
  padding: 20px 22px;
  border: var(--bw) solid var(--linha);
  border-radius: var(--raio-cartao);
  background: var(--superficie);
  overflow-wrap: anywhere;
  animation: vz-entra .26s var(--ease) both;
}
@keyframes vz-entra { from { opacity: 0; transform: translateY(8px); } }
.vz-c-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.vz-c-topo .etiqueta { margin-left: auto; }
.vz-disc { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--texto-2); font-family: var(--fonte-titulo); font-size: 13.5px; font-weight: 600; }
.vz-disc > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-tela .bolinha-cor { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--cor, var(--rubi)); }
.vz-rot { color: var(--texto-3); font-family: var(--fonte-titulo); font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.vz-rot-pergunta { margin-top: auto; text-align: center; }
.vz-pergunta {
  margin-bottom: auto;
  font-family: var(--fonte-titulo);
  font-size: clamp(21px, 5.4vw, 26px);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
}
.vz-cartao.revelado .vz-pergunta { margin: 0; padding-bottom: 14px; border-bottom: var(--bw-fio) dashed var(--linha-media); color: var(--texto-2); font-family: var(--fonte-texto); font-size: 15px; font-weight: 600; text-align: left; }

.vz-comparar { display: grid; gap: 10px; }
@media (min-width: 640px) { .vz-comparar { grid-template-columns: 1fr 1fr; align-items: start; } }
.vz-resposta, .vz-disse { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--raio-3); }
.vz-resposta { background: var(--acento-suave); }
.vz-resposta .vz-rot { color: var(--acento); }
.vz-resposta p { font-size: clamp(17px, 4.6vw, 19px); font-weight: 600; line-height: 1.45; }
.vz-disse { background: var(--superficie-2); }
.vz-disse > p:not(.vz-dica) { font-size: 16.5px; line-height: 1.45; }
.vz-disse.vazio-disse > p:not(.vz-dica) { color: var(--texto-3); }
.vz-bate { border-radius: 3px; background: var(--bom-suave); color: var(--texto); }
.vz-dica { display: flex; align-items: flex-start; gap: 8px; margin-top: 4px; padding: 8px 10px; border-radius: var(--raio-2); background: var(--superficie); font-size: 14.5px; line-height: 1.35; }
.vz-dica .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.vz-dica span { display: grid; gap: 1px; }
.vz-dica small { color: var(--texto-3); font-size: 12.5px; font-weight: 500; }
.vz-dica.perto .ic { color: var(--bom-texto); }
.vz-dica.meio .ic { color: var(--atencao-texto); }
.vz-dica.longe .ic { color: var(--erro-texto); }
.vz-origem { display: flex; align-items: flex-start; gap: 8px; color: var(--texto-3); font-size: 13.5px; line-height: 1.45; }
.vz-origem .ic { width: 17px; height: 17px; flex: none; margin-top: 1px; }

/* ouvindo: ondinhas + o que já entendi */
.vz-ouvindo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--raio-3); background: var(--acento-suave); }
.vz-ondas { display: flex; flex: none; align-items: center; gap: 4px; height: 26px; }
.vz-ondas i { width: 4px; height: 8px; border-radius: 2px; background: var(--rubi); animation: vz-onda .9s var(--ease) infinite; }
.vz-ondas i:nth-child(2) { animation-delay: .15s; }
.vz-ondas i:nth-child(3) { animation-delay: .3s; }
.vz-ondas i:nth-child(4) { animation-delay: .45s; }
@keyframes vz-onda { 50% { height: 24px; } }
.vz-ouvido { flex: 1; min-width: 0; color: var(--texto-2); font-size: 16px; font-style: italic; line-height: 1.4; }

/* botões grandes presos embaixo, no alcance do polegar */
.vz-acoes {
  position: sticky;
  bottom: var(--abas-alt, 0px);
  z-index: 5;
  padding: 10px 0 calc(14px + env(safe-area-inset-bottom));
  background: var(--fundo);
}
.vz-linha { display: flex; align-items: center; gap: 12px; }
.vz-linha > .btn.cheio { flex: 1; width: auto; min-width: 0; }
.vz-mic { flex: none; width: 56px; min-height: 56px; border-color: var(--vinho); background: var(--acento-suave); color: var(--acento); }
.vz-mic .ic { width: 24px; height: 24px; }
.vz-notas { flex: 1; }
.vz-extras { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-bottom: 8px; }
.vz-falar-nota { border-color: var(--vinho); background: var(--acento-suave); color: var(--texto); }

/* ===== fim: o placar dos flashcards (.fc-placar, .fc-total, .fc-fichas, .fc-dadas em css/flashcards.css) ===== */
.vz-fim-acoes { display: flex; flex-wrap: wrap; gap: 12px; padding-bottom: 8px; }
.vz-fim-acoes .btn { flex: 1 1 200px; max-width: 100%; white-space: normal; }


@media (prefers-reduced-motion: reduce) {
  .vz-player, .vz-cartao { animation: none; }
  .vz-tocando .vz-p-ic .ic, .vz-estado.ouvindo .ic { animation: none; }
  .vz-ondas i { animation-duration: 2.4s; }
}

@media print { .vz-player, .vz-acoes, .vz-extras, .vz-ferramentas { display: none !important; } body.vz-com-player { padding-bottom: 0; } }

/* no tablet pra cima o botão do fim fica do tamanho dele */
@media (min-width: 560px) { .vz-fim-acoes .btn { flex: 0 1 auto; } }
