@font-face { font-family: "OpenDyslexic"; src: url("fontes/OpenDyslexic-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "OpenDyslexic"; src: url("fontes/OpenDyslexic-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("fontes/lexend-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("fontes/lexend-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("fontes/lexend-latin-600-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fontes/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fontes/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Comic Neue"; src: url("fontes/comic-neue-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Comic Neue"; src: url("fontes/comic-neue-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Coluna de leitura no centro, marca-texto como único gesto de cor, controles ao alcance do polegar. */
:root {
  --fundo: #f6f7f5; --papel: #ffffff; --tinta: #1b2230; --apagado: #454e5c; --linha: #6e7785;
  --acao: #1a3fb0; --acao-tinta: #ffffff; --marca: #ffd83d; --marca-tinta: #1b2230;
  --frase: #fff4c2; --frase-tinta: #1b2230; --ok: #125a32; --alerta: #6b4000;
  --coracao: #c8102e; --coracao-botao: #a50f25; --coracao-tinta: #ffffff; --apoio-fundo: #fdecee; --realce: #e8ecf6;
  --ui: "OpenDyslexic", Verdana, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --fundo: #14181f; --papel: #1c222b; --tinta: #e9ecf1; --apagado: #b6bfca; --linha: #7f8a98;
    --acao: #8fb0ff; --acao-tinta: #10151d; --marca: #ffd83d; --marca-tinta: #14181f;
    --frase: #3d3718; --frase-tinta: #f6f1da; --ok: #6fd69a; --alerta: #f0b866;
    --coracao: #ff7d89; --coracao-botao: #ff7d89; --coracao-tinta: #14181f; --apoio-fundo: #3a1f25; --realce: #2a3240;
  }
}
body[data-tema="claro"], body[data-tema="pessoal"] {
  color-scheme: light;
  --fundo: #f6f7f5; --papel: #ffffff; --tinta: #1b2230; --apagado: #454e5c; --linha: #6e7785;
  --acao: #1a3fb0; --acao-tinta: #ffffff; --marca: #ffd83d; --marca-tinta: #1b2230;
  --frase: #fff4c2; --frase-tinta: #1b2230; --ok: #125a32; --alerta: #6b4000;
  --coracao: #c8102e; --coracao-botao: #a50f25; --coracao-tinta: #ffffff; --apoio-fundo: #fdecee; --realce: #e8ecf6;
}
body[data-tema="creme"] {
  color-scheme: light;
  --fundo: #f3ecd9; --papel: #fbf6e8; --tinta: #2b2618; --apagado: #4a4333; --linha: #7c745e;
  --acao: #1a3fb0; --acao-tinta: #ffffff; --marca: #f7c948; --marca-tinta: #2b2618;
  --frase: #f0e3b4; --frase-tinta: #2b2618; --ok: #125a32; --alerta: #643c00;
  --coracao: #b00d28; --coracao-botao: #a50f25; --coracao-tinta: #ffffff; --apoio-fundo: #f8e3d8; --realce: #e9e0c8;
}
body[data-tema="escuro"] {
  color-scheme: dark;
  --fundo: #14181f; --papel: #1c222b; --tinta: #e9ecf1; --apagado: #b6bfca; --linha: #7f8a98;
  --acao: #8fb0ff; --acao-tinta: #10151d; --marca: #ffd83d; --marca-tinta: #14181f;
  --frase: #3d3718; --frase-tinta: #f6f1da; --ok: #6fd69a; --alerta: #f0b866;
  --coracao: #ff7d89; --coracao-botao: #ff7d89; --coracao-tinta: #14181f; --apoio-fundo: #3a1f25; --realce: #2a3240;
}
body[data-tema="contraste"] {
  color-scheme: dark;
  --fundo: #000000; --papel: #000000; --tinta: #ffffff; --apagado: #e6e6e6; --linha: #ffffff;
  --acao: #ffe600; --acao-tinta: #000000; --marca: #ffe600; --marca-tinta: #000000;
  --frase: #0b3d91; --frase-tinta: #ffffff; --ok: #7dffb0; --alerta: #ffd27a; --coracao: #ff8a94; --coracao-botao: #ff8a94; --coracao-tinta: #000000; --apoio-fundo: #000000; --realce: #333333;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-block: 90px 180px; }
body {
  margin: 0; background: var(--fundo); color: var(--tinta); font-family: var(--ui); font-size: 100%; line-height: 1.6;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
body[data-vista="ler"] { padding-bottom: 200px; }
body.editando { padding-bottom: 24px; }
a { color: var(--acao); text-underline-offset: .15em; }
button, select, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--acao); outline-offset: 2px; border-radius: 4px; }
h1:focus { outline: none; }
.pular { position: absolute; left: -999px; top: 8px; background: var(--papel); padding: 10px 14px; z-index: 20; }
.pular:focus { left: 16px; }
.oculto { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.oculto:focus-visible + .btn, label.btn:focus-within { outline: 3px solid var(--acao); outline-offset: 2px; }
.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.so-cel { display: none !important; }

/* Um só tipo de botão no site inteiro: caixa de cantos suaves, ícone à esquerda, altura fixa. */
.btn {
  min-height: 46px; padding: 8px 14px; border: 1.5px solid var(--linha); border-radius: 10px; background: var(--papel);
  color: var(--tinta); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; font-size: .9375rem; font-weight: 400; line-height: 1.2; text-align: center; max-width: 100%;
}
.btn:hover { background: var(--realce); border-color: var(--tinta); }
.btn[aria-current="page"] { background: var(--realce); border-color: var(--tinta); font-weight: 700; }
.btn[aria-pressed="true"] { background: var(--tinta); color: var(--fundo); border-color: var(--tinta); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.forte { background: var(--acao); color: var(--acao-tinta); border-color: var(--acao); font-weight: 700; }
.btn.forte:hover { background: var(--tinta); color: var(--fundo); border-color: var(--tinta); }
.btn.apoio { background: var(--apoio-fundo); border: 2px solid var(--coracao); font-weight: 700; }
.btn.apoio .i, .link-apoio .i, .dlg-topo h2 .i { color: var(--coracao); }
.btn.apoio:hover { background: var(--realce); }
.btn.apoio-forte { background: var(--coracao-botao); color: var(--coracao-tinta); border-color: var(--coracao-botao); font-weight: 700; }
.btn.apoio-forte:hover { background: var(--tinta); color: var(--fundo); border-color: var(--tinta); }
.i { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -.2em; }
.b-libras .i, .com-icone .i, #librasBarra .i { width: 1.55em; height: 1.55em; }
.com-icone { display: inline-flex; align-items: center; gap: 6px; }
.link { background: none; border: 0; padding: 0; color: var(--acao); text-decoration: underline; text-underline-offset: .15em; cursor: pointer; }
.fechar-x {
  flex: none; width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--papel); color: var(--tinta); border: 1.5px solid var(--linha); border-radius: 50%; cursor: pointer;
}
.fechar-x:hover { background: var(--realce); border-color: var(--tinta); }

/* Topo: o mesmo em todas as páginas */
.topo { max-width: 1120px; margin-inline: auto; border-bottom: 1px solid var(--linha); padding-block: 10px; background: var(--fundo); }
.topo-in { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.topo nav { display: flex; flex-wrap: wrap; gap: 6px; }
.topo .btn { padding-inline: 10px; font-size: .875rem; gap: 6px; }
.topo-in { gap: 6px; }
@media (max-width: 1120px) {
  .topo nav { order: 5; flex: 1 1 100%; }
  .topo nav .btn { flex: 1 1 auto; }
}
.logo { color: var(--tinta); margin-right: auto; min-height: 46px; display: inline-flex; align-items: center; border-radius: 6px; }
.logo svg { display: block; height: 36px; width: auto; max-width: 100%; }
.logo-m { fill: var(--marca); }
.logo-t { fill: var(--marca-tinta); }
@media (min-width: 641px) and (min-height: 700px) {
  .topo { position: sticky; top: 0; z-index: 5; }
}

.vista { max-width: 760px; margin: 0 auto; padding-block: 32px 40px; }
.vista h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); line-height: 1.2; font-weight: 700; margin: 0 0 12px; text-wrap: balance; }
.sub { font-size: 1.125rem; margin: 0 0 24px; max-width: 58ch; }
.entrada { display: grid; gap: 10px; }
.entrada label[for="novoTexto"], .edicao label { font-weight: 700; }
.entrada textarea { width: 100%; min-height: 240px; padding: 16px; border: 1.5px solid var(--linha); border-radius: 12px; background: var(--papel); font-size: 1.125rem; line-height: 1.7; resize: vertical; }
.entrada textarea::placeholder, #editor::placeholder { color: var(--apagado); opacity: 1; }
.acoes-entrada { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.acoes-entrada .forte { grid-column: 1 / -1; font-size: 1.125rem; min-height: 54px; }
.acoes-entrada > .btn:not(.forte) { min-height: 50px; }
.nota { color: var(--apagado); font-size: 0.9062rem; margin: 0; }
.nota:empty { display: none; }
.pagina { max-width: 66ch; }
.pagina h2 { font-size: 1.25rem; font-weight: 700; margin: 26px 0 6px; }
.pagina p, .pagina ul { margin: 0 0 12px; }
.pagina li { margin-bottom: 6px; }
.contatos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.contatos .btn { flex: 1 1 100%; }

/* Leitor */
.leitor { max-width: none; padding-top: 12px; padding-bottom: 20px; }
.ferramentas { max-width: 1120px; margin: 0 auto 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fonte-rapida { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; }
.fonte-rapida select { min-width: 0; max-width: 100%; min-height: 44px; border: 1.5px solid var(--linha); border-radius: 10px; background: var(--fundo); padding: 6px 8px; font-weight: 400; }
.titulo-doc { flex: 1 1 160px; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aviso { padding: 6px 10px; border-left: 4px solid var(--apagado); border-radius: 0 8px 8px 0; background: var(--papel); font-size: 0.9062rem; line-height: 1.35; }
.dlg .aviso { padding: 10px 12px; }
.aviso:empty { display: none; }
.aviso[data-t="ok"] { border-left-color: var(--ok); }
.aviso[data-t="atencao"] { border-left-color: var(--alerta); }
.voz-carga { font-size: .8125rem; padding-inline: 14px; }
#texto, #editor {
  --fs: 1.375rem; --lh: 1.7; --ls: 0em; --ws: 0em; --ps: 1.1em; --larg: 60ch; --rg: .35;
  font-size: var(--fs); line-height: var(--lh); letter-spacing: var(--ls); word-spacing: var(--ws);
}
#texto { max-width: var(--larg); margin: 20px auto 0; text-align: left; overflow-wrap: anywhere; }
#texto p { margin: 0 0 var(--ps); }
#texto .w { cursor: pointer; }
#texto .w:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
#texto:not([data-modo="palavra"]):not([data-modo="audio"]) .f-on { background: var(--frase); color: var(--frase-tinta); box-shadow: 0 0 0 .1em var(--frase); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
#texto:not([data-modo="frase"]):not([data-modo="audio"]) .w-on { background: var(--marca); color: var(--marca-tinta); box-shadow: 0 0 0 .1em var(--marca); border-radius: 2px; text-decoration: underline 2px; text-underline-offset: .18em; }
#texto.regua .f { opacity: var(--rg); }
#texto.regua .f.f-on { opacity: 1; }
.edicao { max-width: 760px; margin: 16px auto 0; display: grid; gap: 10px; }
#editor { width: 100%; min-height: max(320px, calc(100dvh - 300px)); padding: 16px; border: 1.5px solid var(--linha); border-radius: 12px; background: var(--papel); resize: vertical; }
body.editando .barra, body.editando #editarTexto, body.editando #abrirAjustes, body.editando #alternarFoco, body.editando #novoDoc { display: none; }
body.foco .topo, body.foco .ferramentas > :not(#alternarFoco), body.foco .voz-carga, body.foco .rodape, body.foco .convite, body.foco #inicio, body.foco #abrirVoz, body.foco #librasBarra { display: none !important; }
body.foco .aviso:not([data-t="atencao"]) { display: none; }
body.foco .ferramentas { justify-content: flex-end; }
body.foco #texto { margin-top: 4px; }

.convite { max-width: 68ch; margin: 28px auto 0; padding: 16px; background: var(--papel); border: 1px solid var(--linha); border-radius: 12px; }
.convite h2 { margin: 0 0 6px; font-size: 1.25rem; font-weight: 700; }
.convite p { margin: 0 0 12px; }

.rodape { max-width: 1120px; margin: 30px auto 0; padding-block: 18px 26px; border-top: 1px solid var(--linha); font-size: 0.9062rem; color: var(--apagado); }
.rodape p { margin: 0; }
.rodape nav { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.rodape nav a, .rodape nav .link { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }

/* Barra de reprodução */
body:not([data-vista="ler"]) .barra { display: none; }
.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--papel); border-top: 1px solid var(--linha);
  padding: 6px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.barra-in { max-width: 860px; margin-inline: auto; display: grid; gap: 2px; }
.prog { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; font-size: 0.8125rem; color: var(--apagado); }
.prog input { flex: 1; min-width: 0; accent-color: var(--acao); height: 40px; margin: 0; }
.ctrl { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
.ctrl .btn { flex: 1 1 64px; padding-inline: 8px; }
.ctrl #tocar { flex: 2 1 130px; font-size: 1.0625rem; }
.campo-vel { flex: 1 1 96px; display: flex; align-items: center; gap: 4px; padding-left: 10px; border: 1.5px solid var(--linha); border-radius: 10px; background: var(--papel); }
.campo-vel:hover { background: var(--realce); border-color: var(--tinta); }
.campo-vel select { flex: 1; min-width: 0; min-height: 43px; border: 0; background: transparent; font-size: .9375rem; }
.campo-vel select option { background: var(--papel); color: var(--tinta); }

.painel-libras {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: 150px; z-index: 7; width: 300px; max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 230px); overflow: auto; background: var(--papel); border: 1px solid var(--linha); border-radius: 12px; padding: 10px; display: grid; gap: 8px;
}
body:not([data-vista="ler"]) .painel-libras { bottom: 16px; max-height: calc(100dvh - 32px); }
.painel-topo { display: flex; justify-content: space-between; align-items: center; }
#librasMoldura iframe { width: 100%; height: min(400px, calc(100dvh - 430px)); min-height: 200px; border: 0; display: block; background: #fff; border-radius: 6px; }
.painel-acoes { display: grid; gap: 6px; }
.painel-acoes .btn { padding-inline: 6px; font-size: 0.875rem; min-height: 44px; }
.painel-libras .nota { font-size: 0.8125rem; }

/* Janelas: título fixo com o X sempre à vista */
dialog { background: var(--papel); color: var(--tinta); border: 1px solid var(--linha); border-radius: 14px; padding: 0; width: min(620px, calc(100vw - 32px)); max-height: 86dvh; }
dialog::backdrop { background: rgb(0 0 0 / .5); }
dialog.leve { width: min(460px, calc(100vw - 32px)); }
dialog.leve::backdrop { background: rgb(0 0 0 / .2); }
.dlg { padding: 0 18px 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.dlg-topo { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-inline: -18px; padding: 12px 12px 12px 18px; background: var(--papel); border-bottom: 1px solid var(--linha); }
.dlg-topo h2 { margin: 0; font-size: 1.1875rem; font-weight: 700; line-height: 1.3; }
.dlg-topo h2 .i { margin-right: .35em; }
.dlg h3 { margin: 0; font-size: 0.875rem; font-weight: 700; color: var(--apagado); }
.dlg p { margin: 0; }
.dlg-apoio { font-size: 1.0625rem; }
.dlg-apoio .qr { justify-self: center; margin: 0; }
.grupo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding-top: 14px; border-top: 1px solid var(--linha); }
.dlg-topo + .grupo { border-top: 0; padding-top: 0; }
.perfis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 8px; }
.perfis .btn { justify-content: flex-start; text-align: left; min-height: 50px; }
.sec { border-top: 1px solid var(--linha); }
.sec summary { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; cursor: pointer; list-style: none; border-radius: 6px; }
.sec summary::-webkit-details-marker { display: none; }
.sec summary::after { content: "+"; font-size: 1.5rem; line-height: 1; }
.sec[open] summary::after { content: "\2212"; }
.sec summary:hover { color: var(--acao); }
.sec-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-bottom: 14px; }
.passos { padding-left: 1.6em; margin: 0 0 16px; }
.passos li { margin-bottom: 8px; }
.pagina h2 .i { margin-right: .35em; }
.c { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.c label { font-size: 0.9062rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; }
.c output { color: var(--apagado); font-variant-numeric: tabular-nums; }
.c input[type="range"] { width: 100%; accent-color: var(--acao); height: 44px; margin: 0; }
.c select { width: 100%; max-width: 100%; min-height: 46px; border: 1.5px solid var(--linha); border-radius: 10px; background: var(--fundo); padding: 8px; }
.cores { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.cores input { width: 100%; height: 44px; border: 1.5px solid var(--linha); border-radius: 10px; background: var(--fundo); padding: 3px; }
.check { display: flex; gap: 10px; font-size: 0.9062rem; min-height: 44px; align-items: center; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--acao); flex: none; }
.acoes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.acoes-esq { justify-content: flex-start; }
.qr { display: block; background: #fff; padding: 8px; border-radius: 8px; max-width: 100%; height: auto; }

/* Letra grande ou zoom alto: palavra longa quebra em vez de empurrar a tela para o lado */
h1, h2, h3, p, li, label, .btn, .logo, .tema-op, .titulo-doc, .dlg, .topo-in > * { overflow-wrap: anywhere; min-width: 0; }
.ctrl .btn { overflow-wrap: normal; }
/* Tema: cada amostra mostra as cores de verdade */
.temas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 8px; }
.tema-op { display: grid; justify-items: start; gap: 6px; padding: 12px; min-height: 92px; border: 2px solid var(--linha); border-radius: 12px; cursor: pointer; font-size: .9375rem; text-align: left; line-height: 1.2; }
.tema-op .amostra { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.tema-op[aria-pressed="true"] { outline: 3px solid var(--acao); outline-offset: 2px; }
.t-claro { background: #ffffff; color: #1b2230; }
.t-creme { background: #f3ecd9; color: #2b2618; }
.t-escuro { background: #14181f; color: #e9ecf1; }
.t-contraste { background: #000000; color: #ffe600; }
.acoes .btn[data-op-tema] { flex: 1 1 auto; }
.acoes #temaCores { flex: 1 1 auto; }

@media (max-width: 640px) {
  .so-cel { display: inline-flex !important; }
  .so-tela { display: none !important; }
  .topo-in { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .logo { grid-column: 1 / 3; grid-row: 1; margin: 0; }
  .topo-in .apoio { grid-column: 3; grid-row: 1; }
  .topo nav { grid-column: 1 / -1; order: 5; display: none; }
  .topo nav.aberto { display: grid; }
  .topo nav .btn { justify-content: flex-start; }
  .topo-in .btn { padding-inline: 6px; gap: 5px; font-size: .875rem; }
  .ferramentas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .ferramentas .titulo-doc, .ferramentas .fonte-rapida { grid-column: 1 / -1; }
  .fonte-rapida select { flex: 1; }
  .ferramentas .btn { padding-inline: 6px; font-size: .875rem; gap: 5px; }
  body.foco .ferramentas { display: flex; }
  .ctrl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  body.foco .ctrl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ctrl #tocar { grid-column: 1 / -1; order: -1; }
  .ctrl .btn { font-size: 0.75rem; gap: 2px; padding-inline: 1px; }
  .campo-vel { padding-left: 0; flex-direction: column; justify-content: center; gap: 0; }
  .campo-vel .i { margin-top: 3px; width: 1em; height: 1em; }
  .campo-vel select { padding-inline: 1px; font-size: 0.8125rem; }
  .acoes-entrada > .btn:not(.forte) { padding-inline: 6px; font-size: .875rem; }
  .vista { padding-top: 22px; }
  .painel-libras { left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); width: auto; bottom: 146px; max-height: calc(100dvh - 160px); }
  body:not([data-vista="ler"]) .painel-libras { bottom: 16px; }
  #librasMoldura iframe { height: min(290px, calc(100dvh - 430px)); }
}

/* Preferências do aparelho: mais contraste e cores forçadas */
@media (prefers-contrast: more) {
  :root { --apagado: var(--tinta); --linha: var(--tinta); }
}
@media (forced-colors: active) {
  .btn, dialog, .barra, .painel-libras, .fechar-x, .tema-op { border: 1px solid ButtonText; }
  #texto .f-on { background: Canvas; outline: 2px solid CanvasText; color: CanvasText; forced-color-adjust: none; }
  #texto .w-on { background: Highlight; color: HighlightText; forced-color-adjust: none; }
}

/* Celular deitado ou zoom alto: a barra não pode ocupar metade da tela */
@media (max-height: 480px) {
  .barra { padding-block: 4px; }
  .prog { display: none; }
  .ctrl { display: flex; flex-wrap: nowrap; overflow-x: auto; }
  .ctrl #tocar { order: 0; }
  .ctrl .btn { min-width: 58px; flex: 1 0 auto; }
  body[data-vista="ler"] { padding-bottom: 76px; }
  .painel-libras { bottom: 60px; max-height: calc(100dvh - 70px); }
  #librasMoldura iframe { height: 200px; }
}

/* Celular: ícone em cima, palavra embaixo, sem quebrar a palavra no meio */
@media (max-width: 640px) and (min-height: 481px) {
  .ctrl .btn:not(#tocar) { flex-direction: column; gap: 1px; min-height: 52px; line-height: 1.1; }
  .ctrl .btn:not(#tocar) .i { width: 1.15em; height: 1.15em; }
  .ctrl #proxima { flex-direction: column-reverse; }
  #librasBarra .i { width: 1.4em; height: 1.4em; }
  .campo-vel select { min-height: 28px; flex: 0 1 auto; width: 100%; text-align: center; }
}
