:root {
  color-scheme: dark;
  --fundo: #090a09;
  --papel: #f9f6ec;
  --cinza: #c0c0b9;
  --cor: #ff7653;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --base: max(12px, env(safe-area-inset-bottom));
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; background: var(--fundo); }
body { color: var(--papel); font: 16px var(--sans); }
button, a, input { color: inherit; font: inherit; -webkit-tap-highlight-color: transparent; }
button { border: 0; padding: 0; background: none; cursor: pointer; }
a { text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--cor); outline-offset: 3px; }
svg { display: block; width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; flex-shrink: 0; }
.simbolos { display: none; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app { position: relative; isolation: isolate; height: 100vh; height: 100dvh; width: min(100%, max(460px, calc((100dvh - 240px) * 1.33333))); margin-inline: auto; }
.cabeca { position: absolute; z-index: 3; inset: env(safe-area-inset-top) 0 auto; display: flex; justify-content: center; align-items: center; min-height: 60px; pointer-events: none; }
.cabeca button, .canais { pointer-events: auto; }
.canais { display: flex; gap: 23px; align-items: center; }
.canais button { position: relative; min-height: 46px; color: #a7a8a4; font-weight: 650; font-size: 16px; }
.canais button[aria-pressed="true"] { color: #fff; }
.canais button[aria-pressed="true"]::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 23px; height: 3px; border-radius: 2px; background: var(--cor); transform: translateX(-50%); }
.tecla { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.pesquisa-topo { position: absolute; right: max(8px, env(safe-area-inset-right)); }
#emissao { height: 100%; width: 100%; position: relative; overflow: hidden; outline: 0; user-select: none; -webkit-user-select: none; }
#emissao, .toque { touch-action: pan-x pinch-zoom; }
#fita, .peca { position: absolute; inset: 0; }
#fita { transform: translate3d(0,0,0); will-change: transform; }
.peca { overflow: hidden; background: var(--fundo); contain: layout paint; }
.peca[data-lugar="-1"] { transform: translateY(-100%); }
.peca[data-lugar="1"] { transform: translateY(100%); }
.visor { position: absolute; top: 44.5%; left: 0; width: 100%; aspect-ratio: 4/3; transform: translateY(-50%); overflow: hidden; background: #000; pointer-events: none; }
.visor video, .visor img { position: absolute; top: 0; left: var(--esquerda, 0%); display: block; width: var(--largura, 100%); height: 100%; object-fit: contain; }
.peca[data-imagem="pronta"] .capa { visibility: hidden; }
.toque { position: absolute; inset: 0; width: 100%; height: 100%; }
.toque:focus-visible { outline-offset: -4px; }
.convite { position: absolute; top: 44.5%; left: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px; padding: 11px 15px; border-radius: 24px; color: #fff; background: #131410d9; font-size: 14px; font-weight: 650; white-space: nowrap; }
.convite svg { width: 17px; height: 17px; }
.editorial { position: absolute; z-index: 1; bottom: calc(var(--base) + 32px); left: max(18px, env(safe-area-inset-left)); right: 77px; pointer-events: none; }
.fonte { display: inline-flex; align-items: center; min-height: 44px; gap: 7px; color: var(--papel); font: 650 12px var(--mono); letter-spacing: .035em; pointer-events: auto; }
.fonte i { font-style: normal; color: var(--cor); }
.fonte svg { width: 13px; height: 13px; color: var(--cinza); }
.legenda { max-width: 42ch; min-height: 2.45em; margin: 0; font: 650 clamp(20px,5.65vw,30px)/1.16 var(--sans); letter-spacing: -.035em; text-wrap: pretty; overflow-wrap: anywhere; }
.legenda.longa { font-size: clamp(17px,4.75vw,24px); line-height: 1.23; }
.acoes { position: absolute; z-index: 2; right: max(8px,env(safe-area-inset-right)); bottom: calc(var(--base) + 32px); display: grid; gap: 8px; }
.acoes button { display: flex; width: 56px; min-height: 46px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #fff; text-shadow: 0 1px 3px #000b; }
.disco { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; background: #20211fcf; }
.disco svg { width: 23px; height: 23px; }
.nome-acao { font-size: 10px; font-weight: 650; line-height: 1.15; }
#guardar[aria-pressed="true"] .disco { color: var(--cor); }
#guardar[aria-pressed="true"] svg { fill: currentColor; }
.sair-selecao { position: absolute; top: calc(env(safe-area-inset-top) + 54px); left: 50%; z-index: 2; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; max-width: 85%; min-height: 36px; padding: 4px 11px; border-radius: 20px; background: #191a18e6; font-size: 12px; }
.sair-selecao span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sair-selecao svg { width: 13px; height: 13px; }
.regua { position: absolute; z-index: 2; bottom: max(2px, calc(env(safe-area-inset-bottom) - 7px)); left: max(16px,env(safe-area-inset-left)); right: max(16px,env(safe-area-inset-right)); height: 30px; display: flex; align-items: center; }
.traco { width: 100%; height: 2px; background: #3a3b37; }
#progresso { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left center; background: var(--cor); }
#tempo { appearance: none; -webkit-appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; margin: 0; cursor: pointer; background: transparent; touch-action: none; }
#tempo::-webkit-slider-runnable-track { height: 2px; background: transparent; }
#tempo::-webkit-slider-thumb { -webkit-appearance: none; width: 8px; height: 8px; margin-top: -3px; border-radius: 50%; background: var(--cor); opacity: 0; }
#tempo::-moz-range-thumb { border: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--cor); }
#tempo:focus-visible::-webkit-slider-thumb, #tempo:active::-webkit-slider-thumb { opacity: 1; }
#contador { position: absolute; left: 0; bottom: 100%; padding: 5px 8px; border-radius: 4px; background: #22231f; font: 11px var(--mono); pointer-events: none; visibility: hidden; }
#tempo:active + #contador, #tempo:focus-visible + #contador { visibility: visible; }
.passos { position: absolute; z-index: 2; right: 8px; top: 50%; display: grid; gap: 7px; transform: translateY(-50%); }
.passos .tecla { background: #272825ce; color: #fff; }
#aviso:not(:empty) { position: absolute; z-index: 4; left: 50%; top: calc(env(safe-area-inset-top) + 64px); transform: translateX(-50%); padding: 8px 13px; background: #292a27f2; border-radius: 18px; color: #fff; font-size: 13px; white-space: nowrap; pointer-events: none; }
@media (min-width: 780px) {
  .passos { right: auto; left: min(calc(100% + 15px), calc(50% + 50vw - 52px)); }
  .editorial { left: 20px; right: 95px; }
}
@media (pointer:coarse) {
  .passos:not(:focus-within) { width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (max-width: 540px) and (max-height: 655px) and (orientation:portrait) {
  .cabeca { min-height: 49px; }
  .visor, .convite { top: 42%; }
  .acoes { gap: 4px; }
  .disco { width: 34px; height: 34px; }
  .editorial { bottom: calc(var(--base) + 25px); }
  .legenda { font-size: clamp(18px,5.25vw,23px); }
  .legenda.longa { font-size: 16px; }
}
@media (max-height: 525px) and (orientation:landscape) {
  .app { width: 100%; }
  .cabeca { min-height: 44px; }
  .visor { left: max(1.5%,env(safe-area-inset-left)); width: min(56%, calc((100dvh - 66px) * 1.33333)); top: 52%; }
  .convite { left: 27%; top: 52%; }
  .editorial { left: 58%; right: 65px; bottom: calc(var(--base) + 35px); }
  .legenda, .legenda.longa { font-size: clamp(16px,3.8dvh,22px); }
  .acoes { bottom: calc(var(--base) + 26px); gap: 2px; }
  .disco { width: 30px; height: 30px; }
  .passos { left: 58%; right: auto; top: 58px; display: flex; }
}
dialog { width: min(620px, calc(100vw - 24px)); max-height: 85dvh; overflow-y: auto; border: 1px solid #86816f; border-radius: 12px; background: #eee8d7; color: #26271f; padding: 17px 22px 22px; color-scheme: light; }
dialog::backdrop { background: #080907b8; }
dialog[open] { display: flex; flex-direction: column; }
#indice-painel { display: flex; flex-direction: column; min-height: 0; }
#pesquisa { flex: none; width: 100%; margin-top: 12px; padding: 10px 12px; border: 1px solid #a9a594; border-radius: 4px; background: #faf6ea; color: #26271f; font: 16px var(--sans); }
#lista { overflow-y: auto; overscroll-behavior: contain; }
.painel-cabeca { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.painel-cabeca h2 { margin: 0; font: 500 36px/1 Georgia, serif; letter-spacing: -.055em; }
.selecao { display: flex; flex-wrap: wrap; gap: 4px; }
.selecao button { padding: 5px 10px; border: 1px solid #a9a594; border-radius: 3px; font-size: 13px; }
.selecao button[aria-pressed="true"] { color: #fff8e6; border-color: #26271f; background: #26271f; }
.opcoes-grelha, .resumo-grelha { display: flex; align-items: center; justify-content: space-between; gap: 7px; flex: none; }
.opcoes-grelha { margin: 10px 0 3px; }
.selecao button, #decada { min-height: 40px; }
#decada { max-width: 105px; padding: 5px 3px; font: 600 13px var(--sans); color: #36362c; border: 0; border-bottom: 1px solid #999483; border-radius: 0; background: transparent; }
.resumo-grelha { padding: 0 0 4px; color: #5b584a; }
#contagem { font: 600 11px var(--mono); letter-spacing: .035em; }
#ver-ao-acaso { min-height: 36px; padding: 0; font-size: 13px; font-weight: 650; }
#ver-ao-acaso:disabled { visibility: hidden; }
#lista { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; align-content: start; padding: 2px 3px 4px; }
.linha { align-self: start; padding: 0; display: flex; flex-direction: column; min-width: 0; text-align: left; }
.linha img { display: block; width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; background: #24251e; }
.linha strong { width: 100%; overflow-wrap: anywhere; font: 600 16px/1.12 Georgia, serif; }
.linha small, .arquivo-id { display: block; margin: 6px 0 4px; color: #675344; font: 600 10px/1.25 var(--mono); text-transform: uppercase; }
.linha[aria-current="true"] img { outline: 3px solid #ad452a; outline-offset: -3px; }
.linha:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.mais, .legado, .vazio { grid-column: 1/-1; }
.mais { width: 100%; min-height: 44px; margin: 2px 0; border: 1px solid #a9a594; border-radius: 4px; font-weight: 650; }
.legado { padding: 10px 0; text-decoration: underline; }
.vazio, #ficha p { line-height: 1.45; }
#ficha h3 { margin: 8px 0 18px; font: 500 29px/1.12 Georgia, serif; letter-spacing: -.04em; }
#ficha .arquivo-id { margin-top: 17px; }
#ficha p { margin: 10px 0; font-size: 14px; }
#ficha .nota { font-size: 13px; color: #595a4f; }
.integral, .museu { display: block; width: fit-content; min-height: 44px; padding: 13px 0; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.integral { margin-top: 10px; font-weight: 700; }
#partilha p { line-height: 1.45; }
#partilha-titulo { font: 500 24px/1.15 Georgia, serif; }
#partilha label { display: block; margin: 16px 0 6px; font-size: 13px; }
#ligacao { width: 100%; padding: 10px; border: 1px solid #a9a594; border-radius: 4px; background: #faf6ea; color: #26271f; font: 16px var(--sans); }
#copiar { min-height: 44px; margin-top: 12px; padding-inline: 16px; border-radius: 4px; color: #fff8e6; background: #26271f; font-weight: 650; }
#estado-copia { font-size: 13px; }
@media (max-width: 720px) and (orientation:portrait) {
  dialog { width: min(510px, calc(100vw - 12px)); max-height: 90dvh; padding: 12px 14px max(16px, env(safe-area-inset-bottom)); }
  .resumo-grelha, .painel-cabeca { flex-shrink: 0; }
}
@media (max-width: 380px) {
  .selecao button { padding-inline: 7px; }
  #decada { max-width: 85px; }
}
@media (min-width: 600px) {
  #lista { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
