/* ═══════════════════════════════════════════════════════════════════════
   Central de edição do Editar PDF (utils/pdfWorkspace.js)
   Layout de editor de desktop: barra superior, trilho de categorias à
   esquerda, faixa de ferramentas, miniaturas, documento e propriedades.
   ═══════════════════════════════════════════════════════════════════════ */

.pw-host { width: 100%; max-width: none; margin: var(--space-md) auto 0; text-align: left; }
.pw-host .error-msg { max-width: none; margin: 0 0 var(--space-sm); }

.pw {
  --pw-rail: 84px;
  --pw-thumbs: 168px;
  --pw-props: 290px;
  --pw-canvas-bg: #E9EDF3;
  --pw-page-shadow: 0 1px 3px rgba(16, 27, 65, .12), 0 6px 18px rgba(16, 27, 65, .10);
  --pw-sel: var(--brand-primary);
  display: grid;
  grid-template-columns: var(--pw-rail) 0 minmax(0, 1fr) var(--pw-props);
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas:
    "top   top    top    top"
    "rail  ribbon ribbon ribbon"
    "rail  thumbs canvas props";
  height: calc(100vh - var(--header-h) - 32px);
  min-height: 560px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  font-family: var(--font-body);
  color: var(--color-text);
  transition: grid-template-columns var(--duration-med) var(--ease);
}
.pw.pw-thumbs-open { grid-template-columns: var(--pw-rail) var(--pw-thumbs) minmax(0, 1fr) var(--pw-props); }
[data-theme="dark"] .pw { --pw-canvas-bg: #0A1022; --pw-page-shadow: 0 2px 10px rgba(0, 0, 0, .55); }

.pw svg { flex-shrink: 0; }

/* ─── Barra superior ───────────────────────────────────────────────────── */
.pw-top {
  grid-area: top;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(90deg, var(--banner-gradient-1), var(--banner-gradient-4));
  color: #fff;
  min-width: 0;
}
.pw-top .pw-icon-btn { color: rgba(255, 255, 255, .88); }
.pw-top .pw-icon-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .14); color: #fff; }
.pw-top .pw-icon-btn:disabled { opacity: .4; }
.pw-file { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 300px; }
.pw-file-badge { background: #E5322D; color: #fff; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 2px 5px; letter-spacing: .03em; }
.pw-file-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 500; }
.pw-top-group { display: flex; align-items: center; gap: 2px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .18); }
.pw-zoom-val { min-width: 48px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.pw-page-input {
  width: 46px; height: 28px; text-align: center; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .1); color: #fff; font: inherit; font-size: 13px;
}
.pw-page-input::-webkit-inner-spin-button { display: none; }
.pw-page-total { font-size: 13px; opacity: .8; padding: 0 4px; }
.pw-top-spacer { flex: 1; }
.pw-close { background: transparent !important; color: #fff !important; border-color: rgba(255, 255, 255, .35) !important; display: inline-flex; align-items: center; gap: 6px; }
.pw-close:hover { background: rgba(255, 255, 255, .12) !important; }
.pw-add { background: rgba(255, 255, 255, .1) !important; color: #fff !important; border-color: rgba(255, 255, 255, .35) !important; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pw-add:hover { background: rgba(255, 255, 255, .2) !important; }
/* Arquivos sendo arrastados sobre o documento */
.pw.pw-drop .pw-canvas { outline: 3px dashed var(--brand-primary); outline-offset: -10px; background: rgba(var(--brand-primary-rgb), .08); }
.pw.pw-drop .pw-canvas::after {
  content: 'Solte para adicionar ao fim do documento'; position: sticky; bottom: 16px; left: 0; display: block; width: max-content; margin: -40px auto 0;
  padding: 8px 14px; border-radius: 999px; background: var(--brand-primary); color: #fff; font-size: 13px; font-weight: 600; pointer-events: none;
}
/* Conversão/junção em andamento */
.pw-busy { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 48px 16px; color: var(--color-muted); font-size: 15px; text-align: center; }
.pw-busy::before {
  content: ''; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--brand-soft-strong); border-top-color: var(--brand-primary);
  animation: pw-spin .8s linear infinite; flex-shrink: 0;
}
@keyframes pw-spin { to { transform: rotate(360deg); } }
.pw-host #editor-root { position: relative; }
.pw-busy-overlay {
  position: absolute; inset: 0; z-index: 50; margin: 0; border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-surface) 82%, transparent); color: var(--color-text); font-weight: 500;
  backdrop-filter: blur(2px);
}
.pw-formats-hint { margin-top: 4px; opacity: .85; }
.pw-save { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 9px 18px; }

