.pdf-editor-wrap { width: calc(100% - 32px); max-width: 1680px; margin: 26px auto 64px; }
.pdf-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.pdf-editor-heading > a { color: var(--muted); white-space: nowrap; }
.pdf-editor-heading h1 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.045em; }
.pdf-editor-heading p { margin: 5px 0 0; color: var(--muted); }
.editor-export { white-space: nowrap; }
.pdf-editor-start { position: relative; display: grid; justify-items: center; gap: 8px; min-height: 360px; align-content: center; padding: 36px; border: 2px dashed #cfc3ec; border-radius: 18px; background: #faf8ff; text-align: center; }
.pdf-editor-start p { margin: 0; color: var(--muted); }
.pdf-editor-start .editor-status { min-height: 24px; }
.pdf-editor-app { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #f4f5fa; box-shadow: 0 12px 32px #201a360a; }
.editor-topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 52px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.editor-document-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.editor-replace-file { flex: 0 0 auto; color: var(--purple); cursor: pointer; font-size: .82rem; }
.editor-history-actions { display: flex; align-items: center; gap: 6px; }
.editor-history-actions button, .editor-page-nav button { min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #39354a; font: inherit; font-size: .83rem; }
.editor-history-actions button:hover:not(:disabled), .editor-page-nav button:hover:not(:disabled) { border-color: #9b85db; color: var(--purple); }
.editor-history-actions button:disabled { opacity: .45; cursor: default; }
.editor-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 250px; min-height: min(790px, calc(100dvh - 190px)); }
.editor-pages, .editor-properties { min-width: 0; padding: 14px; background: #fff; }
.editor-pages { border-right: 1px solid var(--line); }
.editor-properties { border-left: 1px solid var(--line); }
.editor-panel-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.editor-panel-title h2 { margin: 0; font-size: .97rem; }
.editor-panel-title span, .editor-panel-title button { color: var(--muted); font-size: .78rem; }
.editor-panel-title button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.editor-page-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 10px; max-height: calc(100dvh - 270px); overflow: auto; padding: 2px; }
.editor-page-thumb { position: relative; display: grid; justify-items: center; gap: 5px; min-width: 0; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: #fafaff; color: inherit; cursor: grab; }
.editor-page-thumb.is-active { border-color: #7554ce; box-shadow: 0 0 0 2px #7554ce28; background: #f6f2ff; }
.editor-page-thumb.is-drop-target { border-color: #7554ce; background: #ede6ff; }
.editor-page-thumb:active { cursor: grabbing; }
.editor-page-thumb canvas { display: block; width: auto; max-width: 100%; max-height: 112px; background: white; box-shadow: 0 1px 5px #201a3618; }
.editor-page-thumb > span { font-size: .75rem; }
.editor-page-thumb-actions { display: flex; gap: 3px; }
.editor-page-thumb-actions button { min-width: 28px; min-height: 26px; padding: 3px 5px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #4b465b; font-size: .7rem; }
.editor-page-thumb-actions button:hover { color: var(--purple); border-color: #aa99d8; }
.editor-page-item { min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: #fafaff; cursor: grab; }
.editor-page-item.is-active { border-color: #7554ce; box-shadow: 0 0 0 2px #7554ce28; background: #f6f2ff; }
.editor-page-item:active { cursor: grabbing; }
.editor-page-thumbnail { display: block; width: auto; max-width: 100%; max-height: 112px; margin: 0 auto 5px; background: white; box-shadow: 0 1px 5px #201a3618; }
.editor-page-label { overflow: hidden; color: #514d5e; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.editor-page-actions { display: flex; gap: 3px; margin-top: 5px; }
.editor-page-actions button { flex: 1; min-width: 0; min-height: 27px; padding: 2px 3px; border: 1px solid var(--line); border-radius: 5px; background: white; color: #4b465b; }
.editor-page-actions button:disabled { opacity: .38; }
.editor-workspace { display: grid; grid-template-rows: auto minmax(300px, 1fr) auto auto; min-width: 0; }
.editor-tools { display: flex; align-items: center; gap: 5px; overflow-x: auto; padding: 9px; border-bottom: 1px solid var(--line); background: #fff; }
.editor-tools button, .editor-add-image { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 36px; padding: 6px 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #4a4659; font: inherit; font-size: .78rem; cursor: pointer; white-space: nowrap; }
.editor-tools button:hover, .editor-add-image:hover { background: #f5f1fd; color: var(--purple); }
.editor-tools button[aria-pressed="true"] { border-color: #d3c5f5; background: #f1ebff; color: #5133a3; }
.editor-add-image { border-color: var(--line); }
.editor-canvas-scroll { display: grid; align-content: start; justify-items: center; overflow: auto; min-height: 360px; padding: 22px; background: #eaecf3; }
.editor-page-canvas { position: relative; flex: 0 0 auto; width: max-content; max-width: 100%; background: white; box-shadow: 0 8px 24px #1c193022; touch-action: none; }
.editor-page-canvas canvas { display: block; max-width: 100%; height: auto; }
#editor-markup-canvas, .editor-object-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
#editor-markup-canvas { pointer-events: none; }
.editor-object-layer { overflow: hidden; pointer-events: none; }
.editor-object { position: absolute; display: grid; align-content: center; min-width: 3px; min-height: 3px; overflow: visible; pointer-events: auto; touch-action: none; cursor: move; user-select: none; }
.editor-object.is-selected { outline: 1px solid #6849c2; }
.editor-object-text { padding: 2px; overflow-wrap: anywhere; white-space: pre-wrap; }
.editor-object-highlight { background: #f6db5875; }
.editor-object-rect { border: var(--stroke-width) solid var(--object-color); }
.editor-object-ellipse { border: var(--stroke-width) solid var(--object-color); border-radius: 50%; }
.editor-object-line, .editor-object-arrow { display: block; min-height: 0; border: 0; border-top: var(--stroke-width) solid var(--object-color); transform-origin: left center; }
.editor-object-arrow::after { content: ""; position: absolute; right: -1px; top: -6px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 9px solid var(--object-color); }
.editor-status.is-error { color: #b42318; }
.pdf-editor-start.is-dragging { border-color: #7554ce; background: #f2edff; }
.editor-object img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.editor-object-resize { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; border: 2px solid white; border-radius: 50%; background: #6849c2; cursor: nwse-resize; }
.editor-page-nav { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 9px; background: #fff; border-top: 1px solid var(--line); }
.editor-page-nav span { min-width: 100px; color: var(--muted); text-align: center; font-size: .84rem; }
.editor-status { min-height: 20px; margin: 0; padding: 0 12px 8px; color: var(--muted); font-size: .83rem; }
.editor-empty-properties { color: var(--muted); font-size: .83rem; line-height: 1.5; }
.editor-object-properties { display: grid; gap: 12px; }
.editor-object-properties label { display: grid; gap: 5px; color: #494458; font-size: .8rem; font-weight: 650; }
.editor-object-properties input, .editor-object-properties textarea { width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #29243a; font: inherit; }
.editor-object-properties input[type="color"] { height: 38px; padding: 3px; }
.editor-object-properties input[type="range"] { padding: 0; }
.editor-note { margin-top: 24px; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.editor-download { display: inline-block; margin: 20px 0; }
@media (max-width: 1180px) {
  .editor-layout { grid-template-columns: 180px minmax(0, 1fr) 220px; }
  .editor-page-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr) 220px; }
  .editor-pages { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .editor-page-list { display: flex; max-height: 150px; overflow-x: auto; overflow-y: hidden; }
  .editor-page-item { flex: 0 0 110px; }
  .editor-page-thumbnail { max-height: 72px; }
  .editor-properties { grid-column: 2; grid-row: 2; border-left: 1px solid var(--line); }
  .editor-workspace { grid-column: 1; grid-row: 2; }
}
@media (max-width: 640px) {
  .pdf-editor-wrap { width: calc(100% - 20px); margin-top: 16px; }
  .pdf-editor-heading { align-items: flex-start; flex-wrap: wrap; }
  .pdf-editor-heading > div { order: 2; flex: 1 0 100%; }
  .editor-layout { display: flex; flex-direction: column; }
  .editor-pages { order: 0; padding: 9px; }
  .editor-workspace { order: 1; min-height: 50vh; }
  .editor-properties { order: 2; border-left: 0; border-top: 1px solid var(--line); }
  .editor-page-list { max-height: 125px; }
  .editor-page-item { flex-basis: 90px; }
  .editor-page-thumbnail { max-height: 55px; }
  .editor-canvas-scroll { min-height: 48vh; padding: 12px 6px; }
  .editor-page-canvas { width: 100%; }
  .editor-tools { padding: 6px; }
  .editor-tools button, .editor-add-image { min-height: 34px; padding-inline: 7px; font-size: .73rem; }
  .editor-history-actions #editor-reset { display: none; }
  .editor-history-actions button { padding: 5px 7px; }
  .editor-topbar { padding-inline: 9px; }
}
