* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f7f8ff;
  --text: #161b33;
  --muted: #727b91;
  --muted-2: #8a91a5;
  --border: #ececff;
  --primary: #6958ff;
  --primary-2: #7c68ff;
  --primary-soft: #f0edff;
  --danger: #ff5a65;
  --danger-soft: #fff3f4;
}

body {
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top, rgba(105, 88, 255, 0.08), transparent 35%),
    var(--bg);
  color: var(--text);
  padding: 28px;
}

.container {
  width: 100%;
  max-width: 1450px;
  margin: 0 auto;
}
.main-card {
  padding-bottom: 10px;
}

/* HEADER */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 34px;
  margin-bottom: 28px;
}
.left {
  flex: 1;
}
.title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-box {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #f6f4ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: 0 14px 28px rgba(105, 88, 255, 0.12);
  flex: 0 0 auto;
  margin-bottom: 20px;
}
.icon-box i {
  font-size: 54px;
}

h1 {
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -1.6px;
  margin-bottom: 0px !important;
}
.desc {
  max-width: 670px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
  margin-top: 0px;
}

.features {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.feature {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 600;
  color: #5d6478;
}
.feature i {
  font-size: 13px;
  border: 7px solid #fff;
  border-radius: 50%;
  background: #fff;
}
.feature:nth-child(1) i {
  color: #11b56d;
}
.feature:nth-child(2) i {
  color: var(--primary);
}
.feature:nth-child(3) i {
  color: #4d8dff;
}

/* TOOL BOX */
.tool-box {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(99, 91, 255, 0.05);
}
.section-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
  color: #161b33;
}
.sub {
  color: var(--muted-2);
  font-size: 13px;
  margin-bottom: 18px;
}

/* DROP ZONE */
.drop {
  border: 2px dashed #d9d2ff;
  background: linear-gradient(180deg, #fff, #fbfaff);
  border-radius: 22px;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 22px;
  transition: 0.22s ease;
}
.drop.dragover {
  border-color: var(--primary);
  background: #f8f6ff;
  transform: translateY(-1px);
}
.drop.hidden {
  display: none;
}

.upload-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(to bottom, var(--primary-2), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  color: #fff;
  font-size: 28px;
  box-shadow: 0 14px 28px rgba(99, 91, 255, 0.26);
}
.drop h2 {
  font-size: 24px;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}
.drop p {
  color: var(--muted-2);
  margin-bottom: 18px;
  font-size: 14px;
}

/* BUTTONS */
.browse-btn {
  height: 46px;
  padding: 0 20px;
  border-radius: 12px;
  background: linear-gradient(to right, var(--primary), var(--primary-2));
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  border: none;
  outline: none;
  cursor: pointer;
  box-shadow: 0 12px 25px rgba(99, 91, 255, 0.22);
  transition: 0.2s ease;
}
.browse-btn:hover {
  transform: translateY(-1px);
}
.browse-btn i {
  margin-right: 8px;
}

.cancel-btn {
  height: 46px;
  padding: 0 20px;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: 0.18s ease;
}
.cancel-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* FILE ROW */
.files {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.file {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: #fff;
  transition: 0.2s ease;
}
.file:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(99, 91, 255, 0.06);
}
.left-file {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.pdf-mini {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff3f3;
  color: #ff6161;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex: 0 0 auto;
}
.file-meta {
  min-width: 0;
}
.file-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 540px;
}
.size {
  font-size: 12px;
  color: var(--muted-2);
}
.trash {
  color: #9aa1b6;
  cursor: pointer;
  transition: 0.2s;
  flex: 0 0 auto;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}
.trash:hover {
  color: #ff6161;
  background: #fff3f3;
}

/* SIGNATURE PANEL */
.sig-panel {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  background: #fff;
}
.sig-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sig-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sig-chip {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  background: #fafbff;
  cursor: pointer;
  transition: 0.18s ease;
  min-width: 90px;
  max-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sig-chip:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(99, 91, 255, 0.12);
  transform: translateY(-1px);
}
.sig-chip.active-chip {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 8px 20px rgba(99, 91, 255, 0.14);
}
.sig-chip img {
  max-height: 48px;
  max-width: 160px;
  display: block;
  pointer-events: none;
}

.chip-del {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: 2px solid #fff;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
  line-height: 1;
}
.chip-del:hover {
  background: #d93f49;
  transform: scale(1.1);
}

/* ADD FIRST SIG */
.add-first-sig {
  margin-top: 20px;
  border: 2px dashed #d9d2ff;
  border-radius: 20px;
  padding: 22px;
  background: linear-gradient(180deg, #fff, #fbfaff);
}
.add-first-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.fi {
  display: flex;
}
.add-first-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex: 0 0 auto;
  margin-right: 10px;
}

/* EDITOR */
.editor-section {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  display: none;
  flex-direction: column;
}
.editor-section.visible {
  display: flex;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fdfcff, #f9f7ff);
  flex-wrap: wrap;
  gap: 10px;
}
.editor-header-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.editor-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.editor-title i {
  color: var(--primary);
}
.editor-hint {
  font-size: 12px;
  color: var(--muted-2);
}

/* Toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafbff;
  flex-wrap: wrap;
  gap: 16px;
}
.toolbar-section {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toolbar-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.toolbar-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}
.tool-group {
  display: flex;
  gap: 6px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: 0.18s ease;
}
.tool-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.tool-btn.danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}
.tool-btn i {
  font-size: 12px;
}

.active-sig-preview {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  min-width: 140px;
}
.active-sig-preview img {
  max-height: 28px;
  max-width: 120px;
  display: block;
}
.active-sig-preview .no-active {
  font-size: 12px;
  color: var(--muted-2);
  font-style: italic;
}

/* Canvas area */
.page-container {
  padding: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 480px;
  overflow: auto;
}
.page-wrapper {
  position: relative;
  display: inline-block;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  border-radius: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  line-height: 0;
}
#pdfCanvas {
  display: block;
}

#sigOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Placed signature */
.placed-sig {
  position: absolute;
  cursor: move;
  pointer-events: all;
  user-select: none;
  touch-action: none;
}
.placed-sig img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.placed-sig .sig-del-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: 2px solid #fff;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  line-height: 1;
}
.placed-sig .sig-del-btn:hover {
  background: #d93f49;
}
.placed-sig .resize-handle {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--primary);
  cursor: se-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.placed-sig .resize-handle svg {
  width: 10px;
  height: 10px;
  color: #fff;
}
.placed-sig.selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Page nav */
.page-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #fafbff;
}
.nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.page-info {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  min-width: 110px;
  text-align: center;
}

/* INFO NOTE */
.reorder {
  margin-top: 12px;
  color: #9aa1b2;
  font-size: 12px;
  background: rgba(154, 161, 184, 0.18);
  width: max-content;
  padding: 7px 12px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.reorder svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* SETTINGS */
.settings {
  margin-top: 22px;
}
.setting-card {
  border: 1px solid rgba(224, 227, 242, 0.95);
  border-radius: 24px;
  padding: 24px;
  background: linear-gradient(180deg, #fff 0%, #fbfbff 100%);
  box-shadow: 0 14px 30px rgba(99, 91, 255, 0.06);
  width: 100%;
}
.format-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.format-group {
  min-width: 0;
}
.format-group label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #4f566b;
  margin-left: 7px;
}
.format-group select {
  width: 100%;
  height: 54px;
  border-radius: 16px;
  border: 1px solid #dde1ef;
  background: #fff;
  padding: 0 16px;
  outline: none;
  font-family: inherit;
  color: #2f3547;
  font-size: 14px;
  transition: 0.22s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.format-group select:hover {
  border-color: #cbd2e8;
}
.format-group select:focus {
  border-color: #6958ff;
  box-shadow: 0 0 0 4px rgba(105, 88, 255, 0.12);
}
.setting-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: #8a91a5;
  margin-left: 7px;
}

/* PROGRESS */
.progress-wrap {
  width: 100%;
  height: 10px;
  background: #ececff;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 18px;
  display: none;
}
.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(to right, #6958ff, #836dff);
  transition: width 0.25s ease;
}
.progress-text {
  margin-top: 10px;
  font-size: 13px;
  color: #7f8799;
  font-weight: 500;
  min-height: 18px;
}

/* MERGE BTN */
.merge-btn {
  width: 100%;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(to right, var(--primary), #836dff);
  margin-top: 18px;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 18px 30px rgba(99, 91, 255, 0.22);
  transition: 0.22s ease;
  cursor: pointer;
  border: none;
  outline: none;
}
.merge-btn:hover {
  transform: translateY(-2px);
}
.merge-btn i {
  margin-right: 8px;
}
.merge-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none;
}

/* ══════════════════════
   MODAL
══════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(22, 27, 51, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: 0.22s ease;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #fff;
  border-radius: 28px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 32px 80px rgba(22, 27, 51, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(18px) scale(0.97);
  transition: 0.22s ease;
}
.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-title i {
  color: var(--primary);
}
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
}
.modal-close:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

/* Tabs */
.modal-tabs {
  display: flex;
  gap: 4px;
  padding: 14px 24px 0;
  border-bottom: 1px solid var(--border);
}
.mtab {
  height: 38px;
  padding: 0 18px;
  border-radius: 10px 10px 0 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: 0.15s;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.mtab:hover {
  color: var(--primary);
  background: var(--primary-soft);
}
.mtab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: transparent;
}

.tab-panel {
  display: none;
  padding: 22px 24px;
}
.tab-panel.active {
  display: block;
}

/* Draw tab */
.draw-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.draw-tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.draw-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.color-input {
  width: 40px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  padding: 3px;
  cursor: pointer;
  background: #fff;
}
.color-input:hover {
  border-color: var(--primary);
}

.mini-select {
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: 0.18s;
}
.mini-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(105, 88, 255, 0.1);
}

.sig-canvas-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 2px dashed #d9d2ff;
  background: #fafbff;
}
#sigDrawCanvas {
  display: block;
  width: 100%;
  cursor: crosshair;
  touch-action: none;
}
.canvas-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #c8c4e8;
  pointer-events: none;
  font-weight: 500;
}

/* Type tab */
.type-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
}
.type-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.type-group label {
  font-size: 12px;
  font-weight: 700;
  color: #4f566b;
}
.type-input {
  height: 46px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: 0.2s;
  width: 100%;
}
.type-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(105, 88, 255, 0.1);
}

.font-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: #d9d2ff transparent;
}
.font-grid::-webkit-scrollbar {
  width: 5px;
}
.font-grid::-webkit-scrollbar-track {
  background: transparent;
}
.font-grid::-webkit-scrollbar-thumb {
  background: #d9d2ff;
  border-radius: 99px;
}

.font-btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 20px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  transition: 0.16s;
  white-space: nowrap;
  flex-shrink: 0;
}
.font-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.font-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.type-preview {
  margin-top: 18px;
  min-height: 80px;
  border-radius: 16px;
  border: 2px dashed #d9d2ff;
  background: #fafbff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#typePreviewText {
  font-size: 36px;
  line-height: 1.2;
}

/* Upload tab */
.upload-sig-area {
  border: 2px dashed #d9d2ff;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #fbfaff);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 22px;
}
.upload-sig-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.upload-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.upload-preview img {
  max-height: 140px;
  max-width: 100%;
  border-radius: 10px;
}

/* Modal footer */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #fafbff;
}

/* ==============================================
   LARGE SCREENS — starts at 1200px
=============================================== */

@media (min-width: 1200px) {
  body {
    padding: 30px 3vw;
  }

  .page-container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .container {
    max-width: 94vw !important;
    width: 94vw !important;
  }
}

