/* SmokePDF — Edit PDF editor */
.ep-wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px 48px; }
.ep-features { display: flex; flex-wrap: wrap; gap: 8px 10px; justify-content: center; margin: 18px 0 0; padding: 0; list-style: none; }
.ep-features li { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--dark2, #334155); background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 999px; padding: 6px 12px; }
.ep-features li svg { width: 16px; height: 16px; color: var(--primary, #4f46e5); }
#epUpload { max-width: 820px; margin: 0 auto; }
#epStatus { max-width: 820px; margin: 12px auto 0; display: none; }
#epStatus a { color: inherit; font-weight: 700; text-decoration: underline; }

.ep-editor { scroll-margin-top: 84px; --ep-bar: #ffffff; --ep-line: #e2e8f0; --ep-bg: #eef1f6; background: var(--ep-bar); border: 1px solid var(--ep-line); border-radius: 16px; box-shadow: var(--shadow-md, 0 10px 30px -4px rgba(79,70,229,.1)); overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 96px); max-height: 1000px; min-height: 520px; }
.ep-editor.ep-fs, .ep-editor:fullscreen { position: fixed; inset: 0; height: 100vh; border-radius: 0; z-index: 9999; border: 0; }
.ep-topbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--ep-line); flex-wrap: wrap; }
.ep-file { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--dark, #0f172a); min-width: 0; max-width: 260px; }
.ep-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-file svg { width: 18px; height: 18px; color: #dc2626; flex: none; }
.ep-group { display: flex; align-items: center; gap: 2px; padding-inline-start: 8px; border-inline-start: 1px solid var(--ep-line); }
.ep-group.ep-end { margin-inline-start: auto; border: 0; gap: 6px; }
.ep-zoom { min-width: 48px; text-align: center; font-size: 13px; font-weight: 700; color: var(--dark2, #334155); direction: ltr; }
.ep-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; min-width: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--dark2, #334155); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.ep-btn:hover:not(:disabled) { background: #f1f5f9; color: var(--dark, #0f172a); }
.ep-btn:disabled { opacity: .35; cursor: default; }
.ep-btn svg { width: 18px; height: 18px; }
.ep-btn.on { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.ep-btn-text { padding: 0 10px; border-color: var(--ep-line); }
.ep-primary { background: var(--primary, #4f46e5); color: #fff !important; padding: 0 14px; border: 0; }
.ep-primary:hover:not(:disabled) { background: var(--primary-dark, #3730a3) !important; }
.ep-danger { color: #b91c1c; }
.ep-danger:hover:not(:disabled) { background: #fef2f2 !important; color: #991b1b !important; }

.ep-toolbar { display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--ep-line); overflow-x: auto; scrollbar-width: thin; background: #fbfcfe; }
.ep-tool { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; padding: 6px 6px 5px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--dark2, #334155); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ep-tool svg { width: 20px; height: 20px; }
.ep-tool:hover { background: #f1f5f9; }
.ep-tool.active { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }

.ep-propbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 7px 12px; min-height: 48px; border-bottom: 1px solid var(--ep-line); font-size: 13px; color: var(--dark2, #334155); }
.ep-phint { color: var(--gray, #64748b); font-size: 12.5px; line-height: 1.7; }
.ep-phint .ep-note { display: block; }
.ep-propbar label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.ep-propbar select, .ep-propbar input[type=number] { height: 32px; border: 1px solid var(--ep-line); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; background: #fff; color: inherit; }
.ep-propbar input[type=number] { width: 72px; direction: ltr; }
.ep-propbar input[type=range] { width: 110px; accent-color: var(--primary, #4f46e5); }
.ep-colors { display: inline-flex; align-items: center; gap: 4px; }
.ep-sw { width: 22px; height: 22px; border-radius: 999px; border: 1px solid rgba(15,23,42,.18); cursor: pointer; padding: 0; box-shadow: inset 0 0 0 2px #fff; }
.ep-sw.on { outline: 2px solid var(--primary, #4f46e5); outline-offset: 1px; }
.ep-colors input[type=color] { width: 28px; height: 26px; border: 1px solid var(--ep-line); border-radius: 6px; padding: 1px; background: #fff; cursor: pointer; }
.ep-sep { width: 1px; height: 24px; background: var(--ep-line); }

.ep-body { flex: 1; display: flex; min-height: 0; }
.ep-thumbs { width: 168px; flex: none; overflow-y: auto; padding: 10px; border-inline-end: 1px solid var(--ep-line); background: #fbfcfe; }
.ep-thumbs-title { font-size: 12.5px; font-weight: 800; color: var(--gray, #64748b); margin: 0 2px 8px; }
.ep-thumb { position: relative; padding: 6px; border-radius: 10px; cursor: pointer; margin-bottom: 6px; }
.ep-thumb:hover { background: #f1f5f9; }
.ep-thumb-img { display: flex; align-items: center; justify-content: center; height: 132px; }
.ep-thumb-img canvas { box-shadow: 0 1px 4px rgba(15,23,42,.18); background: #fff; transition: transform .2s; }
.ep-thumb-num { text-align: center; font-size: 12px; font-weight: 700; color: var(--gray, #64748b); margin-top: 4px; }
.ep-thumb-acts { position: absolute; top: 4px; inset-inline-start: 4px; display: none; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--ep-line); border-radius: 8px; padding: 2px; box-shadow: 0 4px 12px rgba(15,23,42,.12); }
.ep-thumb:hover .ep-thumb-acts, .ep-thumb:focus-within .ep-thumb-acts { display: flex; }
.ep-thumb-acts button { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--dark2, #334155); }
.ep-thumb-acts button:hover:not(:disabled) { background: #eef2ff; color: #4338ca; }
.ep-thumb-acts button:disabled { opacity: .3; }
.ep-thumb-acts svg { width: 15px; height: 15px; }

.ep-viewport { flex: 1; overflow: auto; background: var(--ep-bg); padding: 20px; min-width: 0; direction: ltr; }
.ep-pages { display: flex; flex-direction: column; align-items: center; gap: 22px; direction: ltr; min-width: min-content; }
.ep-slot { position: relative; flex: none; }
.ep-page { position: absolute; left: 50%; top: 50%; background: #fff; box-shadow: 0 2px 10px rgba(15,23,42,.14); transform-origin: center; }
.ep-page canvas { display: block; }
.ep-layer { position: absolute; inset: 0; touch-action: pan-x pan-y; }
.ep-editor:not([data-tool="select"]):not([data-tool="edittext"]) .ep-layer, .ep-obj { touch-action: none; }
.ep-pnum { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 11.5px; font-weight: 700; color: #64748b; }
.ep-editor[data-tool="select"] .ep-layer { cursor: default; }
.ep-editor[data-tool="text"] .ep-layer, .ep-editor[data-tool="date"] .ep-layer { cursor: text; }
.ep-editor:not([data-tool="select"]):not([data-tool="text"]):not([data-tool="date"]):not([data-tool="edittext"]) .ep-layer { cursor: crosshair; }

.ep-obj { position: absolute; box-sizing: border-box; }
.ep-obj svg { display: block; overflow: visible; pointer-events: none; }
.ep-obj img { display: block; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.ep-highlight { opacity: .45; mix-blend-mode: multiply; }
.ep-text { white-space: pre; }
.ep-tx-in { white-space: pre; outline: none; min-width: 4px; }
.ep-tx-in[data-ph]:empty::before { content: attr(data-ph); color: #94a3b8; }
.ep-editor[data-tool="select"] .ep-obj, .ep-editor[data-tool="edittext"] .ep-obj { cursor: move; }
.ep-obj.selected { outline: 1.5px solid var(--primary, #4f46e5); outline-offset: 2px; }
.ep-obj.editing { outline: 1.5px dashed var(--primary, #4f46e5); cursor: text !important; background: rgba(255,255,255,.35); }
.ep-h { position: absolute; width: 11px; height: 11px; background: #fff; border: 2px solid var(--primary, #4f46e5); border-radius: 3px; z-index: 2; }
.ep-h-nw { left: -8px; top: -8px; cursor: nwse-resize; } .ep-h-se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.ep-h-ne { right: -8px; top: -8px; cursor: nesw-resize; } .ep-h-sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.ep-hp { transform: translate(-50%, -50%); border-radius: 999px; cursor: move; }
.ep-line { position: absolute; display: none; border-radius: 3px; cursor: text; }
.ep-editor[data-tool="edittext"] .ep-line { display: block; outline: 1px dashed rgba(79,70,229,.35); }
.ep-editor[data-tool="edittext"] .ep-line:hover { outline: 2px solid var(--primary, #4f46e5); background: rgba(79,70,229,.08); }

.ep-note { display: block; color: #92400e; }
.ep-note a { color: inherit; font-weight: 700; }

.ep-modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10000; }
.ep-dialog { background: #fff; border-radius: 16px; width: min(620px, 100%); max-height: 92vh; overflow: auto; padding: 16px 18px; box-shadow: 0 20px 60px rgba(15,23,42,.3); }
.ep-dialog-wide { width: min(720px, 100%); }
.ep-dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 16px; }
.ep-dlg-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.ep-tabs { display: flex; gap: 4px; background: #f1f5f9; padding: 4px; border-radius: 10px; margin-bottom: 12px; }
.ep-tabs button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; color: #475569; }
.ep-tabs button.on { background: #fff; color: #4338ca; box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.ep-pad { width: 100%; height: auto; aspect-ratio: 560 / 200; border: 1.5px dashed #cbd5e1; border-radius: 12px; touch-action: none; cursor: crosshair; background: #fff; }
.ep-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ep-sig-name { width: 100%; height: 44px; border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 16px; }
.ep-sig-fonts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.ep-sig-fonts button { height: 70px; border: 1.5px solid var(--border, #e2e8f0); border-radius: 12px; background: #fff; font-size: 26px; cursor: pointer; overflow: hidden; white-space: nowrap; }
.ep-sig-fonts button.on { border-color: var(--primary, #4f46e5); background: #f5f3ff; }
.ep-check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13.5px; font-weight: 600; }
.ep-fields { display: grid; gap: 10px; max-height: 56vh; overflow: auto; }
.ep-field { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 10px; align-items: center; font-size: 13px; }
.ep-field span { font-weight: 700; color: #334155; word-break: break-word; }
.ep-field input[type=text], .ep-field textarea, .ep-field select { width: 100%; border: 1px solid var(--border, #e2e8f0); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; }

@media (max-width: 860px) {
  .ep-thumbs { display: none; }
  .ep-editor { height: calc(100vh - 84px); min-height: 460px; border-radius: 12px; }
  .ep-wrap { padding: 0 8px 32px; }
  .ep-hide-sm { display: none; }
  .ep-file { max-width: 140px; }
  .ep-viewport { padding: 12px 8px; }
  .ep-group { padding-inline-start: 4px; }
}
@media (max-width: 520px) {
  .ep-topbar { gap: 4px; padding: 6px; }
  .ep-group.ep-end { margin-inline-start: 0; width: 100%; justify-content: flex-end; }
  .ep-group.ep-end .ep-primary { flex: 1; }
  .ep-file { max-width: 100%; flex: 1 1 100%; }
  .ep-tool { min-width: 56px; font-size: 10.5px; }
}

/* ---- start screen */
#epUpload { max-width: 980px; margin: 0 auto; }
.ep-start { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ep-start-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 30px 22px; min-height: 230px; border-radius: 18px; background: #fff; border: 1.5px solid var(--border, #e2e8f0); box-shadow: var(--shadow, 0 4px 20px -2px rgba(79,70,229,.06)); }
.ep-start-card strong { font-size: 1.15rem; color: var(--dark, #0f172a); }
.ep-start-card small { color: var(--gray, #64748b); font-size: .93rem; line-height: 1.7; max-width: 360px; }
.ep-start-new { border-color: #c7d2fe; background: linear-gradient(180deg, #f5f3ff, #fff 60%); }
.ep-start-ic { font-size: 40px; line-height: 1; }
.ep-start-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.ep-start-row select { height: 44px; border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 0 10px; font: inherit; font-size: 14px; background: #fff; }
.ep-start-row .btn { height: 44px; }
.ep-start-card.upload-zone { margin: 0; cursor: pointer; border-style: dashed; }
.ep-resume { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1.5px solid #bbf7d0; border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; }
.ep-resume[hidden] { display: none; }
.ep-resume > div { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.ep-resume small { color: var(--gray, #64748b); }
.ep-resume-ic { font-size: 26px; }
.ep-link { background: none; border: 0; color: #b91c1c; font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }

/* ---- top bar extras */
.ep-file { border: 0; background: transparent; cursor: pointer; font: inherit; padding: 4px 6px; border-radius: 8px; }
.ep-file:hover { background: #f1f5f9; }
.ep-file svg:last-child { width: 14px; height: 14px; color: #94a3b8; }
.ep-saved { font-size: 12px; color: #16a34a; font-weight: 700; opacity: 0; transition: opacity .3s; }
.ep-saved.on { opacity: 1; }
.ep-menu { position: relative; }
.ep-menu-list { display: none; position: absolute; top: calc(100% + 4px); inset-inline-start: 0; min-width: 230px; background: #fff; border: 1px solid var(--ep-line); border-radius: 12px; box-shadow: 0 12px 30px rgba(15,23,42,.14); padding: 6px; z-index: 50; }
.ep-menu.open .ep-menu-list { display: block; }
.ep-menu-list button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; color: var(--dark2, #334155); cursor: pointer; text-align: start; }
.ep-menu-list button:hover { background: #eef2ff; color: #4338ca; }
.ep-menu-list svg { width: 18px; height: 18px; }
.ep-btn svg + span + svg { width: 14px; height: 14px; }

/* ---- properties bar extras */
.ep-seg { display: inline-flex; border: 1px solid var(--ep-line); border-radius: 9px; overflow: hidden; }
.ep-seg .ep-btn { border-radius: 0; height: 32px; }

/* ---- text boxes */
.ep-obj.editing .ep-tx-in { white-space: pre-wrap; overflow-wrap: anywhere; }
.ep-h-e { right: -8px; top: 50%; margin-top: -6px; cursor: ew-resize; border-radius: 999px; }
.ep-h-w { left: -8px; top: 50%; margin-top: -6px; cursor: ew-resize; border-radius: 999px; }
.ep-form { display: grid; gap: 12px; }
.ep-form label { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.ep-form input[type=text], .ep-form input[type=number], .ep-form select { height: 40px; border: 1px solid var(--border, #e2e8f0); border-radius: 9px; padding: 0 10px; font: inherit; }
.ep-form input[type=color] { height: 36px; width: 60px; border: 1px solid var(--border, #e2e8f0); border-radius: 8px; padding: 2px; }

@media (max-width: 860px) {
  .ep-features li:nth-child(n+5) { display: none; }
  .ep-start { grid-template-columns: 1fr; }
  .ep-start-card { min-height: 0; padding: 22px 16px; }
  .ep-menu .ep-btn-text span { display: none; }
  .ep-form label { grid-template-columns: 1fr; gap: 4px; }
}
