:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #202b35;
  background: #f3f5f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #202b35;
  --muted: #697681;
  --line: #d9e0e5;
  --paper: #f3f5f7;
  --surface: #ffffff;
  --surface-subtle: #f8fafb;
  --accent: #b75d39;
  --accent-dark: #914326;
  --accent-soft: #fbf0eb;
  --success: #276b51;
  --success-soft: #edf6f1;
  --danger: #a34036;
  --danger-soft: #fff0ed;
  --shadow: 0 1px 2px rgb(28 42 53 / 5%), 0 7px 20px rgb(28 42 53 / 4%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px; }

.topbar {
  min-height: 58px;
  padding: 0 clamp(16px, 3vw, 42px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-size: 17px; letter-spacing: -.04em; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.brand b { font-weight: 760; }
.top-links { display: flex; align-items: center; gap: 20px; }
.top-links > a { color: var(--muted); text-decoration: none; font-size: 12px; }
.top-links > a:hover { color: var(--ink); }
.local-pill, .result-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid #dfe5e8;
  border-radius: 6px;
  background: #fff;
  color: #42515e;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.local-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

.page-shell { width: min(1480px, 100%); margin: 0 auto; padding: 18px clamp(16px, 3vw, 42px) 0; }
.hero {
  min-height: 86px;
  margin: 0 0 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.hero-copy { min-width: 0; }
.eyebrow { display: block; color: #66737e; font-size: 10px; font-weight: 700; letter-spacing: .095em; text-transform: uppercase; }
.hero h1 { margin: 4px 0 2px; color: var(--ink); font-size: 21px; font-weight: 680; line-height: 1.2; letter-spacing: -.025em; }
.hero p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.hero-summary { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }

.quick-starts {
  min-height: 48px;
  margin: 0 0 12px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.quick-starts > div:first-child { display: flex; align-items: baseline; gap: 8px; flex: 0 0 auto; }
.quick-starts .eyebrow { font-size: 9px; }
.quick-starts > div:first-child strong { color: #4b5964; font-size: 11px; font-weight: 600; }
.quick-chip-list { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.quick-chip, .secondary-button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #43515d;
  font-size: 11px;
  font-weight: 580;
  cursor: pointer;
}
.quick-chip:hover, .secondary-button:hover { border-color: #c4cdd3; background: var(--surface-subtle); }
.quick-chip[aria-pressed="true"] { border-color: #d9ad9a; background: var(--accent-soft); color: var(--accent-dark); }
.quick-chip:disabled, .text-button:disabled { opacity: .48; cursor: not-allowed; }

.workbench { display: grid; grid-template-columns: minmax(225px, 260px) minmax(0, 1fr); gap: 12px; align-items: start; }
.tool-rail, .work-area { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.tool-rail { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; padding: 13px; }
.rail-heading, .work-heading, .section-heading, .results-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rail-heading { align-items: center; margin: 0 0 11px; }
.rail-heading h2, .section-heading h3, .results-heading h3 { margin: 3px 0 0; color: var(--ink); font-size: 15px; font-weight: 640; letter-spacing: -.015em; }
.count-pill { padding: 4px 6px; border: 1px solid #e4e8eb; border-radius: 5px; background: var(--surface-subtle); color: var(--muted); font-size: 10px; white-space: nowrap; }
.rail-heading-actions { display: flex; align-items: center; gap: 6px; }
.mobile-tools-toggle { display: none; min-height: 30px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #43515d; font-size: 11px; font-weight: 600; cursor: pointer; }
.search-field { height: 34px; margin: 0 0 12px; padding: 0 8px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #7a8791; }
.search-field span { font-size: 18px; line-height: 1; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-field input:focus-visible { outline: none !important; }
.tool-group { margin: 12px 0 0; }
.tool-group h3 { margin: 0 0 4px; padding: 0 5px; color: #78848e; font-size: 9px; font-weight: 720; letter-spacing: .09em; text-transform: uppercase; }
.tool-list { display: grid; gap: 2px; }
.tool-choice { width: 100%; min-height: 31px; padding: 6px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #43515d; text-align: left; font-size: 12px; cursor: pointer; }
.tool-choice:hover { background: #f6f8f9; }
.tool-choice[aria-pressed="true"] { border-color: #e2c4b6; background: var(--accent-soft); color: var(--accent-dark); font-weight: 650; }
.tool-choice .tool-arrow { color: #85919a; }
.rail-note { margin: 12px 1px 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.45; }

.work-area { padding: 17px; }
.work-heading { align-items: flex-start; margin-bottom: 14px; }
.work-heading h2 { margin: 3px 0 3px; color: var(--ink); font-size: 23px; font-weight: 650; line-height: 1.2; letter-spacing: -.025em; }
.work-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.step-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px; border: 1px solid #e4e8eb; border-radius: 5px; background: var(--surface-subtle); color: var(--accent-dark); font-size: 9px; font-weight: 720; white-space: nowrap; }
.step-chip small { color: var(--muted); font-size: 9px; font-weight: 550; }

.upload-card { padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-subtle); }
.drop-zone { min-height: 116px; padding: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px dashed #bdc8ce; border-radius: 6px; background: #fff; color: var(--muted); text-align: center; font-size: 11px; cursor: pointer; }
.drop-zone:hover, .drop-zone.drag-active { border-color: var(--accent); background: #fdf9f7; }
.drop-zone strong { color: var(--ink); font-size: 12px; font-weight: 650; }
.drop-zone small { margin-top: 2px; color: #73808a; font-size: 10px; }
.upload-icon { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid #e3c8ba; border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); font-size: 17px; font-weight: 600; }
.file-actions, .result-actions, .preview-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-actions { justify-content: space-between; padding: 8px 2px 1px; }
.muted, .document-detail { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.text-button { padding: 5px 3px; border: 0; background: transparent; color: #596976; font-size: 11px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.text-button:hover { color: var(--accent-dark); }
.file-list { display: grid; gap: 5px; margin: 8px 0 0; padding: 0; list-style: none; }
.file-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto auto; align-items: center; gap: 7px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.file-type { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 5px; background: var(--accent-soft); color: var(--accent-dark); font-size: 8px; font-weight: 750; }
.file-name { min-width: 0; display: grid; gap: 2px; }
.file-name strong, .result-name strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 620; }
.file-name small { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 10px; }
.file-row button, .page-card button { width: 25px; height: 25px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #65737e; cursor: pointer; }
.file-row button:hover, .page-card button:hover { border-color: var(--line); background: #f5f7f8; }
.file-warning { color: var(--danger) !important; }

.options-panel, .preview-panel { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.section-heading { align-items: flex-end; margin-bottom: 10px; }
.section-heading > div { display: grid; justify-items: start; gap: 5px; }
.section-heading h3 { font-size: 15px; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.options-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.field { min-width: 0; display: grid; gap: 4px; }
.field label { color: #43515d; font-size: 11px; font-weight: 620; }
.field input, .field select, .field textarea, .result-actions input { width: 100%; min-height: 34px; padding: 7px 8px; border: 1px solid #cfd8de; border-radius: 5px; background: #fff; color: var(--ink); font-size: 12px; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus, .result-actions input:focus { border-color: #a96a4e; box-shadow: 0 0 0 2px #f4e5dd; }
.field textarea { min-height: 68px; resize: vertical; }
.field-help { color: var(--muted); font-size: 10px; line-height: 1.4; }
.field-checkbox { display: flex; align-items: center; gap: 7px; }
.field-checkbox input { width: 16px; min-height: 16px; accent-color: var(--accent); }
.field-checkbox label { order: 2; }
.options-form details { grid-column: 1 / -1; padding-top: 9px; border-top: 1px solid var(--line); }
.options-form summary { color: #4d5b66; font-size: 11px; font-weight: 620; cursor: pointer; }
.options-form details .advanced-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding-top: 10px; }

.preview-tools { justify-content: space-between; margin-bottom: 9px; }
.selection-actions { display: flex; gap: 4px; }
.selection-actions button { min-height: 28px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #4c5a65; font-size: 10px; cursor: pointer; }
.selection-actions button:hover { border-color: #c1ccd2; background: #f7f9fa; }
.page-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 8px; }
.page-card { position: relative; min-width: 0; width: 100%; min-height: 130px; margin: 0; padding: 7px; display: flex; flex-direction: column; align-items: stretch; gap: 5px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; cursor: grab; }
.page-card:active { cursor: grabbing; }
.page-card.page-unselected { opacity: .52; }
.page-card img, .page-placeholder { width: 100%; height: 104px; object-fit: contain; border: 1px solid #e4e9ed; background: #fff; }
.page-placeholder { display: grid; place-items: center; color: #77848e; font-size: 10px; }
.page-card figcaption { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: #4c5a65; font-size: 10px; }
.page-card .page-actions { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; }
.page-card button { width: 23px; height: 23px; border-color: #dce3e7; background: #fff; }
.page-card input { position: absolute; top: 7px; left: 7px; accent-color: var(--accent); }
.page-card.drag-over { outline: 2px solid var(--accent); outline-offset: 1px; }
.selection-actions button:disabled, .page-card button:disabled { opacity: .45; cursor: not-allowed; }
.preview-summary-error { color: var(--danger); }

.run-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.run-button, .primary-button { min-height: 37px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 650; cursor: pointer; text-decoration: none; }
.run-button:hover:not(:disabled), .primary-button:hover:not(:disabled) { border-color: var(--accent-dark); background: var(--accent-dark); }
.run-button[data-tool="merge"] { background: #425564; border-color: #425564; }
.run-button:disabled, .primary-button:disabled { opacity: .48; cursor: not-allowed; }
.status { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: #f6f8f9; color: #4d5b66; font-size: 11px; line-height: 1.45; }
.status.error { border-color: #f0d1cb; background: var(--danger-soft); color: var(--danger); }
.status.success { border-color: #cce4d8; background: var(--success-soft); color: var(--success); }

.results { margin-top: 13px; padding: 12px; border: 1px solid #cfded5; border-radius: 7px; background: #f8fbf9; }
.results-heading { margin-bottom: 9px; }
.results-heading h3 { font-size: 16px; }
.result-badge { font-size: 10px; }
.result-list { display: grid; gap: 6px; }
.result-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.result-name { min-width: 0; display: grid; gap: 3px; }
.result-name strong { overflow-wrap: anywhere; white-space: normal; }
.result-name small { color: var(--muted); font-size: 10px; }
.result-actions { margin-top: 9px; padding-top: 9px; border-top: 1px solid #dfe6e2; }
.result-actions label { color: #43515d; font-size: 11px; font-weight: 620; }
.result-actions input { min-width: 140px; flex: 1; }
.result-actions .secondary-button { border-radius: 5px; }

.privacy-panel { margin: 16px 0 24px; padding: 14px 16px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.privacy-icon { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #d5e2da; border-radius: 6px; background: var(--success-soft); color: var(--success); font-weight: 750; }
.privacy-panel h2 { margin: 3px 0 4px; color: var(--ink); font-size: 15px; font-weight: 640; }
.privacy-panel p { max-width: 650px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.privacy-facts { display: flex; gap: 16px; }
.privacy-facts span { display: grid; gap: 2px; }
.privacy-facts b { color: #40515d; font-size: 10px; font-weight: 650; }
.privacy-facts small { color: var(--muted); font-size: 9px; }
footer { min-height: 42px; padding: 10px 2px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
footer span:first-child { color: #40505b; font-weight: 700; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--ink); }
.file-actions .muted { font-size: 11px; }
.quick-chip:focus-visible, .selection-actions button:focus-visible, .secondary-button:focus-visible { outline-offset: 2px; }

@media (max-width: 1050px) {
  .page-shell { padding-right: 18px; padding-left: 18px; }
  .workbench { grid-template-columns: minmax(205px, 230px) minmax(0, 1fr); }
  .quick-starts { align-items: flex-start; flex-direction: column; }
  .quick-chip-list { justify-content: flex-start; }
  .privacy-panel { grid-template-columns: 32px minmax(0, 1fr); }
  .privacy-facts { grid-column: 2; }
}
@media (max-width: 700px) {
  .topbar { min-height: 54px; padding: 0 14px; }
  .top-links { gap: 8px; }
  .top-links > a { display: none; }
  .page-shell { padding: 12px 12px 0; }
  .hero { min-height: 76px; padding: 11px 12px; }
  .hero h1 { font-size: 18px; }
  .hero p { max-width: 55ch; font-size: 11px; }
  .hero-summary { align-items: flex-end; font-size: 9px; }
  .hero-summary .local-pill { font-size: 10px; }
  .workbench { display: flex; flex-direction: column; gap: 9px; }
  .tool-rail, .work-area { width: 100%; }
  .tool-rail { position: static; max-height: none; overflow: visible; padding: 10px 11px; }
  .rail-heading { margin: 0; }
  .mobile-tools-toggle { display: inline-flex; align-items: center; }
  .tool-rail.mobile-collapsed .tool-content { display: none; }
  .tool-groups { display: flex; gap: 8px; overflow: auto; padding-bottom: 3px; }
  .tool-group { flex: 0 0 150px; margin-top: 10px; }
  .tool-choice { min-height: 30px; padding: 5px 7px; }
  .tool-rail .rail-note { display: block; }
  .work-area { padding: 12px; }
  .work-heading h2 { font-size: 20px; }
  .work-heading p { font-size: 11px; }
  .drop-zone { min-height: 100px; }
  .privacy-panel { padding: 12px; grid-template-columns: 28px minmax(0, 1fr); gap: 9px; }
  .privacy-icon { width: 27px; height: 27px; }
  .privacy-panel p { font-size: 10px; }
  .privacy-facts { gap: 12px; flex-wrap: wrap; }
  .result-badge { display: none; }
}
@media (max-width: 480px) {
  .brand { font-size: 16px; }
  .brand img { width: 27px; height: 27px; }
  .local-pill { padding: 5px 7px; font-size: 10px; }
  .hero { align-items: flex-start; }
  .hero-summary { gap: 4px; }
  .hero-summary > span:last-child { display: none; }
  .quick-starts > div:first-child { align-items: flex-start; flex-direction: column; gap: 2px; }
  .quick-chip-list { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; padding-bottom: 3px; }
  .quick-chip { flex: 0 0 auto; }
  .options-form { grid-template-columns: 1fr; }
  .options-form details .advanced-fields { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading > p { align-self: flex-start; }
  .page-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-card { min-height: 112px; }
  .page-card img, .page-placeholder { height: 82px; }
  .run-row, .result-row { align-items: flex-start; flex-direction: column; }
  .result-actions input { flex-basis: 100%; }
  .result-actions .text-button { margin-left: 0; }
  footer { align-items: flex-start; flex-wrap: wrap; }
}

/* Interactive local page editor. */
.pdf-editor { margin-top: 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; overflow: hidden; }
.pdf-editor-toolbar { min-height: 46px; padding: 7px 10px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.pdf-editor-mode-field, .pdf-editor-input-field { display: grid; gap: 4px; min-width: 0; }
.pdf-editor-field-label { color: #465561; font-size: 10px; font-weight: 650; }
.pdf-editor-mode { min-height: 31px; min-width: 150px; padding: 4px 7px; border: 1px solid #cfd8de; border-radius: 5px; background: #fff; color: var(--ink); font-size: 11px; }
.pdf-editor-page-nav, .pdf-editor-zoom-controls { display: flex; align-items: center; gap: 5px; }
.pdf-editor-page-nav { margin-left: auto; }
.pdf-editor-button { min-height: 30px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #40505c; font-size: 10px; font-weight: 600; cursor: pointer; }
.pdf-editor-button:hover:not(:disabled) { border-color: #bcc8ce; background: #f5f8f9; }
.pdf-editor-button:disabled, .pdf-editor-text-button:disabled { opacity: .48; cursor: not-allowed; }
.pdf-editor-icon-button { width: 30px; padding: 3px; font-size: 15px; }
.pdf-editor-page-label, .pdf-editor-zoom-readout { min-width: 76px; color: #586671; text-align: center; font-size: 10px; font-variant-numeric: tabular-nums; }
.pdf-editor-zoom-readout { min-width: 40px; }
.pdf-editor-instructions { min-height: 31px; padding: 7px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e8edef; background: #fff; }
.pdf-editor-mode-description, .pdf-editor-status { margin: 0; color: #60707b; font-size: 10px; line-height: 1.4; }
.pdf-editor-status { color: var(--success); text-align: right; }
.pdf-editor-status.is-error { color: var(--danger); }
.pdf-editor-controls { padding: 9px 10px; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); background: #f8fafb; }
.pdf-editor-controls[hidden], .pdf-editor-input-field[hidden], .pdf-editor-check-field[hidden], .pdf-editor-apply[hidden] { display: none; }
.pdf-editor-input-field { min-width: 120px; flex: 1 1 140px; }
.pdf-editor-input { width: 100%; min-height: 31px; padding: 5px 7px; border: 1px solid #cfd8de; border-radius: 5px; background: #fff; color: var(--ink); font-size: 11px; }
.pdf-editor-input[type="number"] { max-width: 112px; }
.pdf-editor-input[type="color"] { width: 48px; min-width: 48px; padding: 3px; }
.pdf-editor-check-field { min-height: 31px; display: inline-flex; align-items: center; gap: 5px; padding: 0 4px; cursor: pointer; }
.pdf-editor-check-field input { accent-color: var(--accent); }
.pdf-editor-apply { min-height: 31px; border-color: #d7b2a2; background: var(--accent-soft); color: var(--accent-dark); }
.pdf-editor-body { min-width: 0; }
.pdf-editor-viewer { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); background: #e9eef1; }
.pdf-editor-canvas-viewport { min-width: 0; min-height: 420px; max-height: min(78vh, 980px); padding: 16px; overflow: auto; }
.pdf-editor-stage { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 1px 4px rgb(27 40 49 / 17%); }
.pdf-editor-page-canvas { display: block; max-width: none; background: #fff; }
.pdf-editor-overlay { position: absolute; inset: 0; z-index: 1; overflow: hidden; outline: none; touch-action: none; }
.pdf-editor-overlay.is-loading { position: relative; min-height: 420px; display: grid; place-items: center; padding: 20px; background: #f5f7f8; color: var(--muted); text-align: center; font-size: 12px; pointer-events: none; }
.pdf-editor.is-busy .pdf-editor-overlay { pointer-events: none; }
.pdf-editor-mark, .pdf-editor-gesture { position: absolute; overflow: hidden; border: 1px solid var(--mark-color, #111); background: transparent; color: var(--mark-color, #111); font-family: Arial, sans-serif; line-height: 1.15; }
.pdf-editor-mark { pointer-events: none; }
.pdf-editor-mark.mark-text, .pdf-editor-mark.mark-signature { padding: 1px 2px; border-color: transparent; overflow: visible; white-space: nowrap; text-shadow: 0 0 2px #fff; }
.pdf-editor-mark.mark-signature { font-family: "Brush Script MT", "Segoe Script", cursive; font-style: italic; }
.pdf-editor-mark.mark-replace { padding: 1px 2px; border-color: #c4ccd2; background: #fff; }
.pdf-editor-mark.mark-highlight, .pdf-editor-gesture.gesture-highlight { border-color: #ba9b36; background: rgb(255 222 89 / 48%); }
.pdf-editor-mark.mark-rectangle, .pdf-editor-gesture.gesture-rectangle { border: 2px solid var(--mark-color, #b75d39); }
.pdf-editor-mark.mark-redact, .pdf-editor-gesture.gesture-redact { border: 1px solid #000; background: #000; }
.pdf-editor-mark.mark-note { min-width: 24px; min-height: 18px; padding: 3px; border-color: #d2bc72; background: #fff6cb; color: #423d2f; font-size: 10px; }
.pdf-editor-mark.mark-link, .pdf-editor-gesture.gesture-link { border: 1px solid #2563a6; background: rgb(37 99 166 / 8%); }
.pdf-editor-mark.mark-link { overflow-wrap: anywhere; font-size: 9px; }
.pdf-editor-ink-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.pdf-editor-overlay.mode-redact, .pdf-editor-overlay.mode-draw { cursor: crosshair; }
.pdf-editor-text-hit { position: absolute; z-index: 2; padding: 0; border: 1px solid transparent; border-radius: 1px; background: rgb(255 222 89 / 8%); cursor: pointer; }
.pdf-editor-text-hit:hover, .pdf-editor-text-hit.is-selected { border-color: #ba9b36; background: rgb(255 222 89 / 35%); }
.pdf-editor-text-panel { max-height: min(78vh, 980px); padding: 12px; overflow: auto; border-left: 1px solid var(--line); background: #fff; }
.pdf-editor-text-panel[hidden] { display: none; }
.pdf-editor-text-heading, .pdf-editor-marks-heading h3 { margin: 0; color: #354550; font-size: 11px; font-weight: 680; }
.pdf-editor-text-content { margin-top: 8px; color: #44535e; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.pdf-editor-marks { padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
.pdf-editor-marks[hidden] { display: none; }
.pdf-editor-marks-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pdf-editor-mark-actions { display: flex; gap: 10px; }
.pdf-editor-text-button { padding: 3px; border: 0; background: transparent; color: #52616c; font-size: 10px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.pdf-editor-text-button:hover { color: var(--accent-dark); }
.pdf-editor-empty-marks { margin: 7px 0 0; color: #74818a; font-size: 10px; }
.pdf-editor-mark-list { max-height: 160px; margin: 7px 0 0; padding: 0; overflow: auto; list-style: none; }
.pdf-editor-mark-row { min-height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #edf0f2; }
.pdf-editor-mark-description { min-width: 0; overflow: hidden; color: #465560; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
@media (max-width: 780px) {
  .pdf-editor-toolbar { flex-wrap: wrap; }
  .pdf-editor-viewer { grid-template-columns: minmax(0, 1fr); }
  .pdf-editor-text-panel { max-height: 220px; border-top: 1px solid var(--line); border-left: 0; }
  .pdf-editor-canvas-viewport { min-height: 300px; max-height: 72vh; padding: 10px; }
  .pdf-editor-instructions { align-items: flex-start; flex-direction: column; gap: 4px; }
}
@media (max-width: 480px) {
  .pdf-editor-toolbar { gap: 6px; padding: 7px; }
  .pdf-editor-mode { min-width: 136px; }
  .pdf-editor-page-nav { margin-left: 0; }
  .pdf-editor-zoom-controls { margin-left: auto; }
  .pdf-editor-controls { align-items: stretch; }
  .pdf-editor-input-field { flex-basis: calc(50% - 8px); }
  .pdf-editor-input[type="number"] { max-width: none; }
  .pdf-editor-canvas-viewport { min-height: 260px; padding: 8px; }
  .pdf-editor-mark-actions { gap: 5px; }
}

@media (min-width: 781px) { .pdf-editor-viewer.is-reader { grid-template-columns: minmax(0, 1fr) 250px; } }
.pdf-editor-mark.mark-form-text, .pdf-editor-mark.mark-form-checkbox, .pdf-editor-mark.mark-form-dropdown { border: 1px solid #2563a6; background: rgb(37 99 166 / 8%); font: 10px system-ui; color: #184ab8; }

.pdf-editor-jump { width: 46px; height: 28px; padding: 3px; border: 1px solid var(--line); border-radius: 4px; font: 11px system-ui; }
.pdf-editor-toolbar a { text-decoration: none; }
