/* Puerícia · "Marcar na tela" (23/10/2026): editor de anotação (js/anotar.js), anexo na janela do relato e miniatura na
   Gestão (js/relato.js). Usa as variáveis de cor de app.css (modo claro e noturno). */

/* ---------- editor em tela cheia ---------- */
.anotar { position: fixed; inset: 0; z-index: 115; background: var(--bg); color: var(--text); display: flex; flex-direction: column;
  padding: max(10px, env(safe-area-inset-top)) 16px max(10px, env(safe-area-inset-bottom)); gap: 8px; overscroll-behavior: contain; }
.anotar-topo { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; }
.anotar-topo h2 { margin: 0; font-family: var(--cond); font-size: 24px; }
.anotar-aviso { margin: 0; flex: 1 1 320px; font-size: 13.5px; color: var(--amber); background: var(--amber-bg); border: 1px solid var(--amber-border);
  border-radius: 8px; padding: 6px 10px; }
.anotar-barra { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.anotar-grupo { display: flex; gap: 6px; flex-wrap: wrap; }
.anotar-bt { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 48px; min-height: 48px; padding: 6px 12px;
  background: var(--surface); color: var(--heading); border: 1.5px solid var(--input); border-radius: 10px; font-weight: 600; font-size: 14px; }
.anotar-bt[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.anotar-bt:disabled { opacity: .4; cursor: not-allowed; }
.anotar-cor { padding: 6px; }
.anotar-cor[aria-pressed="true"] { background: var(--surface); border: 3px solid var(--heading); box-shadow: 0 0 0 2px var(--surface) inset; }
.anotar-amostra { display: block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(0,0,0,.25); }
.anotar-palco { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.anotar-quadro { display: block; touch-action: none; -webkit-user-select: none; user-select: none; cursor: crosshair;
  box-shadow: 0 2px 14px rgba(10,25,50,.25); background: #fff; }
.anotar-quadro[data-ferramenta="texto"] { cursor: text; }
.anotar-entrada { position: absolute; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: min(440px, calc(100% - 16px));
  background: var(--surface); border: 1.5px solid var(--heading); border-radius: 12px; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.anotar-entrada input { flex: 1 1 180px; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--input); border-radius: 8px; background: var(--input-bg); font-size: 16px; }
.anotar-msg { flex-basis: 100%; color: var(--red-dark); font-weight: 600; }
.anotar-msg:empty { display: none; }
.anotar-dica { margin: 0; font-size: 13px; color: var(--muted); }
.anotar-erro { margin: 0; color: var(--red-dark); font-weight: 600; }
.anotar-acoes { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.anotar-acoes .botao { min-height: 52px; }

@media (max-width: 760px) {
  .anotar { padding-left: 10px; padding-right: 10px; gap: 6px; }
  .anotar-topo h2 { font-size: 20px; }
  .anotar-aviso { font-size: 12.5px; padding: 5px 8px; }
  .anotar-rot { display: none; }                 /* só os ícones no celular (cada botão tem title e rótulo para leitor de tela) */
  .anotar-barra { gap: 6px; }
  .anotar-grupo { gap: 5px; }
  .anotar-bt { min-width: 50px; min-height: 50px; padding: 6px; }
  .anotar-dica { display: none; }
  .anotar-acoes .botao { flex: 1 1 0; }
}
@media (max-width: 760px) and (max-height: 640px) { .anotar-aviso { flex-basis: 100%; } }

/* ---------- anexo na janela do relato ---------- */
.anexo-relato { display: flex; flex-direction: column; gap: 8px; border: 1.5px dashed var(--input); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.anexo-vazio { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.anexo-vazio small { color: var(--muted); }
.anexo-marcar { min-height: 48px; }
.anexo-pronto { display: flex; gap: 12px; align-items: center; }
.anexo-mini-bt { padding: 0; border: 1.5px solid var(--border); border-radius: 8px; background: #fff; overflow: hidden; flex: 0 0 auto; line-height: 0; }
.anexo-mini { display: block; width: 120px; max-height: 160px; object-fit: contain; }
.anexo-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.anexo-info small { color: var(--muted); }
.anexo-botoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.anexo-falha { display: flex; flex-direction: column; gap: 8px; margin: 0; }

/* ---------- Gestão: miniatura e imagem grande ---------- */
.anexo-ver { display: block; margin-top: 6px; padding: 0; border: 1.5px solid var(--border); border-radius: 8px; background: #fff; overflow: hidden; line-height: 0; max-width: 140px; }
.anexo-ver img { display: block; width: 100%; height: auto; max-height: 120px; object-fit: cover; object-position: top; }
.anexo-ver span { display: inline-block; line-height: 1.3; padding: 6px 10px; color: var(--heading); font-weight: 600; font-size: 13px; }
.anexo-ver:hover, .anexo-ver:focus-visible { border-color: var(--heading); }
.caixa.janela-anexo { max-width: min(1100px, 100%); }
.anexo-grande { display: block; max-width: 100%; max-height: calc(100vh - 200px); margin: 0 auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