/* ——— 1440 px ——— */
@media (min-width: 1440px) {
  body {
    padding: 36px 3vw;
  }
  .container {
    max-width: 94vw !important;
    width: 94vw !important;
  }

  h1 {
    font-size: 50px;
    letter-spacing: -1.8px;
  }
  .desc {
    max-width: 55vw;
    font-size: 16px;
  }

  .icon-box {
    width: 112px;
    height: 112px;
    border-radius: 20px;
  }
  .icon-box i {
    font-size: 66px;
  }

  .features {
    gap: 18px;
    margin-top: 18px;
  }
  .feature {
    font-size: 14px;
    padding: 12px 18px;
  }

  .tool-box {
    padding: 32px;
    border-radius: 28px;
  }
  .section-title {
    font-size: 21px;
  }
  .sub {
    font-size: 14px;
  }

  .drop {
    min-height: 270px;
    border-radius: 24px;
  }
  .drop h2 {
    font-size: 27px;
  }
  .drop p {
    font-size: 15px;
  }
  .upload-circle {
    width: 80px;
    height: 80px;
    font-size: 32px;
  }
  .browse-btn,
  .cancel-btn {
    height: 50px;
    padding: 0 26px;
    font-size: 15px;
  }

  .file {
    padding: 18px 20px;
    border-radius: 18px;
  }
  .file-name {
    font-size: 15px;
  }
  .size {
    font-size: 13px;
  }
  .pdf-mini {
    width: 46px;
    height: 46px;
    font-size: 21px;
  }

  .sig-panel {
    padding: 24px;
    border-radius: 24px;
  }
  .sig-chip {
    padding: 14px 18px;
  }
  .sig-chip img {
    max-height: 56px;
  }

  .add-first-icon {
    width: 58px;
    height: 58px;
    font-size: 26px;
  }

  .editor-title {
    font-size: 16px;
  }
  .tool-btn {
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
  }
  .active-sig-preview {
    height: 40px;
    min-width: 160px;
  }

  .page-container {
    padding: 34px;
  }
  .nav-btn {
    width: 42px;
    height: 42px;
    font-size: 15px;
  }
  .page-info {
    font-size: 16px;
    min-width: 130px;
  }

  .setting-card {
    padding: 28px;
    border-radius: 26px;
  }
  .format-group label {
    font-size: 14px;
  }
  .format-group select {
    height: 56px;
    font-size: 15px;
  }
  .setting-note {
    font-size: 14px;
  }

  .merge-btn {
    height: 58px;
    font-size: 16px;
  }

  .modal {
    max-width: 660px;
  }
  .modal-title {
    font-size: 18px;
  }
  .tab-panel {
    padding: 26px;
  }
  .font-btn {
    height: 48px;
    font-size: 22px;
  }
  #typePreviewText {
    font-size: 40px;
  }
  .upload-sig-area {
    min-height: 240px;
  }
  .upload-preview img {
    max-height: 160px;
  }
}

/* ——— 1600 px ——— */
@media (min-width: 1600px) {
  body {
    padding: 38px 3vw;
  }
  h1 {
    font-size: 56px;
    letter-spacing: -2px;
  }
  .desc {
    font-size: 16.5px;
  }

  .icon-box {
    width: 120px;
    height: 120px;
  }
  .icon-box i {
    font-size: 72px;
  }

  .tool-box {
    padding: 36px;
  }
  .section-title {
    font-size: 23px;
  }
  .sub {
    font-size: 15px;
  }

  .drop {
    min-height: 290px;
  }
  .drop h2 {
    font-size: 30px;
  }
  .drop p {
    font-size: 16px;
  }
  .upload-circle {
    width: 86px;
    height: 86px;
    font-size: 34px;
  }
  .browse-btn,
  .cancel-btn {
    height: 54px;
    font-size: 15.5px;
  }

  .file {
    padding: 20px 22px;
  }
  .file-name {
    font-size: 16px;
  }
  .size {
    font-size: 13.5px;
  }
  .pdf-mini {
    width: 50px;
    height: 50px;
    font-size: 23px;
  }

  .setting-card {
    padding: 32px;
  }
  .format-group select {
    height: 58px;
  }

  .merge-btn {
    height: 62px;
    font-size: 17px;
  }

  .modal {
    max-width: 700px;
  }
  .font-btn {
    height: 52px;
    font-size: 24px;
  }
  #typePreviewText {
    font-size: 44px;
  }
}

