:root{--bg:#fff;--panel:#eef4ff;--line:#ccd7e6;--text:#17233b;--muted:#66758a;--primary:#2468d8;--primary-dark:#1853b2;--success:#138a4b;--danger:#c63d4f}
*{box-sizing:border-box}html,body{min-height:100%}body{padding:12px;background:#fff}.app-shell{border:1px solid var(--line);box-shadow:0 8px 24px rgba(24,55,96,.09)}
.topbar{min-height:66px;padding:12px 18px;display:flex;align-items:center;justify-content:space-between;gap:14px;background:var(--panel);border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:10px}.brand-dot{width:13px;height:13px;border-radius:50%;background:#2b74df;box-shadow:0 0 0 6px rgba(43,116,223,.12)}
.eyebrow{color:#315f9f;font-weight:800;letter-spacing:.17em;font-size:10px}.topbar h1{font-size:22px;line-height:1.15;margin:2px 0 0}.stats{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.stats span{background:white;border:1px solid #cbd7e6;border-radius:999px;padding:6px 10px;font-size:11px;color:#12233e}
.play-area{position:relative;padding:18px;min-height:330px}.tool-tabs{display:flex;flex-wrap:wrap;gap:8px;overflow:visible;padding-bottom:4px}.tab{border:1px solid #d3ddeb;background:#fff;color:#34445f;border-radius:10px;padding:9px 12px;cursor:pointer;white-space:nowrap;font-weight:700;font-size:12px}.tab.active{color:#fff;background:var(--primary);border-color:var(--primary)}
.hero-panel{text-align:center;padding:24px 10px 14px}.overlay-icon{color:#2bbb6d;font-size:26px;line-height:1}.hero-panel h2{font-size:22px;margin:4px 0 6px}.hero-panel p{margin:0;color:var(--muted);font-size:14px}
.tool-panel{display:none;width:min(620px,100%);margin:10px auto 6px;text-align:center}.tool-panel.active{display:block}.dropzone{min-height:120px;border:2px dashed #cfd9e7;border-radius:14px;background:#fafcff;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px;cursor:pointer;transition:border-color .18s ease,background .18s ease,box-shadow .18s ease}.dropzone:hover{border-color:#8cb2ee;background:#f5f9ff}.dropzone.has-file{border-style:solid;border-color:#58b984;background:#f3fff8;box-shadow:0 0 0 3px rgba(19,138,75,.07)}.dropzone.has-file strong{color:#137a45;max-width:92%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropzone.has-file span{color:#557565}.dropzone input{display:none}.dropzone strong{font-size:16px}.dropzone span{margin-top:7px;color:var(--muted);font-size:12px;max-width:94%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.field{display:block;margin:14px 0;text-align:left;font-size:12px;font-weight:700;color:#33425b}.field input,.field select{width:100%;margin-top:6px;border:1px solid #ccd7e6;border-radius:10px;padding:11px 12px;background:#fff;color:var(--text);outline:none}.field-grid{display:grid;grid-template-columns:1fr 150px;gap:12px}.primary-btn{border:none;border-radius:999px;min-width:150px;padding:13px 24px;background:var(--primary);color:#fff;font-weight:800;cursor:pointer;box-shadow:0 8px 18px rgba(36,104,216,.22)}.primary-btn:hover{background:var(--primary-dark)}.primary-btn:disabled{opacity:.55;cursor:not-allowed;box-shadow:none}.message{min-height:26px;text-align:center;font-size:13px;margin-top:12px;color:var(--muted)}.message.ok{color:var(--success)}.message.err{color:var(--danger)}
@media(max-width:700px){body{padding:0}.app-shell{border-left:0;border-right:0;box-shadow:none}.topbar{align-items:flex-start}.stats{max-width:44%}.play-area{padding:14px}.field-grid{grid-template-columns:1fr}}
@media(max-width:480px){.topbar{padding:12px}.stats span:nth-child(2){display:none}.topbar h1{font-size:19px}}


/* PDF file thumbnails in Merge */
.merge-dropzone{min-height:140px;padding:18px;align-items:stretch;justify-content:flex-start}
.merge-dropzone .dropzone-summary{text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:74px}
.merge-dropzone .dropzone-summary strong{font-size:16px}
.merge-dropzone .dropzone-summary span{margin-top:7px;color:var(--muted);font-size:12px;max-width:94%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pdf-preview-grid{display:none;width:100%;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:12px;margin-top:12px}
.merge-dropzone.has-file .pdf-preview-grid{display:grid}
.pdf-preview-card{position:relative;min-width:0;background:#fff;border:1px solid #cfe0d7;border-radius:11px;padding:8px;box-shadow:0 3px 9px rgba(23,58,42,.06);text-align:left}
.pdf-thumb-wrap{height:132px;border:1px solid #e3e8ef;border-radius:7px;background:#f5f6f8;display:flex;align-items:center;justify-content:center;overflow:hidden}
.pdf-thumb-wrap canvas{display:block;max-width:100%;max-height:100%;width:auto;height:auto;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.09)}
.pdf-thumb-loading{font-size:11px;color:#7b8799;text-align:center;padding:10px}
.pdf-preview-name{margin-top:7px;font-size:11px;font-weight:800;color:#23334d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pdf-preview-meta{margin-top:3px;font-size:10px;color:#6b7b8f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pdf-preview-index{position:absolute;top:12px;left:12px;z-index:2;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:rgba(36,104,216,.92);color:#fff;font-size:10px;font-weight:800;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 6px rgba(36,104,216,.25)}
@media(max-width:520px){.pdf-preview-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.pdf-thumb-wrap{height:116px}.merge-dropzone{padding:12px}}

/* Universal PDF thumbnails */
.pdf-dropzone{min-height:140px;padding:18px;align-items:stretch;justify-content:flex-start}
.pdf-dropzone .dropzone-summary{text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:72px}
.pdf-dropzone .dropzone-summary strong{font-size:16px;max-width:94%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pdf-dropzone .dropzone-summary span{margin-top:7px;color:var(--muted);font-size:12px;max-width:94%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pdf-dropzone.has-file .dropzone-summary strong{color:#137a45}
.pdf-dropzone.has-file .dropzone-summary span{color:#557565}
.pdf-dropzone.has-file .pdf-preview-grid{display:grid}
.pdf-preview-grid.single-preview{grid-template-columns:minmax(150px,190px);justify-content:center}
.pdf-preview-open{margin-top:5px;font-size:10px;font-weight:700;color:#2468d8;text-align:center}
.pdf-preview-card{cursor:zoom-in;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
.pdf-preview-card:hover{transform:translateY(-2px);border-color:#8fb4ed;box-shadow:0 6px 16px rgba(36,104,216,.13)}
.pdf-preview-card:focus-visible{outline:3px solid rgba(36,104,216,.22);outline-offset:2px}

/* Quick PDF viewer */
body.preview-open{overflow:hidden}
.pdf-modal{position:fixed;inset:0;z-index:99999;display:none;align-items:center;justify-content:center;padding:18px}
.pdf-modal.open{display:flex}
.pdf-modal-backdrop{position:absolute;inset:0;background:rgba(18,31,49,.58);backdrop-filter:blur(2px)}
.pdf-modal-dialog{position:relative;width:min(780px,94vw);max-height:92vh;background:#fff;border:1px solid #d5dfec;border-radius:16px;box-shadow:0 24px 70px rgba(9,24,44,.34);overflow:hidden;display:flex;flex-direction:column}
.pdf-modal-header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 16px;background:#eef4ff;border-bottom:1px solid #ccd7e6}
.pdf-modal-title-wrap{min-width:0;display:flex;flex-direction:column;gap:3px;text-align:left}
.pdf-modal-title-wrap strong{font-size:15px;color:#15233b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:660px}
.pdf-modal-title-wrap span{font-size:11px;color:#66758a}
.preview-close{width:34px;height:34px;flex:0 0 34px;border:1px solid #cbd7e6;border-radius:50%;background:#fff;color:#23334d;font-size:22px;line-height:1;cursor:pointer}
.preview-close:hover{background:#f6f9fe}
.pdf-modal-toolbar{min-height:48px;display:flex;align-items:center;justify-content:center;gap:14px;padding:8px 12px;border-bottom:1px solid #edf1f6;background:#fff}
.pdf-modal-toolbar button{border:1px solid #ccd7e6;border-radius:9px;background:#fff;color:#263751;padding:8px 12px;font-weight:700;font-size:12px;cursor:pointer}
.pdf-modal-toolbar button:hover:not(:disabled){border-color:#87ace4;background:#f5f9ff}
.pdf-modal-toolbar button:disabled{opacity:.4;cursor:not-allowed}
#previewPageInfo{min-width:92px;text-align:center;font-size:12px;font-weight:800;color:#32445e}
.pdf-modal-stage{min-height:300px;max-height:68vh;padding:16px;overflow:visible;background:#e9edf3;display:flex;align-items:flex-start;justify-content:center}
.pdf-modal-stage canvas{display:block;max-width:100%;height:auto;background:#fff;box-shadow:0 4px 18px rgba(20,37,58,.18)}
.preview-loading,.preview-error{margin:auto;padding:30px;text-align:center;font-size:13px;color:#6f7d91}
.preview-error{color:#c63d4f}
.pdf-modal-hint{text-align:center;padding:8px 12px;font-size:10px;color:#7c899b;border-top:1px solid #edf1f6;background:#fff}

@media(max-width:520px){
  .pdf-dropzone{padding:12px}
  .pdf-preview-grid.single-preview{grid-template-columns:minmax(135px,175px)}
  .pdf-modal{padding:8px}
  .pdf-modal-dialog{width:97vw;max-height:95vh;border-radius:12px}
  .pdf-modal-header{padding:10px 12px}
  .pdf-modal-title-wrap strong{max-width:72vw}
  .pdf-modal-toolbar{gap:7px}
  .pdf-modal-toolbar button{padding:7px 9px;font-size:11px}
  .pdf-modal-stage{padding:10px;max-height:70vh}
}

/* Watermark / Crop / Password / Image-to-PDF additions */
.field input[type="number"],.field input[type="password"]{width:100%;margin-top:6px;border:1px solid #ccd7e6;border-radius:10px;padding:11px 12px;background:#fff;color:var(--text);outline:none}
.field input[type="number"]:focus,.field input[type="password"]:focus{border-color:#6ea2ec;box-shadow:0 0 0 3px rgba(36,104,216,.1)}
.field-grid.three-col{grid-template-columns:1fr 1fr 1fr}
.field-grid.four-col{grid-template-columns:repeat(4,1fr)}
.crop-help,.security-note{margin:12px 0 4px;text-align:center;font-size:11px;color:#6e7c90}
.security-note{padding:10px 12px;border:1px solid #d9e2ef;border-radius:10px;background:#f8fbff;line-height:1.45}
.image-dropzone{min-height:140px;padding:18px;align-items:stretch;justify-content:flex-start}
.image-dropzone .dropzone-summary{text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:72px}
.image-dropzone.has-file .dropzone-summary strong{color:#137a45}
.image-preview-grid{display:none;width:100%;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:12px;margin-top:12px}
.image-dropzone.has-file .image-preview-grid{display:grid}
.image-preview-card{position:relative;min-width:0;background:#fff;border:1px solid #cfe0d7;border-radius:11px;padding:8px;box-shadow:0 3px 9px rgba(23,58,42,.06);text-align:left}
.image-thumb-wrap{height:132px;border:1px solid #e3e8ef;border-radius:7px;background:#f5f6f8;display:flex;align-items:center;justify-content:center;overflow:hidden}
.image-thumb-wrap img{display:block;max-width:100%;max-height:100%;object-fit:contain}
@media(max-width:700px){.field-grid.three-col,.field-grid.four-col{grid-template-columns:repeat(2,1fr)}}
@media(max-width:520px){.image-preview-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.image-thumb-wrap{height:116px}.image-dropzone{padding:12px}.field-grid.three-col,.field-grid.four-col{grid-template-columns:1fr 1fr}}


/* SEO / accessibility content */
.skip-link{position:absolute;left:-9999px;top:8px;z-index:100000;background:#17233b;color:#fff;padding:9px 12px;border-radius:8px;text-decoration:none;font-weight:700}.skip-link:focus{left:8px}
.current-tool-title{margin-top:3px;font-size:12px;font-weight:700;color:#536985}
.seo-content{border-top:1px solid #e4eaf2;padding:28px 22px 30px;background:#fff;color:#24344d}
.seo-content h2{font-size:22px;line-height:1.25;margin:0 0 10px;color:#17233b}.seo-content h3{font-size:15px;line-height:1.3;margin:0 0 6px;color:#17233b}
.seo-content p,.seo-content li{font-size:14px;line-height:1.65;color:#5b6b81}.seo-intro{max-width:720px;margin:0 auto 22px}.seo-intro p{margin:8px 0}
.seo-feature-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:760px;margin:0 auto 26px}.seo-feature-grid article{border:1px solid #dbe4ef;border-radius:12px;padding:14px;background:#fafcff}.seo-feature-grid p{margin:0}
.how-it-works,.privacy-box,.faq-section{max-width:760px;margin:24px auto 0}.how-it-works ol{margin:8px 0 0;padding-left:22px}.privacy-box{padding:16px 18px;border:1px solid #d5e3f4;border-radius:12px;background:#f7fbff}.privacy-box p{margin:0}
.faq-section details{border-top:1px solid #e3e8ef;padding:12px 0}.faq-section details:last-child{border-bottom:1px solid #e3e8ef}.faq-section summary{cursor:pointer;font-weight:800;color:#263751;font-size:14px}.faq-section details p{margin:8px 0 0}
.site-footer{border-top:1px solid #e4eaf2;padding:16px 18px;text-align:center;background:#fafcff}.site-footer p{margin:0;color:#7a8798;font-size:11px}.noscript-note{max-width:820px;margin:12px auto;padding:12px;border:1px solid #e2b4b4;background:#fff5f5;color:#9c2f2f;text-align:center}
@media(max-width:620px){.seo-content{padding:22px 14px 26px}.seo-feature-grid{grid-template-columns:1fr}.seo-content h2{font-size:20px}}

/* Keep embedded versions compact; the standalone canonical page keeps the helpful SEO content visible. */
.is-embedded .seo-content,.is-embedded .site-footer{display:none}

/* Visual Rotate PDF editor */
.rotate-file-zone{min-height:118px}
.rotate-editor{margin:14px 0 16px;padding:14px;border:1px solid #dbe4ef;border-radius:14px;background:#f8fbff}
.rotate-editor[hidden]{display:none!important}
.rotate-toolbar{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.rotate-tool-btn{border:1px solid #cbd8e9;border-radius:9px;background:#fff;color:#263751;padding:8px 11px;font-size:12px;font-weight:800;cursor:pointer;transition:.15s ease}
.rotate-tool-btn:hover{border-color:#7fa8e5;background:#f2f7ff;color:#1853b2}
.rotate-hint{margin:4px auto 13px;max-width:680px;text-align:center;color:#66758a;font-size:11px;line-height:1.5}
.rotate-pages-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(142px,1fr));gap:12px}
.rotate-page-card{position:relative;min-width:0;border:1px solid #d5dfec;border-radius:12px;background:#fff;padding:8px;box-shadow:0 3px 10px rgba(28,51,82,.06);cursor:pointer;user-select:none;transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease}
.rotate-page-card:hover{transform:translateY(-2px);border-color:#83ace8;box-shadow:0 7px 18px rgba(36,104,216,.12)}
.rotate-page-card:focus-visible{outline:3px solid rgba(36,104,216,.2);outline-offset:2px}
.rotate-page-number{position:absolute;left:12px;top:12px;z-index:3;min-width:24px;height:24px;padding:0 7px;border-radius:999px;background:#2468d8;color:#fff;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:800;box-shadow:0 2px 7px rgba(36,104,216,.25)}
.rotate-angle-badge{position:absolute;right:12px;top:12px;z-index:3;min-width:38px;height:24px;padding:0 7px;border-radius:999px;background:rgba(23,35,59,.86);color:#fff;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:800}
.rotate-page-canvas-wrap{height:166px;border:1px solid #e1e7ef;border-radius:8px;background:#eef2f6;display:flex;align-items:center;justify-content:center;overflow:hidden}
.rotate-page-canvas-wrap canvas{display:block;max-width:100%;max-height:100%;width:auto;height:auto;background:#fff;box-shadow:0 2px 7px rgba(15,30,50,.12)}
.rotate-page-loading{font-size:11px;color:#7a889b;padding:10px;text-align:center}
.rotate-page-controls{display:grid;grid-template-columns:1fr 1fr 1fr;gap:5px;margin-top:7px}
.rotate-page-controls button{border:1px solid #d1dbe8;border-radius:7px;background:#fff;color:#25364f;height:30px;font-size:14px;font-weight:800;cursor:pointer}
.rotate-page-controls button:hover{border-color:#84abe4;background:#f4f8ff;color:#1853b2}
.rotate-page-caption{margin-top:5px;text-align:center;color:#65758a;font-size:10px;font-weight:700}
@media(max-width:520px){
  .rotate-editor{padding:10px}
  .rotate-pages-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .rotate-page-canvas-wrap{height:138px}
  .rotate-tool-btn{font-size:11px;padding:7px 9px}
}

/* Enlarged rotate preview */
.pdf-modal-dialog{width:min(960px,96vw)}
.pdf-modal-stage{min-height:360px;max-height:72vh;padding:18px;overflow:auto}
.pdf-modal-rotatebar{min-height:52px;display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;padding:8px 12px;border-bottom:1px solid #e7edf5;background:#f8fbff}
.pdf-modal-rotatebar[hidden]{display:none!important}
.pdf-modal-rotatebar button{border:1px solid #c7d5e8;border-radius:9px;background:#fff;color:#243650;padding:9px 13px;font-size:12px;font-weight:800;cursor:pointer}
.pdf-modal-rotatebar button:hover{border-color:#6e9fe5;background:#eef5ff;color:#1853b2}
.preview-rotate-angle{min-width:52px;text-align:center;padding:8px 10px;border-radius:999px;background:#17233b;color:#fff;font-size:12px;font-weight:800}
.rotate-page-card{cursor:zoom-in}
.rotate-page-caption{color:#2468d8}
@media(max-width:520px){
  .pdf-modal-dialog{width:98vw}
  .pdf-modal-stage{min-height:300px;max-height:68vh;padding:8px}
  .pdf-modal-rotatebar{gap:6px;padding:7px}
  .pdf-modal-rotatebar button{padding:8px 9px;font-size:11px}
}


/* Expanded toolkit + calm background */
html{background:#eef4f9;min-height:0;height:auto}
body{background:radial-gradient(circle at 12% 8%,rgba(57,118,207,.12),transparent 28%),radial-gradient(circle at 90% 12%,rgba(56,170,145,.10),transparent 27%),linear-gradient(145deg,#f7faff,#eef5fb 52%,#f7fafc);min-height:0;height:auto}
.app-shell{background:linear-gradient(180deg,rgba(255,255,255,.94),rgba(247,251,255,.94));box-shadow:0 18px 45px rgba(37,69,108,.12)}
.play-area{background:linear-gradient(180deg,rgba(251,253,255,.9),rgba(244,249,253,.92))}
.tool-tabs{display:flex;flex-wrap:wrap;gap:8px;overflow:visible}
.tool-note{font-size:12px;color:#65758d;text-align:center;margin:8px 0 12px}
.secondary-btn{border:1px solid #cad8e8;background:#fff;color:#243650;border-radius:999px;padding:11px 18px;font-weight:800;cursor:pointer}
.organize-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:14px}
.page-organizer{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:12px;margin:14px 0}
.organize-card{position:relative;border:1px solid #d3deeb;background:rgba(255,255,255,.94);border-radius:14px;padding:10px;cursor:grab;box-shadow:0 6px 18px rgba(38,68,105,.06);transition:.15s}
.organize-card.drag-over{outline:2px solid #2b74df;transform:translateY(-2px)}
.organize-card.is-deleted{opacity:.42;filter:grayscale(.8)}
.organize-num{position:absolute;z-index:2;top:7px;left:7px;width:25px;height:25px;border-radius:50%;display:grid;place-items:center;background:#2b74df;color:#fff;font-size:11px;font-weight:800}
.organize-angle{font-size:11px;font-weight:800;color:#49617e;margin-top:6px}
.organize-preview{height:170px;display:grid;place-items:center;overflow:hidden;border-radius:10px;background:#f2f6fb}
.organize-preview img{max-width:100%;max-height:160px;transform-origin:center;transition:transform .18s}
.organize-tools{display:flex;justify-content:center;gap:7px;margin-top:8px}
.organize-tools button{width:36px;height:31px;border:1px solid #ccd8e8;border-radius:8px;background:#fff;cursor:pointer;font-weight:800}
.signature-box{margin:14px 0;padding:12px;border:1px solid #d2deeb;border-radius:14px;background:rgba(255,255,255,.78)}
.signature-pad-wrap{background:#fff;border:1px dashed #b9cce2;border-radius:10px;overflow:hidden}
#signaturePad{display:block;width:100%;height:170px;touch-action:none;cursor:crosshair}
.signature-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:9px;font-size:12px;color:#66758a}
@media(max-width:620px){.page-organizer{grid-template-columns:repeat(2,minmax(0,1fr))}.signature-toolbar{align-items:flex-start;flex-direction:column}}


/* =========================================================
   SIGN PDF — DRAG & RESIZE EDITOR
   ========================================================= */

.signature-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
  color:#23344f;
}

.signature-head strong{
  font-size:14px;
}

.signature-head span{
  color:#718198;
  font-size:12px;
}

.signature-editor{
  margin:16px 0;
  padding:16px;
  border:1px solid rgba(199,215,234,.9);
  border-radius:16px;
  background:rgba(255,255,255,.72);
  box-shadow:0 8px 24px rgba(42,76,116,.055);
}

.signature-editor-toolbar{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

#signPageIndicator{
  min-width:92px;
  text-align:center;
  font-size:12px;
  font-weight:800;
  color:#293a55;
}

.signature-pdf-stage{
  width:100%;
  max-height:72vh;
  overflow:auto;
  padding:14px;
  border:1px solid #ccd9e8;
  border-radius:14px;
  background:
    linear-gradient(45deg,#eef3f8 25%,transparent 25%),
    linear-gradient(-45deg,#eef3f8 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#eef3f8 75%),
    linear-gradient(-45deg,transparent 75%,#eef3f8 75%);
  background-size:22px 22px;
  background-position:0 0,0 11px,11px -11px,-11px 0;
}

.signature-page-wrap{
  position:relative;
  margin:0 auto;
  background:#fff;
  box-shadow:0 10px 28px rgba(28,55,91,.18);
  user-select:none;
}

#signaturePdfCanvas{
  display:block;
  max-width:none;
}

.signature-overlay{
  position:absolute;
  z-index:5;
  min-width:70px;
  min-height:34px;
  border:2px solid #2b74df;
  border-radius:6px;
  cursor:move;
  touch-action:none;
  background:rgba(255,255,255,.06);
  box-shadow:0 0 0 1px rgba(255,255,255,.65);
}

.signature-overlay img{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  pointer-events:none;
  user-select:none;
}

.signature-resize-handle{
  position:absolute;
  right:-9px;
  bottom:-9px;
  width:18px;
  height:18px;
  border-radius:50%;
  background:#2b74df;
  border:3px solid #fff;
  box-shadow:0 2px 7px rgba(20,52,98,.28);
  cursor:nwse-resize;
  touch-action:none;
}

.signature-overlay::before{
  content:"Drag";
  position:absolute;
  top:-24px;
  left:50%;
  transform:translateX(-50%);
  background:#2b74df;
  color:#fff;
  border-radius:999px;
  padding:3px 8px;
  font-size:9px;
  line-height:1;
  font-weight:800;
  pointer-events:none;
}

.signature-editor-help{
  margin-top:10px;
  color:#728198;
  font-size:11px;
  text-align:center;
}

#signatureReadyText{
  font-size:11px;
  color:#677890;
}

@media(max-width:640px){
  .signature-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .signature-editor{
    padding:11px;
  }

  .signature-pdf-stage{
    padding:8px;
    max-height:66vh;
  }

  .signature-editor-toolbar .secondary-btn{
    padding:8px 10px;
    font-size:11px;
  }
}


/* =========================================================
   ADVANCED WATERMARK EDITOR
   ========================================================= */

.watermark-builder,
.watermark-editor{
  margin:16px 0;
  padding:16px;
  border:1px solid rgba(199,215,234,.9);
  border-radius:16px;
  background:rgba(255,255,255,.72);
  box-shadow:0 8px 24px rgba(42,76,116,.055);
}

.watermark-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
  color:#23344f;
}

.watermark-head strong{font-size:14px}
.watermark-head span{font-size:12px;color:#718198}

.watermark-type-tabs{
  display:flex;
  gap:8px;
  margin-bottom:12px;
}

.watermark-type-tabs .active{
  background:#2b74df;
  color:#fff;
  border-color:#2b74df;
}

.watermark-option-panel{
  margin-bottom:12px;
}

.logo-upload-box{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-height:100px;
  border:1.5px dashed #b9cce4;
  border-radius:14px;
  background:rgba(248,251,255,.9);
  cursor:pointer;
}

.logo-upload-box input{display:none}
.logo-upload-box strong{font-size:14px}
.logo-upload-box span{font-size:11px;color:#718198;margin-top:4px}

.watermark-logo-name{
  margin-top:8px;
  font-size:11px;
  color:#63738a;
  text-align:center;
}

.watermark-controls{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin:12px 0;
}

.watermark-controls label{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:10px;
  align-items:center;
}

.watermark-controls input[type="range"]{
  width:100%;
}

.watermark-editor-toolbar{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

#watermarkPageIndicator{
  min-width:92px;
  text-align:center;
  font-size:12px;
  font-weight:800;
  color:#293a55;
}

.watermark-pdf-stage{
  width:100%;
  max-height:72vh;
  overflow:auto;
  padding:14px;
  border:1px solid #ccd9e8;
  border-radius:14px;
  background:
    linear-gradient(45deg,#eef3f8 25%,transparent 25%),
    linear-gradient(-45deg,#eef3f8 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#eef3f8 75%),
    linear-gradient(-45deg,transparent 75%,#eef3f8 75%);
  background-size:22px 22px;
  background-position:0 0,0 11px,11px -11px,-11px 0;
}

.watermark-page-wrap{
  position:relative;
  margin:0 auto;
  background:#fff;
  box-shadow:0 10px 28px rgba(28,55,91,.18);
  user-select:none;
}

#watermarkPdfCanvas{
  display:block;
  max-width:none;
}

.watermark-overlay{
  position:absolute;
  z-index:5;
  min-width:70px;
  min-height:34px;
  border:2px solid #2b74df;
  border-radius:6px;
  cursor:move;
  touch-action:none;
  background:rgba(255,255,255,.04);
  box-shadow:0 0 0 1px rgba(255,255,255,.65);
  transform-origin:center center;
}

.watermark-overlay-content{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  color:#17233b;
  font-weight:800;
  font-size:clamp(12px,2vw,28px);
  white-space:nowrap;
  text-align:center;
  pointer-events:none;
}

.watermark-overlay-content img{
  width:100%;
  height:100%;
  object-fit:contain;
  pointer-events:none;
  user-select:none;
}

.watermark-resize-handle,
.watermark-rotate-handle{
  position:absolute;
  width:18px;
  height:18px;
  border-radius:50%;
  border:3px solid #fff;
  box-shadow:0 2px 7px rgba(20,52,98,.28);
  touch-action:none;
}

.watermark-resize-handle{
  right:-9px;
  bottom:-9px;
  background:#2b74df;
  cursor:nwse-resize;
}

.watermark-rotate-handle{
  left:50%;
  top:-30px;
  transform:translateX(-50%);
  background:#f59f19;
  cursor:grab;
}

.watermark-rotate-handle::after{
  content:"";
  position:absolute;
  left:50%;
  top:15px;
  width:2px;
  height:14px;
  background:#f59f19;
  transform:translateX(-50%);
}

.watermark-editor-help{
  margin-top:10px;
  color:#728198;
  font-size:11px;
  text-align:center;
}

@media(max-width:640px){
  .watermark-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .watermark-controls{
    grid-template-columns:1fr;
  }

  .watermark-editor,
  .watermark-builder{
    padding:11px;
  }

  .watermark-pdf-stage{
    padding:8px;
    max-height:66vh;
  }
}


/* Watermark text-size control */
#watermarkFontSizeRow[hidden]{
  display:none !important;
}

.watermark-overlay-content{
  font-size:42px;
  overflow:visible;
}

.watermark-overlay[data-watermark-type="text"] .watermark-overlay-content{
  white-space:nowrap;
}



/* =========================================================
   WATERMARK CONTROL BOX FIX
   ========================================================= */

.watermark-overlay{
  box-sizing:border-box;
  overflow:visible;
}

.watermark-overlay-content{
  box-sizing:border-box;
  overflow:hidden !important;
  padding:3px 10px;
  transform:none !important;
  opacity:1;
}

.watermark-overlay[data-watermark-type="text"] .watermark-overlay-content{
  width:100%;
  height:100%;
  white-space:nowrap;
  display:flex;
  align-items:center;
  justify-content:center;
}

.watermark-overlay[data-watermark-type="logo"] .watermark-overlay-content{
  padding:2px;
}

/* Opacity only affects watermark content; editing controls remain visible. */
.watermark-overlay{
  opacity:1 !important;
}

.watermark-resize-handle,
.watermark-rotate-handle{
  opacity:1 !important;
  z-index:10;
}

.watermark-resize-handle{
  right:-11px;
  bottom:-11px;
}

.watermark-rotate-handle{
  top:-34px;
}



/* =========================================================
   MERGE PDF — ADD FILES ONE BY ONE
   ========================================================= */

.merge-single-picker{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:18px;
  margin-bottom:12px;
  border:1px solid #cbd9ea;
  border-radius:16px;
  background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(244,249,255,.92));
  box-shadow:0 7px 22px rgba(37,71,112,.055);
}

.merge-picker-copy{
  min-width:0;
  text-align:left;
}

.merge-picker-copy strong{
  display:block;
  color:#17233b;
  font-size:15px;
  margin-bottom:5px;
}

.merge-picker-copy span{
  display:block;
  color:#6b7b91;
  font-size:12px;
  line-height:1.45;
}

.merge-add-button,
.merge-add-more{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  min-height:42px;
  padding:10px 18px;
  border:0;
  border-radius:999px;
  background:#2b74df;
  color:#fff !important;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(43,116,223,.18);
  user-select:none;
}

.merge-add-button:hover,
.merge-add-more:hover{
  background:#1f63c8;
}

.merge-empty-state{
  padding:22px 14px;
  margin:12px 0;
  border:1.5px dashed #c7d7e9;
  border-radius:14px;
  background:rgba(248,251,255,.75);
  color:#708097;
  font-size:12px;
  text-align:center;
}

.merge-file-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin:12px 0 14px;
}

.merge-file-card{
  position:relative;
  display:grid;
  grid-template-columns:42px 124px minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  min-height:150px;
  padding:12px;
  border:1px solid #cfdaea;
  border-radius:14px;
  background:rgba(255,255,255,.9);
  box-shadow:0 5px 16px rgba(31,64,103,.055);
  cursor:grab;
  transition:border-color .15s ease,transform .15s ease,box-shadow .15s ease;
}

.merge-file-card:active{
  cursor:grabbing;
}

.merge-file-card.dragging{
  opacity:.45;
}

.merge-file-card.drag-over{
  border-color:#2b74df;
  box-shadow:0 0 0 3px rgba(43,116,223,.11);
}

.merge-order-badge{
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#2b74df;
  color:#fff;
  font-size:12px;
  font-weight:900;
}

.merge-thumb{
  width:118px;
  height:138px;
  margin:0;
  background:#f3f6fa;
  border-radius:9px;
  overflow:hidden;
}

.merge-file-info{
  min-width:0;
  text-align:left;
}

.merge-file-name{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#17233b;
  font-size:13px;
  margin-bottom:6px;
}

.merge-file-meta{
  display:block;
  color:#718198;
  font-size:11px;
  margin-bottom:9px;
}

.merge-preview-link{
  appearance:none;
  border:0;
  padding:0;
  background:transparent;
  color:#2468d8;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}

.merge-preview-link:hover{
  text-decoration:underline;
}

.merge-card-actions{
  display:flex;
  flex-direction:column;
  gap:7px;
}

.merge-order-btn,
.merge-remove-btn{
  min-width:40px;
  min-height:32px;
  border:1px solid #ccd8e8;
  border-radius:9px;
  background:#fff;
  color:#33445f;
  font-weight:800;
  cursor:pointer;
}

.merge-order-btn:disabled{
  opacity:.35;
  cursor:not-allowed;
}

.merge-remove-btn{
  padding:7px 10px;
  color:#c13e4d;
  border-color:#ecd0d5;
  font-size:10px;
}

.merge-remove-btn:hover{
  background:#fff5f6;
}

.merge-footer-actions{
  display:flex;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
  gap:9px;
  margin:8px 0 16px;
}

.merge-footer-actions .secondary-btn{
  min-height:38px;
}

@media(max-width:680px){
  .merge-single-picker{
    align-items:stretch;
    flex-direction:column;
  }

  .merge-add-button{
    width:100%;
  }

  .merge-file-card{
    grid-template-columns:34px 92px minmax(0,1fr);
    gap:9px;
    min-height:126px;
  }

  .merge-thumb{
    width:88px;
    height:108px;
  }

  .merge-card-actions{
    grid-column:1 / -1;
    flex-direction:row;
    justify-content:flex-end;
  }

  .merge-order-btn,
  .merge-remove-btn{
    min-height:34px;
  }
}

.split-visual-editor{margin:16px 0;padding:16px;border:1px solid #cfdbea;border-radius:16px;background:rgba(255,255,255,.72)}
.split-editor-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px;text-align:left}
.split-editor-head strong{display:block;font-size:15px;margin-bottom:4px}
.split-editor-head span{font-size:12px;color:#728198}
.split-selection-summary{padding:7px 11px;border:1px solid #cbd9e9;border-radius:999px;background:#fff;font-size:11px;white-space:nowrap}
.split-quick-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-bottom:12px}
.split-range-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:end;margin-bottom:14px;text-align:left}
.split-page-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.split-page-card{position:relative;display:flex;flex-direction:column;align-items:center;min-height:230px;padding:10px;border:2px solid transparent;border-radius:14px;background:#fff;cursor:pointer;box-shadow:0 5px 16px rgba(34,67,107,.06)}
.split-page-card:hover{border-color:#aac7ec;transform:translateY(-2px)}
.split-page-card.selected{border-color:#2b74df;background:linear-gradient(180deg,#f2f7ff,#eef9f5);box-shadow:0 0 0 3px rgba(43,116,223,.10)}
.split-page-check{position:absolute;top:8px;right:8px;width:24px;height:24px;display:grid;place-items:center;border-radius:50%;background:#dfe8f5;color:transparent;font-weight:900}
.split-page-card.selected .split-page-check{background:#2b74df;color:#fff}
.split-page-number{width:100%;margin-bottom:8px;padding-right:30px;text-align:left;font-size:11px;font-weight:800;color:#43536b}
.split-page-thumb{width:100%;min-height:180px;display:flex;align-items:center;justify-content:center;overflow:hidden;border:1px solid #dde5ef;border-radius:10px;background:#f3f6fa}
.split-page-thumb canvas{display:block;max-width:100%;max-height:190px}
.split-thumb-loading,.split-loading{color:#7b899c;font-size:11px;text-align:center}
.split-loading{grid-column:1/-1;padding:28px 12px}
@media(max-width:640px){
  .split-visual-editor{padding:12px}
  .split-editor-head{flex-direction:column}
  .split-range-row{grid-template-columns:1fr}
  .split-page-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .split-page-card{min-height:190px;padding:8px}
  .split-page-thumb{min-height:145px}
}


/* =========================================================
   DELETE PDF PAGES — VISUAL PAGE SELECTOR
   ========================================================= */

.delete-visual-editor{
  margin:16px 0;
  padding:16px;
  border:1px solid #cfdbea;
  border-radius:16px;
  background:rgba(255,255,255,.72);
}

.delete-editor-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:12px;
  text-align:left;
}

.delete-editor-head strong{
  display:block;
  font-size:15px;
  margin-bottom:4px;
}

.delete-editor-head span{
  font-size:12px;
  color:#728198;
}

.delete-selection-summary{
  padding:7px 11px;
  border:1px solid #e5c9cf;
  border-radius:999px;
  background:#fff;
  color:#a43a48;
  font-size:11px;
  white-space:nowrap;
}

.delete-quick-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:center;
  margin-bottom:12px;
}

.delete-range-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:end;
  margin-bottom:14px;
  text-align:left;
}

.delete-page-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
  gap:12px;
}

.delete-page-card{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  min-height:230px;
  padding:10px;
  border:2px solid transparent;
  border-radius:14px;
  background:#fff;
  cursor:pointer;
  box-shadow:0 5px 16px rgba(34,67,107,.06);
  transition:transform .15s ease,border-color .15s ease,background .15s ease,opacity .15s ease;
}

.delete-page-card:hover{
  border-color:#e1aeb7;
  transform:translateY(-2px);
}

.delete-page-card.selected{
  border-color:#cf4556;
  background:linear-gradient(180deg,#fff7f8,#fff1f3);
  box-shadow:0 0 0 3px rgba(207,69,86,.09);
}

.delete-page-check{
  position:absolute;
  top:8px;
  right:8px;
  width:24px;
  height:24px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#e6edf6;
  color:transparent;
  font-size:16px;
  font-weight:900;
  z-index:2;
}

.delete-page-card.selected .delete-page-check{
  background:#cf4556;
  color:#fff;
}

.delete-page-card.selected .delete-page-thumb{
  opacity:.56;
  filter:grayscale(.25);
}

.delete-page-number{
  width:100%;
  margin-bottom:8px;
  padding-right:30px;
  text-align:left;
  font-size:11px;
  font-weight:800;
  color:#43536b;
}

.delete-page-thumb{
  width:100%;
  min-height:180px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border:1px solid #dde5ef;
  border-radius:10px;
  background:#f3f6fa;
}

.delete-page-thumb canvas{
  display:block;
  max-width:100%;
  max-height:190px;
}

.delete-thumb-loading,
.delete-loading{
  color:#7b899c;
  font-size:11px;
  text-align:center;
}

.delete-loading{
  grid-column:1/-1;
  padding:28px 12px;
}

@media(max-width:640px){
  .delete-visual-editor{padding:12px}
  .delete-editor-head{flex-direction:column}
  .delete-range-row{grid-template-columns:1fr}
  .delete-page-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .delete-page-card{min-height:190px;padding:8px}
  .delete-page-thumb{min-height:145px}
}


/* =========================================================
   CROP PDF — VISUAL EDITOR
   ========================================================= */

.crop-visual-editor{
  margin:16px 0;
  padding:16px;
  border:1px solid #cfdbea;
  border-radius:16px;
  background:rgba(255,255,255,.72);
  box-shadow:0 8px 24px rgba(42,76,116,.05);
}

.crop-editor-head{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  margin-bottom:12px;
  text-align:left;
}

.crop-editor-head strong{
  display:block;
  font-size:15px;
  color:#17233b;
  margin-bottom:4px;
}

.crop-editor-head span{
  font-size:12px;
  color:#728198;
}

.crop-page-status{
  flex:0 0 auto;
  padding:7px 11px;
  border:1px solid #cbd9e9;
  border-radius:999px;
  background:#fff;
  color:#3e506a;
  font-size:11px;
}

.crop-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:center;
  margin-bottom:12px;
}

.crop-toolbar .secondary-btn.active{
  background:#2b74df;
  color:#fff;
  border-color:#2b74df;
}

.crop-pdf-stage{
  width:100%;
  max-height:72vh;
  overflow:auto;
  padding:14px;
  border:1px solid #ccd9e8;
  border-radius:14px;
  background:
    linear-gradient(45deg,#edf2f7 25%,transparent 25%),
    linear-gradient(-45deg,#edf2f7 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#edf2f7 75%),
    linear-gradient(-45deg,transparent 75%,#edf2f7 75%);
  background-size:22px 22px;
  background-position:0 0,0 11px,11px -11px,-11px 0;
}

.crop-page-wrap{
  position:relative;
  margin:0 auto;
  background:#fff;
  box-shadow:0 10px 28px rgba(28,55,91,.18);
  user-select:none;
}

#cropPdfCanvas{
  display:block;
  max-width:none;
}

.crop-shade{
  position:absolute;
  z-index:2;
  background:rgba(11,28,48,.50);
  pointer-events:none;
}

.crop-box{
  position:absolute;
  z-index:4;
  border:2px solid #2b74df;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.9),
    inset 0 0 0 1px rgba(255,255,255,.45);
  cursor:move;
  touch-action:none;
  background:rgba(43,116,223,.025);
}

.crop-box::before,
.crop-box::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
}

.crop-box::before{
  background:
    linear-gradient(to right,transparent 33.2%,rgba(43,116,223,.20) 33.2%,rgba(43,116,223,.20) 33.5%,transparent 33.5%,transparent 66.4%,rgba(43,116,223,.20) 66.4%,rgba(43,116,223,.20) 66.7%,transparent 66.7%),
    linear-gradient(to bottom,transparent 33.2%,rgba(43,116,223,.20) 33.2%,rgba(43,116,223,.20) 33.5%,transparent 33.5%,transparent 66.4%,rgba(43,116,223,.20) 66.4%,rgba(43,116,223,.20) 66.7%,transparent 66.7%);
}

.crop-handle{
  position:absolute;
  z-index:6;
  width:14px;
  height:14px;
  border-radius:50%;
  background:#2b74df;
  border:3px solid #fff;
  box-shadow:0 2px 7px rgba(24,53,92,.25);
}

.crop-handle-nw{left:-8px;top:-8px;cursor:nwse-resize}
.crop-handle-n{left:50%;top:-8px;transform:translateX(-50%);cursor:ns-resize}
.crop-handle-ne{right:-8px;top:-8px;cursor:nesw-resize}
.crop-handle-e{right:-8px;top:50%;transform:translateY(-50%);cursor:ew-resize}
.crop-handle-se{right:-8px;bottom:-8px;cursor:nwse-resize}
.crop-handle-s{left:50%;bottom:-8px;transform:translateX(-50%);cursor:ns-resize}
.crop-handle-sw{left:-8px;bottom:-8px;cursor:nesw-resize}
.crop-handle-w{left:-8px;top:50%;transform:translateY(-50%);cursor:ew-resize}

.crop-size-badge{
  position:absolute;
  left:50%;
  top:8px;
  transform:translateX(-50%);
  padding:4px 8px;
  border-radius:999px;
  background:rgba(28,55,91,.86);
  color:#fff;
  font-size:9px;
  font-weight:800;
  pointer-events:none;
  white-space:nowrap;
}

.crop-values-panel{
  margin-top:14px;
  padding:14px;
  border:1px solid #d5e0ed;
  border-radius:14px;
  background:rgba(248,251,255,.85);
}

.crop-values-title{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
  text-align:left;
}

.crop-values-title strong{
  font-size:13px;
  color:#23354e;
}

.crop-values-title span{
  font-size:11px;
  color:#75849a;
}

.crop-values-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}

.crop-values-grid label{
  text-align:left;
}

.crop-value-input{
  display:flex;
  align-items:center;
  margin-top:6px;
  border:1px solid #cbd8e8;
  border-radius:10px;
  overflow:hidden;
  background:#fff;
}

.crop-value-input input{
  min-width:0;
  width:100%;
  margin:0;
  padding:10px 10px;
  border:0;
  border-radius:0;
  box-shadow:none;
}

.crop-value-input span{
  padding:0 9px;
  color:#76859b;
  font-size:10px;
}

.crop-help{
  margin-top:10px;
  color:#75849a;
  font-size:11px;
  text-align:center;
}

@media(max-width:680px){
  .crop-visual-editor{padding:11px}
  .crop-editor-head{flex-direction:column}
  .crop-pdf-stage{padding:8px;max-height:66vh}
  .crop-values-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .crop-values-title{align-items:flex-start;flex-direction:column}
}

.edit-pdf-editor{margin:16px 0;padding:16px;border:1px solid #cfdbea;border-radius:16px;background:rgba(255,255,255,.74);box-shadow:0 8px 24px rgba(42,76,116,.05)}
.edit-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;margin-bottom:12px;text-align:left}
.edit-head strong{display:block;font-size:15px;color:#17233b;margin-bottom:4px}
.edit-head span{color:#728198;font-size:12px}
.edit-page-status{flex:0 0 auto;padding:7px 11px;border:1px solid #cbd9e9;border-radius:999px;background:#fff;color:#3d4e67;font-size:11px}
.edit-toolbar{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-bottom:12px}
.edit-tool-btn{min-height:36px;padding:8px 12px;border:1px solid #ccd9e9;border-radius:10px;background:#fff;color:#32445f;font-size:11px;font-weight:800;cursor:pointer}
.edit-tool-btn.active{background:#2b74df;color:#fff;border-color:#2b74df}
.edit-options{display:flex;flex-wrap:wrap;align-items:end;justify-content:center;gap:10px;padding:12px;margin-bottom:12px;border:1px solid #d5e0ed;border-radius:14px;background:rgba(248,251,255,.82)}
.edit-option-group{display:flex;flex-wrap:wrap;gap:10px;align-items:end}
.edit-option-group label{min-width:120px;text-align:left}
.edit-image-upload{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:8px 14px;border:1px solid #cbd9e9;border-radius:10px;background:#fff;cursor:pointer;font-size:11px;font-weight:800}
#editImageName{color:#738298;font-size:11px}
.edit-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.danger-lite{color:#b33a4b!important;border-color:#e8c8ce!important}
.edit-pdf-stage{width:100%;max-height:76vh;overflow:auto;padding:14px;border:1px solid #ccd9e8;border-radius:14px;background:linear-gradient(45deg,#edf2f7 25%,transparent 25%),linear-gradient(-45deg,#edf2f7 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#edf2f7 75%),linear-gradient(-45deg,transparent 75%,#edf2f7 75%);background-size:22px 22px;background-position:0 0,0 11px,11px -11px,-11px 0}
.edit-page-wrap{position:relative;margin:0 auto;background:#fff;box-shadow:0 10px 28px rgba(28,55,91,.18);user-select:none}
#editPdfCanvas{display:block;max-width:none}
.edit-overlay-layer,.edit-draw-canvas{position:absolute;inset:0;width:100%;height:100%}
.edit-overlay-layer{z-index:4}
.edit-draw-canvas{z-index:5;pointer-events:none;touch-action:none}
.edit-draw-canvas.active{cursor:crosshair}
.edit-item{position:absolute;z-index:6;min-width:40px;min-height:26px;border:1px solid transparent;cursor:move;touch-action:none}
.edit-item.selected{border:2px solid #2b74df;box-shadow:0 0 0 1px rgba(255,255,255,.85)}
.edit-item-content{width:100%;height:100%;display:flex;align-items:center;justify-content:flex-start;overflow:hidden;pointer-events:none}
.edit-text-content{color:#17233b;white-space:nowrap;padding:2px 4px;font-weight:500;line-height:1}
.edit-item-content img{width:100%;height:100%;object-fit:contain;pointer-events:none}
.edit-highlight-content{background:#ffeb3b}
.edit-whiteout-content{background:#fff}
.edit-rect-content{border:2px solid #1c3556;box-sizing:border-box;background:transparent}
.edit-resize-handle{display:none;position:absolute;right:-10px;bottom:-10px;width:18px;height:18px;border-radius:50%;background:#2b74df;border:3px solid #fff;box-shadow:0 2px 7px rgba(24,53,92,.25);cursor:nwse-resize}
.edit-item.selected .edit-resize-handle{display:block}
.edit-help{margin-top:10px;color:#75849a;font-size:11px;text-align:center}
@media(max-width:680px){.edit-pdf-editor{padding:11px}.edit-head{flex-direction:column}.edit-pdf-stage{padding:8px;max-height:68vh}.edit-options{align-items:stretch;flex-direction:column}.edit-option-group{width:100%}.edit-option-group label{flex:1 1 140px}}


/* =========================================================
   EDIT PDF — ZOOM + FONT CONTROLS
   ========================================================= */

.edit-zoom-group{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:4px;
  border:1px solid #d3deeb;
  border-radius:12px;
  background:rgba(248,251,255,.9);
}

.edit-zoom-group .secondary-btn{
  min-height:32px;
  padding:6px 10px;
  margin:0;
}

.edit-zoom-btn{
  min-width:34px;
  font-size:17px;
  line-height:1;
}

.edit-zoom-value{
  min-width:58px;
  font-variant-numeric:tabular-nums;
}

#editFontFamily{
  width:100%;
  min-height:40px;
  margin-top:5px;
  border:1px solid #ccd7e6;
  border-radius:10px;
  padding:8px 10px;
  background:#fff;
  color:#17233b;
}

.edit-pdf-stage{
  scroll-behavior:smooth;
}

/* Allow enlarged pages to remain centered when zoomed out,
   and naturally scroll when zoomed in. */
.edit-page-wrap{
  flex:0 0 auto;
}

@media(max-width:680px){
  .edit-zoom-group{
    width:100%;
    justify-content:center;
  }

  .edit-zoom-group .secondary-btn{
    flex:0 0 auto;
  }
}






/* =========================================================
   SEARCH PDF — CLEAN DESKTOP WORKSPACE
   ========================================================= */

.search-pdf-app{
  margin:16px 0;
  padding:16px;
  border:1px solid #d4dfec;
  border-radius:18px;
  background:rgba(255,255,255,.78);
  box-shadow:0 10px 28px rgba(38,71,111,.06);
}

.search-pdf-topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}

.search-pdf-title{
  min-width:0;
  text-align:left;
}

.search-pdf-title strong{
  display:block;
  color:#17233b;
  font-size:16px;
  margin-bottom:4px;
}

.search-pdf-title span{
  display:block;
  color:#728198;
  font-size:12px;
  line-height:1.45;
}

.search-pdf-page-status{
  flex:0 0 auto;
  padding:7px 12px;
  border:1px solid #cedaea;
  border-radius:999px;
  background:#fff;
  color:#4b5d76;
  font-size:11px;
  font-weight:700;
}

.search-pdf-searchcard{
  padding:14px;
  margin-bottom:14px;
  border:1px solid #d5e1ee;
  border-radius:14px;
  background:linear-gradient(135deg,rgba(248,251,255,.98),rgba(243,248,253,.94));
}

.search-pdf-box{
  display:grid;
  grid-template-columns:minmax(0,1fr) 110px;
  gap:10px;
  align-items:center;
}

#searchPdfInput{
  width:100%;
  min-height:46px;
  margin:0;
  padding:11px 14px;
  border:1px solid #c8d6e7;
  border-radius:12px;
  background:#fff;
  color:#17233b;
  outline:none;
  font-size:13px;
}

#searchPdfInput:focus{
  border-color:#6da2ec;
  box-shadow:0 0 0 3px rgba(43,116,223,.10);
}

.search-pdf-button{
  width:100%;
  min-height:46px;
  margin:0;
}

.search-pdf-meta-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-top:10px;
}

.search-pdf-options{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:14px;
  color:#64758c;
  font-size:11px;
}

.search-pdf-options label{
  display:inline-flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  white-space:nowrap;
}

.search-pdf-result-nav{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:7px;
}

.search-pdf-result-nav .secondary-btn{
  min-height:34px;
  padding:7px 11px;
}

#searchPdfCounter{
  min-width:76px;
  text-align:center;
  color:#53657d;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}

.search-pdf-clear{
  min-height:34px;
  padding:7px 11px;
  border:0;
  background:transparent;
  color:#c04453;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}

.search-pdf-workspace{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:12px;
}

.search-pdf-workspace:has(.search-pdf-results:not([hidden])){
  grid-template-columns:260px minmax(0,1fr);
}

.search-pdf-results{
  max-height:74vh;
  overflow:auto;
  padding:8px;
  border:1px solid #d8e2ed;
  border-radius:14px;
  background:rgba(248,251,255,.9);
}

.search-pdf-result{
  width:100%;
  display:block;
  padding:10px;
  margin:0 0 7px;
  border:1px solid transparent;
  border-radius:10px;
  background:#fff;
  text-align:left;
  cursor:pointer;
  transition:border-color .15s ease,background .15s ease,box-shadow .15s ease;
}

.search-pdf-result:hover{
  border-color:#c4d6ec;
}

.search-pdf-result.active{
  border-color:#2b74df;
  background:#eef5ff;
  box-shadow:0 0 0 2px rgba(43,116,223,.07);
}

.search-pdf-result-page{
  display:block;
  margin-bottom:4px;
  color:#2b74df;
  font-size:10px;
  font-weight:900;
}

.search-pdf-result-snippet{
  display:block;
  color:#586980;
  font-size:11px;
  line-height:1.45;
}

.search-pdf-viewer-card{
  min-width:0;
  padding:12px;
  border:1px solid #d8e2ed;
  border-radius:14px;
  background:rgba(255,255,255,.72);
}

.search-pdf-viewer-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.search-pdf-page-nav,
.search-pdf-zoom-group{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
}

.search-pdf-zoom-group{
  padding:4px;
  border:1px solid #d3deeb;
  border-radius:12px;
  background:rgba(248,251,255,.9);
}

.search-pdf-zoom-group .secondary-btn,
.search-pdf-page-nav .secondary-btn{
  min-height:34px;
  margin:0;
  padding:7px 10px;
}

.search-pdf-zoom-value{
  min-width:58px;
  font-variant-numeric:tabular-nums;
}

.search-pdf-stage{
  width:100%;
  min-height:420px;
  max-height:76vh;
  overflow:auto;
  padding:18px;
  border:1px solid #cbd8e7;
  border-radius:12px;
  background:
    linear-gradient(45deg,#edf2f7 25%,transparent 25%),
    linear-gradient(-45deg,#edf2f7 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#edf2f7 75%),
    linear-gradient(-45deg,transparent 75%,#edf2f7 75%);
  background-size:22px 22px;
  background-position:0 0,0 11px,11px -11px,-11px 0;
}

.search-pdf-page-wrap{
  position:relative;
  width:max-content;
  margin:0 auto;
  background:#fff;
  box-shadow:0 12px 30px rgba(28,55,91,.18);
}

#searchPdfCanvas{
  display:block;
  max-width:none;
}

.search-pdf-highlight-layer{
  position:absolute;
  inset:0;
  z-index:3;
  pointer-events:none;
}

.search-pdf-highlight{
  position:absolute;
  border-radius:3px;
  background:rgba(255,223,0,.40);
  box-shadow:0 0 0 1px rgba(224,173,0,.22);
}

.search-pdf-highlight.current{
  background:rgba(255,146,0,.48);
  box-shadow:
    0 0 0 2px rgba(240,126,0,.78),
    0 0 0 5px rgba(255,176,49,.18);
}

@media(max-width:900px){
  .search-pdf-meta-row{
    align-items:flex-start;
    flex-direction:column;
  }

  .search-pdf-result-nav{
    justify-content:flex-start;
  }

  .search-pdf-workspace:has(.search-pdf-results:not([hidden])){
    grid-template-columns:220px minmax(0,1fr);
  }

  .search-pdf-viewer-toolbar{
    align-items:flex-start;
    flex-direction:column;
  }
}

@media(max-width:720px){
  .search-pdf-app{padding:11px}
  .search-pdf-topbar{flex-direction:column}
  .search-pdf-box{grid-template-columns:1fr}
  .search-pdf-workspace,
  .search-pdf-workspace:has(.search-pdf-results:not([hidden])){
    grid-template-columns:1fr;
  }
  .search-pdf-results{max-height:240px}
  .search-pdf-stage{min-height:320px;max-height:68vh;padding:10px}
  .search-pdf-page-nav,
  .search-pdf-zoom-group{
    width:100%;
    justify-content:center;
  }
}


/* =========================================================
   SEARCH PDF — RED KEYWORD + GO TO PAGE
   ========================================================= */

.search-pdf-result{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
}

.search-pdf-result-main{
  min-width:0;
  cursor:pointer;
}

.search-keyword-red{
  padding:0 2px;
  border-radius:3px;
  background:rgba(220,53,69,.14);
  color:#c62838;
  font-weight:900;
}

.search-pdf-goto{
  align-self:center;
  min-height:34px;
  padding:7px 10px;
  border:1px solid #c7d8ec;
  border-radius:9px;
  background:#fff;
  color:#2468d8;
  font-size:10px;
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
}

.search-pdf-goto:hover{
  border-color:#2b74df;
  background:#eef5ff;
}

/* Every matching word on the opened page is red. */
.search-pdf-highlight{
  background:rgba(220,53,69,.23) !important;
  box-shadow:0 0 0 1px rgba(198,40,56,.48) !important;
}

/* The currently selected result gets a stronger red marker. */
.search-pdf-highlight.current{
  background:rgba(220,53,69,.38) !important;
  box-shadow:
    0 0 0 2px rgba(198,40,56,.88),
    0 0 0 5px rgba(220,53,69,.13) !important;
}

@media(max-width:720px){
  .search-pdf-result{
    grid-template-columns:1fr;
  }

  .search-pdf-goto{
    justify-self:start;
  }
}


/* =========================================================
   SEARCH PDF — EXPANDED GO TO PAGE VIEW
   ========================================================= */

.search-pdf-back-results{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:8px 12px;
  font-weight:800;
}

.search-pdf-workspace.detail-mode{
  grid-template-columns:minmax(0,1fr) !important;
}

.search-pdf-results.collapsed-for-detail{
  display:none !important;
}

.search-pdf-workspace.detail-mode .search-pdf-viewer-card{
  width:100%;
  max-width:none;
  padding:14px;
}

.search-pdf-workspace.detail-mode .search-pdf-stage{
  min-height:72vh;
  max-height:82vh;
  padding:18px;
}

.search-pdf-workspace.detail-mode .search-pdf-page-wrap{
  margin:0 auto;
}

.search-pdf-workspace.detail-mode .search-pdf-viewer-toolbar{
  position:sticky;
  top:0;
  z-index:15;
  padding:8px;
  margin:-4px -4px 10px;
  border:1px solid #d8e2ed;
  border-radius:12px;
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(8px);
}

.search-pdf-workspace.detail-mode .search-pdf-back-results{
  margin-right:auto;
}

.search-pdf-workspace.detail-mode #searchPdfCanvas{
  box-shadow:0 14px 34px rgba(28,55,91,.20);
}

/* Make current hit especially obvious in the enlarged page. */
.search-pdf-workspace.detail-mode .search-pdf-highlight.current{
  background:rgba(220,53,69,.46) !important;
  box-shadow:
    0 0 0 3px rgba(198,40,56,.92),
    0 0 0 8px rgba(220,53,69,.14) !important;
}

@media(max-width:720px){
  .search-pdf-workspace.detail-mode .search-pdf-stage{
    min-height:65vh;
    max-height:76vh;
    padding:8px;
  }

  .search-pdf-workspace.detail-mode .search-pdf-viewer-toolbar{
    align-items:stretch;
  }

  .search-pdf-back-results{
    width:100%;
  }
}




/* =========================================================
   SEARCH PDF — ENLARGED CENTERED VIEWER
   ========================================================= */

.search-pdf-stage-shell{
  position:relative;
  min-width:0;
}

.search-pdf-fullscreen-btn{
  position:absolute;
  top:14px;
  right:14px;
  z-index:30;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border:1px solid rgba(196,211,230,.95);
  border-radius:12px;
  background:rgba(255,255,255,.95);
  color:#23415f;
  font-size:22px;
  font-weight:800;
  line-height:1;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(31,65,102,.16);
  backdrop-filter:blur(8px);
}

.search-pdf-fullscreen-btn:hover{
  background:#fff;
  box-shadow:0 9px 22px rgba(31,65,102,.22);
}

.search-fullscreen-exit{
  display:none;
  font-size:17px;
}

.search-pdf-fullscreen-btn.is-fullscreen .search-fullscreen-enter{
  display:none;
}

.search-pdf-fullscreen-btn.is-fullscreen .search-fullscreen-exit{
  display:inline;
}

/* Enlarged mode is a centered product-style lightbox,
   not a true edge-to-edge fullscreen page. */
.search-pdf-stage-shell.pseudo-fullscreen{
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(78vw,980px);
  height:88vh;
  z-index:99999;
  padding:0;
  border:1px solid #c9d6e6;
  border-radius:18px;
  background:#eef3f8;
  box-shadow:
    0 26px 70px rgba(17,38,66,.28),
    0 0 0 9999px rgba(20,35,55,.36);
  overflow:hidden;
}

.search-pdf-stage-shell.pseudo-fullscreen .search-pdf-stage{
  width:100%;
  height:100%;
  min-height:0;
  max-height:none;
  padding:56px 18px 18px;
  border:0;
  border-radius:18px;
  overflow:auto;
  background:
    linear-gradient(45deg,#edf2f7 25%,transparent 25%),
    linear-gradient(-45deg,#edf2f7 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#edf2f7 75%),
    linear-gradient(-45deg,transparent 75%,#edf2f7 75%);
  background-size:22px 22px;
  background-position:0 0,0 11px,11px -11px,-11px 0;
}

.search-pdf-stage-shell.pseudo-fullscreen .search-pdf-page-wrap{
  margin:0 auto;
}

.search-pdf-stage-shell.pseudo-fullscreen .search-pdf-fullscreen-btn{
  position:absolute;
  top:10px;
  right:12px;
  width:40px;
  height:40px;
  z-index:100001;
}

.search-pdf-stage-shell.pseudo-fullscreen::before{
  content:"Enlarged PDF view";
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:48px;
  display:flex;
  align-items:center;
  padding:0 18px;
  border-bottom:1px solid #d5e0eb;
  background:rgba(255,255,255,.96);
  color:#263b57;
  font-size:12px;
  font-weight:800;
  z-index:100000;
}

body.search-pdf-fullscreen-open{
  overflow:hidden !important;
}

/* Keep the PDF large, but not so large that the user loses the whole page context. */
.search-pdf-stage-shell.pseudo-fullscreen #searchPdfCanvas{
  max-width:none;
  box-shadow:0 14px 34px rgba(28,55,91,.18);
}

@media(max-width:1100px){
  .search-pdf-stage-shell.pseudo-fullscreen{
    width:min(88vw,920px);
  }
}

@media(max-width:720px){
  .search-pdf-stage-shell.pseudo-fullscreen{
    width:94vw;
    height:88vh;
    border-radius:14px;
  }

  .search-pdf-stage-shell.pseudo-fullscreen .search-pdf-stage{
    padding:54px 8px 8px;
    border-radius:14px;
  }

  .search-pdf-fullscreen-btn{
    top:10px;
    right:10px;
    width:38px;
    height:38px;
    font-size:19px;
  }
}


/* =========================================================
   ORGANIZE PDF — LARGE THUMBNAIL PREVIEW
   ========================================================= */

.organize-preview{
  position:relative;
  cursor:zoom-in;
}

.organize-preview::after{
  content:"⛶";
  position:absolute;
  right:8px;
  bottom:8px;
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border:1px solid rgba(194,208,226,.95);
  border-radius:8px;
  background:rgba(255,255,255,.94);
  color:#2a4665;
  font-size:14px;
  font-weight:900;
  box-shadow:0 4px 12px rgba(28,55,91,.14);
  opacity:0;
  transform:translateY(3px);
  transition:opacity .15s ease,transform .15s ease;
  pointer-events:none;
}

.organize-card:hover .organize-preview::after{
  opacity:1;
  transform:translateY(0);
}

.organize-preview-modal[hidden]{
  display:none !important;
}

.organize-preview-modal{
  position:fixed;
  inset:0;
  z-index:100000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.organize-preview-backdrop{
  position:absolute;
  inset:0;
  background:rgba(19,34,54,.48);
  backdrop-filter:blur(3px);
}

.organize-preview-dialog{
  position:relative;
  z-index:2;
  width:min(92vw,1120px);
  height:min(90vh,900px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid #cad7e7;
  border-radius:18px;
  background:#fff;
  box-shadow:0 26px 74px rgba(16,37,66,.32);
}

.organize-preview-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid #dbe4ef;
  background:rgba(255,255,255,.98);
}

.organize-preview-header strong{
  display:block;
  color:#17233b;
  font-size:15px;
  margin-bottom:3px;
}

.organize-preview-header span{
  color:#738197;
  font-size:11px;
}

.organize-preview-close{
  width:38px;
  height:38px;
  border:1px solid #d4dfeb;
  border-radius:10px;
  background:#fff;
  color:#263b57;
  font-size:22px;
  line-height:1;
  cursor:pointer;
}

.organize-preview-toolbar{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px;
  padding:10px 14px;
  border-bottom:1px solid #dbe4ef;
  background:#f8fbff;
}

.organize-preview-toolbar .secondary-btn{
  min-height:34px;
  margin:0;
}

.organize-preview-stage{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:20px;
  background:
    linear-gradient(45deg,#edf2f7 25%,transparent 25%),
    linear-gradient(-45deg,#edf2f7 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#edf2f7 75%),
    linear-gradient(-45deg,transparent 75%,#edf2f7 75%);
  background-size:22px 22px;
  background-position:0 0,0 11px,11px -11px,-11px 0;
}

.organize-preview-page-wrap{
  transform-origin:center center;
  margin:0 auto;
  background:#fff;
  box-shadow:0 14px 36px rgba(25,52,87,.18);
}

#organizePreviewCanvas{
  display:block;
  max-width:none;
}

body.organize-preview-open{
  overflow:hidden !important;
}

@media(max-width:720px){
  .organize-preview-modal{
    padding:8px;
  }

  .organize-preview-dialog{
    width:96vw;
    height:92vh;
    border-radius:14px;
  }

  .organize-preview-stage{
    padding:10px;
  }
}


/* Organize preview interaction stability */
.organize-preview-backdrop{
  z-index:1 !important;
}

.organize-preview-dialog{
  z-index:3 !important;
  pointer-events:auto !important;
}

.organize-preview-header,
.organize-preview-toolbar,
.organize-preview-stage{
  position:relative;
  z-index:1;
}

.organize-preview-close,
.organize-preview-toolbar button{
  position:relative;
  z-index:5;
  pointer-events:auto !important;
}


/* =========================================================
   SHARE COMPLETED FILE
   ========================================================= */

.share-output-panel[hidden]{
  display:none !important;
}

.share-output-panel{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
  margin-top:14px;
  padding:13px 14px;
  border:1px solid #c9dece;
  border-radius:14px;
  background:linear-gradient(135deg,rgba(244,252,247,.98),rgba(248,251,255,.98));
  box-shadow:0 7px 20px rgba(32,75,55,.06);
}

.share-output-info{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.share-output-icon{
  flex:0 0 auto;
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#e2f4e8;
  color:#20804b;
  font-size:16px;
  font-weight:900;
}

.share-output-copy{
  min-width:0;
  text-align:left;
}

.share-output-copy strong{
  display:block;
  color:#20354a;
  font-size:12px;
  margin-bottom:3px;
}

.share-output-copy span{
  display:block;
  max-width:260px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#6d7e92;
  font-size:11px;
}

.share-output-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
}

.share-action-btn{
  min-height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:8px 12px;
  border:1px solid #cad7e6;
  border-radius:10px;
  background:#fff;
  color:#31455f;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}

.share-action-btn:hover:not(:disabled){
  border-color:#8eb5e8;
  background:#f4f8ff;
}

.share-action-btn.primary-share{
  border-color:#2b74df;
  background:#2b74df;
  color:#fff;
}

.share-action-btn.primary-share:hover:not(:disabled){
  background:#2164c5;
}

.share-action-btn:disabled{
  opacity:.45;
  cursor:not-allowed;
}

.share-action-icon{
  font-size:15px;
  line-height:1;
}

.share-output-close{
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#718198;
  font-size:19px;
  cursor:pointer;
}

.share-output-close:hover{
  background:#edf2f7;
}

.share-output-hint{
  flex:1 0 100%;
  padding-top:8px;
  border-top:1px solid rgba(202,218,207,.8);
  color:#6d7e92;
  font-size:10px;
  line-height:1.45;
  text-align:left;
}

@media(max-width:720px){
  .share-output-panel{
    align-items:stretch;
  }

  .share-output-info,
  .share-output-actions{
    width:100%;
  }

  .share-output-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .share-output-close{
    position:absolute;
    right:10px;
  }
}


/* =========================================================
   PDF SECURITY CHECK
   ========================================================= */

.security-intro{
  display:flex;
  align-items:flex-start;
  gap:12px;
  margin:14px 0;
  padding:13px 14px;
  border:1px solid #d7e2ee;
  border-radius:14px;
  background:rgba(248,251,255,.9);
}
.security-intro-icon{
  flex:0 0 auto;
  width:38px;height:38px;
  display:grid;place-items:center;
  border-radius:11px;background:#eaf3ff;font-size:20px;
}
.security-intro strong,.security-intro span{display:block;text-align:left}
.security-intro strong{margin-bottom:4px;color:#20344e;font-size:12px}
.security-intro span{color:#718097;font-size:11px;line-height:1.45}
.security-scan-btn{margin-top:2px}
.security-result{margin-top:16px}
.security-summary{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:12px;align-items:center;padding:15px;
  border:1px solid #cfe3d6;border-radius:16px;
  background:linear-gradient(135deg,#f4fcf7,#f8fbff);
}
.security-summary.warning{border-color:#ead7a6;background:linear-gradient(135deg,#fffaf0,#fffdf8)}
.security-summary.high{border-color:#efc0c5;background:linear-gradient(135deg,#fff4f5,#fff9f9)}
.security-summary.info{border-color:#c9daee;background:linear-gradient(135deg,#f4f9ff,#fbfdff)}
.security-shield{
  width:48px;height:48px;display:grid;place-items:center;border-radius:14px;
  background:#e1f4e7;color:#1f824c;font-size:23px;font-weight:900;
}
.security-summary.warning .security-shield{background:#fff0c7;color:#9b6800}
.security-summary.high .security-shield{background:#ffe0e4;color:#c62f43}
.security-summary.info .security-shield{background:#e5f0ff;color:#2c69bb}
.security-summary-copy{min-width:0;text-align:left}
.security-kicker{display:block;color:#8390a2;font-size:9px;font-weight:900;letter-spacing:.08em;margin-bottom:3px}
.security-summary-copy strong{display:block;color:#1c3049;font-size:15px;margin-bottom:4px}
.security-summary-copy > span:last-child{display:block;color:#69798f;font-size:11px;line-height:1.45}
.security-risk-badge{
  padding:7px 10px;border-radius:999px;background:#def2e5;color:#1e7b48;
  font-size:10px;font-weight:900;white-space:nowrap;
}
.security-risk-badge.warning{background:#fff0c7;color:#8e6200}
.security-risk-badge.high{background:#ffe0e4;color:#ba2639}
.security-risk-badge.info{background:#e5f0ff;color:#2c69bb}
.security-metrics{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  gap:9px;margin:10px 0 14px;
}
.security-metrics > div{
  padding:11px 12px;border:1px solid #dbe4ef;border-radius:12px;background:#fff;text-align:left;
}
.security-metrics span,.security-metrics strong{display:block}
.security-metrics span{color:#7b899b;font-size:9px;margin-bottom:4px}
.security-metrics strong{color:#263b56;font-size:13px}
.security-findings-wrap,.security-urls-wrap{
  margin-top:12px;padding:13px;border:1px solid #d8e3ef;border-radius:14px;background:rgba(255,255,255,.78);
}
.security-section-head{margin-bottom:10px;text-align:left}
.security-section-head strong,.security-section-head span{display:block}
.security-section-head strong{color:#253a55;font-size:12px;margin-bottom:3px}
.security-section-head span{color:#7a889a;font-size:10px;line-height:1.4}
.security-findings{display:grid;gap:8px}
.security-finding{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;
  align-items:flex-start;gap:10px;padding:10px 11px;border:1px solid #dce5ee;
  border-radius:11px;background:#fff;text-align:left;
}
.security-finding.high{border-color:#efc4ca;background:#fff8f8}
.security-finding.warning{border-color:#eadab2;background:#fffdf7}
.security-finding.info{border-color:#cfdeef;background:#f9fcff}
.security-finding.safe{border-color:#cfe4d7;background:#f8fcf9}
.security-finding-icon{
  width:26px;height:26px;display:grid;place-items:center;border-radius:8px;background:#eef3f8;font-weight:900;
}
.security-finding.high .security-finding-icon{background:#ffe1e5;color:#c32e42}
.security-finding.warning .security-finding-icon{background:#fff0c9;color:#916200}
.security-finding.safe .security-finding-icon{background:#e3f3e8;color:#257d4d}
.security-finding strong,.security-finding span{display:block}
.security-finding strong{margin-bottom:3px;color:#2a3d55;font-size:11px}
.security-finding div span{color:#748397;font-size:10px;line-height:1.4}
.security-finding-tag{
  padding:5px 7px;border-radius:999px;background:#edf2f7;color:#5f7086;font-size:8px;font-weight:900;white-space:nowrap;
}
.security-finding.high .security-finding-tag{background:#ffe3e7;color:#b9263a}
.security-finding.warning .security-finding-tag{background:#fff1cd;color:#8b6208}
.security-urls{display:grid;gap:6px;max-height:270px;overflow:auto}
.security-url{
  display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px;align-items:start;
  padding:8px 9px;border:1px solid #e0e7ef;border-radius:9px;background:#fff;text-align:left;
}
.security-url code{overflow-wrap:anywhere;color:#465a72;font-size:9px;line-height:1.45}
.security-url-risk{
  padding:4px 6px;border-radius:6px;background:#edf2f7;color:#64748a;font-size:8px;font-weight:900;
}
.security-url.high .security-url-risk{background:#ffe2e6;color:#be293d}
.security-url.warning .security-url-risk{background:#fff0cb;color:#8c6205}
.security-disclaimer{
  margin-top:12px;padding:10px 12px;border-radius:11px;background:#f3f6fa;
  color:#6b798c;font-size:10px;line-height:1.45;text-align:left;
}
.security-disclaimer strong{color:#3a4c63}
@media(max-width:720px){
  .security-summary{grid-template-columns:auto 1fr}
  .security-risk-badge{grid-column:1 / -1;justify-self:start}
  .security-metrics{grid-template-columns:1fr 1fr}
  .security-finding{grid-template-columns:auto minmax(0,1fr)}
  .security-finding-tag{grid-column:2;justify-self:start}
}


/* =========================================================
   EMBEDDED MODE — OPEN FULL TOOLKIT NOTICE
   ========================================================= */

.embedded-full-toolkit-notice[hidden]{
  display:none !important;
}

.embedded-full-toolkit-notice{
  position:sticky;
  top:8px;
  z-index:120;
  width:max-content;
  max-width:calc(100% - 24px);
  margin:8px 12px 10px auto;
  display:flex;
  align-items:center;
  gap:9px;
  padding:9px 11px;
  border:1px solid rgba(93,137,205,.38);
  border-radius:12px;
  background:rgba(255,255,255,.96);
  color:#244263;
  text-decoration:none;
  box-shadow:0 7px 20px rgba(35,70,111,.13);
  backdrop-filter:blur(10px);
  transition:
    transform .15s ease,
    box-shadow .15s ease,
    border-color .15s ease;
}

.embedded-full-toolkit-notice:hover{
  transform:translateY(-1px);
  border-color:#75a2e5;
  box-shadow:0 10px 25px rgba(35,70,111,.18);
}

.embedded-notice-dot{
  flex:0 0 auto;
  width:9px;
  height:9px;
  border-radius:50%;
  background:#2b74df;
  box-shadow:0 0 0 5px rgba(43,116,223,.12);
}

.embedded-notice-copy{
  min-width:0;
  text-align:left;
}

.embedded-notice-copy strong,
.embedded-notice-copy small{
  display:block;
}

.embedded-notice-copy strong{
  color:#1f3857;
  font-size:11px;
  line-height:1.25;
}

.embedded-notice-copy small{
  margin-top:2px;
  color:#718198;
  font-size:9px;
  line-height:1.25;
}

.embedded-notice-arrow{
  flex:0 0 auto;
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:#edf5ff;
  color:#2468d8;
  font-size:14px;
  font-weight:900;
}

@media(max-width:720px){
  .embedded-full-toolkit-notice{
    position:sticky;
    top:6px;
    margin:6px 8px 8px auto;
    max-width:calc(100% - 16px);
    padding:8px 9px;
  }

  .embedded-notice-copy strong{
    font-size:10px;
  }

  .embedded-notice-copy small{
    font-size:8px;
  }
}


/* =========================================================
   PDF COMPARE
   ========================================================= */

.compare-file-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.compare-dropzone{
  min-width:0;
}

.compare-options-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:13px 0;
  padding:12px 13px;
  border:1px solid #d7e2ee;
  border-radius:14px;
  background:rgba(248,251,255,.9);
}

.compare-options-copy{
  min-width:0;
  text-align:left;
}

.compare-options-copy strong,
.compare-options-copy span{
  display:block;
}

.compare-options-copy strong{
  color:#21364f;
  font-size:12px;
  margin-bottom:3px;
}

.compare-options-copy span{
  color:#738198;
  font-size:10px;
  line-height:1.4;
}

.compare-sensitivity{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:auto 120px 34px;
  align-items:center;
  gap:8px;
  color:#687990;
  font-size:10px;
}

.compare-sensitivity input{
  width:120px;
}

.compare-sensitivity b{
  min-width:34px;
  padding:5px 6px;
  border:1px solid #d2deeb;
  border-radius:8px;
  background:#fff;
  color:#324963;
  text-align:center;
}

.compare-start-btn{
  margin-top:0;
}

.compare-progress{
  margin-top:12px;
  padding:10px 12px;
  border:1px solid #d6e2ee;
  border-radius:12px;
  background:#f8fbff;
}

.compare-progress-track{
  height:7px;
  overflow:hidden;
  border-radius:999px;
  background:#e6edf5;
}

.compare-progress-track span{
  display:block;
  width:0;
  height:100%;
  border-radius:inherit;
  background:#2b74df;
  transition:width .15s ease;
}

.compare-progress > span{
  display:block;
  margin-top:6px;
  color:#748399;
  font-size:10px;
  text-align:left;
}

.compare-result{
  margin-top:16px;
}

.compare-summary{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:16px;
  align-items:center;
  padding:14px;
  border:1px solid #cfdeee;
  border-radius:15px;
  background:linear-gradient(135deg,#f7fbff,#fbfdff);
}

.compare-summary-main{
  min-width:0;
  text-align:left;
}

.compare-summary-main strong,
.compare-summary-main span{
  display:block;
}

.compare-kicker{
  color:#8491a3;
  font-size:9px;
  font-weight:900;
  letter-spacing:.08em;
  margin-bottom:3px;
}

.compare-summary-main strong{
  color:#223851;
  font-size:15px;
  margin-bottom:4px;
}

.compare-summary-main span:last-child{
  color:#718097;
  font-size:10px;
  line-height:1.4;
}

.compare-summary-score{
  min-width:115px;
  padding:9px 12px;
  border:1px solid #cfe0f3;
  border-radius:12px;
  background:#fff;
  text-align:center;
}

.compare-summary-score strong,
.compare-summary-score span{
  display:block;
}

.compare-summary-score strong{
  color:#2468d8;
  font-size:20px;
}

.compare-summary-score span{
  margin-top:2px;
  color:#78879a;
  font-size:9px;
}

.compare-metrics{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin:10px 0;
}

.compare-metrics > div{
  padding:10px 11px;
  border:1px solid #dce5ef;
  border-radius:11px;
  background:#fff;
  text-align:left;
}

.compare-metrics span,
.compare-metrics strong{
  display:block;
}

.compare-metrics span{
  margin-bottom:3px;
  color:#7c8999;
  font-size:9px;
}

.compare-metrics strong{
  color:#2b4059;
  font-size:12px;
}

.compare-page-toolbar{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px;
  margin:12px 0;
  padding:9px;
  border:1px solid #d7e2ee;
  border-radius:12px;
  background:#f8fbff;
}

.compare-page-toolbar .secondary-btn{
  min-height:34px;
  margin:0;
}

.compare-page-selector{
  display:flex;
  align-items:center;
  gap:6px;
  color:#61728a;
  font-size:10px;
  font-weight:700;
}

.compare-page-selector select{
  min-width:62px;
  height:34px;
  padding:5px 8px;
  border:1px solid #cfdae8;
  border-radius:9px;
  background:#fff;
  color:#2a405a;
  font-weight:800;
}

.compare-view-switch{
  display:flex;
  align-items:center;
  gap:5px;
  margin-left:auto;
}

.compare-view-switch .active{
  border-color:#2b74df;
  background:#eef5ff;
  color:#2468d8;
}

.compare-side-view{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.compare-view-card{
  min-width:0;
  overflow:hidden;
  border:1px solid #d8e2ed;
  border-radius:13px;
  background:#fff;
}

.compare-view-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 11px;
  border-bottom:1px solid #dce5ef;
  background:#f8fbff;
}

.compare-view-head strong{
  color:#2c4059;
  font-size:11px;
}

.compare-view-head span{
  max-width:65%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#7b899b;
  font-size:9px;
}

.compare-canvas-stage,
.compare-diff-stage{
  min-height:380px;
  max-height:68vh;
  overflow:auto;
  padding:12px;
  background:
    linear-gradient(45deg,#edf2f7 25%,transparent 25%),
    linear-gradient(-45deg,#edf2f7 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#edf2f7 75%),
    linear-gradient(-45deg,transparent 75%,#edf2f7 75%);
  background-size:20px 20px;
  background-position:0 0,0 10px,10px -10px,-10px 0;
}

.compare-canvas-stage canvas,
.compare-diff-stage canvas{
  display:block;
  max-width:none;
  margin:0 auto;
  background:#fff;
  box-shadow:0 8px 24px rgba(28,55,91,.15);
}

.compare-diff-view{
  border:1px solid #d8e2ed;
  border-radius:13px;
  overflow:hidden;
  background:#fff;
}

.compare-diff-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-bottom:1px solid #dce5ef;
  background:#fff8f8;
  text-align:left;
}

.compare-diff-head strong,
.compare-diff-head span{
  display:block;
}

.compare-diff-head strong{
  color:#49333a;
  font-size:11px;
  margin-bottom:3px;
}

.compare-diff-head div span{
  color:#88747a;
  font-size:9px;
}

.compare-diff-badge{
  flex:0 0 auto;
  padding:6px 8px;
  border-radius:999px;
  background:#edf2f7;
  color:#65758a;
  font-size:9px;
  font-weight:900;
}

.compare-diff-badge.has-change{
  background:#ffe3e7;
  color:#be293d;
}

.compare-page-list-wrap{
  margin-top:12px;
  padding:12px;
  border:1px solid #d9e3ee;
  border-radius:13px;
  background:rgba(255,255,255,.78);
}

.compare-page-list-head{
  margin-bottom:9px;
  text-align:left;
}

.compare-page-list-head strong,
.compare-page-list-head span{
  display:block;
}

.compare-page-list-head strong{
  color:#293e57;
  font-size:11px;
  margin-bottom:2px;
}

.compare-page-list-head span{
  color:#7d8999;
  font-size:9px;
}

.compare-changed-list{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  max-height:180px;
  overflow:auto;
}

.compare-page-chip{
  min-width:92px;
  padding:8px 9px;
  border:1px solid #d7e1ed;
  border-radius:9px;
  background:#fff;
  cursor:pointer;
  text-align:left;
}

.compare-page-chip strong,
.compare-page-chip span{
  display:block;
}

.compare-page-chip strong{
  color:#30455f;
  font-size:10px;
  margin-bottom:2px;
}

.compare-page-chip span{
  color:#c13a4a;
  font-size:8px;
}

.compare-page-chip:hover,
.compare-page-chip.active{
  border-color:#2b74df;
  background:#eef5ff;
}

.compare-no-changes{
  width:100%;
  padding:10px;
  border-radius:9px;
  background:#f2faf5;
  color:#347452;
  font-size:10px;
  text-align:left;
}

.compare-note{
  margin-top:10px;
  padding:9px 10px;
  border-radius:10px;
  background:#f3f6fa;
  color:#758296;
  font-size:9px;
  line-height:1.45;
  text-align:left;
}

@media(max-width:820px){
  .compare-file-grid,
  .compare-side-view{
    grid-template-columns:1fr;
  }

  .compare-options-card{
    align-items:flex-start;
    flex-direction:column;
  }

  .compare-view-switch{
    width:100%;
    margin-left:0;
    justify-content:center;
  }
}

@media(max-width:620px){
  .compare-summary{
    grid-template-columns:1fr;
  }

  .compare-summary-score{
    justify-self:start;
  }

  .compare-metrics{
    grid-template-columns:1fr 1fr;
  }

  .compare-sensitivity{
    width:100%;
    grid-template-columns:auto minmax(0,1fr) 34px;
  }

  .compare-sensitivity input{
    width:100%;
  }

  .compare-canvas-stage,
  .compare-diff-stage{
    min-height:300px;
    padding:8px;
  }
}


/* =========================================================
   PDF COMPARE — FULLSCREEN VIEW
   ========================================================= */

.compare-viewer-shell{
  position:relative;
}

.compare-fullscreen-btn{
  min-width:108px;
}

.compare-fullscreen-exit{
  display:none;
}

.compare-fullscreen-btn.is-fullscreen .compare-fullscreen-enter{
  display:none;
}

.compare-fullscreen-btn.is-fullscreen .compare-fullscreen-exit{
  display:inline;
}

.compare-viewer-shell.compare-fullscreen-mode{
  position:fixed;
  inset:2vh 2vw;
  z-index:100000;
  display:flex;
  flex-direction:column;
  min-width:0;
  padding:12px;
  overflow:hidden;
  border:1px solid #cbd8e7;
  border-radius:18px;
  background:#f5f8fc;
  box-shadow:
    0 28px 80px rgba(17,38,66,.34),
    0 0 0 9999px rgba(16,31,49,.48);
}

.compare-viewer-shell.compare-fullscreen-mode .compare-page-toolbar{
  position:sticky;
  top:0;
  z-index:10;
  flex:0 0 auto;
  margin:0 0 10px;
  background:rgba(255,255,255,.97);
  backdrop-filter:blur(10px);
  box-shadow:0 6px 18px rgba(31,63,99,.08);
}

.compare-viewer-shell.compare-fullscreen-mode .compare-side-view,
.compare-viewer-shell.compare-fullscreen-mode .compare-diff-view{
  flex:1 1 auto;
  min-height:0;
}

.compare-viewer-shell.compare-fullscreen-mode .compare-side-view{
  grid-template-columns:1fr 1fr;
  height:calc(100% - 58px);
}

.compare-viewer-shell.compare-fullscreen-mode .compare-view-card,
.compare-viewer-shell.compare-fullscreen-mode .compare-diff-view{
  min-height:0;
  display:flex;
  flex-direction:column;
}

.compare-viewer-shell.compare-fullscreen-mode .compare-canvas-stage,
.compare-viewer-shell.compare-fullscreen-mode .compare-diff-stage{
  flex:1 1 auto;
  min-height:0;
  max-height:none;
  height:100%;
  padding:18px;
}

.compare-viewer-shell.compare-fullscreen-mode .compare-diff-view{
  height:calc(100% - 58px);
}

.compare-viewer-shell.compare-fullscreen-mode .compare-diff-stage{
  height:auto;
}

.compare-viewer-shell.compare-fullscreen-mode .compare-canvas-stage canvas,
.compare-viewer-shell.compare-fullscreen-mode .compare-diff-stage canvas{
  max-width:none;
}

body.compare-fullscreen-open{
  overflow:hidden !important;
}

@media(max-width:820px){
  .compare-viewer-shell.compare-fullscreen-mode{
    inset:1vh 1vw;
    padding:8px;
    border-radius:14px;
  }

  .compare-viewer-shell.compare-fullscreen-mode .compare-side-view{
    grid-template-columns:1fr;
    overflow:auto;
    height:calc(100% - 58px);
  }

  .compare-viewer-shell.compare-fullscreen-mode .compare-view-card{
    min-height:70vh;
  }

  .compare-viewer-shell.compare-fullscreen-mode .compare-page-toolbar{
    align-items:stretch;
  }

  .compare-viewer-shell.compare-fullscreen-mode .compare-view-switch{
    width:100%;
  }

  .compare-fullscreen-btn{
    min-width:96px;
  }
}


/* =========================================================
   LEGAL / PRIVACY PAGES
   ========================================================= */

.legal-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px;
}

.legal-footer-links{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:10px;
}

.legal-footer-links a,
.legal-link-button{
  border:0;
  padding:0;
  background:transparent;
  color:#66788f;
  font:inherit;
  font-size:10px;
  text-decoration:none;
  cursor:pointer;
}

.legal-footer-links a:hover,
.legal-link-button:hover{
  color:#2468d8;
  text-decoration:underline;
}

body.legal-page{
  min-height:100vh;
  margin:0;
  background:
    radial-gradient(circle at 10% 0%,rgba(207,231,255,.65),transparent 34%),
    radial-gradient(circle at 90% 20%,rgba(221,244,235,.65),transparent 32%),
    #f5f8fb;
  color:#25364d;
}

.legal-shell{
  width:min(920px,calc(100% - 28px));
  margin:0 auto;
  padding:26px 0 40px;
}

.legal-header{
  display:flex;
  align-items:flex-start;
  gap:18px;
  margin-bottom:14px;
}

.legal-back{
  flex:0 0 auto;
  margin-top:5px;
  color:#2b6fd3;
  font-size:11px;
  font-weight:800;
  text-decoration:none;
}

.legal-header h1{
  margin:2px 0 4px;
  color:#1e3048;
  font-size:28px;
}

.legal-updated{
  margin:0;
  color:#7c8999;
  font-size:10px;
}

.legal-card{
  padding:20px 22px;
  border:1px solid #d9e3ee;
  border-radius:18px;
  background:rgba(255,255,255,.94);
  box-shadow:0 14px 36px rgba(33,63,98,.08);
}

.legal-card section + section{
  margin-top:22px;
  padding-top:18px;
  border-top:1px solid #e3e9f0;
}

.legal-card h2{
  margin:0 0 8px;
  color:#223750;
  font-size:16px;
}

.legal-card p{
  margin:7px 0;
  color:#5f6f83;
  font-size:12px;
  line-height:1.7;
}

.legal-card a{
  color:#2468d8;
}

.legal-action{
  min-height:38px;
  padding:8px 12px;
  border:1px solid #2b74df;
  border-radius:10px;
  background:#2b74df;
  color:#fff;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}

.legal-action:hover{
  background:#2164c5;
}

.legal-page-footer{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:12px;
  padding:16px 0 0;
}

.legal-page-footer a{
  color:#687a91;
  font-size:10px;
  text-decoration:none;
}

.legal-page-footer a:hover{
  color:#2468d8;
  text-decoration:underline;
}

@media(max-width:680px){
  .legal-header{
    flex-direction:column;
    gap:8px;
  }

  .legal-card{
    padding:16px;
  }

  .legal-footer{
    align-items:flex-start;
    flex-direction:column;
  }

  .legal-footer-links{
    justify-content:flex-start;
  }
}


/* =========================================================
   LEGAL FOOTER — ALIGNMENT & MOBILE FIX
   ========================================================= */

.legal-footer{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px 20px;
}

.legal-footer > p{
  margin:0;
  min-width:0;
  text-align:left;
}

.legal-footer-links{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:8px 14px;
  min-width:0;
}

.legal-footer-links a,
.legal-link-button{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  white-space:nowrap;
}

.legal-link-button{
  border-radius:7px;
  padding:4px 6px;
}

.legal-link-button:hover,
.legal-link-button:focus-visible{
  background:#edf5ff;
  outline:none;
}

.legal-link-button.consent-ready::before{
  content:"";
  width:5px;
  height:5px;
  margin-right:5px;
  border-radius:50%;
  background:#2daf61;
}

.legal-consent-fallback{
  margin-top:14px !important;
  padding:10px 12px;
  border:1px solid #d8e3ef;
  border-radius:10px;
  background:#f5f8fc;
}

@media(max-width:760px){
  .legal-footer{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding-left:12px;
    padding-right:12px;
    text-align:center;
  }

  .legal-footer > p{
    width:100%;
    text-align:center;
    line-height:1.45;
  }

  .legal-footer-links{
    width:100%;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
    justify-content:center;
  }

  .legal-footer-links a,
  .legal-link-button{
    width:100%;
    min-height:34px;
    justify-content:center;
    padding:6px 8px;
    border:1px solid #d8e2ed;
    border-radius:9px;
    background:rgba(255,255,255,.75);
    text-align:center;
    white-space:normal;
    line-height:1.25;
  }
}

@media(max-width:420px){
  .legal-footer-links{
    grid-template-columns:1fr;
  }
}
