/* ===== PDF Tools — shared styles (preetitounicode.com) ===== */
.pdft-wrap { --pa: #d9362b; --pa2: #b62a21; --ink: #1f2937; --muted: #5b6b7b; max-width: 880px; margin: 0 auto; padding: 28px 16px 8px; }
.pdft-wrap * { box-sizing: border-box; }

.pdft-hero { text-align: center; margin-bottom: 22px; }
.pdft-hero .pdft-ic { width: 56px; height: 56px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--pa), var(--pa2)); color: #fff; font-size: 24px; margin-bottom: 12px; }
.pdft-hero h1 { font-size: 28px; line-height: 1.2; color: var(--ink); margin: 0 0 8px; }
.pdft-hero p { font-size: 15px; color: var(--muted); margin: 0; }

.pdft-card { background: #fff; border: 1px solid #e7eef3; border-radius: 16px; box-shadow: 0 8px 30px rgba(31,50,67,.07); padding: 22px; }

/* dropzone */
.pdft-zone { border: 2px dashed #cdd9e3; border-radius: 14px; background: #fafcfe; padding: 38px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.pdft-zone:hover, .pdft-zone.is-drag { border-color: var(--pa); background: #fff5f4; }
.pdft-zone .z-ic { font-size: 38px; color: var(--pa); margin-bottom: 10px; }
.pdft-zone .z-t { font-size: 16px; font-weight: 700; color: var(--ink); }
.pdft-zone .z-s { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pdft-zone .z-btn { display: inline-block; margin-top: 14px; padding: 9px 20px; border-radius: 999px; background: var(--pa); color: #fff; font-size: 14px; font-weight: 600; }

/* compact dropzone once a file is loaded */
.pdft-card.has-file .pdft-zone { display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-align: left; }
.pdft-card.has-file .pdft-zone .z-ic { font-size: 18px; margin: 0; }
.pdft-card.has-file .pdft-zone .z-t { font-size: 13.5px; }
.pdft-card.has-file .pdft-zone .z-s { display: none; }
.pdft-card.has-file .pdft-zone .z-btn { margin: 0 0 0 auto; padding: 7px 15px; font-size: 13px; white-space: nowrap; }

/* file list */
.pdft-list { margin: 16px 0 0; display: flex; flex-direction: column; gap: 9px; }
.pdft-file { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid #e7eef3; border-radius: 11px; background: #fbfdff; }
.pdft-file[draggable="true"] { cursor: grab; }
.pdft-file.dragging { opacity: .4; }
.pdft-file.drop-target { border-color: var(--pa); box-shadow: 0 -2px 0 var(--pa) inset; }
.pdft-grip { color: #b3c0cf; font-size: 14px; flex: 0 0 auto; cursor: grab; }
.pdft-grip:active { cursor: grabbing; }
.pdft-file-ic { color: var(--pa); font-size: 18px; flex: 0 0 auto; }
.pdft-file-thumb { width: 40px; height: 52px; object-fit: cover; border: 1px solid #e2e9ef; border-radius: 4px; flex: 0 0 auto; background: #fff; }
.pdft-file-name { flex: 1 1 auto; font-size: 14px; color: var(--ink); font-weight: 600; word-break: break-all; }
.pdft-file-size { font-size: 12.5px; color: var(--muted); flex: 0 0 auto; }
.pdft-file-acts { display: flex; gap: 5px; flex: 0 0 auto; }
.pdft-file-acts button { width: 30px; height: 30px; border: 1px solid #dce6ec; background: #fff; border-radius: 8px; cursor: pointer; color: #5b7286; font-size: 14px; line-height: 1; transition: background .15s, border-color .15s, color .15s; }
.pdft-file-acts button:hover { background: #f0f5f9; }
.pdft-file-acts button[data-act="del"]:hover { background: #fdecea; border-color: #e6a6a2; color: #d9362b; }

/* options */
.pdft-opts { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.pdft-field { display: flex; flex-direction: column; gap: 5px; }
.pdft-field label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.pdft-field input, .pdft-field select { padding: 9px 11px; border: 1.5px solid #dce6ec; border-radius: 9px; font-size: 14px; color: var(--ink); background: #fff; width: 100%; }
.pdft-field .hint { font-size: 11.5px; color: #93a2b1; }
.pdft-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 14px; }
.pdft-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink); cursor: pointer; }

/* stacked panel (e.g. Protect) — even spacing between items */
.pdft-stack { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.pdft-stack > .pdft-go { margin-top: 0; }
.pdft-stack > .pdft-result, .pdft-stack > .pdft-note { margin-top: 0; }

/* action button + result */
.pdft-go { margin-top: 18px; width: 100%; padding: 14px 22px; border: none; border-radius: 12px; background: var(--pa); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px; transition: background .15s, transform .12s, opacity .15s; }
.pdft-go:hover:not(:disabled) { background: var(--pa2); transform: translateY(-1px); }
.pdft-go:disabled { opacity: .5; cursor: not-allowed; }
.pdft-result { display: none; margin-top: 14px; padding: 12px 15px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.pdft-result.ok { background: #e9f9f1; color: #1c7a4f; border: 1px solid #bfe9d4; }
.pdft-result.err { background: #fdecea; color: #b62a21; border: 1px solid #f0c8c6; }
.pdft-progress { display: none; margin-top: 12px; height: 8px; background: #eef3f7; border-radius: 999px; overflow: hidden; }
.pdft-progress i { display: block; height: 100%; width: 0; background: var(--pa); transition: width .2s; }

/* watermark: two-column controls + live preview */
.pdft-wm { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 16px; }
.pdft-wm-controls { display: flex; flex-direction: column; gap: 30px; }
.pdft-seg { display: flex; gap: 6px; background: #eef3f7; border-radius: 11px; padding: 4px; }
.pdft-seg button { flex: 1; padding: 9px 10px; border: none; background: transparent; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: #5b7286; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background .15s, color .15s, box-shadow .15s; }
.pdft-seg button.is-on { background: #fff; color: var(--pa); box-shadow: 0 2px 8px rgba(31,50,67,.1); }
.pdft-upload { display: inline-flex; align-items: center; gap: 9px; padding: 11px 14px; border: 1.5px dashed #cdd9e3; border-radius: 10px; background: #fafcfe; color: #46586a; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.pdft-upload:hover { border-color: var(--pa); background: #fff5f4; }
.pdft-wm-preview { background: #f3f6f9; border: 1px solid #e7eef3; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; }
.wm-prev-label { font-size: 12px; font-weight: 700; color: #8a9bab; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.wm-prev-canvas { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 16px; min-height: 240px; max-height: 600px; overflow-y: auto; padding: 4px; }
.wm-prev-page { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.wm-prev-page canvas { max-width: 100%; box-shadow: 0 6px 22px rgba(31,50,67,.14); border-radius: 3px; background: #fff; }
.wm-prev-page .pno { font-size: 11px; color: #93a2b1; font-weight: 600; }
.wm-prev-canvas .wm-prev-more { font-size: 12.5px; color: #8a9bab; padding: 8px; text-align: center; }

/* range sliders */
.pdft-field input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: #e0e9f0; outline: none; padding: 0; border: none; }
.pdft-field input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--pa); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.pdft-field input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: none; border-radius: 50%; background: var(--pa); cursor: pointer; }
.pdft-field label b { color: var(--pa); }

@media (max-width: 680px) { .pdft-wm { grid-template-columns: 1fr; } .pdft-wm-preview { order: -1; } }

/* page thumbnail grid (organize) */
.pdft-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.pdft-page { position: relative; border: 1px solid #e2e9ef; border-radius: 10px; background: #fff; padding: 8px; text-align: center; cursor: grab; }
.pdft-page.dragging { opacity: .4; }
.pdft-page.drop-target { outline: 2px dashed var(--pa); }
.pdft-page canvas, .pdft-page img { width: 100%; height: auto; border: 1px solid #eef2f6; border-radius: 5px; transition: transform .2s; position: relative; z-index: 1; }
.pdft-page .p-no { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.pdft-page .p-acts { position: absolute; top: 5px; right: 5px; display: flex; gap: 4px; z-index: 3; }
.pdft-page .p-acts button { width: 26px; height: 26px; border: none; border-radius: 7px; background: rgba(31,41,55,.78); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; }
.pdft-page .p-acts button:hover { background: var(--pa); }
.pdft-page.del { opacity: .35; }
.pdft-page.del canvas { filter: grayscale(1); }

/* secondary toolbar */
.pdft-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 6px; }
.pdft-bar .pdft-meta { font-size: 13px; color: var(--muted); }
.pdft-mini { padding: 7px 14px; border: 1px solid #dce6ec; background: #fff; border-radius: 9px; font-size: 13px; font-weight: 600; color: #46586a; cursor: pointer; }
.pdft-mini:hover { background: #f0f5f9; }

/* SEO content */
.pdft-content { max-width: 880px; margin: 26px auto 0; padding: 0 16px; }
.pdft-content h2 { font-size: 21px; color: var(--ink); margin: 26px 0 10px; }
.pdft-content h3 { font-size: 16px; color: var(--ink); margin: 18px 0 6px; }
.pdft-content p { font-size: 15px; line-height: 1.7; color: #44525f; margin: 0 0 12px; }
.pdft-content ul { margin: 0 0 14px; padding-left: 20px; }
.pdft-content li { font-size: 15px; line-height: 1.7; color: #44525f; margin-bottom: 6px; }
.pdft-privacy { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 13px; color: #1c7a4f; background: #e9f9f1; border: 1px solid #bfe9d4; border-radius: 999px; padding: 7px 14px; }

/* PDF editor */
.pdft-wide { max-width: 1000px; }
.pdft-edit-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 14px; padding: 10px 12px; background: #f3f6f9; border: 1px solid #e7eef3; border-radius: 12px; }
.pdft-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.pdft-tools button { width: 38px; height: 38px; border: 1px solid #dce6ec; background: #fff; border-radius: 9px; cursor: pointer; color: #46586a; font-size: 15px; transition: background .15s, color .15s, border-color .15s; }
.pdft-tools button:hover { background: #eef5fa; }
.pdft-tools button.is-on { background: var(--pa); color: #fff; border-color: var(--pa); }
.pdft-tool-opts { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pdft-tool-opts .t-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #5b7286; font-weight: 600; }
.pdft-tool-opts input[type="color"] { width: 30px; height: 30px; padding: 0; border: 1px solid #dce6ec; border-radius: 7px; cursor: pointer; }
.pdft-tool-opts input[type="number"] { padding: 6px 8px; border: 1.5px solid #dce6ec; border-radius: 8px; font-size: 13px; }

.pdft-stage-wrap { margin-top: 14px; max-height: 70vh; overflow: auto; background: #eef1f5; border-radius: 12px; padding: 18px; display: flex; justify-content: center; }
.pdft-stage { position: relative; box-shadow: 0 8px 30px rgba(31,50,67,.16); line-height: 0; }
.pdft-stage canvas { display: block; }
#pdft_bg { position: relative; z-index: 0; background: #fff; }
#pdft_draw { position: absolute; left: 0; top: 0; z-index: 1; }
#pdft_anno { position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 2; }
.pdft-stage.tool-draw #pdft_anno, .pdft-stage.tool-white #pdft_anno, .pdft-stage.tool-text #pdft_anno, .pdft-stage.tool-image #pdft_anno { cursor: crosshair; }
.anno-text { position: absolute; min-width: 24px; outline: none; line-height: 1.2; white-space: pre-wrap; cursor: move; padding: 1px 2px; }
.anno-text.editing { background: rgba(255,255,255,.7); box-shadow: 0 0 0 1.5px var(--pa); cursor: text; }
.anno-img { position: absolute; cursor: move; }
.anno-img img { width: 100%; height: 100%; display: block; }
.anno-img .a-handle { position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px; background: var(--pa); border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; }
.anno-sel { box-shadow: 0 0 0 1.5px var(--pa); }
.anno-del { position: absolute; top: -10px; right: -10px; width: 20px; height: 20px; border-radius: 50%; background: #d9362b; color: #fff; border: none; font-size: 12px; line-height: 1; cursor: pointer; display: none; }
.anno-sel > .anno-del, .anno-img:hover .anno-del, .anno-text:hover ~ .anno-del { display: block; }
.pdft-nav { display: inline-flex; align-items: center; gap: 10px; }

/* OCR output */
.pdft-ocrout textarea { width: 100%; min-height: 240px; resize: vertical; border: 1.5px solid #dce6ec; border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.6; color: #1f3243; background: #fbfdff; font-family: inherit; }
.pdft-status { display: block; }

/* hub grid */
.pdft-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 8px; }
.pdft-hub-card { display: flex; gap: 13px; align-items: flex-start; padding: 18px; background: #fff; border: 1px solid #e7eef3; border-radius: 14px; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.pdft-hub-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(31,50,67,.1); border-color: #d9c2c0; }
.pdft-hub-card .h-ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--pa), var(--pa2)); color: #fff; font-size: 18px; }
.pdft-hub-card > span:last-child { display: flex; flex-direction: column; }
.pdft-hub-card .h-t { display: block; font-size: 15.5px; font-weight: 700; color: var(--ink); }
.pdft-hub-card .h-d { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.45; }

/* cross-tool nav */
.pdft-related { max-width: 880px; margin: 22px auto 0; padding: 0 16px; }
.pdft-related-h { display: block; font-size: 12px; font-weight: 700; color: #8a9bab; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 9px; }
.pdft-other-all { background: var(--pa) !important; color: #fff !important; border-color: var(--pa) !important; }
.pdft-other { margin-top: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pdft-other a { font-size: 13px; color: #46586a; background: #f1f5f8; border: 1px solid #e2e9ef; border-radius: 999px; padding: 6px 13px; text-decoration: none; }
.pdft-other a:hover { background: var(--pa); color: #fff; border-color: var(--pa); }

@media (max-width: 560px) {
  .pdft-hero h1 { font-size: 23px; }
  .pdft-card { padding: 16px; }
  .pdft-zone { padding: 28px 14px; }
}