/* ——— 1920 px ——— */
@media (min-width: 1920px) {
  body {
    padding: 42px 3vw;
  }
  h1 {
    font-size: 66px;
    letter-spacing: -2.2px;
  }
  .desc {
    max-width: 52vw;
    font-size: 18px;
    line-height: 1.75;
  }
  .title {
    gap: 24px;
    margin-bottom: 20px;
  }
  .top {
    gap: 60px;
    margin-bottom: 40px;
  }

  .icon-box {
    width: 134px;
    height: 134px;
    border-radius: 24px;
  }
  .icon-box i {
    font-size: 80px;
  }

  .features {
    gap: 20px;
    margin-top: 22px;
  }
  .feature {
    font-size: 16px;
    padding: 14px 22px;
    gap: 10px;
  }
  .feature i {
    font-size: 16px;
  }

  .tool-box {
    padding: 44px;
    border-radius: 34px;
  }
  .section-title {
    font-size: 26px;
    margin-bottom: 10px;
  }
  .sub {
    font-size: 17px;
    margin-bottom: 26px;
  }

  .drop {
    min-height: 330px;
    border-radius: 28px;
  }
  .drop h2 {
    font-size: 34px;
    margin-bottom: 14px;
  }
  .drop p {
    font-size: 18px;
    margin-bottom: 28px;
  }
  .upload-circle {
    width: 96px;
    height: 96px;
    font-size: 38px;
    margin-bottom: 26px;
  }
  .browse-btn,
  .cancel-btn {
    height: 58px;
    padding: 0 32px;
    font-size: 17px;
    border-radius: 14px;
  }

  .files {
    gap: 16px;
  }
  .file {
    padding: 22px 26px;
    border-radius: 22px;
  }
  .left-file {
    gap: 18px;
  }
  .file-name {
    font-size: 18px;
    margin-bottom: 5px;
  }
  .size {
    font-size: 14.5px;
  }
  .pdf-mini {
    width: 56px;
    height: 56px;
    font-size: 26px;
    border-radius: 14px;
  }
  .trash {
    font-size: 18px;
  }

  .sig-panel {
    padding: 30px;
    border-radius: 28px;
  }
  .sig-chip {
    padding: 16px 20px;
    border-radius: 16px;
  }
  .sig-chip img {
    max-height: 64px;
  }
  .chip-del {
    width: 26px;
    height: 26px;
    font-size: 12px;
    top: -10px;
    right: -10px;
  }

  .add-first-icon {
    width: 66px;
    height: 66px;
    font-size: 30px;
    border-radius: 18px;
  }

  .editor-section {
    border-radius: 28px;
  }
  .editor-header {
    padding: 20px 26px;
  }
  .editor-title {
    font-size: 18px;
  }
  .editor-hint {
    font-size: 14px;
  }
  .editor-toolbar {
    padding: 18px 26px;
    gap: 20px;
  }
  .tool-btn {
    height: 46px;
    padding: 0 20px;
    font-size: 15px;
    border-radius: 12px;
  }
  .active-sig-preview {
    height: 46px;
    min-width: 180px;
    border-radius: 12px;
  }

  .page-container {
    padding: 40px;
    min-height: 600px;
  }
  .nav-btn {
    width: 48px;
    height: 48px;
    font-size: 16px;
    border-radius: 12px;
  }
  .page-info {
    font-size: 18px;
    min-width: 140px;
  }

  .reorder {
    font-size: 14px;
    padding: 9px 16px;
    margin-top: 20px;
  }
  .reorder svg {
    width: 18px;
    height: 18px;
  }

  .setting-card {
    padding: 36px;
    border-radius: 28px;
  }
  .format-row {
    gap: 26px;
  }
  .format-group label {
    font-size: 16px;
    margin-bottom: 14px;
  }
  .format-group select {
    height: 62px;
    font-size: 16px;
    border-radius: 14px;
    padding: 0 18px;
  }
  .setting-note {
    font-size: 16px;
    margin-top: 14px;
  }

  .merge-btn {
    height: 70px;
    font-size: 19px;
    border-radius: 18px;
    margin-top: 28px;
  }

  .modal {
    max-width: 760px;
    border-radius: 32px;
  }
  .modal-header {
    padding: 24px 30px;
  }
  .modal-title {
    font-size: 20px;
  }
  .modal-close {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .modal-tabs {
    padding: 18px 30px 0;
  }
  .mtab {
    height: 44px;
    padding: 0 22px;
    font-size: 15px;
  }
  .tab-panel {
    padding: 30px;
  }
  .draw-toolbar {
    gap: 18px;
    margin-bottom: 18px;
  }
  .draw-label {
    font-size: 14px;
  }
  .color-input {
    width: 48px;
    height: 42px;
  }
  .mini-select {
    height: 42px;
    font-size: 15px;
    padding: 0 14px;
  }
  .sig-canvas-wrap {
    border-radius: 20px;
  }
  .canvas-hint {
    font-size: 18px;
  }
  .type-input {
    height: 54px;
    font-size: 18px;
    border-radius: 14px;
  }
  .font-btn {
    height: 58px;
    padding: 0 24px;
    font-size: 26px;
    border-radius: 14px;
  }
  .type-preview {
    min-height: 100px;
    border-radius: 20px;
  }
  #typePreviewText {
    font-size: 52px;
  }
  .upload-sig-area {
    min-height: 280px;
    border-radius: 22px;
  }
  .upload-preview img {
    max-height: 180px;
  }
  .modal-footer {
    padding: 20px 30px;
  }
}

