/* DMO Business Tools: PDF Editor. Uses the tokens from styles.css. */

.ed-open main.wrap { max-width: none; padding-left: 12px; padding-right: 12px; }
.ed-open .site-footer { display: none; }

.check-row { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; }
.check-row input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: var(--brand); flex: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.ed-legal { margin-top: 2rem; }

/* ---------- landing */
.ed-drop { margin: 1.25rem 0; }
.ed-drop.dragging { border-color: var(--brand); background: var(--brand-soft); }
.ed-drop .dropzone-title { font-size: 1.25rem; font-weight: 650; margin: 0 0 0.25rem; }
.ed-pick { margin-top: 1.25rem; }
.ed-pick h2 { margin-top: 0; font-size: 1.2rem; }
.ed-doc-list, .ed-recent { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; gap: 0.4rem; }
.ed-doc-btn { width: 100%; text-align: left; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.7rem 0.9rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; min-height: 44px; }
.ed-doc-btn:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.ed-doc-name, .ed-recent-name { font-weight: 600; overflow-wrap: anywhere; }
.ed-recent li { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; padding: 0.6rem 0.9rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- editor frame */
.ed { display: flex; flex-direction: column; gap: 0.5rem; min-height: calc(100vh - 110px); }
.ed-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; }
.ed-top-left { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; min-width: 0; }
.ed-top-left .back { margin: 0; }
.ed-title { font-size: 1.35rem; margin: 0; overflow-wrap: anywhere; }
.ed-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ed-top-right { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.ed-save-state { font-size: 0.9rem; color: var(--muted); min-width: 8rem; text-align: right; }
.ed-save-good { color: var(--good); }
.ed-save-bad { color: var(--bad); font-weight: 650; }
.ed-notices .notice { margin: 0.25rem 0; }
.ed-notices .actions { margin-top: 0.5rem; }
.ed-unlock { display: grid; gap: 0.4rem; max-width: 26rem; margin-top: 0.5rem; }

.ed-more { position: relative; }
.ed-more > summary { list-style: none; cursor: pointer; }
.ed-more > summary::-webkit-details-marker { display: none; }
.ed-more-panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 17rem; display: grid; gap: 2px; padding: 0.4rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(31, 22, 64, 0.14); }
.ed-more-panel a, .ed-menu-btn { display: block; text-align: left; padding: 0.6rem 0.75rem; border-radius: 8px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; min-height: 44px; }
.ed-more-panel a:hover, .ed-menu-btn:hover { background: var(--brand-soft); }
.ed-danger { color: var(--bad); }

.ed-modes { display: flex; flex-wrap: wrap; gap: 0.3rem; border-bottom: 1px solid var(--line); padding-bottom: 0.4rem; }
.ed-mode { font: inherit; font-weight: 600; padding: 0.5rem 0.95rem; min-height: 44px; border-radius: var(--radius-pill); border: 1.5px solid transparent;
  background: transparent; color: var(--brand); cursor: pointer; }
