/* ==========================================================================
   KK SUITE — PDF Editor Online Design System
   Fluid, Full-Width, Sticky Toolbar, Seamless Font Matching.
   ========================================================================== */

/* ── Normal Standard Width for Dropzone / Landing View ── */
/* .sp-tool-wrapper retains standard 1180px from style.css when landing */

/* ── Full Width Focused Workspace ONLY when PDF is Open ── */
body.pe-active {
  overflow: hidden !important;
  height: 100vh !important;
}

body.pe-active .sp-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 60px !important;
  z-index: 500 !important;
  background: #ffffff !important;
  border-bottom: 1px solid var(--sp-border) !important;
}

body.pe-active .sp-tool-wrapper {
  max-width: 100% !important;
  width: 100% !important;
  padding: 68px 24px 12px !important; /* 60px header + 8px gap; ~1 inch (24px) side margin */
  margin: 0 !important;
  height: 100vh !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

body.pe-active .sp-tool-breadcrumb,
body.pe-active .sp-tool-h1-center,
body.pe-active .sp-tool-overview-row,
body.pe-active .sp-features-grid-4,
body.pe-active .sp-faq-section,
body.pe-active .related-tools,
body.pe-active .sp-footer,
body.pe-active #tool-status {
  display: none !important;
}

body.pe-active .pe-editor-card {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* ── Fixed Unified Toolbar inside Editor Workspace ── */
.pe-sticky-bar {
  flex-shrink: 0;
  z-index: 120;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--sp-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  margin-bottom: 10px;
}

/* ── Primary Toolbar on a Single Unified Baseline (No Awkward Wrapping) ── */
.pe-main-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 8px 14px;
  background: #ffffff;
  border-radius: 10px 10px 0 0;
  border-bottom: 1px solid var(--sp-border);
  user-select: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pe-tb-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pe-tb-center {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.pe-tb-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pe-tb-reset-btn {
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 7px;
  border: 1px solid var(--sp-border);
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.pe-tb-reset-btn:hover {
  background: #f8fafc;
  color: #0f172a;
}

.pe-tb-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--badge-red, #f23030);
  border: 1px solid var(--badge-red, #f23030);
  color: #ffffff;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 13px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(242, 48, 48, 0.28);
  transition: all 0.18s ease;
}

.pe-tb-download-btn:hover {
  background: #d62020;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(242, 48, 48, 0.36);
}

.pe-tb-download-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.pe-tb-divider {
  width: 1px;
  height: 22px;
  background: #e2e8f0;
  margin: 0 3px;
}

.pe-tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--sp-border);
  border-radius: 7px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pe-tb-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.pe-tb-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Page Counter Indicator */
.pe-page-counter {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--sp-border);
  border-radius: 7px;
  padding: 1px 3px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.pe-page-nav-btn {
  background: none;
  border: none;
  width: 22px;
  height: 28px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  border-radius: 4px;
  transition: background 0.15s;
}

.pe-page-nav-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

#pe-page-display {
  padding: 0 6px;
  min-width: 48px;
  text-align: center;
}

/* Tool Segmented Chips */
.pe-tb-tools {
  background: #f1f5f9;
  padding: 3px 4px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.pe-tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.pe-tool-chip:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.75);
}

.pe-tool-chip.is-active {
  background: #ffffff;
  color: var(--badge-red, #f23030);
  border-color: rgba(0, 0, 0, 0.06);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.pe-tool-chip svg {
  flex-shrink: 0;
}

/* Zoom Controls */
.pe-zoom-wrap {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--sp-border);
  border-radius: 7px;
  overflow: hidden;
}

.pe-zoom-wrap .pe-tb-btn {
  border: none;
  border-radius: 0;
  width: 28px;
  height: 32px;
}

#pe-zoom-val {
  font-size: 12px;
  font-weight: 600;
  padding: 0 5px;
  min-width: 44px;
  text-align: center;
  color: #1e293b;
}

/* ── Context Inspector Subbar ── */
.pe-context-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-height: 42px;
  padding: 6px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--sp-border);
  font-size: 13px;
}

.pe-ctx-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.pe-ctx-label {
  font-weight: 600;
  color: #475569;
  margin-right: -2px;
}

.pe-ctx-info {
  color: #64748b;
  font-size: 13px;
}

.pe-select {
  height: 30px;
  padding: 0 26px 0 10px;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 16 16'%3E%3Cpath fill='%23666' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E") no-repeat right 8px center;
  border: 1px solid var(--sp-border);
  border-radius: 6px;
  font-size: 12.5px;
  color: #1e293b;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.pe-select:focus {
  outline: 2px solid var(--sp-primary-light);
  border-color: var(--sp-primary);
}

.pe-select-sm {
  width: auto;
  min-width: 75px;
}

.pe-btn-toggles {
  display: inline-flex;
  border: 1px solid var(--sp-border);
  border-radius: 6px;
  overflow: hidden;
}

.pe-tgl-btn {
  width: 30px;
  height: 30px;
  background: #ffffff;
  border: none;
  border-right: 1px solid var(--sp-border);
  color: #475569;
  cursor: pointer;
  font-size: 13px;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}

.pe-tgl-btn:last-child {
  border-right: none;
}

.pe-tgl-btn:hover {
  background: #f8fafc;
  color: #0f172a;
}