/* ——— 2560 px ——— */
@media (min-width: 2560px) {
  body {
    padding: 52px 3vw;
  }
  h1 {
    font-size: 84px;
    letter-spacing: -3px;
  }
  .desc {
    max-width: 50vw;
    font-size: 22px;
    line-height: 1.8;
  }
  .title {
    gap: 30px;
    margin-bottom: 28px;
  }
  .top {
    gap: 80px;
    margin-bottom: 56px;
  }

  .icon-box {
    width: 170px;
    height: 170px;
    border-radius: 30px;
  }
  .icon-box i {
    font-size: 100px;
  }

  .features {
    gap: 26px;
    margin-top: 28px;
  }
  .feature {
    font-size: 20px;
    padding: 18px 28px;
    gap: 14px;
  }
  .feature i {
    font-size: 20px;
    border-width: 10px;
  }

  .tool-box {
    padding: 60px;
    border-radius: 42px;
  }
  .section-title {
    font-size: 34px;
    margin-bottom: 14px;
  }
  .sub {
    font-size: 21px;
    margin-bottom: 34px;
  }

  .drop {
    min-height: 430px;
    border-radius: 36px;
    border-width: 3px;
  }
  .drop h2 {
    font-size: 48px;
    margin-bottom: 18px;
    letter-spacing: -1px;
  }
  .drop p {
    font-size: 23px;
    margin-bottom: 38px;
  }
  .upload-circle {
    width: 124px;
    height: 124px;
    font-size: 52px;
    margin-bottom: 34px;
    box-shadow: 0 24px 48px rgba(99, 91, 255, 0.3);
  }
  .browse-btn,
  .cancel-btn {
    height: 78px;
    padding: 0 48px;
    font-size: 21px;
    border-radius: 20px;
  }

  .files {
    gap: 24px;
  }
  .file {
    padding: 30px 36px;
    border-radius: 28px;
  }
  .left-file {
    gap: 26px;
  }
  .file-name {
    font-size: 23px;
    margin-bottom: 7px;
  }
  .size {
    font-size: 18px;
  }
  .pdf-mini {
    width: 74px;
    height: 74px;
    font-size: 34px;
    border-radius: 18px;
  }
  .trash {
    font-size: 26px;
    padding: 14px;
  }

  .sig-panel {
    padding: 40px;
    border-radius: 34px;
  }
  .sig-chips {
    gap: 20px;
  }
  .sig-chip {
    padding: 20px 26px;
    border-radius: 20px;
    border-width: 3px;
  }
  .sig-chip img {
    max-height: 80px;
  }
  .chip-del {
    width: 32px;
    height: 32px;
    font-size: 14px;
    top: -12px;
    right: -12px;
    border-width: 3px;
  }

  .add-first-sig {
    padding: 34px;
    border-radius: 28px;
    border-width: 3px;
  }
  .add-first-icon {
    width: 84px;
    height: 84px;
    font-size: 38px;
    border-radius: 22px;
    margin-right: 16px;
  }

  .editor-section {
    border-radius: 34px;
  }
  .editor-header {
    padding: 26px 36px;
  }
  .editor-title {
    font-size: 24px;
    gap: 12px;
  }
  .editor-hint {
    font-size: 18px;
  }
  .editor-toolbar {
    padding: 24px 36px;
    gap: 26px;
  }
  .toolbar-label {
    font-size: 16px;
  }
  .toolbar-divider {
    height: 42px;
  }
  .tool-group {
    gap: 10px;
  }
  .tool-btn {
    height: 60px;
    padding: 0 28px;
    font-size: 19px;
    border-radius: 16px;
    border-width: 2px;
    gap: 10px;
  }
  .tool-btn i {
    font-size: 18px;
  }
  .active-sig-preview {
    height: 60px;
    min-width: 240px;
    border-radius: 16px;
    border-width: 2px;
  }
  .active-sig-preview img {
    max-height: 40px;
  }
  .active-sig-preview .no-active {
    font-size: 16px;
  }

  .page-container {
    padding: 50px;
    min-height: 800px;
  }
  .nav-btn {
    width: 62px;
    height: 62px;
    font-size: 22px;
    border-radius: 16px;
    border-width: 2px;
  }
  .page-info {
    font-size: 22px;
    min-width: 180px;
  }

  .reorder {
    font-size: 18px;
    padding: 12px 22px;
    margin-top: 26px;
    border-radius: 50px;
    gap: 12px;
  }
  .reorder svg {
    width: 22px;
    height: 22px;
  }

  .setting-card {
    padding: 44px;
    border-radius: 34px;
  }
  .format-row {
    gap: 34px;
  }
  .format-group label {
    font-size: 20px;
    margin-bottom: 20px;
    margin-left: 10px;
  }
  .format-group select {
    height: 78px;
    font-size: 19px;
    border-radius: 18px;
    padding: 0 24px;
  }
  .setting-note {
    font-size: 20px;
    margin-top: 18px;
    margin-left: 10px;
  }

  .merge-btn {
    height: 88px;
    font-size: 23px;
    border-radius: 24px;
    margin-top: 36px;
    box-shadow: 0 24px 48px rgba(99, 91, 255, 0.28);
  }

  .modal {
    max-width: 900px;
    border-radius: 36px;
  }
  .modal-header {
    padding: 30px 40px;
  }
  .modal-title {
    font-size: 26px;
    gap: 14px;
  }
  .modal-close {
    width: 50px;
    height: 50px;
    font-size: 22px;
    border-radius: 14px;
  }
  .modal-tabs {
    padding: 24px 40px 0;
    gap: 8px;
  }
  .mtab {
    height: 56px;
    padding: 0 30px;
    font-size: 19px;
    gap: 10px;
  }
  .tab-panel {
    padding: 36px 40px;
  }
  .draw-toolbar {
    gap: 24px;
    margin-bottom: 24px;
  }
  .draw-label {
    font-size: 18px;
  }
  .color-input {
    width: 60px;
    height: 54px;
    border-radius: 14px;
    border-width: 2px;
  }
  .mini-select {
    height: 54px;
    font-size: 18px;
    padding: 0 18px;
    border-radius: 14px;
  }
  .sig-canvas-wrap {
    border-radius: 24px;
    border-width: 3px;
  }
  .canvas-hint {
    font-size: 22px;
  }
  .type-row {
    gap: 20px;
  }
  .type-group label {
    font-size: 18px;
  }
  .type-input {
    height: 68px;
    font-size: 22px;
    border-radius: 18px;
    padding: 0 20px;
    border-width: 2px;
  }
  .font-grid {
    gap: 14px;
    max-height: 240px;
  }
  .font-btn {
    height: 72px;
    padding: 0 32px;
    font-size: 32px;
    border-radius: 16px;
    border-width: 2px;
  }
  .type-preview {
    min-height: 140px;
    border-radius: 24px;
    border-width: 3px;
    padding: 24px;
    margin-top: 26px;
  }
  #typePreviewText {
    font-size: 68px;
  }
  .upload-sig-area {
    min-height: 360px;
    border-radius: 28px;
    border-width: 3px;
    padding: 36px;
  }
  .upload-preview img {
    max-height: 220px;
  }
  .modal-footer {
    padding: 26px 40px;
    gap: 16px;
  }
}

/* =========================
   SMALL SCREENS
========================= */

@media (max-width: 950px) {
  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .format-row {
    grid-template-columns: 1fr;
  }
  .editor-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .toolbar-divider {
    display: none;
  }
  .toolbar-section {
    width: 100%;
    justify-content: space-between;
  }
  .tool-group {
    flex-wrap: wrap;
  }
  .page-container {
    padding: 18px;
  }
  .page-wrapper {
    max-width: 100%;
  }
  .file-name {
    max-width: 320px;
  }
}

@media (max-width: 700px) {
  .main-card {
    padding: 20px;
  }
  .tool-box {
    padding: 18px;
    border-radius: 20px;
  }
  .section-title {
    font-size: 16px;
  }
  .sub {
    font-size: 12px;
  }
  .drop {
    min-height: 200px;
    padding: 18px;
  }
  .drop h2 {
    font-size: 20px;
  }
  .drop p {
    font-size: 13px;
  }
  .browse-btn,
  .cancel-btn,
  .merge-btn {
    height: 44px;
    font-size: 13px;
  }
  .file {
    padding: 12px 14px;
  }
  .file-name {
    max-width: 220px;
  }
  .sig-panel,
  .add-first-sig,
  .setting-card {
    padding: 18px;
    border-radius: 18px;
  }
  .sig-panel-header {
    flex-direction: column;
    align-items: stretch;
  }
  .sig-chips {
    gap: 10px;
  }
  .sig-chip {
    min-width: 80px;
    max-width: 100%;
  }
  .editor-section {
    border-radius: 18px;
  }
  .editor-header,
  .editor-toolbar,
  .page-nav {
    padding-left: 14px;
    padding-right: 14px;
  }
  .page-nav {
    gap: 10px;
  }
  .page-info {
    min-width: auto;
  }
  .type-row {
    grid-template-columns: 1fr;
  }
  .type-group {
    width: 100%;
  }
  .font-grid {
    max-height: 180px;
  }
  #typePreviewText {
    font-size: 28px;
  }
  .modal {
    max-width: 100%;
    border-radius: 20px;
  }
  .modal-header,
  .modal-tabs,
  .tab-panel,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .draw-toolbar {
    gap: 10px;
  }
}

