.pte { padding: clamp(14px, 3vw, 28px) clamp(12px, 3vw, 28px) 64px; }

.pte-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.pte-status { font-size: .85rem; color: var(--text-2); }

/* Line editor */
.pte-lineedit {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.pte-lineedit[hidden] { display: none; }
.pte-lineedit textarea { min-height: 44px; font: inherit; resize: vertical; }
.pte-lineedit .field { min-width: 90px; }
.pte-lineedit .field span { font-size: .75rem; }
.pte-lineedit input[type="number"] { width: 84px; }
.pte-lineedit input[type="color"] { width: 44px; height: 34px; padding: 2px; }

.pte-bounds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-in);
}
.pte-bounds legend { padding: 0 4px; font-size: .72rem; color: var(--text-2); }
.pte-fontinfo { flex-basis: 100%; font-size: .8rem; color: var(--text-2); }

.pte-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pte-tools[hidden] { display: none; }
.pte-tools button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: transparent; }

#empty-state { text-align: center; }
#empty-state[hidden] { display: none; }
.dropzone.over { border-color: var(--accent); background: var(--accent-bg); }

.pte-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}
.pte-nav[hidden] { display: none; }
#page-indicator { min-width: 110px; text-align: center; font-weight: 600; font-size: .9rem; }

/* PDF stage */
.pte-stage { overflow: auto; }
#editor-container {
  position: relative;
  transform-origin: top left;
  margin: 0 auto;
  background: #fff;
  box-shadow: var(--shadow-lg, 0 12px 35px rgba(30, 41, 59, .17));
  display: none;
}
#pdf-canvas { position: absolute; top: 0; left: 0; z-index: 1; }
#text-overlay { position: absolute; top: 0; left: 0; z-index: 2; pointer-events: none; }

.pdf-paragraph {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: 1px solid transparent;
  pointer-events: auto;
  cursor: text;
}
.pdf-paragraph:hover { outline-color: var(--accent); background: rgba(26, 95, 208, .06); }
.pdf-paragraph:focus-visible { outline: 2px solid var(--accent); }
.pdf-paragraph.changed { outline: 2px solid var(--warn); background: rgba(245, 158, 11, .12); }

#selection-box { position: absolute; border: 2px solid var(--accent); z-index: 4; pointer-events: none; }
#selection-box[hidden] { display: none; }
#selection-box button {
  position: absolute;
  pointer-events: auto;
  border: 1px solid var(--accent);
  background: #fff;
  padding: 3px 6px;
  font-size: 12px;
  border-radius: 4px;
  touch-action: none;
}
#selection-box [data-action="move"] { left: 0; top: -28px; cursor: move; }
#selection-box [data-action="resize"] { right: 0; bottom: -28px; cursor: nwse-resize; }

@media (max-width: 640px) {
  .pte-lineedit .field { min-width: 0; flex: 1; }
}
