/* 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: .9rem 1.1rem 1.2rem; font-family: var(--font-heading); font-size: 1rem; line-height: 1.62; color: var(--text-primary); overflow-wrap: anywhere; }
.pp-texto b { color: var(--text-primary); 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 {
  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 { 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: .9rem 0 .2rem; 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(--accent-emerald); }
.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; }
/* 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), minmax(0, 1fr)); gap: 2px; align-items: stretch; }
.raiox-rot { grid-column: 1; align-self: center; 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; aspect-ratio: 1 / 1; min-width: 0; 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); }
.raiox i.cit { outline: 1.5px solid #FFE58A; outline-offset: -1px; }
.raiox i.cit:not(.c1):not(.c2):not(.c3):not(.c4):not(.c5) { background: var(--accent-emerald); }
.raiox i.cit:not(.c1):not(.c2):not(.c3):not(.c4):not(.c5)::after { color: rgba(0, 0, 0, .55); }
.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-emerald); cursor: pointer; font-weight: 600; touch-action: manipulation; }
.raiox-sub b:hover { text-decoration: underline; }
.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), minmax(0, 1fr)); } .raiox-doc { font-size: .92rem; } .raiox-num i::after { font-size: 6px; } }