.ed-mode:hover { background: var(--brand-soft); }
.ed-mode[aria-pressed="true"] { background: var(--brand); color: #fff; }
.ed-toolrow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; }
.ed-tools { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.ed-tool { font: inherit; font-size: 0.95rem; padding: 0.4rem 0.8rem; min-height: 44px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; }
.ed-tool:hover:not([disabled]) { border-color: var(--brand-line); background: var(--brand-soft); }
.ed-tool[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
.ed-tool[disabled] { color: var(--muted); cursor: not-allowed; background: #f4f1ec; }
.ed-tool-redact[aria-pressed="true"] { border-color: #000; box-shadow: inset 0 0 0 1.5px #000; background: #eee; color: #000; }
.ed-stamp-select { width: auto; min-height: 44px; }
.ed-hint { margin: 0; color: var(--muted); flex: 1 1 16rem; }

.ed-body { display: grid; grid-template-columns: 9rem minmax(0, 1fr) 17rem; gap: 0.75rem; flex: 1; min-height: 0; }
.ed-thumbs { overflow-y: auto; max-height: calc(100vh - 260px); }
.ed-thumbs ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.ed-thumb { display: grid; justify-items: center; gap: 0.2rem; width: 100%; padding: 0.35rem; background: transparent; border: 2px solid transparent; border-radius: 10px; cursor: pointer; }
.ed-thumb img { max-width: 100%; max-height: 110px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.ed-thumb-blank { display: block; width: 80px; height: 100px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.ed-thumb[aria-current="true"] { border-color: var(--brand); }
.ed-thumb-n { font-size: 0.8rem; color: var(--muted); }

.ed-canvas { overflow: auto; max-height: calc(100vh - 260px); background: #e9e5de; border-radius: var(--radius); padding: 16px; }
.ed-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ed-page { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); flex: none; overflow: hidden; }
.ed-page-img { position: absolute; display: block; user-select: none; pointer-events: none; }
.ed-overlay { position: absolute; inset: 0; touch-action: pinch-zoom; }
.ed-overlay:not(.ed-tool-on-select) { cursor: crosshair; touch-action: none; }
.ed-empty { padding: 3rem 1rem; text-align: center; }

/* items on the page */
.ed-el { position: absolute; box-sizing: border-box; --c: #1f1640; }
.ed-overlay.ed-tool-on-select .ed-el { cursor: move; }
.ed-el:focus-visible, .ed-el.is-selected { outline: 2px dashed var(--brand); outline-offset: 2px; }
.ed-el-text, .ed-el-date { color: var(--c); font-family: Helvetica, Arial, sans-serif; line-height: 1.2; white-space: pre; overflow: visible; }
.ed-el-check svg, .ed-el-cross svg { width: 100%; height: 100%; overflow: visible; }
.ed-el-check polyline, .ed-el-cross path { fill: none; stroke: var(--c); stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; }
.ed-el img { width: 100%; height: 100%; display: block; user-select: none; }
.ed-el-stamp { display: flex; align-items: center; justify-content: center; border: 2px solid #1c6b3a; color: #1c6b3a; font-family: Helvetica, Arial, sans-serif; font-weight: 700; letter-spacing: 0.04em; }
.ed-el-whiteout { background: #fff; box-shadow: 0 0 0 1px rgba(90, 84, 112, 0.5); }
.ed-el-redact { background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.72) 0 6px, rgba(0, 0, 0, 0.55) 6px 12px); border: 2px solid #000; }
.ed-redact-label { position: absolute; top: 2px; left: 4px; font-size: 11px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.05em; }
.ed-el-mark .ed-mark-seg { position: absolute; }
.ed-el-highlight .ed-mark-seg { background: var(--c); opacity: 0.45; mix-blend-mode: multiply; }
.ed-el-underline .ed-mark-seg { border-bottom: 2px solid var(--c); }
.ed-el-strikeout .ed-mark-seg::after { content: ""; position: absolute; left: 0; right: 0; top: 55%; border-top: 2px solid var(--c); }
.ed-el-rect { border: 2px solid var(--c); }
.ed-el-ellipse { border: 2px solid var(--c); border-radius: 50%; }
.ed-vector { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ed-vector polyline, .ed-vector line { fill: none; stroke: var(--c); stroke-linecap: round; stroke-linejoin: round; }
.ed-el-vector { pointer-events: auto; }
.ed-ink-live polyline { stroke: #1d4e78; }
.ed-el-comment { width: 24px; height: 24px; }
.ed-note { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 5px; background: #ffd54d; color: #5a3d00; border: 1px solid #b38700; font-size: 14px; }
.ed-handle { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; background: var(--brand); border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; touch-action: none; }
.ed-ghost { position: absolute; border: 1.5px dashed var(--brand); background: rgba(84, 47, 156, 0.08); pointer-events: none; }
.ed-ghost-redact { border-color: #000; background: rgba(0, 0, 0, 0.35); }
.ed-ghost-highlight { background: rgba(255, 217, 51, 0.4); border-color: #b39400; }
.ed-inline { position: absolute; z-index: 5; box-sizing: content-box; font-family: Helvetica, Arial, sans-serif; line-height: 1.2; padding: 1px 3px; margin: -2px 0 0 -4px;
  border: 1.5px solid var(--brand); border-radius: 3px; background: #fff; color: var(--ink); resize: none; min-height: 1.2em; overflow: hidden;
  white-space: pre; overflow-wrap: normal; box-shadow: 0 2px 10px rgba(31, 22, 64, 0.18); }
/* the document's own lines of text, while the Edit text tool is on */
.ed-tb { position: absolute; z-index: 2; box-sizing: border-box; min-height: 0; margin: 0; padding: 0; border: 1px solid transparent; border-radius: 2px;
  background: transparent; cursor: text; }
.ed-tb:hover, .ed-tb:focus-visible { border-color: var(--brand); background: rgba(84, 47, 156, 0.08); outline: none; }
.ed-overlay.ed-tool-on-edittext .ed-tb { border-color: rgba(84, 47, 156, 0.18); }
.ed-overlay.ed-tool-on-edittext .ed-tb:hover { border-color: var(--brand); }
.ed-tb-note { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 3; max-width: 80%; margin: 0; padding: 6px 10px; border-radius: 6px;
  background: rgba(31, 22, 64, 0.85); color: #fff; font-size: 13px; text-align: center; pointer-events: none; }
.ed-el-textedit { white-space: pre; }
/* the saved PDF puts the baseline 0.93 em below the box top; a 1.2 line box puts it about 1.0 em down */
.ed-el-textedit .ed-el-text { position: relative; top: -0.05em; display: block; color: var(--c); white-space: pre; }
.ed-te-mask { position: absolute; display: block; }
.ed-te-style { display: flex; gap: 6px; margin: 8px 0; }

/* form fields drawn over the page (override the app's large input sizes) */
.ed-overlay .ed-field { position: absolute; box-sizing: border-box; min-height: 0; margin: 0; padding: 0 3px; border: 1px solid rgba(29, 78, 120, 0.55);
  border-radius: 2px; background: #eaf2f9; color: #000; font-family: Helvetica, Arial, sans-serif; line-height: 1.1; width: auto; }
.ed-overlay textarea.ed-field { resize: none; padding-top: 2px; }
.ed-overlay .ed-field.is-required { border-color: #b3261e; box-shadow: inset 3px 0 0 #b3261e; }
.ed-overlay .ed-field:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; background: #fff; }
.ed-overlay .ed-field[disabled] { background: rgba(239, 236, 231, 0.55); border-style: dashed; color: #333; cursor: not-allowed; }
.ed-overlay input[type="checkbox"].ed-field, .ed-overlay input[type="radio"].ed-field { accent-color: var(--brand); padding: 0; appearance: auto; }
.ed-overlay .ed-field-locked { border: 1px dashed rgba(90, 84, 112, 0.6); background: transparent; }

/* properties panel */
.ed-props { overflow-y: auto; max-height: calc(100vh - 260px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; }
.ed-props-h { font-size: 1.05rem; margin: 0 0 0.5rem; }
.ed-props textarea.input, .ed-props textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1.5px solid #9d94ad; border-radius: 10px; box-sizing: border-box; }
.ed-props .label { margin-top: 0.6rem; }
.ed-props .actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; }
.ed-colors { border: 0; padding: 0; margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ed-colors legend { padding: 0; margin-bottom: 0.3rem; font: inherit; font-weight: 650; font-size: 1rem; color: var(--ink); }
.ed-swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.ed-swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--brand); }
.ed-compare p { border-left: 4px solid var(--line); padding-left: 0.6rem; }
.ed-compare p:last-child { border-left-color: #000; }

/* status bar */
.ed-status { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.3rem 1rem; padding: 0.3rem 0.5rem;
  border-top: 1px solid var(--line); font-size: 0.95rem; }
.ed-status-group { display: flex; align-items: center; gap: 0.25rem; }
.ed-pageinfo, .ed-zoomlabel { min-width: 5.5rem; text-align: center; font-variant-numeric: tabular-nums; }
.ed-secure { color: var(--good); }

/* pages mode */
.ed-grid { display: block; }
.ed-grid-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.ed-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.75rem; }
.ed-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5rem; display: grid; gap: 0.35rem; justify-items: center; }
.ed-card.dragging { opacity: 0.5; }
.ed-card-top { display: flex; justify-content: space-between; align-items: center; width: 100%; font-size: 0.9rem; }
.ed-card-n { font-weight: 650; }
.ed-card-pic { position: relative; background: #fff; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.ed-card-pic img { position: absolute; display: block; }
.ed-card-note { margin: 0; text-align: center; overflow-wrap: anywhere; }
.ed-card-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.ed-card-actions .btn { min-width: 44px; padding-left: 8px; padding-right: 8px; }

/* dialogs */
.ed-dialog { border: 0; border-radius: var(--radius-lg); padding: 0; max-width: min(40rem, calc(100vw - 24px)); width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); color: var(--ink); }
.ed-dialog::backdrop { background: rgba(20, 16, 40, 0.45); }
.ed-dialog-inner { padding: 1.25rem 1.4rem; }
.ed-dialog h2 { margin-top: 0; }
.ed-dialog .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.ed-sigpad { display: block; background: #fff; border: 1.5px dashed #9d94ad; border-radius: 10px; touch-action: none; max-width: 100%; }
.ed-sig-pane { margin: 0.75rem 0; }
.ed-ins-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.5rem; max-height: 50vh; overflow-y: auto; }
.ed-ins-page { display: grid; justify-items: center; gap: 0.25rem; }
.ed-ins-page img { width: 100px; background: #fff; box-shadow: 0 0 0 1px var(--line); }

.ed-history-table td { overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .ed-body { grid-template-columns: minmax(0, 1fr) 15rem; }
  .ed-thumbs { display: none; }
}
@media (max-width: 760px) {
  .ed-body { grid-template-columns: minmax(0, 1fr); }
  .ed-canvas { max-height: 70vh; padding: 8px; }
  .ed-props { max-height: none; }
  .ed-top-right { width: 100%; }
  .ed-save-state { text-align: left; width: 100%; min-width: 0; }
  .ed-tools { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 4px; }
  .ed-tool { white-space: nowrap; }
  .ed-status { justify-content: center; }
  .ed-secure { width: 100%; text-align: center; }
  .ed-more-panel { right: auto; left: 0; }
}
.ed-canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* "Send for signature" in the top bar only where there is room; it is always in More. */
@media (max-width: 720px) { .ed-send { display: none; } }
.ed-warn { margin: 8px 0; padding: 6px 10px; border-left: 3px solid #b38700; background: #fff6d6; color: #5a3d00; border-radius: 4px; }