.pe-tgl-btn.is-active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 700;
}

.pe-color-wrap input[type="color"] {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--sp-border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  overflow: hidden;
}

.pe-color-swatches {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pe-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.pe-swatch:hover {
  transform: scale(1.15);
}

.pe-swatch.active {
  box-shadow: 0 0 0 2.5px #2563eb;
  transform: scale(1.1);
}

.pe-ctx-btn-danger {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.pe-ctx-btn-danger:hover {
  background: #fecaca;
}

/* Rubber Stamps Quick List */
.pe-stamps-quick-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pe-stamp-btn {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px dashed;
  background: #ffffff;
  transition: transform 0.15s;
}

.pe-stamp-btn:hover {
  transform: scale(1.05);
}

.stamp-approved { color: #059669; border-color: #059669; }
.stamp-confidential { color: #dc2626; border-color: #dc2626; }
.stamp-draft { color: #2563eb; border-color: #2563eb; }
.stamp-void { color: #475569; border-color: #475569; }
.stamp-paid { color: #16a34a; border-color: #16a34a; }
.stamp-sign { color: #d97706; border-color: #d97706; }

/* ── Stage Layout: Sidebar & Viewport ── */
.pe-stage {
  flex: 1;
  display: flex;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* Thumbnails Sidebar */
.pe-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid var(--sp-border);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  z-index: 10;
  transition: margin-left 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.pe-sidebar.is-collapsed {
  margin-left: -236px;
}

.pe-sidebar-head {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  border-bottom: 1px solid var(--sp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.pe-sidebar-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
}

.pe-sidebar-close:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.pe-thumbnail-stack {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pe-thumb-item {
  position: relative;
  background: #ffffff;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: border-color 0.15s, transform 0.15s;
}

.pe-thumb-item:hover {
  border-color: #cbd5e1;
}

.pe-thumb-item.active {
  border-color: var(--badge-red, #f23030);
  box-shadow: 0 2px 8px rgba(242, 48, 48, 0.22);
}

.pe-thumb-canvas-wrap {
  background: #ffffff;
  display: flex;
  justify-content: center;
  overflow: hidden;
  border-radius: 4px;
}

.pe-thumb-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.pe-thumb-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11.5px;
  color: #64748b;
  font-weight: 600;
}

.pe-thumb-ops {
  display: flex;
  align-items: center;
  gap: 2px;
}

.pe-thumb-op-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}

.pe-thumb-op-btn:hover {
  background: #ffffff;
  border-color: #94a3b8;
  color: #0f172a;
}

.pe-sidebar-foot {
  padding: 10px;
  border-top: 1px solid var(--sp-border);
  background: #ffffff;
}

.pe-add-page-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: 1px dashed var(--sp-border);
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pe-add-page-btn:hover {
  background: #ffffff;
  border-color: var(--badge-red, #f23030);
  color: var(--badge-red, #f23030);
}

/* Center Viewport & Scroller */
.pe-viewport {
  flex: 1;
  min-width: 0;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  overflow-y: auto;
  overflow-x: auto;
  background: #f1f5f9;
  border-radius: 10px;
  border: 1px solid var(--sp-border);
  padding: 20px 20px 60px;
  -webkit-overflow-scrolling: touch;
}

.pe-pages-scroller {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

/* Page Card */
.pe-page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}

.pe-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}

.pe-page-badge {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: #ffffff;
  padding: 3px 10px;
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pe-page-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pe-page-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid var(--sp-border);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.15s;
}

.pe-page-act-btn:hover {
  border-color: #cbd5e1;
  color: #0f172a;
}

/* Page Sheet Stack */
.pe-page-sheet {
  position: relative;
  background: #ffffff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.04);
  border-radius: 2px;
  overflow: hidden;
}

.pe-pdf-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.pe-draw-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.tool-draw .pe-draw-canvas,
.tool-highlight .pe-draw-canvas {
  pointer-events: auto;
  cursor: crosshair;
}

/* ── Text Overlay & Rich Hover Animation ── */
.pe-text-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20; /* Keep above objects in Text tool mode */
  pointer-events: none;
}

.tool-text .pe-text-overlay-layer,
.tool-select .pe-text-overlay-layer {
  pointer-events: auto;
}

.pe-text-block-item {
  position: absolute;
  color: transparent;
  cursor: text;
  border-radius: 3px;
  transition: all 0.16s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: pre;
  box-sizing: border-box;
  border: 1.5px dashed transparent;
  pointer-events: auto;
  user-select: text;
}

/* Dynamic Glowing Hover Animation on Text */
.pe-text-block-item:hover:not(.is-editing) {
  background: rgba(37, 99, 235, 0.12) !important;
  border: 1.5px dashed #2563eb !important;
  box-shadow: 0 0 0 2.5px rgba(37, 99, 235, 0.22), 0 3px 12px rgba(37, 99, 235, 0.16) !important;
  border-radius: 3px !important;
  z-index: 50 !important;
  transform: translateY(-1px);
}

/* Active Editing State */
.pe-text-block-item.is-editing {
  outline: none !important;
  border: 1.5px solid #2563eb !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.25), 0 4px 16px rgba(0, 0, 0, 0.12) !important;
  border-radius: 3px !important;
  z-index: 100 !important;
  cursor: text;
}

/* Seamless edited state */
.pe-text-block-item.is-edited {
  border: 1.5px dashed transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.pe-text-block-item.is-edited:hover:not(.is-editing) {
  background: rgba(37, 99, 235, 0.15) !important;
  border: 1.5px dashed #2563eb !important;
}

/* ── Interactive Objects Layer (Pointer events pass through unless on object) ── */
.pe-objects-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none; /* Allows clicks to reach text layer */
}

.tool-whiteout .pe-page-sheet,
.tool-shapes .pe-page-sheet {
  cursor: crosshair;
}

.pe-obj {
  position: absolute;
  user-select: none;
  cursor: move;
  box-sizing: border-box;
  pointer-events: auto; /* Active object captures clicks */
}

.pe-obj.is-selected {
  outline: 2px solid #2563eb;
}

/* Object Resize Handles */
.pe-obj-handle {
  position: absolute;
  width: 9px;
  height: 9px;
  background: #ffffff;
  border: 2px solid #2563eb;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 15;
}

.pe-handle-tl { top: -5px; left: -5px; cursor: nwse-resize; }
.pe-handle-tr { top: -5px; right: -5px; cursor: nesw-resize; }
.pe-handle-bl { bottom: -5px; left: -5px; cursor: nesw-resize; }
.pe-handle-br { bottom: -5px; right: -5px; cursor: nwse-resize; }

.pe-obj-del-btn {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 22px;
  height: 22px;
  background: #ef4444;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: grid;
  place-items: center;
  font-size: 11px;
  cursor: pointer;
  z-index: 20;
}

.pe-obj-del-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* Custom Text Box */
.pe-custom-text {
  min-width: 30px;
  min-height: 22px;
  padding: 3px 6px;
  border: 1px dashed transparent;
  outline: none;
  word-break: break-word;
  white-space: pre-wrap;
}

.pe-custom-text:focus,
.pe-custom-text.is-selected {
  border-color: #2563eb;
  background: rgba(255, 255, 255, 0.95);
}

/* Whiteout / Redaction Box */
.pe-whiteout-elem {
  background: #ffffff;
  border: 1px dashed rgba(0, 0, 0, 0.12);
}

.pe-whiteout-elem.redaction {
  background: #000000;
}

/* Image Element */
.pe-img-elem img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
  pointer-events: none;
}

/* Rubber Stamp Element */
.pe-stamp-elem {
  padding: 6px 14px;
  border: 3px dashed;
  border-radius: 6px;
  font-family: Impact, -apple-system, sans-serif;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  transform-origin: center center;
}

/* Signature Element */
.pe-sign-elem img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

/* Shapes (SVG rendered) */
.pe-shape-elem svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}

/* ── Signature Modal ── */
.pe-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pe-modal-card {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16);
  border: 1px solid var(--sp-border);
  overflow: hidden;
  animation: pe-modal-pop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pe-modal-pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.pe-modal-top {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sp-border);
}

.pe-modal-top h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--sp-text-main);
  margin: 0;
}

.pe-modal-x-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
}

.pe-modal-x-btn:hover { color: #0f172a; }

.pe-modal-nav {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid var(--sp-border);
  padding: 0 16px;
}

.pe-modal-tab {
  padding: 12px 18px;
  border: none;
  background: none;
  font-size: 13.5px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.pe-modal-tab:hover { color: #0f172a; }

.pe-modal-tab.active {
  color: var(--badge-red, #f23030);
  border-bottom-color: var(--badge-red, #f23030);
}

.pe-modal-content {
  padding: 20px;
}

.pe-input-field {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--sp-border);
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 14px;
}

.pe-input-field:focus {
  outline: 2px solid var(--sp-primary-light);
  border-color: var(--sp-primary);
}

.pe-sig-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.pe-sig-choice {
  padding: 16px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  font-size: 24px;
  color: #1e3a8a;
  transition: all 0.15s;
}

.pe-sig-choice:hover {
  background: #ffffff;
  border-color: #94a3b8;
}

.pe-sig-choice.selected {
  border-color: var(--badge-red, #f23030);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(242, 48, 48, 0.2);
}

.pe-draw-pad-wrap {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  position: relative;
}

.pe-sig-canvas {
  width: 100%;
  height: 160px;
  display: block;
  cursor: crosshair;
}

.pe-sig-clear-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11.5px;
  padding: 3px 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
}

.pe-modal-actions {
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--sp-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Toast Notifications ── */
#pe-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 500;
  color: #ffffff;
  background: #1e293b;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#pe-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#pe-toast.pe-toast-success { background: #059669; }
#pe-toast.pe-toast-error { background: #dc2626; }
#pe-toast.pe-toast-info { background: #1e293b; }

/* ── Mobile & Responsive Adjustments ── */
@media (max-width: 860px) {
  .sp-tool-wrapper {
    padding: 12px 14px 40px !important;
  }
  .pe-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 30;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.15);
  }
  .pe-stage {
    height: 600px;
  }
  .pe-viewport {
    padding: 16px 10px 40px;
  }
}

/* PDF Studio workspace */
.pe-landing-subtitle { text-align:center; color:#64748b; font-size:17px; line-height:1.7; margin:-12px auto 28px; }
body.pe-active .sp-header, body.pe-active .pe-landing-subtitle, body.pe-active .creator-credit { display:none !important; }
body.pe-active .sp-tool-wrapper { padding:0 !important; height:100dvh !important; background:#e8edf2; }
body.pe-active .pe-editor-card { gap:0; }
.pe-document-bar { display:flex; flex-shrink:0; align-items:center; justify-content:space-between; gap:20px; background:#152b29; color:#fff; padding:16px 22px; }
.pe-document-brand { display:flex; align-items:center; gap:12px; min-width:0; }
.pe-brand-mark { display:grid; place-items:center; width:36px; height:36px; border:1px solid #64837a; border-radius:10px; color:#b7e8c8; font-size:22px; font-weight:700; flex-shrink:0; }
.pe-document-brand div { min-width:0; }
.pe-document-brand strong { display:block; font-size:14px; max-width:50vw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pe-document-brand span:not(.pe-brand-mark) { display:block; font-size:11px; color:#b3c8c0; margin-top:3px; }
.pe-document-actions { display:flex; gap:14px; align-items:center; font-size:12px; }
.pe-document-actions button { background:#29433c; color:#e3f1ea; border:1px solid #506d61; border-radius:7px; padding:8px 12px; cursor:pointer; }
.pe-document-actions button[aria-pressed=true] { background:#d0efb4; color:#183125; }
.pe-sticky-bar { border-radius:0; margin:0; box-shadow:none; border-width:0 0 1px; }
.pe-main-toolbar { display:grid; grid-template-columns:1fr auto; gap:8px; padding:10px 18px; overflow:visible; border-radius:0; }
.pe-tb-left { grid-row:2; }
.pe-tb-center { grid-column:1 / -1; grid-row:1; overflow-x:auto; min-width:0; padding-bottom:5px; }
.pe-tb-right { grid-column:2; grid-row:2; }
.pe-tb-tools { gap:5px; }
.pe-tool-chip { border-radius:7px; padding:8px 12px; }
.pe-tool-chip.is-active { background:#e6f0e9; color:#245b41; border-color:#b8d0bf; box-shadow:none; }
.pe-tb-download-btn { background:#245b41; border-color:#245b41; box-shadow:none; }
.pe-tb-download-btn:hover { background:#19452f; box-shadow:none; transform:none; }
.pe-context-bar { border-radius:0; overflow-x:auto; min-height:48px; padding:8px 18px; }
.pe-ctx-group { flex-shrink:0; }
.pe-workspace-utility { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 18px; background:#f9fafb; border-bottom:1px solid #dce3e8; flex-shrink:0; }
.pe-search-wrap { display:flex; align-items:center; gap:9px; min-width:0; }
.pe-search-wrap label { font-size:12px; color:#52645c; }
.pe-search-wrap input { width:220px; max-width:30vw; border:1px solid #d8e0dc; border-radius:6px; padding:7px 9px; background:#fff; font-size:12px; }
.pe-search-wrap span, .pe-view-actions span { font-size:11px; color:#64748b; white-space:nowrap; }
.pe-workspace-utility button { font-size:11px; border:1px solid #d8e0dc; background:#fff; border-radius:5px; padding:6px 9px; cursor:pointer; color:#334b40; }
.pe-view-actions { display:flex; align-items:center; gap:6px; }
.pe-stage { display:flex; gap:0; flex:1; min-height:0; height:auto; position:relative; overflow:hidden; }
.pe-sidebar { width:180px; min-width:180px; border:0; border-right:1px solid #d7dfe5; border-radius:0; background:#f8fafb; }
.pe-sidebar-head { font-size:12px; padding:14px; }
.pe-thumb-item.active { border-color:#4c8560; box-shadow:0 0 0 2px #dfede2; }
.pe-thumb-op-btn { width:27px; height:27px; }
.pe-thumbnail-stack { padding:14px 20px; }
.pe-viewport { border:0; border-radius:0; background:#e8edf2; padding:26px 28px 70px; justify-content:flex-start; }
.pe-pages-scroller { min-width:min-content; width:100%; margin:auto; }
.pe-page-wrapper { flex-shrink:0; }
.pe-page-sheet { border-radius:0; box-shadow:0 3px 14px #34405422; flex-shrink:0; }
.pe-page-plane { position:absolute; top:0; left:0; transform-origin:0 0; }
.pe-page-plane canvas { display:block; }
.pe-workspace-footer { display:flex; justify-content:space-between; gap:16px; flex-shrink:0; background:#f8fafb; color:#607069; padding:9px 18px; font-size:11px; border-top:1px solid #d7dfe5; }
.pe-native-panel { width:300px; flex-shrink:0; background:white; border-left:1px solid #d7dfe5; padding:23px 20px; overflow-y:auto; }
.pe-native-panel[hidden] { display:none; }
.pe-panel-eyebrow { color:#508363; letter-spacing:1.5px; font-size:10px; font-weight:700; }
.pe-native-panel h2 { margin:9px 0; font-size:20px; line-height:1.3; color:#203d2e; }
.pe-panel-description { font-size:12px; line-height:1.7; color:#6c7b73; margin:0 0 24px; }
.pe-native-panel label { display:block; font-size:11px; font-weight:600; color:#54665b; margin:18px 0 8px; }
.pe-font-badge { font-size:12px; color:#245b41; background:#eef5ef; border:1px solid #d8e7d9; padding:9px; border-radius:6px; overflow-wrap:anywhere; }
.pe-original-snippet { color:#859188; font-size:13px; line-height:1.6; max-height:90px; overflow-y:auto; white-space:pre-wrap; overflow-wrap:anywhere; }
.pe-native-panel textarea { width:100%; min-height:100px; box-sizing:border-box; padding:12px; border:1px solid #9ab6a2; border-radius:7px; font:14px/1.7 system-ui,sans-serif; resize:vertical; }
.pe-native-panel .pe-fit-toggle { display:flex; align-items:center; gap:8px; font-weight:400; }
.pe-fit-toggle input { accent-color:#245b41; }
.pe-native-hint { font-size:11px; line-height:1.7; color:#64746b; min-height:60px; }
.pe-panel-actions { display:flex; justify-content:flex-end; gap:8px; }
.pe-panel-actions button { padding:9px 14px; border:1px solid #d2ded6; border-radius:6px; background:#fff; cursor:pointer; }
#pe-native-apply { background:#245b41; color:white; border-color:#245b41; }
#pe-native-apply:disabled { opacity:.4; cursor:not-allowed; }
.pe-text-overlay-layer { pointer-events:none !important; z-index:3; }
.pe-text-block-item { pointer-events:none; background:transparent !important; color:transparent; padding:0; border:0 !important; border-radius:0; transition:none; }
.tool-select .pe-text-block-item, .tool-edit .pe-text-block-item { pointer-events:auto; }
.pe-text-block-item:hover:not(.is-editing), .pe-text-block-item:focus-visible { background:#39875b15 !important; outline:1px solid #4c8560; box-shadow:none !important; border:0 !important; border-radius:0 !important; }
.pe-text-block-item.is-unsupported:hover { outline:1px dashed #bd904b; }
.pe-text-block-item.is-edited { border-bottom:1px dotted #548b62 !important; }
.pe-text-block-item.is-search-match { background:#ffd34a60 !important; outline:1px solid #e9b831; }
.pe-objects-layer { z-index:5; }
.pe-custom-text { padding:0; border:0; line-height:1.25; overflow-wrap:anywhere; word-break:break-all; }
.pe-text-content { display:block; min-height:100%; outline:none; }
.pe-text-content[contenteditable=plaintext-only] { cursor:text; user-select:text; background:#ffffffdd; }
.pe-stamp-elem { padding:0; border:2px dashed; border-radius:0; font:bold 20px Arial,sans-serif; letter-spacing:0; display:flex; justify-content:center; align-items:center; transform:none !important; }
.tool-draw .pe-page-plane,.tool-highlight .pe-page-plane,.tool-shapes .pe-page-plane,.tool-whiteout .pe-page-plane,.pe-obj { touch-action:none; }
.is-busy { pointer-events:none; opacity:.65; }
.pe-editor-card button:focus-visible { outline:2px solid #448568; outline-offset:3px; }
@media (max-width:1100px) { .pe-native-panel { position:absolute; right:0; top:0; bottom:0; z-index:80; box-shadow:-6px 0 22px #233a3020; } .pe-view-actions span { display:none; } }
@media (max-width:680px) {
  .pe-document-bar { padding:11px 12px; }.pe-document-actions { gap:6px; }.pe-document-actions #pe-save-state { display:none; }
  .pe-main-toolbar { padding:8px; gap:6px; }.pe-tb-left { gap:2px; }.pe-tb-right { gap:4px; }
  .pe-tb-left .pe-tb-divider { display:none; }.pe-tb-btn { width:28px; height:30px; }.pe-page-counter { font-size:11px; }.pe-page-nav-btn { width:16px; }
  .pe-tb-download-btn,.pe-tb-reset-btn { font-size:11px; padding:7px; }.pe-tb-download-btn svg { display:none; }
  .pe-workspace-utility { padding:7px 9px; }.pe-search-wrap { gap:5px; }.pe-search-wrap input { max-width:27vw; }.pe-search-wrap label { display:none; }
  .pe-workspace-footer { padding:8px 10px; }.pe-workspace-footer>span:last-child { display:none; }
  .pe-native-panel { width:min(320px,100%); box-sizing:border-box; }.pe-context-bar { padding:8px; }
  .pe-sidebar { width:160px; min-width:160px; }.pe-tool-chip { padding:7px 9px; }
  .pe-document-brand strong { max-width:46vw; }.pe-brand-mark { display:none; }
}
@media (prefers-reduced-motion:reduce) { .pe-editor-card *, #pe-toast { animation:none !important; transition:none !important; scroll-behavior:auto !important; } }
/* Extended document tools */
.pe-sticky-bar { position:relative; }
.pe-more-menu { position:absolute; right:18px; top:100%; z-index:150; display:grid; min-width:230px; padding:6px; background:white; border:1px solid #d7e0d9; border-radius:10px; box-shadow:0 10px 30px #15342824; }
.pe-more-menu[hidden] { display:none; }
.pe-more-menu button { padding:11px 13px; border:0; background:transparent; text-align:left; color:#334b40; font-size:12px; cursor:pointer; border-radius:5px; }
.pe-more-menu button:hover { background:#edf4ee; }
.pe-properties-panel input:not([type=checkbox]), .pe-properties-panel select { width:100%; box-sizing:border-box; padding:9px; border:1px solid #cfddd2; border-radius:5px; background:white; }
.pe-properties-panel [hidden] { display:none; }
#pe-properties-apply { background:#245b41; color:white; }
.pe-properties-delete { margin-top:24px; color:#a03333; padding:8px; border:0; background:transparent; cursor:pointer; }
.pe-link-elem { border:1px dashed #367fa6; background:#2582b514; }
.pe-link-elem::after { content:'↗'; position:absolute; top:0; right:2px; color:#367fa6; font-size:12px; }
.pe-field-elem { border:1px dashed #4a8861; background:#eaf5ee; color:#496b55; display:flex; align-items:center; font:12px system-ui; }
.pe-field-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:3px; }
.pe-note-elem { background:#ffe184; color:#89691b; border:1px solid #dbb64b; border-radius:4px; display:grid; place-items:center; font-size:16px; }
.pe-markup-elem { pointer-events:none; }
.tool-select .pe-markup-elem { pointer-events:auto; }
.pe-widget-layer { position:absolute; inset:0; z-index:6; pointer-events:none; }
.pe-widget { position:absolute; pointer-events:auto; box-sizing:border-box; margin:0; border:1px solid #619b7b90; background:#eff9f0dd; color:#173825; padding:1px 3px; font:12px Arial; border-radius:1px; }
.pe-widget:focus { background:white; outline:2px solid #548b62; }
.pe-widget[type=checkbox],.pe-widget[type=radio] { padding:0; accent-color:#245b41; }
.pe-widget:disabled { background:#eceff033; border-color:transparent; }
.pe-image-target { position:absolute; border:1px dashed #c65947; background:#f7b6a110; cursor:pointer; color:#963525; font-size:11px; }
.pe-image-target:hover { background:#f7b6a155; }
.tool-annotate .pe-text-block-item { pointer-events:auto; cursor:crosshair; }
.tool-images-edit .pe-text-block-item { pointer-events:none; }
.tool-forms .pe-page-plane,.tool-links .pe-page-plane { touch-action:none; cursor:crosshair; }
.pe-sidebar.is-collapsed { display:none; margin:0; }
@media (min-width:681px) { .pe-sidebar { position:relative; inset:auto; box-shadow:none; } }
@media (max-width:680px) {
  .pe-main-toolbar { grid-template-columns:1fr; }.pe-tb-left { grid-column:1; grid-row:2; justify-content:center; }.pe-tb-right { grid-column:1; grid-row:3; justify-content:flex-end; }
  .pe-tb-center { grid-column:1; }.pe-tb-right #download-btn { flex:1; justify-content:center; }
  .pe-search-wrap input { max-width:23vw; }.pe-search-wrap #pe-search-count { display:none; }
}
.pe-sig-canvas { touch-action:none; }
/* Direct editing: wide document, compact tools, no inspector for text. */
.pe-tb-center { overflow:visible; width:100%; min-width:0; padding:0; }
.pe-tb-tools { width:100%; display:flex; flex-wrap:wrap; justify-content:center; gap:4px; }
.pe-tool-chip { min-height:38px; padding:8px 14px; font-size:13px; gap:7px; flex-shrink:0; border:1px solid transparent; }
.pe-tool-symbol { font-size:19px; line-height:16px; font-weight:500; }
.pe-chevron { font-size:13px; margin-left:2px; }
.pe-tool-menu { position:relative; }
.pe-tool-menu-list { position:absolute; left:0; top:calc(100% + 5px); z-index:160; width:210px; display:grid; padding:5px; background:white; border:1px solid #d5dfd8; border-radius:8px; box-shadow:0 8px 28px #183c2926; }
.pe-tool-menu-list[hidden] { display:none; }
.pe-tool-menu-list button { border:0; background:white; color:#314538; text-align:left; border-radius:4px; padding:11px 12px; cursor:pointer; font-size:12px; }
.pe-tool-menu-list button:hover { background:#edf4ee; }
.pe-tool-chip[aria-expanded=true] { background:#edf4ee; border-color:#c5daca; }
.pe-main-toolbar { gap:9px; padding:10px 20px; }
.pe-document-bar { padding:12px 22px; }
.pe-viewport { padding:24px 32px 65px; }
.pe-pages-scroller { margin:0 auto; align-items:center; }
.pe-page-header { padding:0 0 10px; margin:0; }
.pe-page-sheet { border:0; box-shadow:0 1px 6px #21362a10; }
.pe-text-block-item,.pe-text-block-item.is-edited { border:0 !important; box-shadow:none !important; outline:none; border-radius:0 !important; }
.pe-text-block-item:hover:not(.is-editing) { border:0 !important; outline:none !important; box-shadow:none !important; background:#5f9cff0a !important; }
.pe-text-block-item:focus-visible { outline:1px solid #3d8bce; }
.tool-text .pe-text-block-item { pointer-events:auto; }
.pe-inline-editor { position:absolute; display:block; z-index:40; color:#000; -webkit-text-fill-color:currentColor; caret-color:#237cbd; background:transparent; white-space:pre-wrap; padding:0; margin:0; border:0; outline:1px solid #3986b8; outline-offset:2px; min-width:2px; min-height:0; resize:none; user-select:text; cursor:text; overflow:hidden; border-radius:0; box-shadow:none; }
.pe-inline-editor::selection { background:#88bcff70; }
.pe-inline-tools { position:absolute; display:flex; align-items:center; gap:0; padding:0; z-index:50; color:#344054; background:#fff; border:1px solid #008dff; border-radius:5px; box-shadow:0 4px 16px #1d4b6b24; white-space:nowrap; transform-origin:0 0; min-height:34px; }
.pe-inline-tools button { display:grid; place-items:center; min-width:35px; height:34px; border:0; border-right:1px solid #b8ddff; border-radius:0; background:#fff; padding:0 9px; color:#008dff; font:600 14px/1 system-ui; cursor:pointer; }
.pe-inline-tools button:hover,.pe-inline-tools button.is-active { background:#e6f4ff; color:#006fc8; }
.pe-inline-tools .pe-inline-format { font-family:Georgia,serif; font-size:18px; }
.pe-inline-tools .pe-inline-format:nth-child(2) { font-style:italic; font-weight:500; }
.pe-inline-tools .pe-inline-delete { color:#db3b3b; }
.pe-inline-tools .pe-inline-done { min-width:50px; background:#008dff; color:#fff; }
.pe-inline-tools .pe-inline-done:hover { background:#007ad9; color:#fff; }
.pe-inline-tools label { display:flex; gap:4px; align-items:center; height:34px; padding:0 7px; border-right:1px solid #b8ddff; font:11px system-ui; }
.pe-inline-tools input { accent-color:#008dff; }
.pe-inline-select { height:34px; min-width:64px; border:0; border-right:1px solid #b8ddff; border-radius:0; background:#fff; color:#344054; padding:0 22px 0 7px; font:12px system-ui; cursor:pointer; }
.pe-inline-family { min-width:105px; }.pe-inline-size { min-width:72px; }
.pe-inline-color { width:37px; padding:0 6px !important; }
.pe-inline-color input { width:23px; height:23px; padding:0; border:0; background:transparent; cursor:pointer; }
.pe-inline-move { cursor:move !important; }
.pe-inline-error { position:absolute; z-index:45; padding:6px 9px; background:#fff; border:1px solid #d6dce5; border-radius:5px; color:#9a2727; white-space:normal; width:min(310px,70vw); font:12px/1.5 system-ui; }
.pe-inline-error[hidden] { display:none; }
.pe-text-content:empty::before { content:'Type here'; color:#8a9a90; }
.pe-text-content[contenteditable=plaintext-only] { min-width:20px; outline:1px solid #3986b8; }
.pe-custom-text { min-width:0; min-height:0; }
.pe-modal-overlay { z-index:1000; }
.pe-modal-card { border-radius:12px; }
.pe-modal-tab.active { border-color:#245b41; color:#245b41; }
.pe-sig-choice.selected { border-color:#699a77; box-shadow:0 0 0 2px #cfe6d5; }
#sign-insert-btn { background:#245b41; }
@media(max-width:1100px) { .pe-tool-chip { padding:8px 10px; } }
@media(max-width:680px) {
  .pe-main-toolbar { padding:8px; }.pe-tool-chip { padding:7px 8px; min-height:36px; font-size:12px; gap:4px; }
  .pe-tb-tools { gap:1px; }.pe-tool-menu-list { left:auto; right:0; width:190px; }
  .pe-viewport { padding:16px 12px 50px; }.pe-document-bar { padding:10px 12px; }
  .pe-tool-symbol { font-size:16px; }
}
.pe-start-actions { display:flex; flex-wrap:wrap; gap:16px; justify-content:center; margin:0 auto 28px; }
.pe-start-actions button { padding:7px 3px; color:#355d45; background:none; border:0; border-bottom:1px solid #a6c4ae; font-size:13px; cursor:pointer; }
body.pe-active .pe-start-actions { display:none; }

.pe-editor-card.placing-signature .pe-page-plane { cursor: crosshair; }
.pe-editor-card.placing-signature .pe-text-overlay-layer, .pe-editor-card.placing-signature .pe-objects-layer, .pe-editor-card.placing-signature .pe-widget { pointer-events: none !important; }

.pe-editor-card.placing-signature .pe-text-block-item, .pe-editor-card.placing-signature .pe-obj { pointer-events:none !important; }

/* Minimal document chrome: tools stay visible; auxiliary controls are opt-in. */
body.pe-active .pe-main-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; padding:6px 10px; min-height:46px; background:#fff; }
body.pe-active .pe-tb-center { order:0; flex:1 1 auto; width:auto; padding:0; background:none; }
body.pe-active .pe-tb-tools { justify-content:flex-start; width:auto; gap:1px; background:none; padding:0; }
body.pe-active .pe-tb-left { order:1; gap:2px; }
body.pe-active .pe-tb-right { order:2; margin-left:auto; gap:5px; }
body.pe-active .pe-tool-chip { min-height:32px; padding:6px 8px; border-radius:3px; font-size:12px; gap:4px; }
body.pe-active .pe-tb-btn,body.pe-active .pe-tb-reset-btn { min-height:30px; height:30px; }
body.pe-active .pe-tb-download-btn { min-height:32px; height:32px; padding:6px 12px; border-radius:4px; }
body.pe-active .pe-workspace-footer { display:none; }
body.pe-active .pe-context-bar { position:absolute; top:100%; left:12px; right:auto; max-width:calc(100vw - 24px); min-height:36px; padding:5px 9px; z-index:90; border:1px solid #ddd; border-radius:4px; background:#fff; box-shadow:0 3px 9px #0001; }
body.pe-active .pe-workspace-utility { padding:5px 10px; }
body.pe-active .pe-workspace-utility[hidden] { display:none; }
body.pe-active .pe-viewport { padding:12px 16px 24px; background:#e7e7e7; }
body.pe-active .pe-page-header { padding-bottom:6px; }
.pe-text-content:empty::before { content:none; }
.tool-text .pe-text-block-item,.tool-select .pe-text-block-item { pointer-events:none; }
.tool-edit .pe-text-block-item { pointer-events:auto; cursor:text; }
.pe-sig-choice { color:#000; }
.pe-sign-color { display:flex; align-items:center; gap:10px; margin:12px 0; font:13px system-ui; }
.pe-sign-color input { width:32px; height:26px; padding:0; border:0; background:transparent; }
@media(max-width:1000px) { body.pe-active .pe-tb-center { flex-basis:100%; } body.pe-active .pe-tb-left { justify-content:flex-start; } }
@media(max-width:480px) { body.pe-active .pe-tb-left { flex-wrap:wrap; } body.pe-active .pe-main-toolbar { gap:4px; padding:5px; } body.pe-active .pe-tool-chip { padding:5px 6px; } body.pe-active .pe-tb-right { flex:1; } body.pe-active .pe-viewport { padding:10px 8px 20px; } }
/* Blue controls, white surfaces and neutral canvas, matching the reference. */
body.pe-active { --pe-accent:#008dff; --pe-accent-soft:#e6f4ff; }
body.pe-active .pe-tb-tools { border:1px solid #008dff; border-radius:4px; gap:0; }
body.pe-active .pe-tool-chip { color:#008dff; background:#fff; border:0; border-right:1px solid #b8ddff; border-radius:0; }
body.pe-active .pe-tool-chip:hover,body.pe-active .pe-tool-chip.is-active,body.pe-active .pe-tool-chip[aria-expanded=true] { color:#0071cc; background:#e6f4ff; border-color:#b8ddff; box-shadow:none; }
body.pe-active .pe-tb-btn,body.pe-active .pe-page-nav-btn,body.pe-active .pe-tb-reset-btn,body.pe-active .pe-page-act-btn { color:#008dff; background:#fff; border-color:#b8ddff; }
body.pe-active .pe-tb-download-btn,body.pe-active .pe-tb-download-btn:hover { background:#008dff; border-color:#008dff; color:#fff; }
body.pe-active .pe-more-menu button,body.pe-active .pe-tool-menu-list button { color:#344054; }
body.pe-active .pe-more-menu button:hover,body.pe-active .pe-tool-menu-list button:hover { background:#e6f4ff; }
body.pe-active .pe-native-panel h2,body.pe-active .pe-native-panel label,body.pe-active .pe-native-hint { color:#344054; }
body.pe-active .pe-sidebar,body.pe-active .pe-context-bar { background:#fff; }
body.pe-active .pe-thumb-item.active { border-color:#008dff; box-shadow:0 0 0 1px #b8ddff; }
body.pe-active .pe-inline-tools { color:#344054; border-color:#008dff; }
body.pe-active .pe-inline-tools button { background:#fff; color:#008dff; }
body.pe-active .pe-inline-tools button:hover,body.pe-active .pe-inline-tools button.is-active { background:#e6f4ff; color:#006fc8; }
body.pe-active .pe-inline-tools .pe-inline-done,body.pe-active #pe-properties-apply { background:#008dff; color:#fff; }
body.pe-active input[type=checkbox],body.pe-active input[type=radio] { accent-color:#008dff; }
body.pe-active .pe-field-elem,body.pe-active .pe-widget { background:#f0f6ffcc; border-color:#9acbff; color:#222; }
body.pe-active .pe-widget:focus { outline-color:#008dff; background:white; }
.pe-modal-overlay { backdrop-filter:none; }
.pe-modal-tab.active { border-color:#008dff; color:#008dff; }
.pe-sig-choice.selected { border-color:#008dff; box-shadow:0 0 0 1px #b8ddff; }
#sign-insert-btn { background:#008dff; border-color:#008dff; }
.pe-start-actions button { color:#008dff; border-color:#b8ddff; }
.pe-beta-title::after { content:'BETA'; display:inline-block; margin-left:8px; vertical-align:top; color:#475569; font:700 12px/1 system-ui; letter-spacing:.04em; }
.pe-editor-name { display:inline-flex; align-items:center; gap:5px; margin-right:8px; padding-right:10px; border-right:1px solid #d8e8f4; color:#243746; font:700 12px/1 system-ui; white-space:nowrap; }
.pe-editor-name b { color:#008dff; font-size:9px; letter-spacing:.08em; }
@media(max-width:1150px) { .pe-editor-name { display:none; } .pe-inline-tools { max-width:calc(100vw - 24px); overflow-x:auto; } }