@media (max-width: 600px) {
  body {
    padding: 14px;
  }
  .main-card {
    padding: 16px;
  }
  .top {
    gap: 16px;
    margin-bottom: 20px;
  }
  .title {
    gap: 12px;
  }
  h1 {
    font-size: 30px;
    letter-spacing: -1px;
  }
  .desc {
    font-size: 14px;
    line-height: 1.6;
  }
  .features {
    gap: 8px;
  }
  .feature {
    padding: 9px 12px;
    font-size: 12px;
  }
  .tool-box {
    padding: 16px;
  }
  .drop {
    min-height: 180px;
    padding: 14px;
    border-radius: 18px;
  }
  .upload-circle {
    width: 62px;
    height: 62px;
    font-size: 24px;
    margin-bottom: 14px;
  }
  .drop h2 {
    font-size: 18px;
    margin-bottom: 8px;
  }
  .drop p {
    margin-bottom: 14px;
  }
  .files {
    gap: 10px;
  }
  .file {
    flex-direction: column;
    align-items: flex-start;
  }
  .left-file {
    width: 100%;
  }
  .trash {
    align-self: flex-end;
    margin-top: -6px;
  }
  .file-name {
    max-width: 100%;
  }
  .sig-panel,
  .add-first-sig,
  .setting-card {
    padding: 16px;
  }
  .editor-header {
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .editor-title {
    font-size: 14px;
  }
  .editor-hint {
    font-size: 11px;
  }
  .page-container {
    padding: 12px;
    min-height: 360px;
  }
  .page-nav {
    padding: 12px 14px;
    gap: 8px;
  }
  .nav-btn {
    width: 36px;
    height: 36px;
  }
  .reorder {
    width: 100%;
    justify-content: center;
    text-align: center;
    border-radius: 16px;
    padding: 9px 12px;
  }
  .format-group label,
  .setting-note {
    margin-left: 0;
  }
  .format-group select {
    height: 50px;
    border-radius: 14px;
  }
  .progress-wrap {
    height: 9px;
  }
  .merge-btn {
    height: 50px;
    font-size: 14px;
  }
  .modal-header {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .modal-title {
    font-size: 16px;
  }
  .modal-tabs {
    padding-top: 10px;
    gap: 2px;
    overflow-x: auto;
  }
  .mtab {
    height: 36px;
    padding: 0 14px;
    white-space: nowrap;
  }
  .tab-panel {
    padding: 16px;
  }
  .type-input {
    height: 44px;
  }
  .font-btn {
    height: 42px;
    font-size: 18px;
    padding: 0 14px;
  }
  #typePreviewText {
    font-size: 24px;
  }
  .upload-sig-area {
    min-height: 180px;
    padding: 16px;
  }
  .upload-preview img {
    max-height: 120px;
  }
}

@media (max-width: 425px) {
  body {
    padding: 10px;
    font-size: 13px;
  }
  .main-card {
    padding: 14px;
    padding-bottom: 0;
  }
  h1 {
    font-size: 26px;
    line-height: 1.15;
  }
  .desc {
    font-size: 13px;
    line-height: 1.6;
  }
  .section-title {
    font-size: 16px;
  }
  .sub {
    font-size: 12px;
  }
  .feature {
    font-size: 12px;
    padding: 9px 12px;
    gap: 6px;
  }
  .feature i {
    font-size: 12px;
  }
  .drop h2 {
    font-size: 18px;
  }
  .drop p {
    font-size: 12px;
  }
  .browse-btn,
  .cancel-btn,
  .merge-btn {
    font-size: 13px;
    height: 46px;
  }
  .file-name {
    font-size: 13px;
  }
  .size {
    font-size: 11px;
  }
  .setting-card label {
    font-size: 12px;
  }
  .format-group select {
    font-size: 13px;
    height: 46px;
  }
  .tool-btn {
    font-size: 12px;
    height: 34px;
  }
  .active-sig-preview {
    height: 34px;
    min-width: 120px;
  }
  .nav-btn {
    width: 34px;
    height: 34px;
  }
  .page-info {
    font-size: 13px;
  }
  .icon-box {
    display: none;
  }
  .tool-box,
  .setting-card,
  .sig-panel,
  .add-first-sig,
  .editor-section {
    border-radius: 16px;
  }
  .drop {
    min-height: 160px;
    padding: 16px;
  }
  .modal {
    border-radius: 16px;
  }
  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .modal-footer .browse-btn,
  .modal-footer .cancel-btn {
    width: 100%;
  }
  .draw-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .draw-tool-group {
    justify-content: space-between;
    width: 100%;
  }
  .toolbar-section {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .tool-group {
    width: 100%;
  }
  .tool-btn {
    width: 100%;
    justify-content: center;
  }
  .active-sig-preview {
    min-width: 100%;
    width: 100%;
  }
  .page-nav {
    flex-wrap: wrap;
  }
  .page-info {
    order: 2;
    width: 100%;
  }
  .nav-btn {
    order: 1;
  }
  #typePreviewText {
    font-size: 20px;
  }
  .font-btn {
    font-size: 16px;
    padding: 0 12px;
    height: 40px;
  }
  .sig-chip {
    min-width: 72px;
    padding: 8px 10px;
  }
  .chip-del,
  .placed-sig .sig-del-btn {
    width: 20px;
    height: 20px;
  }
  .placed-sig .resize-handle {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 375px) {
  body {
    padding: 8px;
    font-size: 12.5px;
  }
  h1 {
    font-size: 23px;
    line-height: 1.2;
  }
  .desc {
    font-size: 12px;
    line-height: 1.5;
  }
  .section-title {
    font-size: 15px;
  }
  .sub {
    font-size: 11.5px;
  }
  .title {
    gap: 10px;
  }
  .feature {
    font-size: 11.5px;
    padding: 8px 10px;
  }
  .drop {
    min-height: 150px;
    padding: 14px;
    border-radius: 16px;
  }
  .drop h2 {
    font-size: 17px;
  }
  .drop p {
    font-size: 11.5px;
  }
  .upload-circle {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }
  .browse-btn,
  .cancel-btn,
  .merge-btn {
    font-size: 12.5px;
    height: 44px;
    border-radius: 10px;
  }
  .file {
    padding: 12px;
  }
  .file-name {
    font-size: 12.5px;
  }
  .size {
    font-size: 10.5px;
  }
  .pdf-mini {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
  .setting-card {
    padding: 12px;
    border-radius: 14px;
  }
  .setting-card label {
    font-size: 11.5px;
  }
  .format-group select {
    font-size: 12.5px;
    height: 42px;
    border-radius: 10px;
  }
  .setting-note {
    font-size: 11px;
  }
  .modal-title {
    font-size: 15px;
  }
  .mtab {
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }
  .tab-panel {
    padding: 14px;
  }
  .type-input {
    height: 42px;
    font-size: 14px;
  }
  .font-btn {
    height: 38px;
    font-size: 15px;
    padding: 0 10px;
  }
  #typePreviewText {
    font-size: 18px;
  }
  .upload-sig-area {
    min-height: 160px;
    padding: 14px;
  }
  .upload-preview img {
    max-height: 100px;
  }
  .tool-box {
    padding: 12px;
    border-radius: 16px;
  }
  .icon-box {
    display: none;
  }
}

@media (max-width: 325px) {
  body {
    padding: 6px;
    font-size: 12px;
  }
  .tool-box,
  .setting-card,
  .sig-panel,
  .add-first-sig,
  .editor-section {
    padding: 10px;
    border-radius: 12px;
  }
  h1 {
    font-size: 21px;
    line-height: 1.18;
  }
  .desc {
    font-size: 11.5px;
    line-height: 1.45;
  }
  .section-title {
    font-size: 14px;
  }
  .sub {
    font-size: 10.5px;
  }
  .title {
    gap: 8px;
  }
  .feature {
    font-size: 10.5px;
    padding: 7px 9px;
    gap: 5px;
  }
  .drop {
    min-height: 140px;
    padding: 12px;
    border-radius: 14px;
  }
  .drop h2 {
    font-size: 15px;
  }
  .drop p {
    font-size: 10.5px;
    margin-bottom: 12px;
  }
  .upload-circle {
    width: 48px;
    height: 48px;
    font-size: 20px;
    margin-bottom: 12px;
  }
  .browse-btn,
  .cancel-btn,
  .merge-btn {
    height: 42px;
    font-size: 12px;
    border-radius: 10px;
  }
  .file {
    padding: 10px;
    border-radius: 12px;
  }
  .left-file {
    gap: 8px;
  }
  .pdf-mini {
    width: 32px;
    height: 32px;
    font-size: 15px;
    border-radius: 10px;
  }
  .file-name {
    font-size: 12px;
  }
  .size {
    font-size: 10px;
  }
  .setting-card label {
    font-size: 11px;
    margin-bottom: 8px;
  }
  .format-group select {
    height: 40px;
    font-size: 12px;
    border-radius: 10px;
  }
  .setting-note {
    font-size: 10px;
  }
  .tool-btn {
    height: 32px;
    font-size: 11px;
    padding: 0 10px;
  }
  .active-sig-preview {
    height: 32px;
    min-width: 110px;
    font-size: 11px;
  }
  .nav-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  .page-info {
    font-size: 12px;
  }
  .modal {
    border-radius: 14px;
  }
  .modal-title {
    font-size: 14px;
  }
  .mtab {
    height: 32px;
    padding: 0 10px;
    font-size: 11px;
  }
  .tab-panel {
    padding: 12px;
  }
  .type-input {
    height: 40px;
    font-size: 13px;
  }
  .font-btn {
    height: 36px;
    font-size: 14px;
    padding: 0 8px;
  }
  #typePreviewText {
    font-size: 16px;
  }
  .upload-sig-area {
    min-height: 140px;
  }
  .reorder {
    font-size: 10px;
    padding: 4px 8px;
    gap: 4px;
  }
  .icon-box {
    display: none;
  }
}

/* =========================
   SIGN PDF - DARK MODE
========================= */

body.dark {
  color-scheme: dark;
  --bg: #0b1220;
  --card: #111827;
  --card-2: #0f172a;
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --border: rgba(148, 163, 184, 0.14);
  --border-2: rgba(148, 163, 184, 0.2);
  --primary: #ef4444;
  --primary-2: #b91c1c;
  --primary-soft: rgba(239, 68, 68, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(239, 68, 68, 0.1);
}

body.dark {
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.1), transparent 40%),
    var(--bg);
  color: var(--text);
}