.pw-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent;
  color: var(--color-muted); cursor: pointer; transition: background var(--duration-fast), color var(--duration-fast);
}
.pw-icon-btn:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand-primary); }
.pw-icon-btn:disabled { cursor: default; }

/* ─── Trilho de categorias ─────────────────────────────────────────────── */
.pw-rail {
  grid-area: rail;
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 6px;
  background: var(--color-surface-2);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
}
.pw-rail-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 4px; border: 0; border-radius: 10px; background: transparent;
  color: var(--color-muted); font: inherit; font-size: 11.5px; font-weight: 500; cursor: pointer;
  position: relative; transition: background var(--duration-fast), color var(--duration-fast);
}
.pw-rail-btn:hover { background: var(--brand-soft); color: var(--brand-primary); }
.pw-rail-btn.active { background: var(--brand-soft-strong); color: var(--brand-primary); font-weight: 600; }
.pw-rail-btn.active::before {
  content: ''; position: absolute; left: -6px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-primary);
}

/* ─── Faixa de ferramentas ─────────────────────────────────────────────── */
.pw-ribbon {
  grid-area: ribbon;
  display: flex; align-items: stretch; gap: 6px;
  min-height: 64px; padding: 6px 10px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  overflow-x: auto; scrollbar-width: thin;
}
.pw-ribbon-group { display: flex; align-items: center; gap: 2px; padding-right: 8px; border-right: 1px solid var(--color-border); }
.pw-ribbon-group:last-child { border-right: 0; }
.pw-tool-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 64px; height: 52px; padding: 4px 8px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--color-text); font: inherit; font-size: 11.5px; cursor: pointer; white-space: nowrap;
  transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
}
.pw-tool-btn svg { color: var(--gray-600); }
.pw-tool-btn:hover { background: var(--color-surface-2); }
.pw-tool-btn.active { background: var(--brand-soft); border-color: var(--brand-border-soft); color: var(--brand-primary); }
.pw-tool-btn.active svg { color: var(--brand-primary); }
.pw-tool-btn.pw-danger:hover { color: var(--color-error); }
.pw-tool-btn.pw-danger:hover svg { color: var(--color-error); }
.pw-ribbon-format { gap: 10px; padding-left: 4px; }
.pw-color, .pw-num { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-muted); }
.pw-color input { width: 30px; height: 30px; padding: 0; border: 1px solid var(--color-border); border-radius: 6px; background: none; cursor: pointer; }
.pw-num input { width: 54px; height: 30px; border: 1px solid var(--color-border); border-radius: 6px; padding: 0 6px; font: inherit; font-size: 13px; background: var(--color-surface); color: var(--color-text); }
.pw-fmt-btn { width: 32px; height: 30px; border: 1px solid var(--color-border); border-radius: 6px; background: var(--color-surface); color: var(--color-text); cursor: pointer; font: inherit; }
.pw-fmt-btn.active { background: var(--brand-soft-strong); border-color: var(--brand-primary); color: var(--brand-primary); }
.pw-ribbon-note { font-size: 13px; color: var(--color-muted); padding: 0 8px; max-width: 640px; }

