/* prova-pagina.css — botão de página, painel da prova em texto e raio-X.
   Só ganha elementos quando prova-pagina.js está ativo para a conta (lab). */

/* ── botão de página: pílula com ícone de "vai para a página" ── */
.page-ref[data-tipo="pdf"][role="button"] {
  display: inline-flex; align-items: center; gap: 0.18rem;
  padding: 0.04rem 0.42rem 0.04rem 0.55rem; margin: 0 0.05rem;
  border-radius: 999px;
  background: rgba(78, 146, 112, 0.14);
  -webkit-background-clip: border-box; background-clip: border-box;
  border: 1px solid rgba(78, 146, 112, 0.45);
  color: var(--accent-emerald);
  font-weight: 600; font-size: 0.86em; line-height: 1.35;
  white-space: nowrap; cursor: pointer; vertical-align: baseline;
  text-decoration: none; touch-action: manipulation; user-select: none;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.page-ref[data-tipo="pdf"][role="button"] > i { font-size: 0.95em; line-height: 1; opacity: .9; }
.page-ref[data-tipo="pdf"][role="button"]:hover,
.page-ref[data-tipo="pdf"][role="button"]:focus-visible {
  background: rgba(78, 146, 112, 0.28); border-color: var(--accent-emerald); color: #DFF3E8; outline: none; transform: translateY(-1px);
}
.page-ref[data-tipo="pdf"][role="button"]:active { transform: translateY(0); }
.page-ref[data-tipo="fls"] { opacity: .85; }
.page-ref-flash { animation: prova-flash 1.4s ease; }
@keyframes prova-flash { 0%, 60% { box-shadow: 0 0 0 4px rgba(124, 196, 154, .5); } 100% { box-shadow: none; } }

/* ── painel ── */
#prova-painel {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(460px, 100vw);
  background: var(--bg-secondary); color: var(--text-primary);
  border-left: 1px solid var(--border-color); box-shadow: -12px 0 40px rgba(0, 0, 0, .45);
  transform: translateX(105%); transition: transform .22s ease; z-index: 9000;
  display: flex; flex-direction: column; font-family: var(--font-body);
  touch-action: manipulation; /* sem zoom de toque duplo nos botões */
}
#prova-painel.aberto { transform: translateX(0); }
.pp-cab { flex: none; display: flex; align-items: flex-start; gap: .6rem; padding: .9rem 1rem .6rem; border-bottom: 1px solid var(--border-color); }
.pp-tit { display: flex; flex-direction: column; gap: .1rem; min-width: 0; flex: 1; }
.pp-doc { font-family: var(--font-heading); font-size: 1rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pp-pag { font-family: var(--font-mono); font-size: .74rem; color: var(--accent-emerald); letter-spacing: .04em; }
.pp-fechar { background: transparent; border: none; color: var(--text-secondary); font-size: 1.3rem; cursor: pointer; padding: .1rem .3rem; border-radius: 6px; touch-action: manipulation; }
.pp-fechar:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.pp-status { flex: none; font-size: .78rem; padding: .4rem 1rem; color: var(--text-muted); border-bottom: 1px solid var(--border-color); }
.pp-status.ok { color: var(--accent-emerald); }
.pp-status.quase { color: #D9B061; }
.pp-status.nao { color: #E08A76; }
.pp-status.ctx { color: var(--text-secondary); }
.pp-cit { flex: none; font-family: var(--font-heading); font-style: italic; font-size: .9rem; color: var(--text-secondary); padding: .55rem 1rem .65rem; line-height: 1.45; max-height: 7rem; overflow: auto; border-bottom: 1px solid var(--border-color); }
.pp-cit[hidden] { display: none; }
.pp-texto { flex: 1; overflow: auto; padding: 1rem 1rem 1.4rem; background: var(--bg-primary); overflow-wrap: anywhere; }
/* ── Folha (08/09): papel claro SEMPRE, mesmo no tema escuro — é uma folha
   numa sala escura, e o contraste vira a assinatura do painel. ── */
.pp-folha { position: relative; background: #F5F2EA; color: #1F2320; padding: 1.5rem 1.6rem 1.4rem 1.7rem; border-radius: 2px; font-family: var(--font-heading); font-size: 1rem; line-height: 1.62;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 14px 32px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.22);
  background-image: radial-gradient(rgba(0,0,0,.028) 1px, transparent 1px); background-size: 5px 5px; }
.pp-folha::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(90deg, rgba(0,0,0,.10), transparent); border-radius: 2px 0 0 2px; }
.pp-folha.com-cit::after { content: ""; position: absolute; right: -7px; top: 2.2rem; width: 7px; height: 2.4rem; background: var(--accent-emerald, #4E9270); border-radius: 0 3px 3px 0; box-shadow: 2px 0 4px rgba(0,0,0,.25); }
.pp-folha-cab { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: #5C625E; border-bottom: 1px solid rgba(0,0,0,.14); padding-bottom: .55rem; margin-bottom: 1.1rem; }
.pp-folha-cab b { font-weight: 500; color: #1F2320; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pp-folha-cab span { flex: none; }
.pp-folha-nota { font-family: "Caveat", "Segoe Print", "Bradley Hand", cursive; font-size: 1.05rem; line-height: 1.2; color: #27543F; margin: -.5rem 0 .8rem; padding-left: 1.1rem; position: relative; }
.pp-folha-nota::before { content: ""; position: absolute; left: 0; top: .6rem; width: .7rem; height: 1px; background: #27543F; }
.pp-folha-txt { text-align: justify; hyphens: auto; }
.pp-folha-txt b { color: #1F2320; font-weight: 600; }
.pp-folha-pe { text-align: center; font-family: var(--font-heading); font-size: .78rem; letter-spacing: .08em; color: #5C625E; margin-top: 1.6rem; min-height: 1em; }
.pp-folha b, .pp-folha-txt b { color: #1F2320; font-weight: 600; }

/* marca-texto verde Segan: faixa translúcida atrás do texto, pontas suaves,
   o texto mantém a cor. Parece caneta, não bloco. */
.pp-texto mark, .pp-folha mark {
  color: inherit; background: transparent; padding: .06em .12em 0.02em; margin: 0 -.02em;
  background-image: linear-gradient(180deg, transparent 12%, rgba(124, 196, 154, .42) 12%, rgba(124, 196, 154, .42) 88%, transparent 88%);
  border-radius: .18em .28em .16em .3em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.pp-esqueleto { height: 60%; border-radius: 8px; background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%); background-size: 200% 100%; animation: pp-shimmer 1.1s linear infinite; }
@keyframes pp-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pp-rodape { flex: none; display: flex; justify-content: space-between; gap: .5rem; padding: .55rem .8rem; border-top: 1px solid var(--border-color); }
.pp-nav { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); font-family: inherit; font-size: .76rem; padding: .35rem .6rem; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: .2rem; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.pp-nav:hover { color: var(--text-primary); border-color: var(--accent-emerald); }
@media (max-width: 880px) {
  #prova-painel { top: auto; bottom: 0; right: 0; left: 0; width: 100vw; height: 80dvh; border-left: none; border-top: 1px solid var(--border-color); border-radius: 16px 16px 0 0; transform: translateY(105%); }
  #prova-painel.aberto { transform: translateY(0); }
  .pp-texto { padding: .7rem .6rem 1rem; }
  .pp-folha { padding: 1.2rem 1.1rem 1.2rem 1.3rem; font-size: 1.02rem; }
}
@media (prefers-reduced-motion: reduce) { #prova-painel { transition: none; } .pp-esqueleto { animation: none; } .page-ref-flash { animation: none; } }

/* ── raio-X ── */
.raiox-box { margin: 0 0 1.25rem; padding: .7rem .8rem .75rem; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-secondary); touch-action: manipulation; }
.raiox-cab { display: flex; flex-direction: column; gap: .15rem; margin-bottom: .3rem; }
.raiox-tit { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.raiox-qual { text-transform: none; letter-spacing: 0; color: var(--text-secondary); }
.raiox-doc { font-family: var(--font-heading); font-size: .98rem; line-height: 1.3; color: var(--text-primary); }
.raiox-descr { font-size: .78rem; line-height: 1.4; color: var(--text-secondary); margin: 0 0 .55rem; }
.raiox-aviso { margin: .55rem 0 0; font-size: .74rem; color: var(--text-muted); }
/* grade: primeira coluna é o rótulo da linha (número da primeira página) */
.raiox { display: grid; grid-template-columns: 2.4rem repeat(var(--cols, 20), var(--cel, 12px)); grid-auto-rows: var(--cel, 12px); gap: 2px; align-items: start; justify-content: start; }
.raiox-rot { grid-column: 1; align-self: center; height: var(--cel, 12px); line-height: var(--cel, 12px); font-family: var(--font-mono); font-style: normal; font-size: .62rem; color: var(--text-muted); text-align: right; padding-right: .35rem; }
.raiox i { display: flex; align-items: center; justify-content: center; width: var(--cel, 12px); height: var(--cel, 12px); background: var(--bg-tertiary); border-radius: 2px; cursor: pointer; }
.raiox-num i::after { content: attr(data-p); font-family: var(--font-mono); font-style: normal; font-size: clamp(6px, .55rem, 9px); line-height: 1; color: rgba(255, 255, 255, .28); }
.raiox i.c1 { background: #1F3A31; } .raiox i.c2 { background: #27543F; } .raiox i.c3 { background: #33754F; }
.raiox i.c4 { background: #4E9270; } .raiox i.c5 { background: #7CC49A; box-shadow: 0 0 5px rgba(124, 196, 154, .55); }
.raiox i.c3::after, .raiox i.c4::after, .raiox i.c5::after { color: rgba(0, 0, 0, .55); }
/* citadas: sem contorno (08/09); ficam na lista de baixo */
.raiox i.cit:not(.c1):not(.c2):not(.c3):not(.c4):not(.c5) { background: var(--accent-emerald); }

.raiox i:hover { filter: brightness(1.35); }
.raiox-pe { display: flex; flex-direction: column; gap: .2rem; margin-top: .55rem; }
.raiox-sub { font-family: var(--font-mono); font-size: .7rem; color: var(--text-muted); }
.raiox-sub b { color: var(--accent-cyan); cursor: pointer; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(76, 138, 147, .6); touch-action: manipulation; }
.raiox-sub b:hover { color: var(--text-primary); text-decoration-color: currentColor; }
.raiox-leg { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-mono); font-size: .64rem; color: var(--text-muted); margin-top: .15rem; }
.raiox-leg i { display: inline-block; width: 9px; height: 9px; border-radius: 1px; margin-right: 1px; }
@media (max-width: 880px) { .raiox { gap: 1px; grid-template-columns: 2rem repeat(var(--cols, 15), var(--cel, 12px)); } .raiox-doc { font-size: .92rem; } .raiox-num i::after { font-size: 6px; } }
/* chip sem documento identificável (multi-docs): texto, sem link */
.page-ref-sem-doc { opacity: .85; cursor: default; text-decoration: none; }
