/* ============================================================
   PDFCraft — Unified Editor Workspace (Acrobat-style)
   Depends on the design tokens defined in styles.css
   ============================================================ */

:root {
  --ed-canvas-bg: #2b2d31;
  --ed-toolbar-h: 50px;
  --ed-rail-w: 132px;
  --ed-props-w: 264px;
  --ed-accent: var(--a2);
}
[data-theme="light"] {
  --ed-canvas-bg: #d6d8dc;
}

/* When the editor is mounted, let it own the viewport */
.pc-main.ed-active #pc-content { padding: 0 !important; }
.pc-main.ed-active .pc-page-footer { display: none; }

/* ── Editor shell ── */
.ed {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h));
  background: var(--bg);
  overflow: hidden;
}

/* ── Empty state / drop zone ── */
.ed-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ed-drop {
  width: min(560px, 100%);
  border: 2px dashed var(--brd2);
  border-radius: var(--r-xl);
  background: var(--sur);
  padding: 52px 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr), transform var(--tr);
  position: relative;
}
.ed-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ed-drop.over { border-color: var(--ed-accent); background: var(--sur2); transform: scale(1.01); }
.ed-drop-ico {
  width: 60px; height: 60px; margin: 0 auto 18px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--a2), var(--a1));
  border-radius: 16px; color: #fff;
  box-shadow: 0 10px 30px rgba(37,99,235,.4);
}
.ed-drop-ico svg { width: 28px; height: 28px; }
.ed-drop h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 6px; }
.ed-drop p { color: var(--tx2); font-size: .85rem; }
.ed-drop .ed-drop-sub { margin-top: 14px; font-size: .76rem; color: var(--tx3); }

/* ── Toolbar ── */
.ed-toolbar {
  height: var(--ed-toolbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  background: var(--sur);
  border-bottom: 1px solid var(--brd);
  overflow-x: auto;
  scrollbar-width: none;
}
.ed-toolbar::-webkit-scrollbar { display: none; }
.ed-tool-group { display: flex; align-items: center; gap: 2px; }
.ed-divider { width: 1px; height: 24px; background: var(--brd2); margin: 0 6px; flex-shrink: 0; }
.ed-spacer { flex: 1; }

.ed-tbtn {
  height: 34px; min-width: 34px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--tx2);
  cursor: pointer;
  font-size: .78rem; font-weight: 600;
  transition: all var(--tr);
  white-space: nowrap;
  flex-shrink: 0;
}
.ed-tbtn svg { width: 16px; height: 16px; }
.ed-tbtn:hover { background: var(--sur3); color: var(--tx1); }
.ed-tbtn.active {
  background: color-mix(in srgb, var(--ed-accent) 16%, transparent);
  color: var(--a3);
  border-color: color-mix(in srgb, var(--ed-accent) 35%, transparent);
}
.ed-tbtn.primary {
  background: var(--ed-accent); color: #fff; padding: 0 14px;
}
.ed-tbtn.primary:hover { background: var(--a1); color: #fff; }
.ed-tbtn:disabled { opacity: .4; cursor: not-allowed; }
.ed-tbtn-lbl { display: inline; }
@media (max-width: 1100px) { .ed-tbtn-lbl { display: none; } }

.ed-zoom {
  display: flex; align-items: center; gap: 2px;
  background: var(--sur2); border: 1px solid var(--brd); border-radius: var(--r-sm);
  padding: 2px;
}
.ed-zoom button {
  width: 26px; height: 26px; display: grid; place-items: center;
  background: transparent; border: none; color: var(--tx2); cursor: pointer; border-radius: 4px;
}
.ed-zoom button:hover { background: var(--sur3); color: var(--tx1); }
.ed-zoom-val { font-size: .74rem; font-weight: 700; color: var(--tx1); min-width: 44px; text-align: center; }

.ed-pagenav { display: flex; align-items: center; gap: 4px; font-size: .76rem; color: var(--tx2); font-weight: 600; }
.ed-pagenav input { width: 42px; text-align: center; padding: 4px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-sm); color: var(--tx1); font: inherit; }

/* ── Body: rail | canvas | props ── */
.ed-body { flex: 1; display: flex; min-height: 0; }

/* Thumbnail rail */
.ed-rail {
  width: var(--ed-rail-w); flex-shrink: 0;
  background: var(--sur); border-right: 1px solid var(--brd);
  overflow-y: auto; padding: 10px 8px;
}
.ed-rail-head { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tx3); font-weight: 800; padding: 0 4px 8px; }
.ed-thumb {
  position: relative; margin-bottom: 10px; border-radius: var(--r-sm);
  border: 2px solid transparent; cursor: pointer; overflow: hidden;
  background: #fff; transition: border-color var(--tr); box-shadow: var(--shadow-sm);
}
.ed-thumb.active { border-color: var(--ed-accent); }
.ed-thumb.dragging { opacity: .4; }
.ed-thumb.drag-over { border-color: var(--a3); border-style: dashed; }
.ed-thumb canvas { display: block; width: 100%; }
.ed-thumb-num {
  position: absolute; left: 4px; bottom: 4px;
  background: rgba(0,0,0,.7); color: #fff; font-size: .64rem; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
}
.ed-thumb-del {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  background: rgba(0,0,0,.6); border: none; color: #fff; border-radius: 5px;
  display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity var(--tr);
}
.ed-thumb:hover .ed-thumb-del { opacity: 1; }
.ed-thumb-del svg { width: 12px; height: 12px; }
.ed-rail-add {
  width: 100%; padding: 10px; margin-top: 4px;
  border: 1px dashed var(--brd2); background: transparent; border-radius: var(--r-sm);
  color: var(--tx2); cursor: pointer; font-size: .72rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.ed-rail-add:hover { color: var(--tx1); border-color: var(--brd3); }
.ed-rail-add svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Canvas viewport */
.ed-canvas-wrap {
  flex: 1; overflow: auto; background: var(--ed-canvas-bg);
  padding: 26px; display: flex; flex-direction: column; align-items: center; gap: 26px;
}
.ed-page {
  position: relative; background: #fff; box-shadow: 0 6px 26px rgba(0,0,0,.45);
  flex-shrink: 0;
}
.ed-page canvas { display: block; }
.ed-page-tag {
  position: absolute; left: 0; top: -22px; font-size: .68rem; color: rgba(255,255,255,.55); font-weight: 600;
}
.ed-overlay { position: absolute; inset: 0; overflow: hidden; }
.ed-overlay.tool-crop { cursor: crosshair; }
.ed-overlay.tool-text { cursor: text; }
.ed-overlay.tool-edittext { cursor: text; }
/* Edit-Text hotspots: clickable boxes laid over the PDF's real text runs */
.ed-ethot { position: absolute; z-index: 3; cursor: text; border-radius: 2px; background: rgba(13,148,136,.10); outline: 1px dashed rgba(13,148,136,.5); outline-offset: -1px; transition: background .12s; }
.ed-ethot:hover { background: rgba(13,148,136,.24); outline-color: rgba(13,148,136,.85); }
.ed-overlay.tool-draw, .ed-overlay.tool-highlight,
.ed-overlay.tool-rect, .ed-overlay.tool-ellipse,
.ed-overlay.tool-line, .ed-overlay.tool-redact,
.ed-overlay.tool-whiteout, .ed-overlay.tool-image,
.ed-overlay.tool-signature, .ed-overlay.tool-field { cursor: crosshair; }

/* Elements */
.ed-el { position: absolute; box-sizing: border-box; }
.ed-el.selected { outline: 1.5px solid var(--ed-accent); outline-offset: 1px; }
.ed-el.tool-select-hover { outline: 1.5px dashed var(--a3); outline-offset: 1px; }
.ed-el-text {
  white-space: pre; line-height: 1.2; padding: 1px 2px;
  cursor: move; display: inline-block; width: max-content; max-width: 92vw;
}
.ed-el-text[contenteditable=true] { cursor: text; outline: 2px solid var(--ed-accent); outline-offset: 1px; background: rgba(37,99,235,.08); }
.ed-el-text:empty[contenteditable=true]::before { content: 'Type…'; }
.ed-el-img { cursor: move; }
.ed-el-img img { width: 100%; height: 100%; display: block; pointer-events: none; }
.ed-el-shape { cursor: move; }
.ed-el-shape svg { width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; }
.ed-el-fill { cursor: move; width: 100%; height: 100%; }
.ed-el-field {
  cursor: move; border: 1.5px dashed var(--a2); background: rgba(37,99,235,.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--a3); font-size: .7rem; font-weight: 700; border-radius: 3px; text-align: center;
}

/* Resize handles */
.ed-handle {
  position: absolute; width: 11px; height: 11px; background: #fff;
  border: 1.5px solid var(--ed-accent); border-radius: 2px; z-index: 5;
}
.ed-handle.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.ed-handle.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.ed-handle.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.ed-handle.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.ed-el-del-btn {
  position: absolute; top: -12px; right: -12px; width: 22px; height: 22px;
  background: var(--red); border: 2px solid var(--sur); color: #fff; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; z-index: 6;
}
.ed-el-del-btn svg { width: 11px; height: 11px; }

/* Rotation handle (single selection) */
.ed-rot-handle {
  position: absolute; left: 50%; top: -28px; transform: translateX(-50%);
  width: 18px; height: 18px; background: #fff; border: 1.5px solid var(--ed-accent);
  border-radius: 50%; cursor: grab; z-index: 6; display: grid; place-items: center;
}
.ed-rot-handle::after { content: ''; position: absolute; top: 17px; left: 50%; width: 1.5px; height: 11px; background: var(--ed-accent); transform: translateX(-50%); }
.ed-rot-handle svg { width: 11px; height: 11px; color: var(--ed-accent); pointer-events: none; }
.ed-rot-handle:active { cursor: grabbing; }

/* Hyperlink element — multiple visual designs */
.ed-el-link { cursor: move; display: flex; align-items: center; box-sizing: border-box; overflow: visible; }
.ed-el-link.lk-invisible { border: 1.5px dashed #2563eb; background: rgba(37,99,235,.10); border-radius: 4px; }
.ed-link-badge { position: absolute; top: -9px; left: -9px; width: 18px; height: 18px; background: #2563eb; color: #fff; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ed-link-badge svg { width: 11px; height: 11px; }

/* Link design picker */
.ws-link-styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ed-mini-btn.active { background: color-mix(in srgb, var(--ed-accent) 16%, transparent); border-color: var(--ed-accent); color: var(--ed-accent); }

/* Locked element */
.ed-el-locked { outline: 1.5px dashed #f59e0b !important; cursor: default !important; }
.ed-el-locked .ed-handle, .ed-el-locked .ed-rot-handle { display: none !important; }

/* Marquee selection box */
.ed-marquee { position: absolute; border: 1.5px solid var(--ed-accent); background: rgba(37,99,235,.10); pointer-events: none; z-index: 7; }

/* Snap/alignment guides */
.ed-guide { position: absolute; background: #ef4444; pointer-events: none; z-index: 8; }
.ed-guide.v { width: 1px; top: 0; bottom: 0; }
.ed-guide.h { height: 1px; left: 0; right: 0; }

/* Multi-select align grid */
.ws-align-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* Lock checkbox row */
.ed-lock-row { display: flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 600; color: var(--tx1); cursor: pointer; user-select: none; }
.ed-lock-row input { width: 15px; height: 15px; accent-color: var(--ed-accent); }
.ed-lock-row svg { width: 14px; height: 14px; opacity: .7; }

/* Signature placement — ghost follows the cursor until you click to drop */
.ed-place-ghost { position: fixed; transform: translate(-50%, -50%); z-index: 900; pointer-events: none; opacity: .85; filter: drop-shadow(0 4px 12px rgba(0,0,0,.35)); }
.ed-place-ghost img { width: 100%; height: 100%; display: block; }
.placing .ed-overlay, .placing .ed-page { cursor: copy !important; }

/* Crop overlay rectangle */
.ed-crop-box { position: absolute; border: 2px dashed var(--a3); background: rgba(96,165,250,.12); pointer-events: none; }
.ed-crop-shade { position: absolute; inset: 0; background: rgba(0,0,0,.45); pointer-events: none; }

/* ── Properties panel ── */
.ed-props {
  width: var(--ed-props-w); flex-shrink: 0;
  background: var(--sur); border-left: 1px solid var(--brd);
  overflow-y: auto; padding: 14px;
}
.ed-props-title {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--tx3); font-weight: 800; margin-bottom: 12px;
  display: flex; align-items: center; gap: 7px;
}
.ed-props-title svg { width: 14px; height: 14px; }
.ed-prop { margin-bottom: 14px; }
.ed-prop-lbl { font-size: .72rem; font-weight: 600; color: var(--tx2); margin-bottom: 6px; display: flex; justify-content: space-between; }
.ed-prop-lbl .v { color: var(--tx1); font-weight: 700; }
.ed-prop input[type=text], .ed-prop input[type=number], .ed-prop select, .ed-prop textarea {
  width: 100%; padding: 8px 10px; background: var(--sur2);
  border: 1px solid var(--brd2); border-radius: var(--r-sm);
  color: var(--tx1); font: inherit; font-size: .8rem;
}
.ed-prop textarea { resize: vertical; min-height: 64px; }
.ed-prop input[type=range] { width: 100%; }
.ed-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-swatch { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--brd2); cursor: pointer; }
.ed-swatch.active { border-color: var(--tx1); transform: scale(1.08); }
.ed-seg { display: flex; gap: 4px; }
.ed-seg button {
  flex: 1; padding: 7px; background: var(--sur2); border: 1px solid var(--brd2);
  border-radius: var(--r-sm); color: var(--tx2); cursor: pointer; font-size: .76rem; font-weight: 700;
}
.ed-seg button.active { background: color-mix(in srgb, var(--ed-accent) 18%, transparent); color: var(--a3); border-color: var(--ed-accent); }
.ed-props-empty { color: var(--tx3); font-size: .8rem; text-align: center; padding: 30px 10px; line-height: 1.6; }
.ed-props-empty svg { width: 30px; height: 30px; margin-bottom: 10px; opacity: .5; }
.ed-props-hint { font-size: .72rem; color: var(--tx3); line-height: 1.5; margin-top: 4px; }

.ed-apply-btn {
  width: 100%; padding: 11px; background: var(--ed-accent); color: #fff;
  border: none; border-radius: var(--r-md); font-weight: 700; font-size: .82rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 8px;
}
.ed-apply-btn:hover { background: var(--a1); }
.ed-apply-btn svg { width: 15px; height: 15px; }
.ed-apply-btn.ghost { background: var(--sur3); color: var(--tx1); }
.ed-apply-btn.ghost:hover { background: var(--sur2); }
/* eSign onboarding coachmark */
.ed-onb { width: min(460px, 100%); }
.ed-onb-lead { font-size: .9rem; color: var(--tx2); line-height: 1.55; margin: 0 0 16px; }
.ed-onb-step { display: flex; gap: 13px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--brd); }
.ed-onb-step:first-of-type { border-top: none; padding-top: 2px; }
.ed-onb-num { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--ed-accent) 18%, transparent); color: var(--ed-accent); border: 1px solid color-mix(in srgb, var(--ed-accent) 40%, transparent); display: grid; place-items: center; font-weight: 800; font-size: .82rem; }
.ed-onb-stxt b { display: block; font-size: .9rem; color: var(--tx1); font-weight: 700; }
.ed-onb-stxt span { display: block; font-size: .8rem; color: var(--tx3); line-height: 1.5; margin-top: 2px; }
.ed-onb-tip { display: flex; gap: 10px; align-items: center; margin-top: 14px; padding: 11px 13px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--ed-accent) 9%, var(--sur2)); border: 1px solid color-mix(in srgb, var(--ed-accent) 22%, var(--brd2)); font-size: .8rem; color: var(--tx2); line-height: 1.45; }
.ed-onb-tip svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--ed-accent); }
.ed-prop-divider { height: 1px; background: var(--brd); margin: 14px 0; }