/* Main containers */
body.dark .page-container,
body.dark .container {
  background: transparent;
}

body.dark .tool-box,
body.dark .setting-card,
body.dark .editor-section,
body.dark .modal,
body.dark .drop,
body.dark .sig-panel,
body.dark .add-first-sig,
body.dark .page-wrapper,
body.dark .page-nav,
body.dark .modal-tabs,
body.dark .modal-footer,
body.dark .tab-panel,
body.dark .type-preview,
body.dark .upload-sig-area,
body.dark .upload-preview {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

/* Top title area */
body.dark .title h1,
body.dark h1,
body.dark h2,
body.dark h3,
body.dark .section-title,
body.dark .editor-title,
body.dark .modal-title {
  color: #ffffff !important;
}

body.dark .desc,
body.dark .sub,
body.dark .editor-hint,
body.dark .setting-note,
body.dark .page-info,
body.dark .draw-label,
body.dark .toolbar-label,
body.dark label,
body.dark p,
body.dark span {
  color: var(--muted) !important;
}

/* Feature chips */
body.dark .features .feature {
  color: #e2e8f0 !important;
  background: transparent !important;
  border: none !important;
}
body.dark .feature i {
  color: var(--primary) !important;
}

/* Drop zone */
body.dark .drop {
  background: var(--card-2) !important;
  border: 1px dashed rgba(148, 163, 184, 0.25) !important;
}
body.dark .drop h2 {
  color: #ffffff !important;
}
body.dark .drop p {
  color: var(--muted) !important;
}

body.dark .upload-circle {
  background: linear-gradient(
    to bottom,
    var(--primary),
    var(--primary-2)
  ) !important;
}

/* Buttons */
body.dark .tool-btn,
body.dark .cancel-btn,
body.dark .nav-btn,
body.dark .font-btn,
body.dark .mtab {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
}

body.dark .browse-btn,
body.dark .merge-btn {
  background: linear-gradient(
    to right,
    var(--primary),
    var(--primary-2)
  ) !important;
  color: #ffffff !important;
}

body.dark .browse-btn:hover,
body.dark .tool-btn:hover,
body.dark .cancel-btn:hover,
body.dark .nav-btn:hover:not(:disabled),
body.dark .font-btn:hover {
  background: #1f2937 !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
}

body.dark .tool-btn.danger,
body.dark .merge-btn.danger {
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.28) !important;
}
body.dark .tool-btn.danger:hover {
  background: var(--danger-soft) !important;
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}

