/* Editor de PDF */
.pe { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.pe > * { min-width: 0; }
.pe-barra { position: sticky; top: 63px; z-index: 15; display: flex; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 6px 18px rgba(23,21,43,.08); }
.pe-fer { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; flex: 1; min-width: 0; }
.pe-acoes { display: flex; gap: 4px; flex: none; border-left: 1px solid var(--line); padding-left: 6px; }
.pe-barra button { font: inherit; font-size: 12px; font-weight: 600; color: var(--ink); background: transparent; border: 0; border-radius: 10px; min-width: 44px; min-height: 44px; padding: 4px 8px; display: grid; justify-items: center; align-content: center; gap: 2px; cursor: pointer; white-space: nowrap; flex: none; }
.pe-barra button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pe-barra button:hover:not(:disabled) { background: var(--soft); }
.pe-barra button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.pe-barra button:disabled { opacity: .35; cursor: default; }
.pe-props[hidden] { display: none; }
.pe-props { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13px; font-weight: 600; min-height: 40px; }
.pe-p { display: inline-flex; align-items: center; gap: 6px; }
.pe-p[hidden] { display: none; }
.pe-p input[type=color] { width: 36px; height: 32px; border: 1.5px solid var(--line); border-radius: 8px; padding: 2px; background: var(--card); cursor: pointer; }
.pe-p input[type=number] { width: 64px; font: inherit; font-size: 14px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 8px; }
.pe-p select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); }
.pe-chk input { width: 18px; height: 18px; accent-color: var(--brand); }
.pe-tog { font: inherit; font-size: 15px; width: 36px; height: 34px; justify-content: center; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; }
.pe-tog[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.pe-dica { margin: 0; font-size: 13px; color: var(--muted); min-height: 1.2em; }
.pe-paginas { display: grid; gap: 18px; justify-items: center; background: #e9e7f2; border-radius: 16px; padding: 16px 8px; overflow-x: auto; }
.pe-pag { display: grid; gap: 6px; justify-items: center; }
.pe-pag-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; font-size: 13px; color: var(--muted); }
.pe-pag-barra b { color: var(--ink); margin-right: 6px; }
.pe-pag-barra button { font: inherit; font-size: 13px; font-weight: 600; background: var(--card); border: 1px solid var(--line); border-radius: 8px; min-height: 34px; padding: 4px 10px; cursor: pointer; color: var(--ink); }
.pe-pag-barra button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pe-pag-barra button:disabled { opacity: .4; cursor: default; }
.pe-folha { position: relative; background: #fff; box-shadow: 0 4px 18px rgba(23,21,43,.18); flex: none; }
.pe-folha canvas.pe-fundo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pe-camada { position: absolute; inset: 0; overflow: hidden; }
.pe-camada.desenho { touch-action: none; cursor: crosshair; }
.pe-camada.escrever { cursor: text; }
.pe-obj { position: absolute; box-sizing: border-box; touch-action: none; }
.pe .ferr-selecionar .pe-obj { cursor: move; }
.pe-obj.texto { white-space: pre; line-height: 1.2; padding: 0; margin: 0; min-width: 4px; min-height: 1em; outline: none; }
.pe-obj.texto[contenteditable="true"] { cursor: text; outline: 1.5px dashed var(--brand); background: rgba(255,255,255,.6); }
.pe-obj.elipse { border-radius: 50%; }
.pe-obj.marca { mix-blend-mode: multiply; }
.pe-obj.img img { width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.pe-obj svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.pe-obj.vetor { pointer-events: none; }
.pe-obj.vetor .alvo { pointer-events: stroke; stroke: transparent; fill: none; }
.pe-obj.sel { outline: 2px solid var(--brand); outline-offset: 2px; }
.pe-obj.vetor.sel { outline: none; }
.pe-obj.vetor.sel svg .vis { filter: drop-shadow(0 0 2px rgba(68,51,230,.9)); }
.pe-alca { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; display: grid; place-items: center; touch-action: none; z-index: 3; cursor: nwse-resize; }
.pe-alca::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.pe-alvo { position: absolute; border-radius: 2px; cursor: text; background: rgba(68,51,230,.06); outline: 1px dashed rgba(68,51,230,.45); }
.pe-alvo:hover, .pe-alvo:focus-visible { background: rgba(68,51,230,.16); outline: 2px solid var(--brand); }
.pe-campo { position: absolute; z-index: 2; box-sizing: border-box; border: 1px solid rgba(68,51,230,.5); background: rgba(239,237,255,.92); font: inherit; padding: 0 3px; color: #000; }
.pe-campo:focus { outline: 2px solid var(--brand); background: #fff; }
input.pe-campo[type=checkbox] { accent-color: var(--brand); margin: 0; }
.pe-fim { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.pe-fim .btn-ghost { cursor: pointer; }
.pe-dialogo { border: 0; border-radius: 18px; padding: 0; width: min(640px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.pe-dialogo::backdrop { background: rgba(23,21,43,.45); }
.pe-dialogo form { padding: 18px; display: grid; gap: 12px; }
.pe-dialogo h2 { margin: 0; font-size: 18px; }
.pe-abas { display: flex; gap: 6px; }
.pe-abas button { font: inherit; font-weight: 600; font-size: 14px; border: 1.5px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.pe-abas button[aria-selected="true"] { border-color: var(--brand); color: var(--brand); background: var(--soft); }
.pe-dialogo canvas { width: 100%; height: auto; border: 1.5px dashed var(--soft-line); border-radius: 12px; background: #fff; touch-action: none; display: block; }
.pe-dialogo input[type=text] { font: inherit; font-size: 16px; width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.pe-dlg-acoes { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (max-width: 760px) {
  /* celular: ferramentas na 1ª linha (rolam de lado), desfazer/zoom na 2ª */
  .pe-barra { top: 63px; border-radius: 12px; flex-wrap: wrap; gap: 2px; }
  .pe-fer { flex-basis: 100%; }
  .pe-acoes { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 2px; width: 100%; justify-content: space-around; }
  .pe-acoes button { min-height: 38px; }
  .pe-barra button span { font-size: 11px; }
  .pe-paginas { padding: 10px 4px; border-radius: 12px; }
}
