/* Docshar — tool pages (#toolView): option segments, page grid, form-field boxes. */

/* ---------- Tool pages ---------- */
.seg { display: grid; gap: 6px; }
.seg-opt { text-align: left; padding: 9px 11px; border-radius: 10px; border: 1px solid #e2e8f0; background: #fff; font-size: 13px; color: #3f3f46; transition: all .15s; }
.seg-opt:hover { border-color: #c7d2fe; }
.seg-opt[data-on="true"] { border-color: #6366f1; background: #eef2ff; color: #3730a3; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; }
.pg-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 12px; border: 1px solid #e2e8f0; background: #fff; transition: all .15s; user-select: none; }
.pg-card:hover { border-color: #c7d2fe; }
.pg-card[data-sel="true"] { border-color: #6366f1; background: #eef2ff; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.pg-card[data-mark="delete"][data-sel="true"] { border-color: #e11d48; background: #fff1f2; box-shadow: 0 0 0 3px rgba(225,29,72,.12); }
.pg-card[data-mark="delete"][data-sel="true"] .pg-thumb { opacity: .45; }
.pg-card.dragging { opacity: .4; }
.pg-card.drop-before { box-shadow: -4px 0 0 #6366f1; }
.pg-thumb { width: 100%; aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center; background: #f8fafc; border-radius: 6px; overflow: hidden; }
.pg-thumb canvas { max-width: 100%; max-height: 100%; box-shadow: 0 1px 3px rgba(15,23,42,.18); background: #fff; transition: transform .2s; }
.pg-check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 9999px; display: none; align-items: center; justify-content: center; color: #fff; background: #6366f1; font-size: 13px; font-weight: 700; }
.pg-card[data-sel="true"] .pg-check { display: flex; }
.pg-card[data-mark="delete"] .pg-check { background: #e11d48; }
.pg-tools { display: flex; gap: 2px; }
.pg-tools button { width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: #64748b; }
.pg-tools button:hover { background: #f1f5f9; color: #18181b; }
.ff-box { position: absolute; border: 1.5px solid #6366f1; background: rgba(99,102,241,.12); border-radius: 3px; font-size: 10px; color: #3730a3; overflow: hidden; white-space: nowrap; padding: 1px 3px; cursor: move; }
.ff-box[data-sel="true"] { border-color: #e11d48; background: rgba(225,29,72,.10); color: #9f1239; }

/* ---------- Six-spot position picker (page numbers, header & footer, Bates) ---------- */
.pos6 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 8px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; max-width: 220px; }
.pos6 .seg-opt { height: 30px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.pos6 .seg-opt:nth-child(1), .pos6 .seg-opt:nth-child(5) { justify-content: flex-start; padding-left: 9px; }
.pos6 .seg-opt:nth-child(3), .pos6 .seg-opt:nth-child(7) { justify-content: flex-end; padding-right: 9px; }
.pos6-dot { width: 18px; height: 5px; border-radius: 3px; background: #cbd5e1; transition: background .15s; }
.pos6 .seg-opt[data-on="true"] .pos6-dot { background: #4f46e5; }
.pos6-body { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: #fff; border-radius: 6px; box-shadow: inset 0 0 0 1px #eef2f7; }
.pos6-body span { height: 4px; border-radius: 2px; background: #e2e8f0; }
.pos6-body span:nth-child(2) { width: 85%; }
.pos6-body span:nth-child(4) { width: 60%; }

/* ---------- "Continue with" row on the result card ---------- */
.next-btn { height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid #e2e8f0; background: #fff; font-size: 13px; font-weight: 500; color: #3f3f46; display: inline-flex; align-items: center; gap: 7px; transition: border-color .15s, background .15s, color .15s; }
.next-btn:hover { border-color: #a5b4fc; background: #eef2ff; color: #3730a3; }
.next-btn svg { width: 16px; height: 16px; color: #6366f1; }
.next-more { position: relative; }
.next-pop { position: absolute; z-index: 30; left: 0; bottom: calc(100% + 6px); width: 280px; max-width: calc(100vw - 48px); background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 12px 32px -8px rgba(15,23,42,.25); padding: 8px; }
.next-pop[hidden] { display: none; }
.next-pop-list { max-height: 260px; overflow-y: auto; margin-top: 6px; }
.next-pop-list button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; font-size: 13px; color: #3f3f46; text-align: left; }
.next-pop-list button:hover, .next-pop-list button:focus-visible { background: #eef2ff; color: #3730a3; outline: none; }
.next-pop-list svg { width: 16px; height: 16px; color: #6366f1; flex-shrink: 0; }

/* ---------- Crop: page preview with a draggable crop box, page strip ---------- */
.crop-stage { width: 100%; display: flex; justify-content: center; }
.crop-holder { position: relative; overflow: hidden; background: #fff; box-shadow: 0 4px 14px rgba(15,23,42,.12), 0 0 0 1px #e2e8f0; touch-action: none; user-select: none; }
.crop-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crop-box { position: absolute; z-index: 1; cursor: move; outline: 2px solid #4f46e5; box-shadow: 0 0 0 9999px rgba(15,23,42,.45); }
.crop-box:focus-visible { outline: 3px solid #818cf8; }
.crop-box[data-dragging="true"] { box-shadow: 0 0 0 9999px rgba(15,23,42,.3); }
/* Handles: edges are pills, corners are squares; each has a larger invisible touch area. */
.crop-h { position: absolute; background: #fff; border: 2px solid #4f46e5; border-radius: 4px; box-shadow: 0 1px 3px rgba(15,23,42,.35); transition: transform .12s, background .12s; }
.crop-h::before { content: ""; position: absolute; inset: -10px; }
.crop-h:hover, .crop-box[data-dragging="true"] .crop-h { background: #4f46e5; }
.crop-h-n, .crop-h-s { left: 50%; width: 34px; height: 10px; margin-left: -17px; cursor: ns-resize; }
.crop-h-e, .crop-h-w { top: 50%; width: 10px; height: 34px; margin-top: -17px; cursor: ew-resize; }
.crop-h-n { top: -6px; } .crop-h-s { bottom: -6px; } .crop-h-w { left: -6px; } .crop-h-e { right: -6px; }
.crop-h-nw, .crop-h-ne, .crop-h-sw, .crop-h-se { width: 14px; height: 14px; }
.crop-h-nw { left: -8px; top: -8px; cursor: nwse-resize; } .crop-h-se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.crop-h-ne { right: -8px; top: -8px; cursor: nesw-resize; } .crop-h-sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.crop-off .crop-box { display: none; }
.crop-nav { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid #e2e8f0; color: #3f3f46; background: #fff; }
.crop-nav:hover:not(:disabled) { border-color: #a5b4fc; color: #4f46e5; }
.crop-nav:disabled { opacity: .4; cursor: default; }
.crop-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 6px; }
.crop-thumb { flex: 0 0 auto; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.crop-thumb-img { position: relative; display: block; width: 100%; overflow: hidden; background: #f1f5f9; border-radius: 4px; box-shadow: 0 0 0 1px #e2e8f0; }
.crop-thumb-box { position: absolute; outline: 1.5px solid #4f46e5; box-shadow: 0 0 0 999px rgba(15,23,42,.35); }
.crop-thumb[data-on="true"] .crop-thumb-img { box-shadow: 0 0 0 2px #4f46e5; }
.crop-thumb[data-own="true"] .crop-thumb-n { color: #4f46e5; font-weight: 700; }
.crop-thumb-n { font-size: 11px; color: #64748b; }

/* ---------- "About this tool" content (prerendered by scripts/build-tool-pages.js) ---------- */
.seo-content { margin-top: 48px; padding-top: 28px; border-top: 1px solid #e2e8f0; color: #3f3f46; font-size: 15px; line-height: 1.65; }
.seo-content:empty { display: none; }
.seo-lang { margin: 0 0 14px; font-size: 14px; }
.seo-lang a { font-weight: 600; }
.seo-narrow { margin-top: 32px; padding-top: 20px; font-size: 14px; }
.seo-content h2 { font-size: 17px; font-weight: 700; color: #18181b; margin: 0 0 10px; letter-spacing: -0.01em; }
.seo-content a { color: #4f46e5; font-weight: 500; text-decoration: none; }
.seo-content a:hover { text-decoration: underline; }
.seo-intro { font-size: 16px; color: #52525b; max-width: 760px; margin: 0 0 24px; }
.seo-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-bottom: 24px; }
.seo-narrow .seo-grid { grid-template-columns: 1fr; gap: 20px; }
.seo-steps { list-style: decimal; padding-left: 22px; margin: 0; }
.seo-list { list-style: disc; padding-left: 20px; margin: 0; }
.seo-steps li, .seo-list li { margin: 4px 0; }
.seo-note, .seo-privacy { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px 18px; margin-bottom: 20px; }
.seo-privacy p { margin: 0; }
.seo-faq { margin-bottom: 24px; }
.seo-faq details { border-bottom: 1px solid #e2e8f0; padding: 10px 0; }
.seo-faq summary { cursor: pointer; font-weight: 600; color: #27272a; }
.seo-faq details p { margin: 8px 0 2px; color: #52525b; }
.seo-related ul { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 0 0 12px; padding: 0; list-style: none; }
.seo-related li { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 14px; }
.seo-related li span { display: block; font-size: 13px; color: #71717a; margin-top: 2px; }
.seo-related p { margin: 0; }
/* Plain tool list on the home page before the JS grid replaces it */
.seo-home { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); padding: 12px 0 24px; }
.seo-cat h2 { font-size: 15px; font-weight: 700; color: #18181b; margin: 0 0 8px; }
.seo-cat ul { list-style: none; margin: 0; padding: 0; }
.seo-cat li { margin: 6px 0; font-size: 14px; color: #71717a; }
.seo-cat a { color: #4338ca; font-weight: 600; text-decoration: none; }
.seo-cat li span { display: block; font-size: 13px; }