/* ─── Miniaturas ───────────────────────────────────────────────────────── */
.pw-thumbs {
  grid-area: thumbs;
  background: var(--color-surface-2);
  border-right: 1px solid var(--color-border);
  overflow: hidden; min-width: 0;
}
.pw-thumbs-list { height: 100%; overflow-y: auto; padding: 12px 8px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; scrollbar-width: thin; }
.pw-thumb { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; user-select: none; touch-action: pan-y; }
.pw-thumb-frame {
  position: relative; background: #fff; border-radius: 3px; outline: 2px solid transparent; outline-offset: 2px;
  box-shadow: 0 1px 3px rgba(16, 27, 65, .18); overflow: hidden; transition: outline-color var(--duration-fast);
}
.pw-thumb-img { position: absolute; left: 50%; top: 50%; transform-origin: center; }
.pw-thumb-img canvas { width: 100%; height: 100%; display: block; }
.pw-thumb-num { font-size: 12px; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.pw-thumb:hover .pw-thumb-frame { outline-color: var(--gray-300); }
.pw-thumb.current .pw-thumb-frame { outline-color: var(--brand-primary); }
.pw-thumb.current .pw-thumb-num { color: var(--brand-primary); font-weight: 600; }
.pw-thumb.selected .pw-thumb-frame { outline: 3px solid var(--brand-primary); }
.pw-thumb.selected .pw-thumb-frame::after { content: ''; position: absolute; inset: 0; background: rgba(var(--brand-primary-rgb), .16); }
.pw-thumb.dragging { opacity: .35; }
.pw-thumb-ghost { position: fixed; z-index: 2000; pointer-events: none; opacity: .9; transform: scale(.85); transform-origin: top left; }
.pw-thumb-marker { width: 110px; height: 3px; border-radius: 3px; background: var(--brand-primary); flex-shrink: 0; margin: -8px 0; }

/* ─── Documento ────────────────────────────────────────────────────────── */
.pw-canvas {
  grid-area: canvas;
  position: relative;
  overflow: auto;
  background: var(--pw-canvas-bg);
  outline: none;
  overscroll-behavior: contain;
}
.pw-pages { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 24px 28px 48px; min-width: max-content; }
.pw-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pw-slot-label { font-size: 12px; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.pw-page { position: relative; }
.pw-page-inner {
  position: absolute; left: 50%; top: 50%;
  transform-origin: center;
  background: #fff;
  box-shadow: var(--pw-page-shadow);
  transition: transform var(--duration-med) var(--ease);
}
.pw-page-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pw-deco, .pw-form-layer, .pw-overlay { position: absolute; inset: 0; }
.pw-deco { pointer-events: none; overflow: hidden; z-index: 1; }
.pw-overlay { z-index: 2; touch-action: none; }
.pw-form-layer { z-index: 3; pointer-events: none; }
.pw-form-layer > * { pointer-events: auto; }
/* Fora do modo Selecionar, desenhar tem prioridade sobre os campos existentes. */
.pw:not([data-tool="select"]) .pw-form-layer { z-index: 1; }
.pw:not([data-tool="select"]) .pw-form-layer > * { pointer-events: none; }

.pw[data-category="pages"] .pw-overlay,
.pw[data-category="doc"] .pw-overlay,
.pw[data-category="protect"] .pw-overlay { pointer-events: none; }
.pw[data-category="pages"] .pw-page { cursor: pointer; }
.pw-slot.selected .pw-page-inner { outline: 3px solid var(--brand-primary); outline-offset: 3px; }

.pw-page-tools { display: none; position: absolute; top: 0; right: 0; gap: 4px; z-index: 5; }
.pw[data-category="pages"] .pw-page-tools { display: flex; }
.pw[data-category="pages"] .pw-slot { padding-top: 34px; }
.pw-mini-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); cursor: pointer; box-shadow: var(--shadow-sm);
}
.pw-mini-btn:hover { color: var(--brand-primary); border-color: var(--brand-primary); }
.pw-mini-btn.pw-danger:hover { color: var(--color-error); border-color: var(--color-error); }

/* Cursores por ferramenta */
.pw[data-tool="text"] .pw-overlay, .pw[data-tool="signType"] .pw-overlay { cursor: text; }
.pw[data-tool="rect"] .pw-overlay, .pw[data-tool="rectFill"] .pw-overlay, .pw[data-tool="highlight"] .pw-overlay,
.pw[data-tool="redact"] .pw-overlay, .pw[data-tool="pen"] .pw-overlay, .pw[data-tool^="field"] .pw-overlay,
.pw[data-tool="date"] .pw-overlay { cursor: crosshair; }