/* ── Modal (signature / esign send) ── */
.ed-modal-ov {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 1300; padding: 20px;
}
.ed-modal-ov.open { display: flex; }
.ed-modal {
  width: min(520px, 100%); background: var(--sur); border: 1px solid var(--brd2);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden;
}
.ed-modal-head { padding: 16px 18px; border-bottom: 1px solid var(--brd); display: flex; align-items: center; gap: 10px; }
.ed-modal-head h3 { font-size: 1rem; font-weight: 800; flex: 1; }
.ed-modal-close { background: var(--sur2); border: 1px solid var(--brd2); width: 30px; height: 30px; border-radius: 8px; color: var(--tx2); cursor: pointer; display: grid; place-items: center; }
.ed-modal-sig { width: min(540px, 100%); }
.ed-modal-body { padding: 18px; max-height: min(74vh, 680px); overflow-y: auto; }
.ed-sig-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.ed-sig-tab { flex: 1; padding: 9px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-sm); color: var(--tx2); cursor: pointer; font-weight: 700; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ed-sig-tab svg { width: 15px; height: 15px; }
.ed-sig-tab.active { background: color-mix(in srgb, var(--ed-accent) 16%, transparent); color: var(--a3); border-color: var(--ed-accent); }
/* Draw + Type shared toolbar */
.ed-sig-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.ed-sig-ink-row { display: inline-flex; gap: 6px; align-items: center; }
.ed-sig-ink { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--brd2); cursor: pointer; padding: 0; position: relative; }
.ed-sig-ink.active { border-color: var(--tx1); transform: scale(1.12); }
.ed-sig-ink-pick { overflow: hidden; background: conic-gradient(from 0deg,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00); display: grid; place-items: center; }
.ed-sig-ink-pick input[type=color] { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); opacity: 0; cursor: pointer; border: none; padding: 0; }
.ed-sig-bar input[type=range] { width: 110px; accent-color: var(--ed-accent); }
.ed-sig-pen-lbl { font-size: .72rem; color: var(--tx2); font-weight: 700; }
.ed-sig-pen-lbl b { color: var(--tx1); }
/* Draw pad with signature line */
.ed-sig-padwrap { position: relative; }
.ed-sig-pad { width: 100%; height: 190px; background: #fff; border: 1px solid var(--brd2); border-radius: var(--r-md); touch-action: none; cursor: crosshair; display: block; }
.ed-sig-baseline { position: absolute; left: 28px; right: 28px; bottom: 52px; border-bottom: 2px dashed #cbd5e1; pointer-events: none; }
.ed-sig-x-mark { position: absolute; left: 30px; bottom: 54px; color: #cbd5e1; font-size: 16px; font-weight: 700; pointer-events: none; }
.ed-sig-padwrap.inked .ed-sig-baseline, .ed-sig-padwrap.inked .ed-sig-x-mark { opacity: .35; }
.ed-sig-hint { margin-top: 8px; font-size: .72rem; color: var(--tx3); text-align: center; }
.ed-sig-input { width: 100%; padding: 10px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: 8px; color: var(--tx1); font: inherit; }
.ed-sig-type-preview {
  height: 130px; background: #fff; border: 1px solid var(--brd2); border-radius: var(--r-md);
  display: grid; place-items: center; color: #111; margin-top: 12px; overflow: hidden; padding: 0 16px; text-align: center; line-height: 1.1;
}
.ed-sig-fonts { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.ed-sig-font { padding: 8px 14px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-sm); cursor: pointer; color: var(--tx1); font-size: 1.35rem; line-height: 1; }
.ed-sig-font.active { border-color: var(--ed-accent); background: color-mix(in srgb, var(--ed-accent) 10%, transparent); }
/* Upload tab */
.ed-sig-drop { width: 100%; padding: 30px 24px; }
.ed-sig-uprev { margin-top: 14px; text-align: center; }
.ed-sig-uprev img { max-height: 130px; max-width: 100%; background: #fff; border: 1px solid var(--brd2); border-radius: 10px; padding: 10px; }
.ed-sig-uprev button { display: block; margin: 10px auto 0; background: var(--sur2); border: 1px solid var(--brd2); color: var(--tx2); padding: 6px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .78rem; }
/* e-sign request */
.ed-es-steps { display: flex; gap: 8px; margin-bottom: 16px; }
.ed-es-step { flex: 1; display: flex; align-items: center; gap: 7px; font-size: .74rem; font-weight: 600; color: var(--tx2); background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-sm); padding: 7px 9px; }
.ed-es-step b { width: 18px; height: 18px; flex-shrink: 0; display: grid; place-items: center; background: var(--ed-accent); color: #fff; border-radius: 50%; font-size: .68rem; }
.ed-es-signer { display: flex; gap: 6px; margin-bottom: 6px; }
.ed-es-signer input { padding: 8px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: 6px; color: var(--tx1); font: inherit; }
.ed-es-signer input[data-sn] { flex: 1; } .ed-es-signer input[data-se] { flex: 1.3; }
/* saved templates bar — prominent card at the top of the eSign modal */
.ed-es-tplbar { margin-bottom: 16px; padding: 12px 13px; background: color-mix(in srgb, var(--ed-accent) 6%, var(--sur2)); border: 1px solid color-mix(in srgb, var(--ed-accent) 24%, var(--brd2)); border-radius: var(--r-sm); }
.ed-es-tplbar:empty { display: none; }
.ed-es-tpl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ed-es-tpl-save { flex-shrink: 0; font-size: .76rem; font-weight: 700; color: #fff; background: var(--ed-accent); border: none; border-radius: 8px; padding: 7px 12px; cursor: pointer; }
.ed-es-tpl-save:hover { filter: brightness(1.08); }
.ed-es-tpl-hint { font-size: .72rem; color: var(--tx2); margin: 9px 0 7px; }
.ed-es-tpl-empty { font-size: .74rem; color: var(--tx2); margin-top: 9px; line-height: 1.45; }
.ed-es-tpl-lbl { font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--tx2); }
.ed-es-tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-es-tpl-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--tx1); background: color-mix(in srgb, var(--ed-accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ed-accent) 32%, transparent); border-radius: 20px; padding: 6px 8px 6px 12px; cursor: pointer; transition: background .14s; }
.ed-es-tpl-chip:hover { background: color-mix(in srgb, var(--ed-accent) 20%, transparent); }
.ed-es-tpl-chip i { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: var(--tx3); background: var(--sur3); }
.ed-es-tpl-chip i:hover { color: #fff; background: var(--red, #ef4444); }
.ed-es-tpl-chip i svg { width: 10px; height: 10px; }
/* template dropdown selector */
.ed-es-tpl-row { display: flex; align-items: center; gap: 8px; }
.ed-es-tpl-selwrap { position: relative; flex: 1; min-width: 0; }
.ed-es-tpl-select { width: 100%; appearance: none; -webkit-appearance: none; font: inherit; font-size: .82rem; font-weight: 600; color: var(--tx1); background: var(--sur2); border: 1px solid var(--brd2); border-radius: 10px; padding: 10px 34px 10px 12px; cursor: pointer; transition: border-color .14s; }
.ed-es-tpl-select:hover { border-color: color-mix(in srgb, var(--ed-accent) 45%, var(--brd2)); }
.ed-es-tpl-select:focus { outline: none; border-color: var(--ed-accent); }
.ed-es-tpl-select option { background: var(--sur2); color: var(--tx1); }
.ed-es-tpl-caret { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--tx3); display: inline-flex; }
.ed-es-tpl-caret svg { width: 14px; height: 14px; transform: rotate(90deg); }
.ed-es-tpl-del { flex-shrink: 0; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--sur2); border: 1px solid var(--brd2); color: var(--tx3); cursor: pointer; transition: color .14s, background .14s, opacity .14s; }
.ed-es-tpl-del:hover { color: #fff; background: var(--red, #ef4444); border-color: transparent; }
.ed-es-tpl-del:disabled { opacity: .4; cursor: default; }
.ed-es-tpl-del:disabled:hover { color: var(--tx3); background: var(--sur2); border-color: var(--brd2); }
.ed-es-tpl-del svg { width: 13px; height: 13px; pointer-events: none; }
/* signing-order segmented control + OTP toggle */
.ed-es-seg { display: flex; gap: 8px; }
.ed-es-seg-b { flex: 1; text-align: left; background: var(--sur2); border: 1px solid var(--brd2); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: var(--tx2); transition: border-color .14s, background .14s; }
.ed-es-seg-b b { display: block; font-size: .82rem; font-weight: 700; color: var(--tx1); }
.ed-es-seg-b span { display: block; font-size: .7rem; color: var(--tx3); line-height: 1.35; margin-top: 3px; }
.ed-es-seg-b.active { border-color: var(--ed-accent); background: color-mix(in srgb, var(--ed-accent) 12%, var(--sur2)); }
.ed-es-seg-b.active b { color: var(--ed-accent); }
.ed-es-otp { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 13px; border-radius: 12px; background: var(--sur2); border: 1px solid var(--brd2); cursor: pointer; }
.ed-es-otp input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--ed-accent); cursor: pointer; flex-shrink: 0; }
.ed-es-otp span { font-size: .76rem; color: var(--tx2); line-height: 1.45; }
.ed-es-otp span b { color: var(--tx1); font-weight: 700; }
.ed-es-order { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: .72rem; font-weight: 800; }
.ed-es-fc { flex-shrink: 0; font-size: .68rem; font-weight: 700; color: var(--tx2); background: var(--sur3); padding: 4px 8px; border-radius: 20px; white-space: nowrap; }
.ed-es-fc.zero { color: #fbbf24; background: rgba(245, 158, 11, .16); }

.ed-mini-btn.solid { background: var(--ed-accent); border-color: var(--ed-accent); color: #fff; }

/* Send-modal branding hint (links to the Dashboard → Branding tab) */
.ed-es-brandhint { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--sur2); border: 1px solid var(--brd2); font-size: .77rem; color: var(--tx2); }
.ed-es-brandhint.on { background: color-mix(in srgb, var(--ed-accent) 9%, var(--sur2)); border-color: color-mix(in srgb, var(--ed-accent) 30%, var(--brd2)); }
.ed-es-bh-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.ed-es-bh-logo { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 6px; object-fit: contain; background: #fff; border: 1px solid var(--brd2); }
.ed-es-bh-txt { flex: 1 1 auto; min-width: 0; line-height: 1.4; }
.ed-es-bh-txt b { color: var(--tx1); font-weight: 700; }
.ed-es-brandhint button { flex: 0 0 auto; background: none; border: none; color: var(--ed-accent); font: inherit; font-size: .77rem; font-weight: 700; cursor: pointer; padding: 0; }
.ed-es-brandhint button:hover { text-decoration: underline; }

/* ════ Send modal · two-pane "Review & Send" (live document + form) ════ */
.ed-modal-sig2 { width: min(960px, 100%); }
.ed-modal-sig2 .ed-modal-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr); gap: 0; padding: 0; max-height: min(74vh, 680px); overflow: hidden; }
/* each column owns its scroll — explicit max-height so grid items are bounded */
.ed-modal-sig2 .ed-es-doc, .ed-modal-sig2 .ed-es-form { max-height: min(74vh, 680px); }
/* left: live document */
.ed-es-doc { display: flex; gap: 12px; padding: 16px; background: linear-gradient(180deg, var(--bg2, #0f0f0f), var(--sur)); border-right: 1px solid var(--brd); overflow-y: auto; min-height: 0; }
.ed-es-docmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 11px; }
.ed-es-thumbs { display: flex; flex-direction: column; gap: 8px; width: 46px; flex-shrink: 0; }
.ed-es-thumb { position: relative; aspect-ratio: .77; border-radius: 6px; background: var(--sur3); border: 1.5px solid var(--brd2); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--tx2); transition: border-color .14s, box-shadow .14s; }
.ed-es-thumb:hover { border-color: var(--brd3); }
.ed-es-thumb.on { border-color: var(--ed-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ed-accent) 35%, transparent); color: var(--tx1); }
.ed-es-th-n { font-size: .7rem; font-weight: 800; }
.ed-es-th-dots { display: flex; gap: 2px; }
.ed-es-th-dot { width: 5px; height: 5px; border-radius: 50%; }
.ed-es-docbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ed-es-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.ed-es-leg { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .72rem; font-weight: 700; color: var(--tx2); background: var(--sur2); border: 1px solid var(--brd2); padding: 4px 9px; border-radius: 20px; cursor: pointer; transition: opacity .14s, border-color .14s, color .14s; }
.ed-es-leg.on { border-color: var(--ed-accent); color: var(--tx1); }
.ed-es-leg.dim { opacity: .4; }
.ed-es-leg-dot { width: 9px; height: 9px; border-radius: 50%; }
.ed-es-pager { display: flex; align-items: center; gap: 7px; color: var(--tx2); font-weight: 700; font-size: .76rem; flex-shrink: 0; }
.ed-es-pager button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--brd2); background: var(--sur2); color: var(--tx1); cursor: pointer; display: grid; place-items: center; }
.ed-es-pager svg { width: 13px; height: 13px; }
.ed-es-paper { position: relative; align-self: flex-start; width: 100%; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.5), inset 0 0 0 1px rgba(0,0,0,.06); }
.ed-es-paper canvas { display: block; }
.ed-es-fov { position: absolute; left: 0; top: 0; pointer-events: none; }
.ed-es-fbox { position: absolute; border: 1.5px dashed; border-radius: 5px; box-sizing: border-box; overflow: hidden; transition: opacity .14s; }
.ed-es-fbox.dim { opacity: .24; }
.ed-es-fbox-t { display: inline-block; font-size: .58rem; font-weight: 800; color: #fff; padding: 1px 5px; border-radius: 0 0 5px 0; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ed-es-docnote { font-size: .72rem; color: var(--tx3); line-height: 1.45; }
/* right: form column scrolls independently */
.ed-es-form { padding: 18px; overflow-y: auto; min-height: 0; }
/* readiness strip */
.ed-es-ready { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 12px; margin-bottom: 16px; background: color-mix(in srgb, var(--green, #16a34a) 12%, var(--sur2)); border: 1px solid color-mix(in srgb, var(--green, #16a34a) 32%, var(--brd2)); }
.ed-es-ready:empty { display: none; }
.ed-es-ready.warn { background: color-mix(in srgb, #d97706 12%, var(--sur2)); border-color: color-mix(in srgb, #d97706 34%, var(--brd2)); }
.ed-es-ready-ic { width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; background: var(--green, #16a34a); color: #fff; font-weight: 900; }
.ed-es-ready.warn .ed-es-ready-ic { background: #d97706; }
.ed-es-ready-txt { min-width: 0; }
.ed-es-ready-txt b { font-size: .86rem; font-weight: 800; display: block; color: var(--tx1); }
.ed-es-ready-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.ed-es-rchip { font-size: .68rem; font-weight: 700; color: var(--tx2); background: var(--sur); border: 1px solid var(--brd2); padding: 3px 8px; border-radius: 20px; }
.ed-es-rchip.ok { color: var(--green2, #22c55e); border-color: color-mix(in srgb, var(--green2, #22c55e) 30%, var(--brd2)); }
.ed-es-rchip.off { color: var(--tx3); }
/* richer signer rows: colour bar + page badge + spotlight */
.ed-es-signer { position: relative; align-items: center; padding-left: 11px; }
.ed-es-signer::before { content: ''; position: absolute; left: 0; top: 5px; bottom: 5px; width: 3px; border-radius: 3px; background: var(--es-bar, #8b5cf6); }
.ed-es-signer.spot { outline: 1.5px solid color-mix(in srgb, var(--es-bar, #8b5cf6) 60%, transparent); outline-offset: 2px; border-radius: 8px; }
.ed-es-order { cursor: pointer; transition: transform .12s; }
.ed-es-order:hover { transform: scale(1.1); }
.ed-es-spage { flex-shrink: 0; font-size: .64rem; font-weight: 800; color: var(--tx3); background: var(--sur3); border: 1px solid var(--brd2); padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
/* drag-to-reorder */
.ed-es-grip { flex-shrink: 0; cursor: grab; color: var(--tx3); font-weight: 900; letter-spacing: -2px; padding: 0 1px; user-select: none; }
.ed-es-grip:active { cursor: grabbing; }
.ed-es-signer.dragging { opacity: .5; }
.ed-es-signer.drop-above { box-shadow: 0 -2px 0 var(--ed-accent); }
.ed-es-signer.drop-below { box-shadow: 0 2px 0 var(--ed-accent); }
/* Add-signer row + "Everyone at once" toggle */
.ed-es-addrow { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.ed-es-addrow .ed-rail-add { flex: 1; }
.ed-es-paratog { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; flex-shrink: 0; font-size: .78rem; font-weight: 700; color: var(--tx2); user-select: none; }
.ed-es-paratog input { position: absolute; opacity: 0; width: 0; height: 0; }
.ed-es-paratog-sw { position: relative; width: 34px; height: 20px; border-radius: 20px; background: var(--brd3); transition: background .14s; flex-shrink: 0; }
.ed-es-paratog-sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .14s; }
.ed-es-paratog input:checked + .ed-es-paratog-sw { background: var(--ed-accent); }
.ed-es-paratog input:checked + .ed-es-paratog-sw::after { left: 16px; }
.ed-es-paratog input:checked ~ .ed-es-paratog-lbl { color: var(--tx1); }
/* bulk send — structured add + chips */
.ed-es-bulknote { font-size: .76rem; color: var(--tx2); line-height: 1.5; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--ed-accent) 8%, var(--sur2)); border: 1px solid color-mix(in srgb, var(--ed-accent) 24%, var(--brd2)); margin-bottom: 14px; }
.ed-es-bulknote b { color: var(--tx1); font-weight: 700; }
.ed-es-bulknote.warn { background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.32); color: #fbbf24; }
.ed-es-bulkadd { display: flex; gap: 7px; align-items: stretch; }
.ed-es-bulkadd input { padding: 9px 10px; min-width: 0; }
.ed-es-bulkadd #ed-es-bname { flex: 1 1 0; } .ed-es-bulkadd #ed-es-bemail { flex: 1.4 1 0; }
/* the Add button must size to its content here — its base rule is width:100%, which
   (with no shrink) would otherwise grab the whole row and crush the inputs to squares */
.ed-es-bulkadd .ed-rail-add { flex: 0 0 auto; width: auto; margin-top: 0; padding: 9px 16px; white-space: nowrap; }
.ed-es-bchips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; align-items: center; }
.ed-es-bchip { display: inline-flex; align-items: center; gap: 7px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: 20px; padding: 5px 6px 5px 11px; font-size: .76rem; }
.ed-es-bchip b { font-weight: 700; color: var(--tx1); }
.ed-es-bchip span { color: var(--tx3); }
.ed-es-bchip button { width: 18px; height: 18px; flex-shrink: 0; display: grid; place-items: center; border: none; border-radius: 50%; background: var(--sur3); color: var(--tx3); cursor: pointer; }
.ed-es-bchip button:hover { background: var(--red, #ef4444); color: #fff; }
.ed-es-bchip button svg { width: 9px; height: 9px; }
.ed-es-bcount { font-size: .72rem; font-weight: 700; color: var(--tx2); padding-left: 4px; }
.ed-es-bempty { font-size: .76rem; color: var(--tx3); }
.ed-es-bpaste { margin-top: 13px; }
.ed-es-bpaste summary { cursor: pointer; font-size: .78rem; font-weight: 700; color: var(--a3); list-style: none; }
.ed-es-bpaste summary::-webkit-details-marker { display: none; }
.ed-es-bpaste-hint { font-size: .72rem; color: var(--tx3); margin-top: 6px; }
/* ── refined signer row: a clean card, balanced badges, subtle remove ── */
.ed-es-signer { background: var(--sur2); border: 1px solid var(--brd2); border-radius: 12px; padding: 8px 9px 8px 12px; gap: 9px; margin-bottom: 8px; }
.ed-es-signer:hover { border-color: var(--brd3); }
.ed-es-signer input { flex: 1; min-width: 0; background: var(--sur); border: 1px solid var(--brd2); border-radius: 8px; padding: 8px 10px; color: var(--tx1); font: inherit; font-size: .85rem; }
.ed-es-signer input[data-se] { flex: 1.25; }
.ed-es-signer input:focus { outline: none; border-color: var(--ed-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ed-accent) 18%, transparent); }
.ed-es-order { width: 24px; height: 24px; font-size: .74rem; }
.ed-es-spage { font-size: .62rem; padding: 4px 6px; }
.ed-es-fc { font-size: .65rem; padding: 4px 9px; font-weight: 800; }
.ed-es-fc:not(.zero) { color: var(--green2, #22c55e); background: color-mix(in srgb, var(--green2, #22c55e) 15%, var(--sur3)); }
.ed-es-signer [data-sr] { width: 26px; height: 26px; flex-shrink: 0; border-radius: 7px; background: transparent; border: 1px solid transparent; color: var(--tx3); display: grid; place-items: center; cursor: pointer; transition: background .12s, color .12s; }
.ed-es-signer [data-sr]:hover { background: color-mix(in srgb, var(--red, #ef4444) 16%, transparent); color: #f87171; }
.ed-es-signer [data-sr] svg { width: 12px; height: 12px; }
/* contact autocomplete (shared by send modal + editor signer panel) */
.ed-ac { position: fixed; z-index: 2000; background: var(--sur); border: 1px solid var(--brd3); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; max-width: 340px; }
.ed-ac-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; border-radius: 8px; padding: 8px 9px; cursor: pointer; color: var(--tx1); }
.ed-ac-item:hover, .ed-ac-item.hi { background: var(--sur3); }
.ed-ac-av { width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; background: var(--ed-accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.ed-ac-main { flex: 1; min-width: 0; }
.ed-ac-main b { display: block; font-size: .84rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-ac-main span { display: block; font-size: .74rem; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-ac-tag { flex-shrink: 0; font-size: .62rem; font-weight: 800; color: var(--tx3); background: var(--sur2); border: 1px solid var(--brd2); padding: 2px 7px; border-radius: 20px; }
/* People tab — contact list + add */
.ed-people-add { display: flex; gap: 8px; margin-bottom: 16px; }
.ed-people-add input { flex: 1; min-width: 0; }
.ed-people-add #ed-pc-email { flex: 1.3; }
.ed-people-add .ed-apply-btn { flex-shrink: 0; width: auto; white-space: nowrap; }
.ed-people-list { display: flex; flex-direction: column; gap: 8px; }
.ed-people-list .ed-dash-person { margin-bottom: 0; }
/* inline-editable contact rows */
.ed-dash-pedit { flex: 1; min-width: 0; display: flex; gap: 7px; }
.ed-people-in { min-width: 0; background: var(--sur); border: 1px solid transparent; border-radius: 7px; padding: 7px 9px; color: var(--tx1); font: inherit; font-size: .82rem; transition: border-color .12s, box-shadow .12s; }
.ed-people-in[data-pf="name"] { flex: 0 0 34%; font-weight: 700; }
.ed-people-in[data-pf="email"] { flex: 1; }
.ed-people-in:hover { border-color: var(--brd2); }
.ed-people-in:focus { outline: none; border-color: var(--ed-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ed-accent) 16%, transparent); }
.ed-people-in.bad { border-color: var(--red, #ef4444); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red, #ef4444) 16%, transparent); }
@media (max-width: 560px) { .ed-dash-pedit { flex-direction: column; } .ed-people-in[data-pf="name"] { flex: 1; } }
.ed-people-rm { width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; background: transparent; border: 1px solid var(--brd2); color: var(--tx3); display: grid; place-items: center; cursor: pointer; transition: background .12s, color .12s; }
.ed-people-rm:hover { background: color-mix(in srgb, var(--red, #ef4444) 16%, transparent); color: #f87171; border-color: transparent; }
.ed-people-rm svg { width: 12px; height: 12px; }
.ed-dash-uses.muted { color: var(--tx3); font-weight: 700; }
/* editor signer panel: focus ring in the signer's own colour + amber zero-field hint */
.ws-signer-top input:focus, .ws-signer-email:focus { outline: none; border-color: var(--sc, var(--a2)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--sc, var(--a2)) 25%, transparent); }
.ws-signer-count.zero { color: #fbbf24; background: rgba(245,158,11,.16); }
/* stack on narrow viewports (slim panes / mobile) — single shared scroll */
@media (max-width: 760px) {
  .ed-modal-sig2 { width: min(560px, 100%); }
  .ed-modal-sig2 .ed-modal-body { grid-template-columns: 1fr; overflow-y: auto; }
  .ed-modal-sig2 .ed-es-doc, .ed-modal-sig2 .ed-es-form { max-height: none; overflow: visible; }
  .ed-es-doc { border-right: 0; border-bottom: 1px solid var(--brd); }
  .ed-es-paper { max-height: 240px; }
}

/* Dashboard → Branding tab */
.ed-brand-intro { font-size: .82rem; color: var(--tx2); line-height: 1.55; margin-bottom: 16px; }
.ed-brand-intro b { color: var(--tx1); }
.ed-brand-cols { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
@media (max-width: 720px) { .ed-brand-cols { grid-template-columns: 1fr; } }
.ed-brand-field { margin-bottom: 15px; }
.ed-brand-field > label { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--tx3); margin-bottom: 7px; }
.ed-brand-logorow { display: flex; align-items: center; gap: 12px; }
.ed-brand-logo { width: 84px; height: 84px; flex-shrink: 0; border-radius: 14px; border: 1.5px dashed var(--brd2); background: #fff; display: grid; place-items: center; cursor: pointer; overflow: hidden; }
.ed-brand-logo:hover { border-color: var(--ed-accent); }
.ed-brand-logo.has { border-style: solid; }
.ed-brand-logo #ed-brand-prev { font-size: .74rem; font-weight: 700; color: var(--tx3); display: grid; place-items: center; width: 100%; height: 100%; }
.ed-brand-logo img { max-width: 88%; max-height: 88%; object-fit: contain; }
.ed-brand-color { display: flex; align-items: center; gap: 10px; }
.ed-brand-color input[type=color] { width: 46px; height: 34px; padding: 0; border: 1px solid var(--brd2); border-radius: 9px; background: none; cursor: pointer; }
.ed-brand-color code { font-size: .82rem; font-weight: 700; color: var(--tx1); text-transform: uppercase; }
.ed-brand-toggle { margin-top: 4px; }
.ed-brand-form .ed-apply-btn { margin-top: 16px; }
.ed-brand-status { font-size: .74rem; color: var(--tx3); margin-top: 9px; min-height: 16px; }
.ed-brand-status.ok { color: #4ade80; font-weight: 600; }
/* live preview cards */
.ed-brand-pv { display: flex; flex-direction: column; gap: 14px; }
.ed-bpv { border-radius: 14px; overflow: hidden; border: 1px solid var(--brd2); position: relative; }
.ed-bpv-tag { position: absolute; top: 8px; right: 10px; font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--tx3); }
.ed-bpv-sign { background: #0b0d12; padding: 16px 14px; }
.ed-bpv-mail { background: #fff; padding-bottom: 16px; }
.ed-bpv-mailbar { height: 5px; width: 100%; }
.ed-bpv-mail .ed-bpv-top { padding: 14px 14px 0; }
.ed-bpv-top { display: flex; align-items: center; gap: 11px; }
.ed-bpv-logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; overflow: hidden; flex-shrink: 0; }
.ed-bpv-logo img { width: 100%; height: 100%; object-fit: contain; }
.ed-bpv-nm { font-size: .92rem; font-weight: 800; color: #fff; }
.ed-bpv-sub { font-size: .68rem; font-weight: 600; color: #9aa0b0; margin-top: 1px; }
.ed-bpv-btn { margin-top: 14px; text-align: center; padding: 11px; border-radius: 11px; color: #fff; font-size: .82rem; font-weight: 800; }

/* Full-page "sent for signature" confirmation */
.ed-sent-ov { position: absolute; inset: 0; z-index: 1200; display: none; align-items: center; justify-content: center; padding: 24px; background: var(--sur); }
.ed-sent-ov.open { display: flex; }
.ed-sent-card { width: min(460px, 100%); text-align: center; }
.ed-sent-badge { width: 78px; height: 78px; margin: 0 auto 18px; border-radius: 50%; background: linear-gradient(135deg, #8b5cf6, #6366f1); display: grid; place-items: center; color: #fff; box-shadow: 0 16px 44px rgba(124,58,237,.4); animation: edSentPop .5s cubic-bezier(.2,1.4,.4,1); }
.ed-sent-badge svg { width: 34px; height: 34px; }
@keyframes edSentPop { 0% { transform: scale(0) } 100% { transform: scale(1) } }
.ed-sent-card h2 { font-size: 1.5rem; font-weight: 800; margin: 0 0 8px; }
.ed-sent-card > p { color: var(--tx2); font-size: .9rem; line-height: 1.6; margin: 0 0 18px; }
.ed-sent-list { text-align: left; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-md); overflow: hidden; margin-bottom: 16px; }
.ed-sent-signer { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--brd); }
.ed-sent-signer:last-child { border-bottom: none; }
.ed-sent-num { width: 24px; height: 24px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--ed-accent); color: #fff; font-size: .74rem; font-weight: 800; }
.ed-sent-sname { font-weight: 700; font-size: .86rem; color: var(--tx1); }
.ed-sent-semail { font-size: .76rem; color: var(--tx3); }
.ed-sent-state { margin-left: auto; font-size: .68rem; font-weight: 700; color: var(--tx2); background: var(--sur3); padding: 4px 9px; border-radius: 20px; white-space: nowrap; }
.ed-sent-signer:first-child .ed-sent-state { color: #fff; background: var(--ed-accent); }
.ed-sent-foot { font-size: .78rem; color: var(--tx3); line-height: 1.6; margin: 0 0 20px; }
.ed-sent-card .ed-apply-btn { max-width: 220px; margin: 0 auto; }

/* ── Top-right account chip ── */
.ws-account { position: relative; }
.ws-account-btn { display: flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: 20px; color: var(--tx1); cursor: pointer; font: inherit; }
.ws-account-btn:hover { border-color: var(--brd3); }
.ws-account-av { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; display: grid; place-items: center; font-size: .76rem; font-weight: 800; }
.ws-account-nm { font-size: .8rem; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-account-menu { display: none; position: absolute; top: calc(100% + 6px); right: 0; min-width: 200px; background: var(--sur); border: 1px solid var(--brd2); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.ws-account-menu.open { display: block; }
.ws-account-email { font-size: .72rem; color: var(--tx3); padding: 7px 10px 9px; border-bottom: 1px solid var(--brd); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
.ws-account-menu button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 10px; background: none; border: none; color: var(--tx1); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; border-radius: var(--r-sm); text-align: left; }
.ws-account-menu button:hover { background: var(--sur2); }
.ws-account-menu button svg { width: 14px; height: 14px; }
.ws-account-menu #ws-account-out { color: var(--red); }
@media (max-width: 760px) { .ws-account-nm { display: none; } }

/* ── Element-props header close (back to panel) ── */
.ws-elhead { display: flex; align-items: center; gap: 8px; }
.ws-elhead-x { margin-left: auto; width: 26px; height: 26px; flex-shrink: 0; display: grid; place-items: center; background: var(--sur2); border: 1px solid var(--brd2); border-radius: 7px; color: var(--tx2); cursor: pointer; }
.ws-elhead-x:hover { color: var(--tx1); background: var(--sur3); }
.ws-elhead-x svg { width: 12px; height: 12px; }

/* ── Request eSign gate (signed-out state of the panel) ── */
.ed-esign-gate { text-align: center; padding: 24px 14px; }
.ed-esign-gate-ic { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 15px; background: linear-gradient(135deg, #16a34a, #15803d); display: grid; place-items: center; color: #fff; box-shadow: 0 10px 28px rgba(22,163,74,.35); }
.ed-esign-gate-ic svg { width: 26px; height: 26px; }
.ed-esign-gate h3 { font-size: 1.05rem; font-weight: 800; margin: 0 0 8px; color: var(--tx1); }
.ed-esign-gate p { font-size: .84rem; color: var(--tx2); line-height: 1.55; margin: 0 0 18px; }

/* ── My Agreements dashboard ── */
.ed-dash-ov { position: absolute; inset: 0; z-index: 1100; display: none; background: var(--bg, #0b0d12); }
.ed-dash-ov.open { display: block; }
.ed-dash { max-width: 760px; margin: 0 auto; height: 100%; display: flex; flex-direction: column; padding: 0 16px; }
.ed-dash-head { display: flex; align-items: center; padding: 20px 4px 14px; }
.ed-dash-htitle { display: flex; align-items: center; gap: 12px; }
.ed-dash-logo { width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(22,163,74,.32); }
.ed-dash-logo svg { width: 20px; height: 20px; }
.ed-dash-head h2 { font-size: 1.42rem; font-weight: 800; margin: 0; letter-spacing: -.3px; }
.ed-dash-sub { font-size: .8rem; color: var(--tx3); margin-top: 1px; }
.ed-dash-x { margin-left: auto; width: 44px; height: 44px; border-radius: 12px; background: var(--sur3); border: 1px solid var(--brd2); color: var(--tx1); cursor: pointer; display: grid; place-items: center; transition: background .12s, color .12s; }
.ed-dash-x:hover { color: #fff; background: var(--brd3); }
.ed-dash-x:active { background: var(--brd3); }
/* glyph never intercepts the click — the whole button is the hit target */
.ed-dash-x svg { width: 18px; height: 18px; pointer-events: none; }
.ed-dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ed-dash-stat { display: flex; align-items: center; gap: 11px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-md); padding: 13px 14px; }
.ed-dash-stat-ic { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; }
.ed-dash-stat-ic svg { width: 17px; height: 17px; }
.ed-dash-stat b { display: block; font-size: 1.35rem; font-weight: 800; color: var(--tx1); line-height: 1.05; }
.ed-dash-stat span { font-size: .66rem; color: var(--tx3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ed-dash-stat.st-total .ed-dash-stat-ic { background: color-mix(in srgb, var(--a2) 16%, transparent); color: var(--a2); }
.ed-dash-stat.st-done .ed-dash-stat-ic { background: rgba(34,197,94,.16); color: #22c55e; }
.ed-dash-stat.st-prog .ed-dash-stat-ic { background: rgba(245,158,11,.16); color: #f59e0b; }
.ed-dash-stat.st-people .ed-dash-stat-ic { background: rgba(139,92,246,.16); color: #8b5cf6; }
.ed-dash-pdf svg { width: 15px; height: 15px; }
.ed-dash-prog { height: 5px; background: var(--sur3); border-radius: 4px; overflow: hidden; margin: 12px 0 0; }
.ed-dash-prog-bar { height: 100%; border-radius: 4px; transition: width .3s; }
.ed-dash-prog-bar.done { background: linear-gradient(90deg, #22c55e, #16a34a); }
.ed-dash-prog-bar.prog { background: linear-gradient(90deg, #f59e0b, #d97706); }
.ed-dash-prog-bar.declined { background: linear-gradient(90deg, #f87171, #dc2626); }
.ed-dash-faces { display: flex; align-items: center; gap: 0; margin-top: 12px; }
.ed-dash-face { width: 26px; height: 26px; border-radius: 50%; background: var(--sur3); color: var(--tx2); border: 2px solid var(--sur2); display: grid; place-items: center; font-size: .66rem; font-weight: 800; margin-left: -7px; }
.ed-dash-face:first-child { margin-left: 0; }
.ed-dash-face.ok { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.ed-dash-facetxt { font-size: .76rem; color: var(--tx2); font-weight: 600; margin-left: 10px; }
.ed-dash-empty-ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--sur2); border: 1px solid var(--brd2); display: grid; place-items: center; color: var(--tx3); }
.ed-dash-empty-ic svg { width: 24px; height: 24px; }
.ed-dash-empty p { line-height: 1.6; }
.ed-dash-empty-acts { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 16px; }
.ed-dash-pmain { flex: 1; min-width: 0; }
.ed-dash-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.ed-dash-tab { padding: 9px 18px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-sm); color: var(--tx2); font-weight: 700; font-size: .82rem; cursor: pointer; }
.ed-dash-tab.active { background: color-mix(in srgb, var(--ed-accent) 16%, transparent); color: var(--ed-accent); border-color: var(--ed-accent); }
.ed-dash-body { flex: 1; overflow-y: auto; padding-bottom: 24px; }
.ed-dash-filters { display: flex; gap: 6px; margin-bottom: 12px; }
.ed-dash-fchip { padding: 6px 13px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: 20px; color: var(--tx2); font-size: .74rem; font-weight: 700; cursor: pointer; }
.ed-dash-fchip.active { background: var(--ed-accent); color: #fff; border-color: var(--ed-accent); }
.ed-dash-card { position: relative; background: linear-gradient(180deg, var(--sur2), color-mix(in srgb, var(--sur2) 78%, var(--bg, #0b0d12))); border: 1px solid var(--brd2); border-radius: 16px; padding: 15px 16px; margin-bottom: 10px; overflow: hidden; }
/* subtle accent rail down the left edge, tinted by status */
.ed-dash-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brd2); opacity: .8; }
.ed-dash-card:has(.ed-dash-status.done)::before { background: linear-gradient(180deg, #22c55e, #16a34a); }
.ed-dash-card:has(.ed-dash-status.prog)::before { background: linear-gradient(180deg, #f59e0b, #d97706); }
.ed-dash-card:has(.ed-dash-status.declined)::before { background: linear-gradient(180deg, #f87171, #dc2626); }
.ed-dash-card-top { display: flex; align-items: center; gap: 13px; }
.ed-dash-pdf { width: 36px; height: 45px; flex-shrink: 0; border-radius: 8px; background: linear-gradient(160deg, #f0556b, #c0264a); color: #fff; font-size: .58rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 5px 14px rgba(192,38,74,.32); }
.ed-dash-card-main { flex: 1; min-width: 0; }
.ed-dash-dname { font-weight: 700; font-size: .94rem; color: var(--tx1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.1px; }
.ed-dash-meta { font-size: .74rem; color: var(--tx3); margin-top: 3px; }
.ed-dash-status { flex-shrink: 0; font-size: .7rem; font-weight: 800; padding: 5px 11px; border-radius: 20px; white-space: nowrap; border: 1px solid transparent; letter-spacing: .01em; }
.ed-dash-status.done { color: #4ade80; background: rgba(34,197,94,.13); border-color: rgba(34,197,94,.25); }
.ed-dash-status.prog { color: #fbbf24; background: rgba(251,191,36,.13); border-color: rgba(251,191,36,.25); }
.ed-dash-signers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ed-dash-chip { font-size: .72rem; font-weight: 600; color: var(--tx2); background: var(--sur3); padding: 4px 10px; border-radius: 20px; }
.ed-dash-chip.ok { color: #4ade80; background: rgba(34,197,94,.12); }
.ed-dash-dl { margin-top: 12px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px; background: var(--sur3); border: 1px solid var(--brd2); border-radius: var(--r-sm); color: var(--tx1); font-weight: 700; font-size: .8rem; cursor: pointer; }
.ed-dash-dl:hover { border-color: var(--ed-accent); }
.ed-dash-dl svg { width: 14px; height: 14px; }
.ed-dash-person { display: flex; align-items: center; gap: 12px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 8px; }
.ed-dash-avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; display: grid; place-items: center; font-weight: 800; }
.ed-dash-pname { font-weight: 700; font-size: .88rem; color: var(--tx1); }
.ed-dash-pemail { font-size: .76rem; color: var(--tx3); }
.ed-dash-uses { margin-left: auto; font-size: .72rem; font-weight: 700; color: var(--tx3); background: var(--sur3); padding: 4px 9px; border-radius: 20px; }
.ed-dash-empty { text-align: center; color: var(--tx3); padding: 40px 20px; font-size: .86rem; }
.ed-dash-status.cancelled { color: var(--tx3); background: var(--sur3); border-color: var(--brd2); }
.ed-dash-status.declined { color: #f87171; background: rgba(220,38,38,.13); border-color: rgba(220,38,38,.28); }
.ed-dash-status.expired { color: #fb923c; background: rgba(249,115,22,.13); border-color: rgba(249,115,22,.28); }
/* dashboard — saved signatures */
.ed-dash-sighint { font-size: .8rem; color: var(--tx2); line-height: 1.5; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-sm); padding: 11px 13px; margin-bottom: 14px; }
.ed-dash-sigloading { text-align: center; color: var(--tx3); padding: 30px; font-size: .85rem; }
.ed-dash-sigs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ed-dash-sig { position: relative; background: #fff; border: 1px solid var(--brd2); border-radius: 10px; height: 88px; display: grid; place-items: center; overflow: hidden; }
.ed-dash-sig img { max-width: 86%; max-height: 70%; object-fit: contain; }
.ed-dash-sig-rm { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; display: grid; place-items: center; border: none; border-radius: 50%; background: rgba(15,18,26,.62); color: #fff; cursor: pointer; opacity: 0; transition: opacity .14s; }
.ed-dash-sig:hover .ed-dash-sig-rm { opacity: 1; }
.ed-dash-sig-rm svg { width: 12px; height: 12px; }
@media (hover: none) { .ed-dash-sig-rm { opacity: 1; } }
.ed-dash-card.clickable { cursor: pointer; transition: border-color var(--tr), transform var(--tr), box-shadow var(--tr); }
.ed-dash-card.clickable:hover { border-color: color-mix(in srgb, var(--ed-accent) 55%, var(--brd2)); transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0,0,0,.30); }
.ed-dash-card.clickable:hover .ed-dash-arrow { color: var(--ed-accent); transform: translateX(3px); }
.ed-dash-card.clickable:active { transform: translateY(0) scale(.995); }
.ed-dash-arrow { margin-left: auto; align-self: center; color: var(--tx3); display: inline-flex; transition: color var(--tr), transform var(--tr); }
.ed-dash-arrow svg { width: 14px; height: 14px; }
/* ── modern dashboard uplift ── */
.ed-dash { max-width: 1240px; padding: 0 20px; }
/* Container-relative columns: fills 2+ columns when the pane is wide, and reflows
   to a single column when it's narrow (e.g. PDFCraft inside a slim IDE panel).
   A viewport media-query would wrongly keep 2 columns and overflow such panes. */
.ed-dash-aglist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 12px; align-items: start; }
.ed-dash-aglist .ed-dash-card, .ed-dash-aglist .ed-dash-person { margin-bottom: 0; }
/* primary / set-primary on saved signatures */
.ed-dash-sig.primary { border-color: var(--ed-accent); box-shadow: 0 0 0 1px var(--ed-accent) inset; }
.ed-dash-sig-badge { position: absolute; top: 6px; left: 6px; font-size: .6rem; font-weight: 800; color: #fff; background: var(--ed-accent); padding: 3px 7px; border-radius: 20px; }
.ed-dash-sig-acts { position: absolute; top: 6px; right: 6px; display: flex; gap: 5px; opacity: 0; transition: opacity .14s; }
.ed-dash-sig:hover .ed-dash-sig-acts { opacity: 1; }
@media (hover: none) { .ed-dash-sig-acts { opacity: 1; } }
.ed-dash-sig-star, .ed-dash-sig-acts .ed-dash-sig-rm { position: static; width: 24px; height: 24px; display: grid; place-items: center; border: none; border-radius: 50%; background: rgba(15,18,26,.66); color: #cbd0d8; cursor: pointer; font-size: .8rem; opacity: 1; }
.ed-dash-sig-star.on { background: var(--ed-accent); color: #fff; }
.ed-dash-sig-star:hover { color: #fbbf24; }
.ed-dash-sig-acts .ed-dash-sig-rm:hover { color: #fff; background: var(--red, #ef4444); }
.ed-es-tpl-chip b { font-size: .66rem; font-weight: 800; background: rgba(255,255,255,.14); padding: 1px 6px; border-radius: 10px; }
.ed-dash-hero { position: relative; overflow: hidden; margin: 16px 0 18px; padding: 24px 24px 20px; border-radius: 24px; border: 1px solid color-mix(in srgb, var(--ed-accent) 26%, var(--brd2)); background: linear-gradient(135deg, color-mix(in srgb, var(--ed-accent) 26%, var(--sur)) 0%, var(--sur) 56%); box-shadow: 0 20px 50px -24px color-mix(in srgb, var(--ed-accent) 65%, transparent); }
.ed-dash-hero-bg { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(520px 240px at 92% -45%, color-mix(in srgb, var(--ed-accent) 55%, transparent), transparent 66%), radial-gradient(360px 220px at 6% 125%, color-mix(in srgb, #6366f1 32%, transparent), transparent 70%); }
.ed-dash-hero > *:not(.ed-dash-hero-bg) { position: relative; z-index: 1; }
.ed-dash-hero .ed-dash-x { position: absolute; top: 14px; right: 14px; z-index: 4; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); color: #fff; }
.ed-dash-hero .ed-dash-x:hover { background: rgba(255,255,255,.22); }
/* light theme: the hero is pale, so a white glyph vanishes — use a dark, visible one */
[data-theme="light"] .ed-dash-hero .ed-dash-x { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.14); color: #2a2a35; }
[data-theme="light"] .ed-dash-hero .ed-dash-x:hover { background: rgba(0,0,0,.11); color: #000; }
.ed-dash-hero-row { display: flex; align-items: center; gap: 15px; }
.ed-dash-hero-txt { min-width: 0; flex: 1; padding-right: 52px; }
.ed-dash-avatar-lg { width: 56px; height: 56px; flex-shrink: 0; border-radius: 17px; background: linear-gradient(140deg, var(--ed-accent), color-mix(in srgb, var(--ed-accent) 40%, #6366f1)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; border: 1px solid rgba(255,255,255,.2); box-shadow: 0 12px 30px -6px color-mix(in srgb, var(--ed-accent) 62%, transparent), inset 0 1px 0 rgba(255,255,255,.28); }
.ed-dash-hero-txt h2 { font-size: 1.55rem; font-weight: 900; margin: 0; letter-spacing: -.5px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: linear-gradient(118deg, var(--tx1) 12%, color-mix(in srgb, var(--ed-accent) 58%, var(--tx1))); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.ed-dash-hero .ed-dash-sub { font-size: .85rem; font-weight: 600; color: var(--tx2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-dash-quick { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; }
.ed-dash-qbtn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; font: inherit; font-weight: 700; font-size: .84rem; cursor: pointer; border: 1px solid var(--brd2); background: var(--sur3); color: var(--tx1); transition: transform .14s, filter .14s; }
.ed-dash-qbtn svg { width: 15px; height: 15px; }
.ed-dash-qbtn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.ed-dash-qbtn.primary { background: linear-gradient(135deg, var(--ed-accent), color-mix(in srgb, var(--ed-accent) 55%, #6366f1)); color: #fff; border: none; box-shadow: 0 8px 20px color-mix(in srgb, var(--ed-accent) 36%, transparent); }
.ed-dash-stat { font: inherit; text-align: left; width: 100%; cursor: pointer; transition: transform .14s, border-color .14s; border-radius: 16px; }
.ed-dash-stat:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--ed-accent) 42%, var(--brd2)); }
.ed-dash-tab { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; }
.ed-dash-tabn { font-size: .68rem; font-weight: 800; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--sur3); color: var(--tx2); display: inline-grid; place-items: center; }
.ed-dash-tab.active .ed-dash-tabn { background: color-mix(in srgb, var(--ed-accent) 30%, transparent); color: var(--ed-accent); }
.ed-dash-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.ed-dash-search { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px; padding: 9px 13px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: 12px; color: var(--tx3); transition: border-color .14s; }
.ed-dash-search:focus-within { border-color: var(--ed-accent); }
.ed-dash-search input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--tx1); font: inherit; font-size: .86rem; }
.ed-dash-card { border-radius: 16px; transition: transform .14s, border-color .14s, box-shadow .14s; }
.ed-dash-card.clickable:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--ed-accent) 45%, var(--brd2)); box-shadow: 0 12px 28px rgba(0,0,0,.26); }
.ed-dash-filters { margin-bottom: 0; }

/* ════ triage-first dashboard (Needs you + wide two-column + activity) ════ */
.ed-dash-needs { margin-bottom: 18px; }
.ed-dash-needs-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ed-dash-needs-lbl { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--tx2); }
.ed-dash-needs-hint { font-size: .74rem; font-weight: 600; color: var(--tx3); }
.ed-dash-clear { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .74rem; font-weight: 700; color: var(--a3); background: none; border: none; cursor: pointer; }
.ed-dash-clear svg { width: 11px; height: 11px; }
.ed-dash-triage { display: grid; grid-template-columns: repeat(6, 1fr); gap: 11px; }
.ed-dash-tri.bulkf { color: #a78bfa; } .ed-dash-tri.bulkf .ed-dash-tri-ic { background: rgba(139,92,246,.16); }
.ed-dash-tri { position: relative; text-align: left; background: var(--sur2); border: 1px solid var(--brd2); border-radius: 16px; padding: 15px 16px; cursor: pointer; overflow: hidden; font: inherit; transition: transform .14s, border-color .14s, box-shadow .14s; }
.ed-dash-tri:hover { transform: translateY(-3px); border-color: color-mix(in srgb, currentColor 45%, var(--brd2)); box-shadow: 0 12px 26px -14px color-mix(in srgb, currentColor 70%, transparent); }
.ed-dash-tri.sel { box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 55%, transparent) inset, 0 8px 22px rgba(0,0,0,.36); }
.ed-dash-tri-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 12px; }
.ed-dash-tri-ic svg { width: 18px; height: 18px; }
.ed-dash-tri-n { display: block; font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--tx1); }
.ed-dash-tri-cap { display: block; font-size: .76rem; color: var(--tx2); font-weight: 600; margin-top: 5px; }
.ed-dash-tri-edge { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: currentColor; opacity: .85; }
.ed-dash-tri.danger { color: #f87171; border-color: rgba(220,38,38,.30); } .ed-dash-tri.danger .ed-dash-tri-ic { background: rgba(220,38,38,.16); }
.ed-dash-tri.warn { color: #fbbf24; border-color: rgba(217,119,6,.30); } .ed-dash-tri.warn .ed-dash-tri-ic { background: rgba(217,119,6,.16); }
.ed-dash-tri.wait { color: var(--a3); } .ed-dash-tri.wait .ed-dash-tri-ic { background: color-mix(in srgb, var(--a2) 16%, transparent); }
.ed-dash-tri.ready { color: #22c55e; } .ed-dash-tri.ready .ed-dash-tri-ic { background: rgba(34,197,94,.16); }
.ed-dash-tri.all { color: var(--tx2); } .ed-dash-tri.all .ed-dash-tri-ic { background: var(--sur3); } .ed-dash-tri.all .ed-dash-tri-edge { opacity: .25; }

/* two-column body: list + activity sidebar */
.ed-dash-2col { display: grid; grid-template-columns: 1fr 312px; gap: 18px; align-items: start; }
.ed-dash-maincol { min-width: 0; }
.ed-dash-lhead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ed-dash-ltitle { margin: 0; font-size: .96rem; font-weight: 800; }
.ed-dash-lcnt { font-size: .74rem; color: var(--tx3); font-weight: 600; }
.ed-dash-lhead .ed-dash-search { margin-left: auto; flex: none; width: 250px; }

/* status-forward rows */
.ed-dash-rows { display: flex; flex-direction: column; gap: 9px; }
.ed-dash-row { display: grid; grid-template-columns: 12px minmax(0,1fr) 180px 188px 22px; align-items: center; gap: 16px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-lg); padding: 14px 16px; cursor: pointer; transition: border-color .14s, background .14s; }
.ed-dash-row:hover { border-color: color-mix(in srgb, var(--ed-accent) 45%, var(--brd2)); background: var(--sur3); }
.ed-dash-sdot { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); }
.ed-dash-sdot.prog { color: var(--a3); background: var(--a3); }
.ed-dash-sdot.done { color: #22c55e; background: #22c55e; }
.ed-dash-sdot.declined { color: #f87171; background: #f87171; }
.ed-dash-sdot.expiring { color: #fbbf24; background: #fbbf24; }
.ed-dash-sdot.closed { color: var(--tx3); background: var(--tx3); }
.ed-dash-rmain { min-width: 0; }
.ed-dash-rname { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .92rem; }
.ed-dash-pdf.sm { width: auto; height: auto; display: inline-block; box-shadow: none; background: #b91c1c; font-size: .56rem; font-weight: 800; color: #fff; padding: 2px 5px; border-radius: 4px; letter-spacing: .04em; flex-shrink: 0; }
.ed-dash-rt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-dash-rmid { display: flex; flex-direction: column; gap: 8px; }
.ed-dash-rmid .ed-dash-prog { margin: 0; }
.ed-dash-face.more { background: var(--sur3); color: var(--tx2); }
.ed-dash-rnext { text-align: right; min-width: 0; }
.ed-dash-nexttxt { font-size: .82rem; font-weight: 700; color: var(--tx1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-dash-nexttxt.warn { color: #fbbf24; } .ed-dash-nexttxt.bad { color: #f87171; } .ed-dash-nexttxt.ok { color: #22c55e; } .ed-dash-nexttxt.muted { color: var(--tx2); }
.ed-dash-nextsub { font-size: .73rem; color: var(--tx3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-dash-rarrow { color: var(--tx3); display: inline-flex; justify-self: end; transition: color .14s, transform .14s; }
.ed-dash-rarrow svg { width: 15px; height: 15px; }
.ed-dash-rarrow.dl { color: #22c55e; }
.ed-dash-row:hover .ed-dash-rarrow { color: var(--ed-accent); transform: translateX(2px); }

/* activity sidebar */
.ed-dash-aside { background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-lg); padding: 16px 16px 8px; position: sticky; top: 6px; }
.ed-dash-ring { display: flex; align-items: center; gap: 14px; padding-bottom: 15px; margin-bottom: 14px; border-bottom: 1px solid var(--brd); }
.ed-dash-ring svg { flex-shrink: 0; }
.ed-dash-ring-t b { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--tx1); }
.ed-dash-ring-t span { display: block; font-size: .74rem; color: var(--tx2); margin-top: 2px; }
.ed-dash-aside-h { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 800; margin-bottom: 14px; color: var(--tx1); }
.ed-dash-aside-h svg { width: 14px; height: 14px; color: var(--tx3); }
.ed-dash-feed { display: flex; flex-direction: column; }
.ed-dash-fitem { display: flex; gap: 11px; padding-bottom: 16px; position: relative; }
.ed-dash-fitem::before { content: ''; position: absolute; left: 6px; top: 15px; bottom: -1px; width: 1.5px; background: var(--brd2); }
.ed-dash-fitem:last-child { padding-bottom: 6px; } .ed-dash-fitem:last-child::before { display: none; }
.ed-dash-fdot { width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid var(--sur2); flex-shrink: 0; margin-top: 1px; z-index: 1; background: var(--tx3); }
.ed-dash-fdot.g { background: #22c55e; } .ed-dash-fdot.b { background: var(--a3); } .ed-dash-fdot.r { background: #f87171; } .ed-dash-fdot.a { background: #fbbf24; }
.ed-dash-fmain { min-width: 0; flex: 1; }
.ed-dash-ftxt { font-size: .8rem; line-height: 1.4; color: var(--tx2); }
.ed-dash-ftxt b { color: var(--tx1); font-weight: 700; }
.ed-dash-ftime { font-size: .7rem; color: var(--tx3); margin-top: 2px; }
.ed-dash-feed-empty { font-size: .76rem; color: var(--tx3); line-height: 1.5; padding-bottom: 8px; }
/* reflow to single column in a slim pane */
@container (max-width: 720px) { .ed-dash-2col { grid-template-columns: 1fr; } .ed-dash-aside { order: -1; } .ed-dash-triage { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .ed-dash-2col { grid-template-columns: 1fr; } .ed-dash-triage { grid-template-columns: repeat(2, 1fr); } .ed-dash-row { grid-template-columns: 12px 1fr auto; } .ed-dash-rmid { display: none; } .ed-dash-lhead .ed-dash-search { width: 100%; } .ed-dash-lhead { flex-wrap: wrap; } }
/* skeleton (instant-open loading) */
.ed-dash-skrow { height: 84px; border-radius: 16px; margin-bottom: 10px; }
.ed-dash-skrow, .ed-dash-skline, .ed-dash-stat.sk, .ed-dash-avatar-lg.sk { background: linear-gradient(90deg, var(--sur2) 25%, var(--sur3) 50%, var(--sur2) 75%); background-size: 200% 100%; animation: edsk 1.25s ease-in-out infinite; }
.ed-dash-skline { height: 14px; border-radius: 6px; }
.ed-dash-stat.sk { height: 62px; border: 1px solid var(--brd2); }
.ed-dash-avatar-lg.sk { box-shadow: none; }
@keyframes edsk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
/* detail view */
.ed-dash-back { display: inline-flex; align-items: center; gap: 6px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-sm); color: var(--tx1); padding: 8px 13px; font-weight: 700; font-size: .82rem; cursor: pointer; }
.ed-dash-back svg { width: 13px; height: 13px; }
.ed-dash-detail { padding-bottom: 24px; }
.ed-dash-dhero { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.ed-dash-pdf.big { width: 50px; height: 62px; font-size: .72rem; border-radius: 8px; }
.ed-dash-dtitle { font-size: 1.15rem; font-weight: 800; color: var(--tx1); word-break: break-word; }
.ed-dash-dmsg { background: var(--sur2); border-left: 3px solid var(--ed-accent); border-radius: 0 10px 10px 0; padding: 12px 14px; margin-bottom: 16px; font-size: .86rem; color: var(--tx1); line-height: 1.55; white-space: pre-wrap; }
.ed-dash-drow { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--brd); font-size: .84rem; }
.ed-dash-drow span { color: var(--tx3); } .ed-dash-drow b { color: var(--tx1); font-weight: 600; }
.ed-dash-fp { align-items: flex-start; gap: 16px; }
.ed-dash-fp span { flex-shrink: 0; }
.ed-dash-fp b { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .64rem; font-weight: 500; color: var(--tx2); word-break: break-all; text-align: right; line-height: 1.5; }
.ed-dash-dlabel { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--tx3); margin: 18px 0 10px; }
.ed-dash-signrow { display: flex; align-items: center; gap: 12px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-md); padding: 11px 14px; margin-bottom: 8px; }
.ed-dash-snum { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; background: var(--sur3); color: var(--tx2); display: grid; place-items: center; font-size: .72rem; font-weight: 800; }
.ed-dash-sinfo { flex: 1; min-width: 0; }
.ed-dash-sname { font-weight: 700; font-size: .86rem; color: var(--tx1); }
.ed-dash-semail { font-size: .76rem; color: var(--tx3); }
.ed-dash-sstat { text-align: right; font-size: .76rem; font-weight: 700; color: var(--tx3); flex-shrink: 0; }
.ed-dash-sstat.ok { color: #4ade80; }
.ed-dash-sstat.declined { color: #f87171; }
.ed-dash-sstat span { display: block; font-size: .68rem; font-weight: 500; color: var(--tx3); margin-top: 2px; }
.ed-dash-sstat.declined { color: #f87171; }
/* audit meta under a signed/declined signer */
.ed-dash-saudit { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; }
.ed-dash-saudit span { font-size: .68rem; font-weight: 600; color: var(--tx2); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
/* audit-trail timeline */
.ed-dash-timeline { position: relative; margin: 2px 0 6px; padding-left: 4px; }
.ed-dash-tl { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 0 0 14px 16px; }
.ed-dash-tl::before { content: ''; position: absolute; left: 4px; top: 12px; bottom: -2px; width: 1.5px; background: var(--brd2); }
.ed-dash-tl:last-child::before { display: none; }
.ed-dash-tl-dot { position: absolute; left: 0; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--tx3); border: 2px solid var(--sur); box-shadow: 0 0 0 1px var(--brd2); }
.ed-dash-tl.ok .ed-dash-tl-dot, .ed-dash-tl.done .ed-dash-tl-dot { background: #4ade80; }
.ed-dash-tl.declined .ed-dash-tl-dot { background: #f87171; }
.ed-dash-tl.created .ed-dash-tl-dot { background: var(--ed-accent); }
.ed-dash-tl.remind .ed-dash-tl-dot { background: #fbbf24; }
.ed-dash-tl-main { flex: 1; min-width: 0; }
.ed-dash-tl-t { font-size: .82rem; font-weight: 700; color: var(--tx1); line-height: 1.3; }
.ed-dash-tl-s { font-size: .72rem; color: var(--tx3); margin-top: 2px; word-break: break-word; }
.ed-dash-tl-time { font-size: .68rem; color: var(--tx3); white-space: nowrap; flex-shrink: 0; padding-top: 1px; }
.ed-dash-auditnote { font-size: .7rem; color: var(--tx3); line-height: 1.5; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-md); padding: 9px 12px; margin-top: 4px; }
.ed-dash-dactions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.ed-dash-dactions .ed-apply-btn { margin-top: 0; }

/* ── Auth (login / signup) modal for the e-sign gate ── */
.pdfauth-ov { position: fixed; inset: 0; z-index: 3000; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(4,6,11,.66); backdrop-filter: blur(4px); }
.pdfauth-ov.open { display: flex; }
.pdfauth-card { width: min(400px, 100%); background: var(--sur, #12151c); border: 1px solid var(--brd2, #2b3142); border-radius: 18px; padding: 28px 26px 22px; position: relative; box-shadow: 0 24px 70px rgba(0,0,0,.55); text-align: center; }
.pdfauth-x { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--tx3, #6b7180); font-size: 24px; line-height: 1; cursor: pointer; }
.pdfauth-logo { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; background: linear-gradient(135deg, #8b5cf6, #6366f1); display: grid; place-items: center; font-size: 26px; box-shadow: 0 10px 28px rgba(124,58,237,.42); }
.pdfauth-card h2 { font-size: 1.2rem; font-weight: 800; margin: 0 0 6px; color: var(--tx1, #e7e9ee); }
.pdfauth-sub { font-size: .82rem; color: var(--tx2, #9aa0b0); line-height: 1.5; margin: 0 0 18px; }
.pdfauth-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px; background: #fff; color: #1f2430; border: none; border-radius: 11px; font-weight: 700; font-size: .9rem; cursor: pointer; }
.pdfauth-google:hover { background: #f1f2f5; }
.pdfauth-google:disabled { opacity: .6; cursor: default; }
.pdfauth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 14px; color: var(--tx3, #6b7180); font-size: .72rem; }
.pdfauth-or::before, .pdfauth-or::after { content: ''; flex: 1; height: 1px; background: var(--brd, #232838); }
.pdfauth-err { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.4); color: #fca5a5; font-size: .78rem; padding: 9px 11px; border-radius: 9px; margin-bottom: 12px; text-align: left; }
.pdfauth-err.ok { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.4); color: #86efac; }
.pdfauth-field { display: block; text-align: left; margin-bottom: 11px; }
.pdfauth-field span { display: block; font-size: .7rem; font-weight: 700; color: var(--tx2, #9aa0b0); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.pdfauth-field input { width: 100%; padding: 11px 12px; background: var(--sur2, #171b24); border: 1px solid var(--brd2, #2b3142); border-radius: 10px; color: var(--tx1, #e7e9ee); font: inherit; font-size: .9rem; box-sizing: border-box; }
.pdfauth-field input:focus { outline: none; border-color: #8b5cf6; }
.pdfauth-submit { width: 100%; padding: 12px; margin-top: 4px; background: linear-gradient(135deg, #8b5cf6, #6366f1); border: none; border-radius: 11px; color: #fff; font-weight: 800; font-size: .92rem; cursor: pointer; box-shadow: 0 10px 24px rgba(99,102,241,.35); }
.pdfauth-submit:disabled { opacity: .6; cursor: default; }
.pdfauth-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.pdfauth-link { background: none; border: none; color: var(--tx2, #9aa0b0); font: inherit; font-size: .76rem; cursor: pointer; }
.pdfauth-link b { color: #a78bfa; }
.pdfauth-link:hover { color: var(--tx1, #e7e9ee); }
/* signed-in chip inside the e-sign modal */
.ed-es-account { display: flex; align-items: center; gap: 10px; font-size: .77rem; color: var(--tx2); background: var(--sur2); border: 1px solid var(--brd2); border-radius: 10px; padding: 9px 12px; margin-bottom: 16px; }
.ed-es-account .ed-es-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 800; flex-shrink: 0; }
.ed-es-account-sub { color: var(--tx3); font-size: .7rem; }
.ed-es-account b { color: var(--tx1); }
.ed-es-account .ed-es-signout { margin-left: auto; background: none; border: none; color: var(--tx3); font-size: .72rem; font-weight: 700; cursor: pointer; }
.ed-es-account .ed-es-signout:hover { color: var(--red); }
.ed-es-note { display: flex; gap: 9px; align-items: flex-start; margin-top: 14px; padding: 11px 12px; background: color-mix(in srgb, var(--green, #16a34a) 9%, transparent); border: 1px solid color-mix(in srgb, var(--green, #16a34a) 26%, transparent); border-radius: var(--r-sm); font-size: .76rem; line-height: 1.5; color: var(--tx2); }
.ed-es-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--green, #16a34a); }
.ed-sig-save { display: flex; align-items: center; gap: 7px; font-size: .76rem; font-weight: 600; color: var(--tx2); cursor: pointer; user-select: none; }
.ed-sig-save input { width: 15px; height: 15px; accent-color: var(--ed-accent); }
.ed-modal-foot { padding: 14px 18px; border-top: 1px solid var(--brd); display: flex; gap: 8px; align-items: center; }
.ed-modal-foot .ghost { background: var(--sur2); border: 1px solid var(--brd2); color: var(--tx2); padding: 9px 16px; border-radius: var(--r-md); cursor: pointer; font-weight: 700; font-size: .8rem; display: inline-flex; align-items: center; gap: 6px; }
.ed-modal-foot .ghost svg { width: 14px; height: 14px; }
.ed-modal-foot .solid { background: var(--ed-accent); border: none; color: #fff; padding: 9px 18px; border-radius: var(--r-md); cursor: pointer; font-weight: 700; font-size: .8rem; display: inline-flex; align-items: center; gap: 6px; }
.ed-modal-foot .solid svg { width: 14px; height: 14px; }

/* Request-signatures modal — grouped sections */
.ed-prop-sub { font-weight: 500; color: var(--tx3); }
.ed-es-sect { margin-bottom: 20px; }
.ed-es-secth { display: flex; align-items: center; gap: 9px; font-size: .82rem; font-weight: 800; color: var(--tx1); margin: 0 0 12px; padding-bottom: 9px; border-bottom: 1px solid var(--brd); }
.ed-es-sectn { width: 21px; height: 21px; flex-shrink: 0; display: grid; place-items: center; background: var(--ed-accent); color: #fff; border-radius: 50%; font-size: .72rem; font-weight: 800; }
.ed-es-bulk-row { margin-top: 0; margin-bottom: 12px; }
.ed-es-fieldnote { font-size: .73rem; line-height: 1.45; margin-top: 9px; padding: 8px 11px; border-radius: 9px; background: var(--sur2); border: 1px solid var(--brd2); color: var(--tx3); }
.ed-es-fieldnote.warn { color: #fbbf24; background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.28); }
.ed-es-fieldnote.ok { color: #4ade80; background: rgba(34,197,94,.09); border-color: rgba(34,197,94,.24); }
.ed-es-fieldnote:empty { display: none; }
/* collapsible Options group */
.ed-es-adv { border: 1px solid var(--brd2); border-radius: var(--r-md); background: var(--sur2); overflow: hidden; margin-bottom: 14px; }
.ed-es-adv > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: .82rem; font-weight: 700; color: var(--tx1); }
.ed-es-adv > summary::-webkit-details-marker { display: none; }
.ed-es-adv-hint { flex: 1; font-size: .72rem; font-weight: 500; color: var(--tx3); }
.ed-es-adv-caret { width: 16px; height: 16px; color: var(--tx3); transition: transform .18s; }
.ed-es-adv-caret svg { width: 16px; height: 16px; transform: rotate(90deg); }
.ed-es-adv[open] .ed-es-adv-caret { transform: rotate(90deg); }
.ed-es-adv-body { padding: 2px 14px 14px; border-top: 1px solid var(--brd); }
.ed-es-adv-body .ed-prop:first-child { margin-top: 12px; }
.ed-es-foothint { font-size: .74rem; color: var(--tx3); line-height: 1.5; margin-top: 12px; text-align: center; }
/* footer button hierarchy: quiet download link · secondary · primary */
.ed-es-foot { gap: 10px; }
.ed-es-dllink { background: none; border: none; color: var(--tx3); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 4px; }
.ed-es-dllink:hover { color: var(--tx1); }
.ed-es-dllink svg { width: 14px; height: 14px; }
.ed-es-secondary { background: var(--sur2); border: 1px solid var(--brd2); color: var(--tx1); padding: 10px 16px; border-radius: var(--r-md); cursor: pointer; font-weight: 700; font-size: .8rem; display: inline-flex; align-items: center; gap: 6px; }
.ed-es-secondary svg { width: 14px; height: 14px; }
.ed-es-secondary:hover { border-color: var(--ed-accent); }
.ed-es-primary { background: linear-gradient(135deg, var(--ed-accent), color-mix(in srgb, var(--ed-accent) 55%, #6366f1)); border: none; color: #fff; padding: 11px 20px; border-radius: var(--r-md); cursor: pointer; font-weight: 800; font-size: .82rem; display: inline-flex; align-items: center; gap: 7px; box-shadow: 0 8px 20px color-mix(in srgb, var(--ed-accent) 34%, transparent); transition: transform .14s, filter .14s; }
.ed-es-primary svg { width: 15px; height: 15px; }
.ed-es-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
@media (max-width: 520px) { .ed-es-dllink { order: 3; flex-basis: 100%; justify-content: center; margin-top: 4px; } }

/* Export overlay */
.ed-busy { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; z-index: 1400; flex-direction: column; gap: 14px; color: #fff; }
.ed-busy.open { display: flex; }
.ed-busy .pc-spinner { width: 38px; height: 38px; border-width: 3px; }
.ed-busy span { font-size: .9rem; font-weight: 600; }

/* Mobile */
@media (max-width: 860px) {
  .ed-rail { display: none; }
  .ed-props { position: absolute; right: 0; top: var(--ed-toolbar-h); bottom: 0; z-index: 40; transform: translateX(100%); transition: transform var(--tr); }
  .ed-props.open { transform: translateX(0); }
}

/* ============================================================
   WORKSPACE (tabbed app shell) — .ws-*
   ============================================================ */
.pc-main.ed-active { margin-left: 0 !important; width: 100vw !important; max-width: 100vw; }
.pc-app:has(.pc-main.ed-active) .pc-sidebar { display: none; }
.pc-main.ed-active > .pc-topbar { display: none; }
.pc-main.ed-active #pc-content { padding: 0 !important; }
/* the PWA install banner / kofi float are siblings of .pc-app — hide them in-app */
body:has(.pc-main.ed-active) .pc-pwa-banner,
body:has(.pc-main.ed-active) .kofi-float-button,
body:has(.pc-main.ed-active) [id^="kofi"][class*="float"] { display: none !important; }

/* Full-screen app surface — sits above the host SPA shell regardless of its flex layout */
.ws { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }

/* Top bar */
.ws-top { height: 52px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--sur); border-bottom: 1px solid var(--brd); }
.ws-home { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--tx2); background: var(--sur2); border: 1px solid var(--brd); flex-shrink: 0; }
.ws-home:hover { color: var(--tx1); background: var(--sur3); }
.ws-home svg { width: 16px; height: 16px; }
.ws-brand { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: .9rem; flex-shrink: 0; }
.ws-brand svg { width: 20px; height: 24px; }
@media (max-width: 720px) { .ws-brand span { display: none; } }
.ws-tabs { display: flex; align-items: center; gap: 5px; flex: 1; overflow-x: auto; scrollbar-width: none; padding: 0 4px; }
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tab { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 6px 0 10px; background: var(--sur2); border: 1px solid var(--brd); border-radius: 9px; cursor: pointer; max-width: 200px; flex-shrink: 0; color: var(--tx2); transition: background var(--tr); }
.ws-tab:hover { background: var(--sur3); color: var(--tx1); }
.ws-tab.active { background: color-mix(in srgb, var(--a2) 14%, var(--sur)); border-color: color-mix(in srgb, var(--a2) 42%, transparent); color: var(--tx1); }
.ws-tab svg { width: 15px; height: 16px; flex-shrink: 0; }
.ws-tab-name { font-size: .78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-tab-x { width: 18px; height: 18px; display: grid; place-items: center; border: none; background: transparent; color: var(--tx3); border-radius: 4px; cursor: pointer; flex-shrink: 0; }
.ws-tab-x:hover { background: var(--sur3); color: var(--tx1); }
.ws-tab-x svg { width: 11px; height: 11px; }
.ws-newtab { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--brd2); background: var(--sur2); color: var(--tx2); border-radius: var(--r-sm); cursor: pointer; flex-shrink: 0; }
.ws-newtab:hover { color: var(--tx1); background: var(--sur3); }
.ws-newtab svg { width: 15px; height: 15px; }
.ws-top-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ws-zoom { display: flex; align-items: center; gap: 2px; background: var(--sur2); border: 1px solid var(--brd); border-radius: var(--r-sm); padding: 2px; }
.ws-zoom button:not(.ws-zoom-val) { width: 25px; height: 25px; display: grid; place-items: center; background: transparent; border: none; color: var(--tx2); cursor: pointer; border-radius: 4px; }
.ws-zoom button:not(.ws-zoom-val):hover { background: var(--sur3); color: var(--tx1); }
.ws-zoom-val { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; font-size: .72rem; font-weight: 700; min-width: 52px; height: 25px; padding: 0 8px; background: transparent; border: none; color: var(--tx1); cursor: pointer; border-radius: 4px; line-height: 1; }
.ws-zoom-val:hover { background: var(--sur3); }
.ws-zoom-val svg { width: 10px; height: 10px; opacity: .65; flex-shrink: 0; }
.ws-pagenav { display: flex; align-items: center; gap: 3px; font-size: .74rem; color: var(--tx2); font-weight: 600; }
.ws-pagenav button { width: 26px; height: 26px; display: grid; place-items: center; background: var(--sur2); border: 1px solid var(--brd); border-radius: var(--r-sm); color: var(--tx2); cursor: pointer; }
.ws-pagenav button svg { width: 13px; height: 13px; }
.ws-pagenav input { width: 38px; text-align: center; padding: 3px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-sm); color: var(--tx1); font: inherit; }
@media (max-width: 820px) { .ws-pagenav, .ws-zoom { display: none !important; } }
.ws-tbtn { width: 32px; height: 32px; display: grid; place-items: center; background: var(--sur2); border: 1px solid var(--brd); border-radius: var(--r-sm); color: var(--tx2); cursor: pointer; }
.ws-tbtn:hover:not(:disabled) { color: var(--tx1); background: var(--sur3); }
.ws-tbtn:disabled { opacity: .35; cursor: not-allowed; }
.ws-tbtn svg { width: 15px; height: 15px; }
.ws-save { display: flex; align-items: center; gap: 7px; padding: 0 14px; height: 34px; background: var(--a2); color: #fff; border: none; border-radius: var(--r-sm); font-weight: 700; font-size: .82rem; cursor: pointer; }
.ws-save:hover { background: var(--a1); }
.ws-save svg { width: 15px; height: 15px; }
@media (max-width: 600px) { .ws-save span { display: none; } }

/* Body: rail | resizer | stage */
.ws-body { flex: 1; display: flex; min-height: 0; }
.ws-rail { width: var(--rail-w, 250px); flex-shrink: 0; background: var(--sur); border-right: 1px solid var(--brd); display: flex; flex-direction: column; overflow: hidden; }
.ws-resizer { width: 6px; flex-shrink: 0; cursor: col-resize; background: transparent; position: relative; }
.ws-resizer::after { content: ''; position: absolute; inset: 0 2px; background: var(--brd); transition: background var(--tr); }
.ws-resizer:hover::after { background: var(--a2); }
.ws-stage { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--ed-canvas-bg); }
.ws-stage .ed-canvas-wrap { flex: 1; align-items: center; justify-content: flex-start; }
.ws-stage .ed-page { margin-inline: auto; }

.ws-rail-hint { display: flex; align-items: center; gap: 7px; margin: 8px 8px 0; padding: 9px 11px; font-size: .72rem; color: var(--tx2); background: var(--sur2); border: 1px solid var(--brd); border-radius: var(--r-sm); }
.ws-rail-hint svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--a3); }
.ws-rail-search { display: flex; align-items: center; gap: 7px; padding: 10px 12px; border-bottom: 1px solid var(--brd); }
.ws-rail-search span { display: grid; place-items: center; color: var(--tx3); }
.ws-rail-search svg { width: 15px; height: 15px; }
.ws-rail-search input { flex: 1; background: transparent; border: none; color: var(--tx1); font: inherit; font-size: .82rem; outline: none; }
.ws-rail-scroll { flex: 1; overflow-y: auto; padding: 8px; }
.ws-rail-group { margin-bottom: 12px; }
.ws-rail-glabel { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tx3); font-weight: 800; padding: 4px 8px 6px; }
.ws-tool { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; background: transparent; border: 1px solid transparent; border-radius: var(--r-sm); color: var(--tx1); cursor: pointer; font-size: .82rem; font-weight: 600; text-align: left; transition: background var(--tr); }
.ws-tool:hover { background: color-mix(in srgb, var(--tc) 10%, transparent); }
.ws-tool:hover .ws-tool-ic { background: color-mix(in srgb, var(--tc) 28%, transparent); }
.ws-tool-ic { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 16%, transparent); border-radius: 8px; color: var(--tc); transition: background var(--tr); }
.ws-tool-ic svg { width: 16px; height: 16px; }

/* Empty-state hero */
.ws-hero { width: min(460px, 100%); text-align: center; background: var(--sur); border: 2px dashed var(--brd2); border-radius: var(--r-xl); padding: 44px 34px; cursor: pointer; position: relative; transition: border-color var(--tr), background var(--tr); }
.ws-hero input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ws-hero.over { border-color: var(--a2); background: var(--sur2); }
.ws-hero-ico { width: 64px; height: 64px; margin: 0 auto 18px; display: grid; place-items: center; background: linear-gradient(135deg, var(--a3), var(--a1)); border-radius: 18px; color: #fff; box-shadow: 0 12px 30px rgba(37,99,235,.4); }
.ws-hero-ico svg { width: 30px; height: 30px; }
.ws-hero h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; color: var(--tx1); }
.ws-hero p { color: var(--tx2); font-size: .85rem; line-height: 1.55; margin-bottom: 18px; }
.ws-hero-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; background: var(--a2); color: #fff; border-radius: var(--r-md); font-weight: 700; font-size: .85rem; }
.ws-hero-btn svg { width: 15px; height: 15px; }
.ws-hero-sub { margin-top: 16px; font-size: .74rem; color: var(--tx3); }

/* Tool panel */
.ws-panel-head { display: flex; align-items: center; gap: 9px; padding: 12px; border-bottom: 1px solid var(--brd); }
.ws-panel-ic { width: 28px; height: 28px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc, var(--a2)) 18%, transparent); color: var(--tc, var(--a3)); border-radius: 8px; flex-shrink: 0; }
.ws-panel-ic svg { width: 16px; height: 16px; }
.ws-panel-title { flex: 1; font-weight: 800; font-size: .92rem; }
.ws-panel-x { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--brd2); background: var(--sur2); color: var(--tx2); border-radius: 7px; cursor: pointer; flex-shrink: 0; }
.ws-panel-x:hover { color: var(--tx1); background: var(--sur3); }
.ws-panel-x svg { width: 14px; height: 14px; }
.ws-panel-body { flex: 1; overflow-y: auto; padding: 14px; }

/* Pages panel */
.ws-pages-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ws-pg { position: relative; background: #fff; border: 2px solid var(--brd2); border-radius: var(--r-sm); overflow: hidden; cursor: grab; box-shadow: var(--shadow-sm); }
.ws-pg.dragging { opacity: .4; }
.ws-pg canvas { display: block; width: 100%; }
.ws-pg-num { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.7); color: #fff; font-size: .62rem; font-weight: 700; padding: 1px 6px; border-radius: 9px; }
.ws-pg-acts { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; opacity: 0; transition: opacity var(--tr); }
.ws-pg:hover .ws-pg-acts { opacity: 1; }
.ws-pg-acts button { width: 22px; height: 22px; display: grid; place-items: center; background: rgba(0,0,0,.6); border: none; color: #fff; border-radius: 5px; cursor: pointer; }
.ws-pg-acts button svg { width: 12px; height: 12px; }

/* ── Split: visual page picker ── */
.ws-split-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.ws-split-quick button { padding: 7px 4px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-sm); color: var(--tx1); font-size: .74rem; font-weight: 600; cursor: pointer; }
.ws-split-quick button:hover { background: var(--sur3); }
.ws-split-grid { grid-template-columns: repeat(3, 1fr); max-height: 280px; overflow-y: auto; padding: 2px; }
.ws-split-pg { cursor: pointer; border-color: var(--brd2); transition: border-color var(--tr), box-shadow var(--tr); }
.ws-split-pg .ws-split-check { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.35); border: 1.5px solid #fff; display: grid; place-items: center; opacity: 0; transition: opacity var(--tr); }
.ws-split-pg .ws-split-check svg { width: 11px; height: 11px; color: #fff; }
.ws-split-pg.sel { border-color: var(--ed-accent); box-shadow: 0 0 0 2px var(--ed-accent); }
.ws-split-pg.sel .ws-split-check { opacity: 1; background: var(--ed-accent); border-color: #fff; }
.ws-merge-tab { display: flex; align-items: center; gap: 8px; }
.ws-merge-tab .ws-mg-ic { display: grid; place-items: center; } .ws-merge-tab .ws-mg-ic svg { width: 14px; height: 14px; }

/* ── Crop: margin presets ── */
.ws-crop-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ws-crop-presets button { padding: 8px 4px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-sm); color: var(--tx1); font-size: .74rem; font-weight: 600; cursor: pointer; }
.ws-crop-presets button:hover { background: var(--sur3); border-color: var(--ed-accent); }

/* ── Crop: interactive frame on the page ── */
.ed-page.crop-editing { overflow: hidden; }
.ed-crop-frame {
  position: absolute; z-index: 20; cursor: move; box-sizing: border-box;
  outline: 1.5px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.55);
  background-image: linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px);
  background-size: 33.33% 33.33%; background-position: 0 0;
}
.ed-crop-h { position: absolute; width: 14px; height: 14px; background: #fff; border: 1.5px solid var(--ed-accent); border-radius: 2px; z-index: 21; }
.ed-crop-h.nw { left: -7px; top: -7px; cursor: nwse-resize; }
.ed-crop-h.ne { right: -7px; top: -7px; cursor: nesw-resize; }
.ed-crop-h.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.ed-crop-h.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.ed-crop-h.n { left: 50%; top: -7px; transform: translateX(-50%); cursor: ns-resize; }
.ed-crop-h.s { left: 50%; bottom: -7px; transform: translateX(-50%); cursor: ns-resize; }
.ed-crop-h.e { right: -7px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.ed-crop-h.w { left: -7px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }

.ws-drop-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ws-textout { margin-top: 10px; background: var(--sur2); border: 1px solid var(--brd); border-radius: var(--r-sm); padding: 10px; font-family: var(--mono); font-size: .68rem; max-height: 240px; overflow: auto; white-space: pre-wrap; color: var(--tx2); }
.ws-mini-actions { display: flex; flex-direction: column; }

/* Keep the app chrome clean inside the workspace */
.pc-app:has(.pc-main.ed-active) .pc-pwa-banner,
.pc-app:has(.pc-main.ed-active) #kofiModal ~ * .kofi-float { display: none !important; }

/* ============================================================
   3-PANE: left category nav · center preview · right panel
   ============================================================ */
.ws-body { display: flex; }
.ws-nav { width: 78px; flex-shrink: 0; background: var(--sur); border-right: 1px solid var(--brd); display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; overflow-y: auto; }
.ws-navbtn { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; background: transparent; border: 1px solid transparent; border-radius: var(--r-md); color: var(--tx2); cursor: pointer; transition: all var(--tr); }
.ws-navbtn:hover { background: var(--sur2); color: var(--tx1); }
.ws-navbtn.active { background: color-mix(in srgb, var(--tc) 14%, transparent); border-color: color-mix(in srgb, var(--tc) 34%, transparent); color: var(--tc); }
.ws-navbtn-ic { width: 26px; height: 26px; display: grid; place-items: center; }
.ws-navbtn-ic svg { width: 21px; height: 21px; }
.ws-navbtn-lbl { font-size: .62rem; font-weight: 700; letter-spacing: .01em; text-align: center; line-height: 1.1; }

.ws-side { width: var(--side-w, 300px); flex-shrink: 0; background: var(--sur); border-left: 1px solid var(--brd); display: flex; flex-direction: column; overflow: hidden; }
.ws-side-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--tx3); text-align: center; padding: 30px; font-size: .82rem; }
.ws-side-empty svg { width: 30px; height: 30px; opacity: .5; }
.ws-side-head { display: flex; align-items: center; gap: 11px; padding: 14px; border-bottom: 1px solid var(--brd); }
.ws-side-ic { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 16%, transparent); color: var(--tc); border-radius: 10px; }
.ws-side-ic svg { width: 19px; height: 19px; }
.ws-side-title { font-weight: 800; font-size: .98rem; }
.ws-side-sub { font-size: .72rem; color: var(--tx2); margin-top: 1px; }
.ws-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px; border-bottom: 1px solid var(--brd); }
.ws-chip { display: flex; align-items: center; gap: 8px; padding: 8px 9px; background: var(--sur2); border: 1px solid var(--brd); border-radius: var(--r-sm); color: var(--tx1); cursor: pointer; font-size: .76rem; font-weight: 600; text-align: left; transition: all var(--tr); min-width: 0; }
.ws-chip:hover { border-color: color-mix(in srgb, var(--tc) 45%, transparent); }
.ws-chip.active { background: color-mix(in srgb, var(--tc) 15%, transparent); border-color: var(--tc); color: var(--tc); }
.ws-chip-ic { width: 20px; height: 20px; flex-shrink: 0; display: grid; place-items: center; color: var(--tc); }
.ws-chip-ic svg { width: 16px; height: 16px; }
.ws-chip-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-side-body { flex: 1; overflow-y: auto; padding: 14px; }

.ws-elhead { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--tx1); margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--brd); }
.ws-elhead svg { width: 15px; height: 15px; color: var(--a3); }
.ws-el-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ws-el-actions .ed-apply-btn { margin-top: 0; }
.ws-sig-saved { margin-top: 10px; text-align: center; }
.ws-sig-saved img { max-width: 100%; max-height: 90px; background: #fff; border: 1px solid var(--brd2); border-radius: 8px; padding: 6px; }

/* framed preview when the right panel is present */
.ws-stage .ed-canvas-wrap { padding: 28px 28px 60px; }

/* ── Top bar: contrast + grouping ── */
.ws-top { background: var(--sur); border-bottom: 1px solid var(--brd2); box-shadow: 0 1px 0 rgba(0,0,0,.25); padding-left: 8px; }
.ws-newtab { width: auto; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px; padding: 0 13px; height: 32px; font-size: .76rem; font-weight: 700; line-height: 1; }
.ws-newtab svg { width: 14px; height: 14px; }
.ws-newtab span { white-space: nowrap; }
@media (max-width: 760px) { .ws-newtab span { display: none; } .ws-newtab { padding: 0; width: 32px; } }
.ws-histgroup { display: flex; gap: 2px; padding: 2px; background: var(--sur2); border: 1px solid var(--brd); border-radius: var(--r-sm); }
.ws-histgroup .ws-tbtn { width: 30px; height: 28px; border: none; background: transparent; }
.ws-histgroup .ws-tbtn:not(:disabled) { color: var(--tx1); }
.ws-top-right { gap: 8px; }
.ws-top-right > * { flex-shrink: 0; }

/* ── Left nav: footer brand + home ── */
.ws-nav { padding: 10px 8px 8px; }
.ws-nav-cats { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.ws-nav-foot { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--brd); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ws-nav-foot-row { display: flex; gap: 6px; width: 100%; }
.ws-foot-btn { width: 100%; height: 32px; display: grid; place-items: center; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-sm); color: var(--tx2); cursor: pointer; transition: all var(--tr); }
.ws-foot-btn:hover { color: var(--tx1); background: var(--sur3); border-color: var(--brd3); }
.ws-foot-btn svg { width: 16px; height: 16px; }
/* Theme toggle switch */
.ws-theme-tg { position: relative; width: 100%; height: 26px; border-radius: 13px; background: var(--sur3); border: 1px solid var(--brd2); cursor: pointer; padding: 0; }
.ws-theme-knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--a2); color: #fff; display: grid; place-items: center; transition: left var(--tr); box-shadow: 0 1px 3px rgba(0,0,0,.45); }
.ws-theme-knob svg { width: 12px; height: 12px; }
.ws-theme-tg[data-dark="false"] .ws-theme-knob { left: calc(100% - 22px); }
.ws-theme-btn { display: none; }   /* top-bar theme button: mobile-only (shown via @media); desktop uses the left-nav pill */
.ws-nav-brand { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .56rem; font-weight: 800; color: var(--tx2); letter-spacing: .02em; font-family: inherit; background: none; border: 1px solid transparent; border-radius: var(--r-sm); padding: 5px 4px; cursor: pointer; transition: background var(--tr), border-color var(--tr), color var(--tr); }
.ws-nav-brand:hover { color: var(--tx1); background: var(--sur2); border-color: var(--brd2); }
.ws-nav-brand:active { transform: translateY(.5px); }
.ws-nav-brand svg { width: 20px; height: 24px; }
.ws-nav-brand img { width: 24px; height: 24px; object-fit: contain; border-radius: 6px; }
.ws-nav-home { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; width: 100%; border-radius: var(--r-sm); color: var(--tx3); font-size: .58rem; font-weight: 700; }
.ws-nav-home:hover { background: var(--sur2); color: var(--tx1); }
.ws-nav-home svg { width: 16px; height: 16px; }

/* Add-text affordance: visible placeholder so new text boxes are obvious */
.ed-el-text:empty::before { content: 'Type here…'; color: rgba(120,130,150,.85); }
.ed-el-text { min-width: 64px; min-height: 1.1em; }

/* Crop mask + active region */
.ed-crop-mask { position: absolute; inset: 0; pointer-events: none; }
.ed-crop-region { position: absolute; border: 1.5px solid var(--a3); box-shadow: 0 0 0 9999px rgba(0,0,0,.45); pointer-events: none; }

/* Watermark position grid + tile toggle */
.ws-posgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 84px; margin-bottom: 8px; }
.ws-posgrid button { aspect-ratio: 1; background: var(--sur2); border: 1px solid var(--brd2); border-radius: 4px; cursor: pointer; position: relative; }
.ws-posgrid button:hover { border-color: var(--a3); }
.ws-posgrid button::after { content: ''; position: absolute; inset: 30%; border-radius: 1px; background: var(--tx3); }
.ws-posgrid button:hover::after { background: var(--a3); }
.ws-checkrow { display: flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--tx2); cursor: pointer; }
.ws-checkrow input { accent-color: var(--a2); }

/* Saved signatures */
.ws-side-sublabel { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tx3); font-weight: 800; margin: 14px 0 8px; }
.ws-sig-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ws-sig-item { position: relative; background: #fff; border: 1px solid var(--brd2); border-radius: 8px; padding: 8px; cursor: pointer; transition: border-color var(--tr); display: grid; place-items: center; min-height: 56px; }
.ws-sig-item:hover { border-color: var(--a2); }
.ws-sig-item img { max-width: 100%; max-height: 44px; pointer-events: none; }
.ws-sig-del { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; background: var(--red); border: 2px solid var(--sur); color: #fff; border-radius: 50%; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity var(--tr); }
.ws-sig-item:hover .ws-sig-del { opacity: 1; }
.ws-sig-del svg { width: 10px; height: 10px; }

.ed-page-inner { will-change: transform; }
.ed-page.cropped { outline: 1px solid rgba(96,165,250,.5); }

/* Modal header icon sizing (was rendering full-size) */
.ed-modal-head > svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--a3); }
.ed-modal-head { gap: 11px; }
.ed-sig-pad { cursor: crosshair; }

/* Element layer + mini buttons; stamp chips */
.ws-el-layers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ed-mini-btn { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-sm); color: var(--tx1); cursor: pointer; font-size: .76rem; font-weight: 600; }
.ed-mini-btn:hover { background: var(--sur3); }
.ed-mini-btn svg { width: 15px; height: 15px; }
.ws-stamp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 4px; }
.ws-stamp-btn { padding: 9px 6px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-sm); cursor: pointer; font-size: .74rem; font-weight: 800; letter-spacing: .02em; }
.ws-stamp-btn.active { border-color: var(--a2); box-shadow: 0 0 0 1px var(--a2) inset; }

/* Page drop indicator */
.ws-pg.drop-before { box-shadow: -3px 0 0 0 var(--a2); }
.ws-pg-acts button { width: 20px; height: 20px; }

/* e-sign signer rows */
/* Signer cards — tap to make active; each is colour-coded */
.ws-signer-card { background: var(--sur2); border: 1px solid var(--brd2); border-radius: var(--r-sm); padding: 9px; margin-bottom: 8px; cursor: pointer; transition: border-color var(--tr), box-shadow var(--tr); }
.ws-signer-card:hover { border-color: var(--brd3); }
.ws-signer-card.active { border-color: var(--sc); box-shadow: 0 0 0 1px var(--sc), 0 0 14px -6px var(--sc); }
.ws-signer-top { display: flex; align-items: center; gap: 7px; }
.ws-signer-dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--sur); box-shadow: 0 0 0 1px var(--brd2); cursor: pointer; padding: 0; }
.ws-signer-top input { flex: 1; min-width: 0; padding: 6px 8px; background: var(--sur); border: 1px solid var(--brd2); border-radius: 6px; color: var(--tx1); font: inherit; font-size: .78rem; font-weight: 600; }
.ws-signer-count { flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; background: var(--sur3); color: var(--tx2); border-radius: 10px; font-size: .68rem; font-weight: 800; }
.ws-signer-rm { width: 24px; height: 24px; flex-shrink: 0; display: grid; place-items: center; background: var(--sur); border: 1px solid var(--brd2); color: var(--tx2); border-radius: 6px; cursor: pointer; }
.ws-signer-rm:hover { color: var(--red); border-color: var(--red); }
.ws-signer-rm svg { width: 12px; height: 12px; }
.ws-signer-email { width: 100%; margin-top: 6px; padding: 6px 8px; background: var(--sur); border: 1px solid var(--brd2); border-radius: 6px; color: var(--tx1); font: inherit; font-size: .76rem; }
.ws-signer-flag { margin-top: 7px; font-size: .68rem; font-weight: 700; color: var(--sc); letter-spacing: .02em; }
.ws-signer-ord { width: 18px; height: 18px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--sur3); color: var(--tx2); font-size: .66rem; font-weight: 800; }
.ws-signer-move { display: inline-flex; flex-direction: column; flex-shrink: 0; }
.ws-signer-move button { width: 18px; height: 13px; padding: 0; background: var(--sur); border: 1px solid var(--brd2); color: var(--tx2); cursor: pointer; font-size: 8px; line-height: 1; display: grid; place-items: center; }
.ws-signer-move button:first-child { border-radius: 5px 5px 0 0; border-bottom: none; }
.ws-signer-move button:last-child { border-radius: 0 0 5px 5px; }
.ws-signer-move button:hover:not(:disabled) { color: var(--tx1); background: var(--sur3); }
.ws-signer-move button:disabled { opacity: .3; cursor: default; }
.ws-ftype-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* Zoom presets dropdown */
.ws-zoom { position: relative; }
.ws-zoom-val { display: flex; align-items: center; gap: 3px; background: transparent; border: none; color: var(--tx1); cursor: pointer; font-size: .72rem; font-weight: 700; padding: 0 7px; height: 25px; border-radius: 4px; }
.ws-zoom-val:hover { background: var(--sur3); }
.ws-zoom-val svg { width: 11px; height: 11px; opacity: .7; }
.ws-zoommenu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 130px; background: var(--sur); border: 1px solid var(--brd2); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 5px; z-index: 60; display: none; }
.ws-zoommenu.open { display: block; }
.ws-zoommenu button { display: block; width: 100%; text-align: left; padding: 7px 10px; background: transparent; border: none; color: var(--tx1); cursor: pointer; font-size: .78rem; border-radius: var(--r-sm); }
.ws-zoommenu button:hover { background: var(--sur2); }
.ws-zoommenu-sep { height: 1px; background: var(--brd); margin: 4px 0; }

/* Find bar */
.ws-find { position: absolute; top: calc(52px + 8px); right: 16px; z-index: 70; display: none; align-items: center; gap: 6px; background: var(--sur); border: 1px solid var(--brd2); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px 8px; }
.ws-find.open { display: flex; }
.ws-find-ic { display: grid; place-items: center; color: var(--tx3); }
.ws-find-ic svg { width: 15px; height: 15px; }
.ws-find input { width: 200px; background: transparent; border: none; outline: none; color: var(--tx1); font: inherit; font-size: .82rem; }
.ws-find-count { font-size: .72rem; color: var(--tx2); font-weight: 600; min-width: 46px; text-align: right; }
.ws-find button { width: 26px; height: 26px; display: grid; place-items: center; background: var(--sur2); border: 1px solid var(--brd); border-radius: var(--r-sm); color: var(--tx2); cursor: pointer; }
.ws-find button:hover { color: var(--tx1); background: var(--sur3); }
.ws-find button svg { width: 13px; height: 13px; }

/* Find highlight */
.ed-find-hl { background: rgba(250,204,21,.55); outline: 1.5px solid #eab308; border-radius: 2px; pointer-events: none; animation: edFindPulse 1.4s ease; }
@keyframes edFindPulse { 0%,100% { background: rgba(250,204,21,.45); } 40% { background: rgba(250,204,21,.85); } }

/* The whole panel below the header scrolls as one — so every tool + its
   properties are reachable without a cramped inner scrollbar. */
.ws-side-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.ws-side-scroll .ws-chips { overflow: visible; }
.ws-side-scroll .ws-side-body { flex: 0 0 auto; overflow: visible; }

/* Active-tool one-line description */
.ws-tool-desc {
  display: flex; align-items: flex-start; gap: 9px; margin: 12px 14px 0;
  padding: 10px 11px; background: color-mix(in srgb, var(--tc) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc) 28%, transparent);
  border-radius: var(--r-sm); font-size: .76rem; line-height: 1.45; color: var(--tx2);
}
.ws-tool-desc strong { color: var(--tx1); font-weight: 700; }
.ws-tool-desc-ic { flex-shrink: 0; width: 18px; height: 18px; display: grid; place-items: center; color: var(--tc); }
.ws-tool-desc-ic svg { width: 16px; height: 16px; }

/* Custom colour picker swatch */
.ed-swatch-pick { position: relative; overflow: hidden; background: conic-gradient(from 0deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); display: grid; place-items: center; }
.ed-swatch-pick input[type=color] { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); opacity: 0; cursor: pointer; padding: 0; border: none; }
.ed-swatch-pick::after { content: '+'; color: #fff; font-weight: 800; font-size: 13px; text-shadow: 0 1px 2px rgba(0,0,0,.6); pointer-events: none; }

/* Prevent browser double-tap zoom (touch-action) + accidental selection of CHROME only.
   NOTE: must NOT put user-select:none on an ancestor of contenteditable — that breaks
   text entry in Safari. So we scope it to non-editable UI, never the page/overlay. */
.ed-page, .ed-overlay, .ed-canvas-wrap { touch-action: manipulation; }
/* Freehand / crop need the finger to draw, so they capture touch; every other tool keeps
   touch-action so the document scrolls and the overlay only ever tap-places. */
.ed-overlay.tool-draw, .ed-overlay.tool-marker, .ed-overlay.tool-eraser, .ed-overlay.tool-crop { touch-action: none; }
.ws-top, .ws-tabs, .ws-tab, .ws-nav, .ws-navbtn, .ws-side-head, .ws-chips, .ws-chip,
.ws-zoom, .ws-pagenav, .ed-page-tag, .ws-elhead, .ed-props-hint, .ed-prop-lbl, .ws-tool-desc {
  -webkit-user-select: none; user-select: none;
}
.ed-el-text { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* ============================================================
   WORKSPACE — MOBILE (bottom category bar + bottom-sheet panel)
   ============================================================ */
/* These chrome bits only exist on small screens */
.ws-sheet-grab, .ws-side-close, .ws-sheet-backdrop, .ws-sheet-fab, .ws-zoom-fab { display: none; }

@media (max-width: 768px) {
  /* Bottom-nav height folds in the iOS safe area so the sheet, stage and
     floating buttons (all keyed off this var) stay aligned above it. */
  :root { --ws-botnav-h: calc(60px + env(safe-area-inset-bottom)); }

  .ws-resizer { display: none !important; }
  .ws-body { position: relative; }

  /* Stage uses the full width; leave room for the bottom category bar */
  .ws-stage { padding-bottom: var(--ws-botnav-h); }
  .ws-stage .ed-canvas-wrap { padding: 16px 14px 30px; }

  /* Category nav → fixed bottom tab bar */
  .ws-nav {
    position: fixed; left: 0; right: 0; bottom: 0;
    width: 100%; height: var(--ws-botnav-h);
    flex-direction: row; align-items: center; gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: none; border-top: 1px solid var(--brd2);
    background: var(--sur);
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none;
    z-index: 425;
    box-shadow: 0 -2px 14px rgba(0,0,0,.28);
  }
  .ws-nav::-webkit-scrollbar { display: none; }
  .ws-nav-cats { flex-direction: row; flex: 1 0 auto; gap: 4px; overflow: visible; }
  .ws-navbtn { flex: 1 0 auto; min-width: 60px; padding: 6px 6px; gap: 3px; }
  .ws-navbtn-ic { width: 22px; height: 22px; }
  .ws-navbtn-ic svg { width: 19px; height: 19px; }
  .ws-navbtn-lbl { font-size: .56rem; }
  .ws-nav-foot {
    flex-direction: row; align-items: center; gap: 6px;
    margin-top: 0; padding-top: 0; border-top: none;
    width: auto; flex-shrink: 0;
    padding-left: 8px; margin-left: 4px;
    border-left: 1px solid var(--brd);
  }
  .ws-nav-foot-row { width: auto; }
  .ws-nav-brand { display: none; }
  /* On mobile the theme toggle lives in the TOP bar (so the bottom category
     bar isn't crowded); the desktop left-nav pill is hidden here. */
  .ws-nav-foot #ws-theme { display: none; }
  .ws-theme-btn { display: grid; }
  .ws-foot-btn { width: 40px; height: 40px; border-radius: 50%; }
  .ws-foot-btn svg { width: 18px; height: 18px; }

  /* Tool panel → bottom sheet sitting above the category bar */
  .ws-side {
    position: fixed; left: 0; right: 0; bottom: var(--ws-botnav-h);
    width: 100% !important; max-height: 64vh;
    border-left: none;
    border-top: 1px solid var(--brd2);
    border-radius: 20px 20px 0 0;
    transform: translateY(115%);
    transition: transform .3s var(--ease);
    z-index: 430;
    box-shadow: 0 -18px 50px rgba(0,0,0,.5);
    overflow: hidden;
  }
  .ws.sheet-open .ws-side { transform: translateY(0); }

  .ws-sheet-backdrop {
    display: block;
    position: fixed; inset: 0 0 var(--ws-botnav-h) 0;
    background: rgba(0,0,0,.55);
    opacity: 0; pointer-events: none;
    transition: opacity .3s var(--ease);
    z-index: 428;
  }
  .ws.sheet-open .ws-sheet-backdrop { opacity: 1; pointer-events: auto; }

  /* Drag-handle bar at the top of the sheet */
  .ws-sheet-grab {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 22px; padding: 0; border: none;
    background: transparent; cursor: pointer; flex-shrink: 0;
  }
  .ws-sheet-grab span { width: 40px; height: 4px; border-radius: 99px; background: var(--brd3); }

  /* Explicit close (×) in the sheet header */
  .ws-side-close {
    display: grid; place-items: center; flex-shrink: 0;
    width: 30px; height: 30px; margin-left: auto;
    border: 1px solid var(--brd2); background: var(--sur2);
    color: var(--tx2); border-radius: 8px; cursor: pointer;
  }
  .ws-side-close svg { width: 15px; height: 15px; }
  .ws-side-head { padding-top: 4px; }

  /* Floating "Tools" button to reopen the sheet */
  .ws-sheet-fab {
    display: grid; place-items: center;
    position: fixed; right: 16px; bottom: calc(var(--ws-botnav-h) + 16px);
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--a2); color: #fff; border: none;
    box-shadow: 0 8px 24px rgba(37,99,235,.5);
    cursor: pointer; z-index: 426;
    transition: transform .2s var(--ease), opacity .2s var(--ease);
  }
  .ws-sheet-fab:active { transform: scale(.92); }
  .ws-sheet-fab svg { width: 22px; height: 22px; }
  .ws.sheet-open .ws-sheet-fab { opacity: 0; pointer-events: none; transform: scale(.8); }

  /* Floating zoom controls (app-style +/- and fit-to-width) */
  .ws-zoom-fab {
    display: flex; flex-direction: column; gap: 1px;
    position: fixed; left: 14px; bottom: calc(var(--ws-botnav-h) + 16px);
    background: var(--sur2); border: 1px solid var(--brd2); border-radius: 13px;
    overflow: hidden; z-index: 426; box-shadow: var(--shadow-md);
    transition: opacity .2s var(--ease);
  }
  .ws-zoom-fab button {
    width: 42px; height: 40px; display: grid; place-items: center;
    background: transparent; border: none; color: var(--tx1); cursor: pointer;
  }
  .ws-zoom-fab button:active { background: var(--sur3); }
  .ws-zoom-fab button + button { border-top: 1px solid var(--brd); }
  .ws-zoom-fab svg { width: 18px; height: 18px; }
  .ws.sheet-open .ws-zoom-fab { opacity: 0; pointer-events: none; }

  /* App-style page view: the page fits the width by default (no diagonal "zig-zag"
     panning); overscroll contained so the body never rubber-bands while scrolling. */
  .ws-stage .ed-canvas-wrap { overscroll-behavior: contain; }

  /* Bigger touch targets inside the sheet + breathing room under the last row
     (so tools never feel cut off; respects the iOS home-indicator safe area) */
  .ws-chips { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 14px calc(18px + env(safe-area-inset-bottom)); }
  .ws-side-body { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .ws-chip { padding: 11px 11px; }
  .ws-side-scroll { -webkit-overflow-scrolling: touch; }
}

@media (max-width: 768px) and (orientation: landscape) {
  .ws-side { max-height: 78vh; }
}
.ed-dash-errwhy { font-family: var(--mono); font-size: .72rem; color: var(--tx3); background: var(--sur2); border: 1px solid var(--brd2); border-radius: 8px; padding: 7px 11px; margin: 4px auto 0; max-width: 420px; }
/* Bulk Send tool — "where everyone signs" indicator */
.ed-bs-spot { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 2px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--brd2); background: var(--sur2); }
.ed-bs-spot.ok { border-color: color-mix(in srgb, var(--green2, #22c55e) 34%, var(--brd2)); background: color-mix(in srgb, var(--green2, #22c55e) 9%, var(--sur2)); }
.ed-bs-spot-n { font-size: .8rem; font-weight: 800; color: var(--tx2); }
.ed-bs-spot.ok .ed-bs-spot-n { color: var(--green2, #22c55e); }
.ed-bs-spot .ed-mini-btn { width: 100%; }
/* People — tappable contact cards + brief profile */
.ed-dash-person.clickable { cursor: pointer; transition: border-color .14s, transform .14s, background .14s; }
.ed-dash-person.clickable:hover { border-color: color-mix(in srgb, var(--ed-accent) 45%, var(--brd2)); background: var(--sur3); transform: translateX(2px); }
.ed-dash-person .ed-dash-arrow { margin-left: 4px; color: var(--tx3); display: inline-flex; transition: color .14s, transform .14s; }
.ed-dash-person.clickable:hover .ed-dash-arrow { color: var(--ed-accent); transform: translateX(2px); }
.ed-dash-person .ed-dash-arrow svg { width: 14px; height: 14px; }
.ed-dash-contact { max-width: 1080px; margin: 0 auto; padding-bottom: 26px; }
.ed-dash-contact2col { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.ed-dash-cside { position: sticky; top: 6px; display: flex; flex-direction: column; gap: 14px; }
.ed-dash-ccard { background: var(--sur2); border: 1px solid var(--brd2); border-radius: 16px; padding: 20px; }
.ed-dash-ccard:first-child { text-align: center; background: linear-gradient(160deg, color-mix(in srgb, var(--ed-accent) 12%, var(--sur2)), var(--sur2) 70%); }
.ed-dash-cavatar { width: 76px; height: 76px; margin: 2px auto 13px; border-radius: 20px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.9rem; box-shadow: 0 14px 30px -10px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.3); border: 1px solid rgba(255,255,255,.18); }
.ed-dash-cname { font-size: 1.3rem; font-weight: 800; letter-spacing: -.3px; line-height: 1.15; word-break: break-word; }
.ed-dash-cemail { color: var(--tx2); font-size: .85rem; margin-top: 3px; word-break: break-all; }
.ed-dash-ctag { display: inline-block; margin-top: 11px; font-size: .68rem; font-weight: 800; color: var(--a3); background: color-mix(in srgb, var(--ed-accent) 14%, var(--sur)); border: 1px solid color-mix(in srgb, var(--ed-accent) 30%, var(--brd2)); padding: 4px 12px; border-radius: 20px; }
.ed-dash-cstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.ed-dash-cstat { background: var(--sur); border: 1px solid var(--brd2); border-radius: 12px; padding: 12px 6px; text-align: center; }
.ed-dash-cstat b { display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.ed-dash-cstat span { font-size: .64rem; color: var(--tx3); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 6px; display: block; }
.ed-dash-cedit { display: flex; flex-direction: column; gap: 9px; }
.ed-dash-cedit input { width: 100%; }
.ed-dash-cedit .ed-apply-btn { width: 100%; }
.ed-ct-rm { width: 100%; margin-top: 10px; background: transparent !important; border: 1px solid color-mix(in srgb, var(--red, #ef4444) 40%, var(--brd2)); color: #f87171; }
.ed-ct-rm:hover { background: color-mix(in srgb, var(--red, #ef4444) 14%, transparent) !important; }
.ed-dash-cmain { min-width: 0; }
.ed-dash-clist { display: flex; flex-direction: column; gap: 9px; }
.ed-dash-crow { display: flex; align-items: center; gap: 13px; background: var(--sur2); border: 1px solid var(--brd2); border-radius: 13px; padding: 13px 16px; cursor: pointer; transition: border-color .14s, transform .14s; }
.ed-dash-crow:hover { border-color: color-mix(in srgb, var(--ed-accent) 45%, var(--brd2)); transform: translateX(2px); }
.ed-dash-crow-main { flex: 1; min-width: 0; }
.ed-dash-crow-t { font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-dash-crow .ed-dash-status { flex-shrink: 0; }
.ed-dash-crow .ed-dash-arrow { color: var(--tx3); display: inline-flex; } .ed-dash-crow:hover .ed-dash-arrow { color: var(--ed-accent); } .ed-dash-crow .ed-dash-arrow svg { width: 14px; height: 14px; }
.ed-dash-bulktag { font-size: .56rem; font-weight: 800; color: #a78bfa; background: rgba(139,92,246,.16); padding: 1px 6px; border-radius: 5px; vertical-align: middle; }
.ed-dash-dlabel .ed-dash-lcnt { margin-left: 6px; }
@media (max-width: 860px) { .ed-dash-contact2col { grid-template-columns: 1fr; } .ed-dash-cside { position: static; } }

/* ── Crash-safe session restore modal ──────────────────────────────────────
   Shown on reopen when an auto-saved editing session is found. */
.ed-modal.ed-restore {
  width: min(440px, 100%); padding: 26px 24px 22px; text-align: center;
  animation: ed-restore-pop .32s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes ed-restore-pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.ed-restore-ic {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 8px 22px rgba(99,102,241,.4);
}
.ed-restore-ic svg { width: 26px; height: 26px; }
.ed-restore h3 { font-size: 1.18rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 7px; }
.ed-restore p { font-size: .85rem; color: var(--tx2); line-height: 1.5; margin: 0 auto; max-width: 34ch; }
.ed-restore-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  margin: 18px 0; padding: 13px 15px; border-radius: 14px;
  background: var(--sur2); border: 1px solid var(--brd2);
}
.ed-restore-thumb {
  flex-shrink: 0; width: 38px; height: 44px; border-radius: 7px;
  display: grid; place-items: center; color: var(--a3, #818cf8);
  background: rgba(99,102,241,.12); border: 1px solid var(--brd2);
}
.ed-restore-thumb svg { width: 22px; height: 22px; }
.ed-restore-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ed-restore-meta strong { font-size: .9rem; font-weight: 700; color: var(--tx1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-restore-meta span { font-size: .76rem; color: var(--tx2); }
.ed-restore-acts { display: flex; flex-direction: column; gap: 9px; }
.ed-restore-acts .ed-apply-btn { margin: 0; width: 100%; justify-content: center; }
.ed-restore-fresh {
  width: 100%; background: none; border: 1px solid var(--brd2); color: var(--tx2);
  font: inherit; font-size: .86rem; font-weight: 600; padding: 10px; border-radius: 10px;
  cursor: pointer; transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.ed-restore-fresh:hover { color: var(--tx1); border-color: var(--brd2); background: var(--sur2); }
.ed-restore-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 14px 0 0 !important; font-size: .72rem !important; color: var(--tx3) !important; max-width: none !important;
}
.ed-restore-note svg { width: 12px; height: 12px; flex-shrink: 0; }