/* Modal */
body.dark .modal-backdrop {
  background: rgba(2, 6, 23, 0.72) !important;
  backdrop-filter: blur(8px);
}
body.dark .modal {
  background: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.16) !important;
}
body.dark .modal-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12) !important;
}
body.dark .modal-close {
  background: #111827 !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
}
body.dark .modal-close:hover {
  border-color: var(--danger) !important;
  color: var(--danger) !important;
  background: var(--danger-soft) !important;
}

/* Tabs */
body.dark .modal-tabs {
  background: #111827 !important;
  border: 1px solid rgba(148, 163, 184, 0.12) !important;
}
body.dark .mtab {
  background: transparent !important;
  color: var(--muted) !important;
}
body.dark .mtab.active {
  background: transparent !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
}

/* Draw tab */
body.dark .draw-toolbar,
body.dark .type-controls,
body.dark .toolbar-section,
body.dark .format-group {
  background: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.12) !important;
}

body.dark .color-input,
body.dark .mini-select,
body.dark .type-input,
body.dark input,
body.dark select,
body.dark textarea {
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
}

body.dark .color-input:focus,
body.dark .mini-select:focus,
body.dark .type-input:focus,
body.dark input:focus,
body.dark select:focus,
body.dark textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16) !important;
  outline: none;
}

body.dark .sig-canvas-wrap {
  background: #0b1220 !important;
  border: 1px solid rgba(148, 163, 184, 0.12) !important;
}
body.dark .canvas-hint {
  color: var(--muted-2) !important;
}

/* Type preview */
body.dark .type-preview {
  background: #0b1220 !important;
  border: 1px dashed rgba(148, 163, 184, 0.22) !important;
}
body.dark .type-preview span {
  color: #ffffff !important;
}

/* Font grid buttons */
body.dark .font-grid {
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
body.dark .font-btn.active {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #ffffff !important;
}

/* Upload section */
body.dark .upload-sig-area,
body.dark .upload-sig-inner,
body.dark .upload-preview {
  background: var(--card-2) !important;
  border-color: rgba(148, 163, 184, 0.14) !important;
}
body.dark .upload-sig-inner p {
  color: var(--muted) !important;
}
body.dark .upload-preview img {
  background: #ffffff;
  border-radius: 14px;
}

/* Signature panel */
body.dark .sig-panel,
body.dark .add-first-sig {
  background: var(--card) !important;
  border: 1px solid rgba(148, 163, 184, 0.12) !important;
}
body.dark .sig-chips .sig-chip,
body.dark .sig-chip {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
}
body.dark .sig-chip.active {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}
body.dark .chip-del {
  background: var(--danger) !important;
  border-color: var(--card) !important;
}

/* Editor */
body.dark .editor-section {
  background: var(--card) !important;
}
body.dark .editor-header,
body.dark .editor-toolbar {
  background: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.12) !important;
}
body.dark .active-sig-preview {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
}
body.dark .no-active {
  color: var(--muted) !important;
}
body.dark .page-wrapper {
  background: #0f172a !important;
  border: 1px solid rgba(148, 163, 184, 0.12) !important;
  box-shadow: none !important;
}
body.dark #sigOverlay {
  background: transparent !important;
}
body.dark .placed-sig .sig-del-btn {
  background: var(--danger) !important;
  border-color: var(--card) !important;
}
body.dark .placed-sig .resize-handle {
  background: var(--primary) !important;
}
body.dark .placed-sig.selected {
  outline-color: var(--primary) !important;
}

/* Navigation */
body.dark .page-nav {
  background: #111827 !important;
  border-color: rgba(148, 163, 184, 0.12) !important;
}
body.dark .page-info strong {
  color: #ffffff !important;
}

/* Settings */
body.dark .settings,
body.dark .setting-card {
  background: var(--card) !important;
  border-color: rgba(148, 163, 184, 0.12) !important;
}
body.dark .setting-note {
  color: var(--muted-2) !important;
}

/* Progress */
body.dark .progress-wrap {
  background: #1e293b !important;
  border: 1px solid rgba(148, 163, 184, 0.12) !important;
}
body.dark .progress-bar {
  background: linear-gradient(90deg, #ef4444, #b91c1c) !important;
}
body.dark .progress-text {
  color: var(--muted) !important;
}

/* Small fixes */
body.dark hr,
body.dark .toolbar-divider,
body.dark .modal-footer,
body.dark .modal-header {
  border-color: rgba(148, 163, 184, 0.12) !important;
}
body.dark ::placeholder {
  color: #64748b !important;
}
body.dark input[type="file"] {
  color: var(--muted) !important;
}

/* Scrollbar */
body.dark ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
body.dark ::-webkit-scrollbar-track {
  background: #0f162a;
}
body.dark ::-webkit-scrollbar-thumb {
  background: #283552;
  border-radius: 999px;
}
body.dark ::-webkit-scrollbar-thumb:hover {
  background: #34456a;
}

@media (max-width: 600px) {
  .page-container {
    padding-left: 0px !important;
    padding-right: 0px !important;
    padding-top: 0px !important;
  }
}