/* ─── Itens sobre a página ─────────────────────────────────────────────── */
.pw-item { position: absolute; box-sizing: border-box; cursor: move; user-select: none; }
.pw-item.selected { outline: 1.5px solid var(--pw-sel); outline-offset: 1px; }
.pw-item:hover:not(.selected) { outline: 1px dashed rgba(var(--brand-primary-rgb), .7); outline-offset: 1px; }
.pw-item-text {
  white-space: pre; font-family: Helvetica, Arial, sans-serif; padding: 0; margin: 0; min-width: 6px; min-height: 1em;
  transform-origin: top left;
}
.pw-item-text.pw-script { font-family: "Times New Roman", Times, serif; font-style: italic; }
.pw-item-text.editing { cursor: text; user-select: text; outline: 1.5px dashed var(--pw-sel); background: rgba(var(--brand-primary-rgb), .06); }
.pw-item-text.editing:empty::before { content: 'Digite aqui…'; color: #8C95A1; font-style: normal; }
.pw-item-image img { width: 100%; height: 100%; display: block; object-fit: fill; pointer-events: none; }
.pw-item-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; cursor: move; }
.pw-item-line .pw-line-hit { pointer-events: stroke; }
.pw-item-line polyline { vector-effect: non-scaling-stroke; }
.pw-item-line.selected { outline: none; filter: drop-shadow(0 0 2px rgba(var(--brand-primary-rgb), .9)); }
.pw-item-redact { opacity: .92; outline: 1px dashed rgba(229, 50, 45, .9); outline-offset: 0; }
.pw-item-redact::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(229, 50, 45, .16) 0 6px, transparent 6px 12px);
}
.pw-item-field {
  border: 1.5px dashed #2F6FE4; background: rgba(47, 111, 228, .10); border-radius: 2px;
  display: flex; align-items: center; justify-content: space-between; gap: 2px; padding: 0 3px; overflow: hidden;
  color: #2F6FE4; font-family: Helvetica, Arial, sans-serif;
}
.pw-field-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.pw-field-checkbox { border-style: solid; border-radius: 2px; }
.pw-field-radio { border-style: solid; border-radius: 50%; }
.pw-handle {
  position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; border-radius: 3px;
  background: #fff; border: 2px solid var(--pw-sel); cursor: nwse-resize; display: none; z-index: 2;
}
.pw-item.selected .pw-handle { display: block; }

/* Campos já existentes no PDF */
.pw-existing {
  position: absolute; box-sizing: border-box; margin: 0; padding: 0 3px; border: 1px solid rgba(47, 111, 228, .55);
  background: rgba(214, 228, 255, .55); color: #111; font-family: Helvetica, Arial, sans-serif; border-radius: 2px;
}
.pw-existing:focus { outline: 2px solid #2F6FE4; background: rgba(214, 228, 255, .85); }
textarea.pw-existing { resize: none; line-height: 1.2; }
.pw-existing-checkbox, .pw-existing-radio { accent-color: #2F6FE4; cursor: pointer; }
.pw-existing:disabled { opacity: .55; cursor: not-allowed; }

/* Marca d'água / numeração / recorte (prévia) */
.pw-wm-layer { position: absolute; inset: 0; }
.pw-wm-layer.under { mix-blend-mode: multiply; }
.pw-wm {
  position: absolute; white-space: pre; line-height: 1;
  font-family: var(--wm-font); font-size: var(--wm-size); font-weight: var(--wm-weight); font-style: var(--wm-style);
  color: var(--wm-color); opacity: var(--wm-op);
  transform: translate(-50%, -50%) rotate(var(--wm-rot));
}
.pw-pn { position: absolute; white-space: nowrap; line-height: 1; font-family: Helvetica, Arial, sans-serif; transform: translateY(-0.86em); }
.pw-crop i { position: absolute; background: rgba(16, 27, 65, .42); }
.pw-crop .t { left: 0; right: 0; top: 0; height: var(--ct); }
.pw-crop .b { left: 0; right: 0; bottom: 0; height: var(--cb); }
.pw-crop .l { left: 0; top: var(--ct); bottom: var(--cb); width: var(--cl); }
.pw-crop .r { right: 0; top: var(--ct); bottom: var(--cb); width: var(--cr); }
.pw-crop b { position: absolute; top: var(--ct); bottom: var(--cb); left: var(--cl); right: var(--cr); border: 1.5px dashed #FFB125; }

/* ─── Painel de propriedades ───────────────────────────────────────────── */
.pw-props {
  grid-area: props;
  border-left: 1px solid var(--color-border);
  background: var(--color-surface);
  overflow-y: auto; padding: 14px 16px 24px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: thin;
}
.pw-props-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pw-props-head h3 { font-size: 15px; font-weight: 600; margin: 0; }
.pw-props-hint { font-size: 13px; line-height: 1.5; color: var(--color-text); background: var(--brand-soft); border: 1px solid var(--brand-border-soft); border-radius: 10px; padding: 10px 12px; margin: 0; }
.pw-props-note { font-size: 12.5px; line-height: 1.5; color: var(--color-muted); margin: 0; }
.pw-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--color-muted); min-width: 0; flex: 1; }
.pw-field input[type="text"], .pw-field input[type="number"], .pw-field input[type="password"], .pw-field select, .pw-field textarea {
  width: 100%; box-sizing: border-box; height: 34px; padding: 0 9px; border: 1px solid var(--color-border); border-radius: 8px;
  background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 13.5px;
}
.pw-field textarea { height: auto; padding: 7px 9px; resize: vertical; line-height: 1.4; }
.pw-field input:focus, .pw-field select:focus, .pw-field textarea:focus { outline: 2px solid rgba(var(--brand-primary-rgb), .35); border-color: var(--brand-primary); }
.pw-field input[type="color"] { width: 100%; height: 34px; padding: 2px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); cursor: pointer; }
.pw-field input[type="range"] { width: 100%; accent-color: var(--brand-primary); }
.pw-row { display: flex; gap: 10px; align-items: flex-end; }
.pw-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; color: var(--color-text); }
.pw-check input { width: 16px; height: 16px; accent-color: var(--brand-primary); flex-shrink: 0; }
.pw-props-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pw-props-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.pw-props .pw-danger:hover { color: var(--color-error); border-color: var(--color-error); }
.pw-seg { display: flex; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; }
.pw-seg > * {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border: 0; background: var(--color-surface);
  color: var(--color-text); font: inherit; font-size: 13px; cursor: pointer; border-right: 1px solid var(--color-border);
}
.pw-seg > *:last-child { border-right: 0; }
.pw-seg > .active { background: var(--brand-soft-strong); color: var(--brand-primary); font-weight: 600; }
.pw-seg input[type="color"] { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
.pw-section { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface-2); }
.pw-section-title { font-weight: 600; font-size: 13.5px; color: var(--color-text); }
.pw-summary { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--color-border); font-size: 12.5px; color: var(--color-muted); }
.pw-summary h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; color: var(--color-muted); }
.pw-summary ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; color: var(--color-text); }
.pw-summary p { margin: 0; }

.pw-thumbs-toggle { display: inline-flex; }

/* ─── Telas médias: painel de propriedades mais estreito ───────────────── */
@media (max-width: 1180px) {
  .pw { --pw-props: 250px; --pw-thumbs: 148px; }
  .pw-top-group.pw-pager { display: none; }
}

/* ─── Mobile / tablet estreito ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .pw-host { margin-top: var(--space-sm); }
  .pw, .pw.pw-thumbs-open {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(380px, 1fr) auto;
    grid-template-areas: "top" "rail" "ribbon" "canvas" "props";
    height: auto; min-height: 0;
    border-radius: var(--radius-md);
  }
  .pw-top { flex-wrap: wrap; gap: 6px; padding: 8px; }
  .pw-file { flex: 1 1 100%; max-width: none; order: -1; }
  .pw-top-group { padding-left: 6px; }
  .pw-top-group.pw-zoom .pw-zoom-val { min-width: 40px; }
  .pw-close span, .pw-add span { display: none; }
  .pw-rail { flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--color-border); padding: 6px; scrollbar-width: none; }
  .pw-rail-btn { flex: 0 0 auto; min-width: 72px; }
  .pw-rail-btn.active::before { left: 12px; right: 12px; top: auto; bottom: -6px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .pw-ribbon { min-height: 58px; }
  .pw-canvas { height: 68vh; }
  .pw-pages { padding: 16px 12px 32px; gap: 18px; }
  .pw-props { border-left: 0; border-top: 1px solid var(--color-border); max-height: none; overflow: visible; }
  /* Miniaturas viram uma gaveta sobre o documento */
  .pw-thumbs { display: none; }
  .pw.pw-thumbs-open .pw-thumbs {
    display: block; grid-area: canvas; z-index: 6; width: 150px; justify-self: start;
    box-shadow: 8px 0 24px rgba(16, 27, 65, .18);
  }
}
