/* PDF Tiện Ích 1.2.1 — consolidated UI system. One owner per component. */
:root{--bg:#f6f8fb;--surface:#fff;--ink:#152c44;--text:#34465b;--muted:#61758c;--primary:#1557cf;--primary-hover:#0f439f;--primary-soft:#eef4ff;--line:#dce4ee;--success:#197047;--success-bg:#eaf8f0;--danger:#a52828;--danger-bg:#fff3f0;--radius:12px;--radius-sm:8px;--container:1200px;--focus:#91b9ff;--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;--space-8:32px;--space-10:40px;--space-12:48px}
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;line-height:1.6;font-size:15px;-webkit-font-smoothing:antialiased}
h1,h2,h3{color:var(--ink);line-height:1.25;letter-spacing:-.03em}
h1{font-size:clamp(2rem,4vw,3.25rem);margin:12px 0 16px;font-weight:800}
h2{font-size:clamp(1.35rem,2.4vw,1.85rem);margin:0 0 20px;font-weight:750}
h3{font-size:1.09rem;margin:0 0 8px;font-weight:700}
p{margin:0 0 16px}
a{color:inherit;text-decoration:none}
button,input,select{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.55}
:where(a,button,input,select,summary):focus-visible{outline:3px solid var(--focus);outline-offset:3px}
[hidden]{display:none!important}
header.site-header{background:var(--surface);border-bottom:1px solid var(--line)}
.nav,.container,.footer-inner{width:min(var(--container),calc(100% - 40px));margin-left:auto;margin-right:auto}
.nav{display:flex;align-items:center;justify-content:space-between;gap:24px;min-height:74px}
.brand{display:inline-flex;align-items:center;gap:2px;white-space:nowrap;font-size:21px;font-weight:800;letter-spacing:-.05em;color:var(--ink)}.brand span{color:var(--primary)}
.nav-links{display:flex;align-items:center;flex-wrap:wrap;gap:28px;font-size:14px;font-weight:650}
.nav-links a:hover,.textlink,.breadcrumb a,.related a{color:var(--primary)}
.tiny{font-size:13px;color:var(--muted)}
.hero{max-width:810px;margin:0 auto;text-align:center;padding:70px 0 34px}
.eyebrow{display:inline-flex;align-items:center;font-size:12px;font-weight:760;letter-spacing:.025em;color:#164a9d;background:var(--primary-soft);border:1px solid #d6e6ff;border-radius:40px;padding:6px 13px}
.hero h1{letter-spacing:-.047em}
.hero p{max-width:720px;margin:0 auto 28px;font-size:17px;color:var(--muted)}
.search{background:var(--surface);border:1px solid #becfe4;display:flex;align-items:center;gap:12px;border-radius:var(--radius);padding:10px 16px;max-width:620px;margin:auto;box-shadow:0 9px 24px rgba(23,52,88,.04)}
.search span{font-size:22px;color:var(--primary)}
.search input{font-size:16px;color:var(--ink);border:0;outline:none;background:transparent;min-height:40px;width:100%;min-width:0}
.search:focus-within{border-color:var(--primary);box-shadow:0 0 0 3px #b7d0ff66}
.hero-shortcuts{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:18px;font-size:13px;color:var(--muted)}
.hero-shortcuts a{font-weight:650;color:var(--primary);border-bottom:1px solid transparent}
.hero-shortcuts a:hover{border-color:var(--primary)}
.trust-strip{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:18px 30px;border-bottom:1px solid var(--line);padding:12px 0 34px;color:#395d78;font-weight:600;font-size:13px}
.section{margin:48px 0}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.section-heading h2{margin-bottom:16px}
.filters{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 24px}
.chip{padding:9px 16px;font-size:13px;font-weight:700;border-radius:100px;border:1px solid var(--line);background:var(--surface);color:#48607a;min-height:42px}
.chip:hover,.chip.active,.chip[aria-pressed="true"]{background:var(--primary-soft);color:var(--primary);border-color:#afcaff}
.tools{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.tool-card{display:flex;flex-direction:column;min-width:0;padding:22px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);transition:background .15s,border-color .15s,transform .15s}
.tool-card:hover{border-color:#94b6ec;background:#fff;transform:translateY(-2px)}
.tool-card .glyph{width:44px;height:44px;border-radius:10px;background:var(--primary-soft);display:grid;place-items:center;font-size:21px;line-height:1;margin-bottom:16px}
.tool-card h3{margin-bottom:7px;font-size:16px}.tool-card p{font-size:13px;color:var(--muted);margin:0;line-height:1.52}
.details{display:grid;grid-template-columns:repeat(3,1fr);gap:22px}.feature{padding:22px 0;border-top:2px solid #ccd8ea}.feature strong{display:block;margin:12px 0 6px;color:var(--ink);font-size:17px}.feature p{color:var(--muted);font-size:14px}
.faq{padding:17px 0;border-top:1px solid var(--line)}.faq summary{cursor:pointer;font-weight:720;color:var(--ink)}.faq p{color:var(--muted);margin:12px 0 0}
.breadcrumb{font-size:13px;color:var(--muted);padding:26px 0 12px}
.tool-heading{max-width:860px;padding:6px 0 19px}.tool-heading h1{font-size:clamp(1.9rem,3.2vw,2.5rem)}.tool-heading p{color:var(--muted);font-size:16px;margin-bottom:8px}
.workflow-steps{display:flex;align-items:center;gap:12px;margin:4px 0 23px;font-size:13px;color:#43607e;font-weight:650;max-width:650px}
.workflow-step{display:flex;align-items:center;gap:8px;white-space:nowrap}.workflow-step b{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#e6efff;color:var(--primary)}
.workflow-line{height:1px;flex:1;background:var(--line);min-width:8px}
.workspace{display:grid;grid-template-columns:minmax(0,1fr) 306px;gap:24px;align-items:start}
.panel{min-width:0;padding:26px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}.panel h2{font-size:19px}
.dropzone{background:#fbfdff;border:2px dashed #b4c8e1;border-radius:var(--radius);padding:34px 20px;min-height:204px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;transition:background .15s,border-color .15s}
.dropzone.dragover{background:var(--primary-soft);border-color:var(--primary)}.dropzone.is-busy{pointer-events:none;opacity:.7}
.upload-icon{font-size:32px;line-height:1}.dropzone h3{margin:9px 0 6px}.dropzone p{font-size:13px;color:var(--muted);margin-bottom:17px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:10px 19px;background:var(--primary);border-radius:var(--radius-sm);border:1px solid var(--primary);color:#fff!important;font-size:14px;font-weight:730;line-height:1.25;text-align:center}
.btn:hover{background:var(--primary-hover);border-color:var(--primary-hover)}.btn.secondary{background:#fff;color:#334c67!important;border-color:#ccdaea}.btn.secondary:hover{background:var(--primary-soft);border-color:#9cbbeb}.btn.full{width:100%}
.file-input{position:absolute!important;width:1px;height:1px;opacity:0;pointer-events:none}
.file-list{margin-top:18px;display:grid;gap:8px}.file-row{display:flex;align-items:center;gap:9px;border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 12px;min-width:0}
.file-icon{font-size:20px}.file-text{min-width:0;flex:1}.file-name{font-size:14px;color:var(--ink);font-weight:690;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-size{font-size:12px;color:var(--muted)}
.small-btn{min-width:44px;min-height:44px;border:1px solid var(--line);background:#fff;border-radius:var(--radius-sm);color:#385572;font-size:16px;font-weight:680}.small-btn:hover:not(:disabled){background:var(--primary-soft);border-color:#b0c9ec}
.form-section{border-top:1px solid var(--line);padding-top:23px;margin-top:23px}
.form-section label{display:block;font-size:14px;font-weight:720;color:var(--ink);margin-bottom:var(--space-2)}.form-section label:not(:first-child){margin-top:var(--space-4)}
.form-section input:not([type=checkbox]),.form-section select,.form-section textarea{display:block;width:100%;max-width:490px;min-height:45px;background:#fff;border:1px solid #cbd8e8;border-radius:var(--radius-sm);padding:9px 12px;color:var(--ink)}
.form-section input[type=checkbox]{width:20px;height:20px;accent-color:var(--primary)}
.form-section textarea{max-width:100%;min-height:180px;resize:vertical;line-height:1.6}
.form-section :is(input,select,textarea):disabled{opacity:.75;background:#f2f5f9}
.hint{margin:8px 0 0;font-size:13px;color:var(--muted);line-height:1.6}.inline-warning{border-left:3px solid #d18b23;padding:9px 12px;background:#fff9ed;font-size:13px;color:#74501c;margin:0 0 22px}
.margin-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;max-width:520px}.margin-grid input{max-width:none}
.actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:24px}
.status{display:none;margin-top:17px;padding:13px 15px;border-radius:var(--radius-sm);font-size:14px;overflow-wrap:anywhere}
.status.visible{display:block}.status.info{background:var(--primary-soft);border:1px solid #caddff;color:#254f94}.status.error{background:var(--danger-bg);border:1px solid #eac4bb;color:var(--danger)}.status.ok{background:var(--success-bg);border:1px solid #b6ddc5;color:var(--success)}
.result{margin-top:14px;padding:18px;background:var(--success-bg);border:1px solid #b6ddc5;border-radius:var(--radius-sm)}.result p{font-size:14px;font-weight:700;color:var(--success);overflow-wrap:anywhere}.result .btn{background:var(--success);border-color:var(--success)}.result .btn:hover{background:#125935;border-color:#125935}
.aside-list{font-size:14px;color:var(--muted);padding-left:20px}.aside-list li{margin-bottom:12px}.aside-subheading{font-size:16px;margin-top:26px}.notice{background:#f2f7ff;padding:14px;border-radius:var(--radius-sm);font-size:13px;color:#48627e;margin-top:22px}
.related a{display:block;border-bottom:1px solid var(--line);padding:10px 0;font-size:14px;font-weight:650}
.preview{margin-top:22px;border-top:1px solid var(--line);padding-top:18px}.preview h3{font-size:15px;margin:0 0 12px}
.preview-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:9px}.preview-page{min-width:0;display:flex;flex-direction:column;align-items:center;gap:5px;font-size:12px;color:var(--muted)}.preview-page :is(canvas,img){max-width:100%;width:auto;height:115px;object-fit:contain;background:#fff;border:1px solid var(--line);border-radius:4px}
.page-selector,.order-control{margin-top:18px}.selector-label{font-size:14px;font-weight:720;color:var(--ink);margin-bottom:10px}
.page-picks{display:grid;grid-template-columns:repeat(auto-fill,minmax(44px,1fr));gap:8px}
.page-pill{min-height:44px;min-width:44px;border-radius:var(--radius-sm);background:#fff;border:1px solid #cbd9ea;color:var(--ink);font-weight:700;font-size:14px}.page-pill:hover{border-color:var(--primary);background:var(--primary-soft)}.page-pill.selected,.page-pill[aria-pressed=true]{background:var(--primary);border-color:var(--primary);color:#fff}
.order-list{max-height:330px;overflow-y:auto;border-top:1px solid var(--line)}.order-row{min-height:54px;display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid var(--line);font-size:14px;color:var(--ink);font-weight:650}.order-buttons{display:flex;gap:8px;flex:none}
.content-bottom{width:min(100%,820px);margin:50px 0 80px}.content-bottom p{color:var(--muted)}.content-bottom h2:not(:first-child){margin-top:32px}.seo-steps{padding-left:24px;margin:0 0 28px}.seo-steps li{margin-bottom:11px;padding-left:5px}
.footer{margin-top:66px;border-top:1px solid var(--line);background:#fff}.footer-inner{display:flex;align-items:flex-start;justify-content:space-between;gap:32px;padding:34px 0}.footer-inner small{color:var(--muted);font-size:13px}.footer-links{display:flex;gap:18px;flex-wrap:wrap;font-size:13px;font-weight:600}
.empty{color:var(--muted);padding:28px 0}
.wp-content{max-width:820px;margin:28px 0 64px;overflow-wrap:anywhere}.wp-content img{max-width:100%;height:auto}.wp-content a{color:var(--primary);text-decoration:underline}.wp-content :is(h2,h3){margin-top:24px}
@media(max-width:1060px){.tools{grid-template-columns:repeat(3,minmax(0,1fr))}.workspace{grid-template-columns:minmax(0,1fr) 265px;gap:16px}.panel{padding:20px}}
@media(max-width:780px){.nav,.container,.footer-inner{width:min(var(--container),calc(100% - 30px))}.nav{min-height:65px}.nav-links{gap:14px;font-size:13px}.nav-links a:nth-child(2){display:none}.hero{padding:52px 0 28px}.hero p{font-size:16px}.tools{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.tool-card{padding:17px}.tool-card .glyph{margin-bottom:12px}.workspace{grid-template-columns:1fr}.details{grid-template-columns:1fr;gap:12px}.footer-inner{display:block}.footer-links{margin-top:18px}.section{margin:36px 0}.actions .btn{flex:1}.trust-strip{gap:10px 18px}.preview-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:420px){.brand{font-size:19px}.nav-links a:nth-child(3){display:none}.tool-card{padding:14px}.tool-card h3{font-size:15px}.tool-card p{font-size:12px}.margin-grid{gap:12px}.panel{padding:16px}.file-row{gap:6px;padding:8px}.file-row .small-btn{padding:4px}.workflow-steps{gap:7px;font-size:11px}.workflow-step{gap:5px}.workflow-step b{width:23px;height:23px}.page-picks{grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.page-pill{min-width:0}.preview-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:350px){.tools{grid-template-columns:1fr}.tool-card{display:flex;flex-direction:row;align-items:flex-start;gap:13px}.tool-card .glyph{flex:none;margin:0}.brand{font-size:18px}.nav-links{font-size:12px}.trust-strip{flex-direction:column;align-items:center}.margin-grid{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.tool-card,.dropzone{transition:none}.tool-card:hover{transform:none}}

/* v1.2.1 — visual page selection and paginated PDF thumbnails */
.page-quick-actions{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 12px}
.quick-btn{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:7px 13px;border:1px solid #cbd9e8;border-radius:8px;background:#fff;color:var(--ink);font-size:13px;font-weight:680;line-height:1.3}
.quick-btn:hover:not(:disabled){background:var(--primary-soft);border-color:#a7c4eb;color:var(--primary)}
.quick-btn:disabled{opacity:.42;cursor:not-allowed}
.selection-counter{font-size:12px;color:var(--muted);font-weight:650;margin:9px 0}
.preview-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:13px}
.preview-toolbar h3{margin:0 0 3px}.preview-toolbar .hint{margin:0}
.preview-nav{display:flex;flex-wrap:wrap;gap:7px;flex:none}
.preview-instruction{color:#536a86;font-size:13px;margin:0 0 12px}
.preview-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.preview-page{appearance:none;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;min-width:0;margin:0;padding:9px;border:1px solid transparent;border-radius:10px;background:#f7faff;color:var(--muted);font:inherit;font-size:13px;line-height:1.3}
.preview-page canvas{display:block;height:145px;max-height:145px;max-width:100%;object-fit:contain;border:1px solid #d2dbe8;background:white;border-radius:4px}
.preview-page.is-selectable{cursor:pointer;border-color:#d2dbe8;background:#fff}
.preview-page.is-selectable:hover{border-color:#84a9e0;background:#f3f7ff}
.preview-page.is-selectable.selected,.preview-page.is-selectable[aria-pressed="true"]{border-color:var(--primary);background:#edf4ff;box-shadow:inset 0 0 0 1px var(--primary);color:#174b9f;font-weight:750}
.preview-page.is-selectable:focus-visible,.quick-btn:focus-visible{outline:3px solid #2d6ff0;outline-offset:3px}
@media(max-width:780px){.preview-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.preview-page canvas{height:132px}.preview-toolbar{align-items:flex-start}}
@media(max-width:520px){.preview-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.preview-toolbar{flex-direction:column;align-items:stretch}.preview-nav .quick-btn{flex:1}.preview-page canvas{height:142px}.page-quick-actions .quick-btn{flex:1 1 auto}}

/* v1.3.4 visual page editor — single owner, shared design tokens */
.ve-layout{display:grid;grid-template-columns:minmax(0,1fr) 282px;gap:24px;align-items:start}
.ve-main{min-width:0}.ve-upload{min-height:184px;padding:25px 18px}
.ve-filename{display:block;font-size:13px;font-weight:650;color:var(--muted);max-width:100%;overflow-wrap:anywhere;margin-top:12px}
.ve-toolbar,.ve-pager{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}
.ve-toolbar{border-bottom:1px solid var(--line);padding:18px 0 20px;margin-bottom:22px}
.ve-toolbar>div{display:flex;gap:8px;flex-wrap:wrap}.ve-toolbar .btn,.ve-toolbar .quick-btn{min-height:42px;font-size:13px;padding:8px 13px}
.ve-pages h2{font-size:20px;margin-bottom:6px}.ve-tip{font-size:13px;color:var(--muted);margin:10px 0 18px}
.ve-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}
.ve-card{min-width:0;border:1px solid var(--line);border-radius:var(--radius-sm);background:#fff;padding:10px;transition:border-color .15s,background .15s;cursor:grab}
.ve-card:hover{border-color:#9cbce6}.ve-card.dragging{opacity:.45}.ve-card.drag-over{background:var(--primary-soft);border:2px dashed var(--primary);padding:9px}
.ve-thumb{height:160px;display:flex;align-items:center;justify-content:center;background:#f5f8fc;border:1px solid #e5ebf3;border-radius:6px;overflow:hidden;padding:6px}
.ve-thumb img{max-width:100%;max-height:100%;object-fit:contain;box-shadow:0 2px 7px #102a431a;background:#fff}
.ve-blank{display:grid;place-items:center;width:72%;height:91%;background:white;border:1px solid #dce4ec;color:#8a9ab1;font-size:12px}
.ve-caption{display:flex;align-items:flex-start;justify-content:space-between;gap:6px;flex-wrap:wrap;min-height:43px;padding:11px 0 7px;color:var(--ink);font-size:12px;line-height:1.35}
.ve-caption span{color:var(--muted)}.ve-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.ve-action{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;min-height:48px;padding:5px 2px;border:1px solid #dce5ee;background:#fff;border-radius:6px;color:#31577c;font-size:17px;font-weight:700;line-height:1.2}
.ve-action:last-child{grid-column:1/-1}.ve-action-label{font-size:11px;font-weight:650;line-height:1.2}.ve-action:not(:disabled):hover{background:var(--primary-soft);border-color:#a3c1e9;color:var(--primary)}
.ve-action.ve-danger:not(:disabled):hover{background:var(--danger-bg);color:var(--danger);border-color:#eebdbd}
.ve-pager{border-top:1px solid var(--line);margin-top:20px;padding-top:16px;font-size:13px;color:var(--muted)}.ve-pager>div{display:flex;gap:8px}
.ve-export{display:flex;align-items:center;gap:14px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:22px;margin-top:23px}.ve-export .hint{margin:0}
.ve-aside .notice{margin:20px 0}.ve-aside .aside-list{margin:0;padding-left:20px}
@media(max-width:1100px){.ve-layout{grid-template-columns:minmax(0,1fr) 250px;gap:16px}.ve-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:850px){.ve-layout{grid-template-columns:1fr}.ve-aside{max-width:none}.ve-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:640px){.ve-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ve-thumb{height:150px}.ve-toolbar{align-items:stretch}.ve-toolbar>div{width:100%}.ve-toolbar>div>button{flex:1}.ve-export .btn{width:100%}}
@media(max-width:370px){.ve-grid{gap:9px}.ve-card{padding:6px}.ve-thumb{height:125px}.ve-caption{min-height:50px}.ve-action{min-height:46px;font-size:16px}}
@media(prefers-reduced-motion:reduce){.ve-card{transition:none}}
@media(max-width:360px){.workflow-steps{gap:3px;font-size:10px}.workflow-step{gap:3px}.workflow-step b{width:20px;height:20px;min-width:20px}.workflow-line{min-width:3px}}

/* Engine health check – secondary, unobtrusive, keyboard accessible */
.engine-check { display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-top:12px;max-width:680px; }
.engine-check-button { cursor:pointer; min-height:40px; border-radius:8px; background:transparent; color:#2856ad; border:1px solid #b4c6e8; padding:8px 14px;font:inherit;font-size:14px; font-weight:600; }
.engine-check-button:hover { background:#eff6ff; }
.engine-check-button:disabled { opacity:.55;cursor:wait; }
.engine-check-button:focus-visible { outline:3px solid #1f69db; outline-offset:3px; }
.engine-diagnostic { margin:0;padding:10px 12px; border:1px solid #cbd5e1; border-radius:8px;background:#f8fafc;line-height:1.6;color:#334155;font-size:14px; }
.engine-diagnostic.passed { border-color:#a7ddc0;background:#edf9f2;color:#195f38; }
.engine-diagnostic.failed { border-color:#e9b2b2;background:#fff4f4;color:#873333; }

/* v1.4.0 — signature pad: accessible sizing and clear visual affordance */
#signature-pad{display:block;width:min(100%,640px);height:auto;aspect-ratio:15/4;background:#fff;border:2px dashed #92b5df;border-radius:10px;touch-action:none;cursor:crosshair;margin:8px 0 10px}
#signature-pad:focus-visible{outline:3px solid var(--primary);outline-offset:2px}
.signature-clear{width:auto;min-width:160px;padding:8px 14px;font-size:13px;margin:0 0 14px}
@media(max-width:420px){#signature-pad{width:100%;}.signature-clear{width:100%}}

/* v1.4.2: text-and-logo editor. Scoped to avoid changing older 18 tools. */
.ti-workspace .ti-upload-row{display:flex;align-items:center;flex-wrap:wrap;gap:12px;min-width:0;margin-bottom:18px}
.ti-upload-row #ti-file-label{font-size:13px;color:var(--muted);min-width:0;overflow-wrap:anywhere}
.ti-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:9px;margin:0 0 14px}
.ti-bar label{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:650}
.ti-bar input{height:42px;width:66px;border:1px solid #cbd8e8;border-radius:8px;padding:5px;text-align:center;font:inherit}
.ti-page-frame{display:flex;justify-content:center;background:#edf2f8;border:1px solid #d9e2ef;padding:16px;border-radius:10px;overflow:hidden}
.ti-page-stage{position:relative;width:100%;max-width:660px;min-width:0;box-shadow:0 2px 14px #162c4518}
.ti-page-stage canvas{display:block;width:100%;height:auto;background:white}
#ti-layer{position:absolute;inset:0;overflow:hidden;touch-action:none}
.ti-object{position:absolute;z-index:1;display:flex;align-items:flex-start;justify-content:flex-start;border:1px dashed #2563eb;background:transparent;cursor:grab;touch-action:none;text-align:left;padding:0;min-width:8px;min-height:8px;line-height:1.35;border-radius:1px;user-select:none}
.ti-object.is-active,.ti-object:focus-visible{border:2px solid #0c62e6;outline:2px solid #fff;outline-offset:1px;z-index:2}
.ti-object:active{cursor:grabbing}
.ti-object img{width:100%;height:100%;object-fit:fill;pointer-events:none}
.ti-text-object{white-space:nowrap;overflow:hidden;font-weight:600}
.ti-controls-head{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;margin:20px 0 12px}
.ti-controls-head h2{margin:0;font-size:18px}
.ti-buttons{display:flex;flex-wrap:wrap;gap:9px}
.ti-edit{margin:18px 0;padding:15px;background:#f7faff;border:1px solid #d9e4f3;border-radius:9px}
.ti-edit h3,.ti-workspace #ti-controls>h3{font-size:15px;margin:12px 0}
.ti-edit label{display:block;font-size:13px;font-weight:650;margin:10px 0 5px}
.ti-edit input:not([type=color]){width:100%;max-width:440px;min-height:40px;border:1px solid #cbd8e8;background:white;border-radius:8px;padding:7px 10px}
.ti-edit input[type=color]{width:70px;height:42px;padding:3px;border:1px solid #cbd8e8;border-radius:8px}
.ti-edit input[type=range]{accent-color:var(--primary)}
.ti-item{display:flex;justify-content:space-between;align-items:center;gap:8px;max-width:570px;padding:9px 0;border-bottom:1px solid var(--line)}
.ti-item .quick-btn:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ti-item.is-active .quick-btn:first-child{border-color:var(--primary);background:var(--primary-soft)}
.ti-item .quick-btn:last-child{color:#9b2424}
.ti-workspace .notice{margin-top:18px}
@media(max-width:480px){.ti-page-frame{padding:8px}.ti-bar{justify-content:center}.ti-buttons .btn{flex:1;min-width:0}.ti-item .quick-btn{font-size:12px;padding-inline:8px}}

/* v1.4.3 – Direct manipulation + history, scoped to text/logo editor. */
.ti-text-object{overflow:visible}
.ti-resize-handle{position:absolute;right:-12px;bottom:-12px;z-index:5;display:flex;align-items:center;justify-content:center;width:30px;height:30px;min-width:30px;min-height:30px;padding:0;border:2px solid #fff;border-radius:7px;background:#1f67d8;color:#fff;font-size:19px;line-height:1;cursor:nwse-resize;touch-action:none;box-shadow:0 1px 5px #1d355c55}
.ti-resize-handle:hover{background:#144da5}
.ti-resize-handle:focus-visible{outline:3px solid #ffb642;outline-offset:2px}
.ti-history{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:4px 0 16px}
.ti-history .quick-btn{min-height:44px;padding:9px 16px;font-weight:650}
.ti-history .hint{margin:0 0 0 2px}
.ti-result a.btn{display:inline-flex;align-items:center;justify-content:center;margin:6px 8px 6px 0;min-height:44px}
@media(max-width:480px){.ti-history .quick-btn{flex:1}.ti-history .hint{width:100%;text-align:center}.ti-resize-handle{width:32px;height:32px;right:-13px;bottom:-13px}}

/* v1.4.3 – Preview is secondary to the actual file download. */
.ti-workspace .result .btn.secondary{background:#fff;border-color:#a4d1b5;color:#235f40!important}
.ti-workspace .result .btn.secondary:hover{background:#e5f4ea;border-color:#7ab995;color:#235f40!important}
.ti-workspace .result .btn{vertical-align:middle}


/* v1.4.4: opt-in bulk placement; consistent 44px touch targets. */
.ti-advanced{margin-top:16px;border-top:1px solid #dce5f1;padding-top:13px}
.ti-advanced>summary{cursor:pointer;color:#174b9f;font-weight:700;min-height:44px;display:flex;align-items:center;list-style-position:inside}
.ti-advanced[open]>summary{margin-bottom:12px}
.ti-advanced .hint{font-size:13px;margin:9px 0}
.ti-align-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:8px 0 16px}
.ti-align-grid .quick-btn,.ti-edit-actions .quick-btn,.ti-edit-actions .btn{min-height:44px;min-width:0;padding:10px 8px;white-space:normal;line-height:1.25;text-align:center}
.ti-edit-actions{display:flex;flex-wrap:wrap;gap:9px;margin:9px 0 13px}
.ti-edit-actions>*{flex:1 1 145px}
@media(max-width:420px){.ti-align-grid .quick-btn{font-size:12px}.ti-edit-actions>*{flex:1 1 100%}}

/* v1.5.0: batch tool. Scoped styles, responsive 320px+ */
.batch-workspace{align-items:start}
.batch-workspace .batch-file-summary{font-size:13px;font-weight:650;color:var(--muted);margin:14px 0 6px}
.batch-file-row{gap:8px;min-width:0}
.batch-file-row .file-text{min-width:0;flex:1}
.batch-file-row .small-btn{min-width:42px;min-height:44px;font-size:18px}
.batch-options{margin:22px 0 16px;padding:16px;border:1px solid var(--line);border-radius:var(--radius);min-width:0;background:#f9fbff}
.batch-options legend{font-size:15px;font-weight:750;color:var(--ink);padding:0 6px}
.batch-options label:not(.batch-remember){display:block;margin:12px 0 6px;font-size:14px;font-weight:700;color:var(--ink)}
.batch-options input:not([type=checkbox]),.batch-options select{display:block;width:100%;padding:11px 12px;min-height:44px;border:1px solid #bfcde0;border-radius:8px;background:#fff;color:var(--ink)}
.batch-remember{display:flex;gap:9px;align-items:flex-start;margin:16px 0 6px;line-height:1.5;font-weight:650;color:var(--ink)}
.batch-remember input{width:20px;height:20px;flex:none;accent-color:var(--primary)}
.batch-actions{display:flex;gap:10px;flex-wrap:wrap}
.batch-actions .btn{min-height:46px}
.batch-progress{margin:18px 0;padding:12px;border:1px solid var(--line);background:white;border-radius:8px}
.batch-progress label{display:block;font-weight:650;font-size:13px;margin:0 0 7px}
.batch-progress progress{width:100%;height:14px;accent-color:var(--primary)}
.batch-progress span{display:block;font-size:13px;color:var(--muted)}
.batch-workspace .result{margin-top:16px}
.batch-workspace .result .btn{display:inline-flex;align-items:center;justify-content:center;min-height:46px}
.batch-workspace .dropzone h2{font-size:20px;margin:0 0 6px}
@media(max-width:540px){.batch-options{padding:12px}.batch-actions{display:grid;grid-template-columns:1fr}.batch-actions .btn{width:100%}.batch-workspace .panel{min-width:0}.batch-file-row .small-btn{padding:7px 9px}}

/* v1.5.1: streamlined batch controls, shared spacing. */
.batch-subsection{padding:12px 0 4px;border-top:1px solid var(--line);margin-top:16px;min-width:0}
.batch-subsection[hidden],#batch-number[hidden],#batch-logo-options[hidden]{display:none!important}
.batch-subsection .batch-check{display:flex!important;align-items:flex-start;gap:10px;font-weight:700;line-height:1.55;margin:4px 0!important;cursor:pointer}
.batch-check input[type=checkbox]{flex:none;width:20px;height:20px;margin:2px 0;accent-color:var(--primary)}
.batch-subsection input[type=file]{font-size:14px;padding:10px;max-width:100%;min-width:0}
.batch-plan{background:#edf4ff;border:1px solid #cddff8;border-radius:8px;padding:10px 12px;margin:18px 0 10px;color:#17406f;line-height:1.5;font-size:13px;font-weight:650;overflow-wrap:anywhere}
.batch-options .hint{line-height:1.6;overflow-wrap:anywhere}

/* v1.5.2: compact batch result review; independent of site-wide table styles. */
.batch-result h2{font-size:20px;margin:0 0 14px}
.batch-result h3{font-size:16px;margin:20px 0 6px}
.batch-result-overview{font-size:14px;font-weight:650;line-height:1.6;color:var(--ink);margin:12px 0}
.batch-results-scroll{width:100%;max-width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:10px;margin:12px 0 4px}
.batch-results-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:13px}
.batch-results-table th,.batch-results-table td{padding:11px 9px;text-align:left;border-bottom:1px solid var(--line);vertical-align:middle;overflow-wrap:anywhere}
.batch-results-table th{background:#f1f6fe;font-weight:750;color:var(--ink)}
.batch-results-table tr:last-child td{border-bottom:0}
.batch-results-table th:first-child,.batch-results-table td:first-child{width:43%}
.batch-results-table th:nth-child(2),.batch-results-table td:nth-child(2){width:13%}
.batch-results-table th:nth-child(3),.batch-results-table td:nth-child(3){width:20%}
.batch-results-table th:last-child,.batch-results-table td:last-child{width:24%}
.batch-preview-link{display:inline-flex;align-items:center;min-height:42px;padding:8px 6px;font-weight:700;color:var(--primary);text-underline-offset:3px}
.batch-preview-unavailable{font-size:12px;color:var(--muted)}
@media(max-width:540px){
  .batch-results-table,.batch-results-table tbody{display:block;width:100%}
  .batch-results-table thead{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .batch-results-table tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 8px;padding:12px;border-bottom:1px solid var(--line)}
  .batch-results-table tr:last-child{border-bottom:0}
  .batch-results-table td,.batch-results-table td:first-child,.batch-results-table td:nth-child(2),.batch-results-table td:nth-child(3),.batch-results-table td:last-child{display:block;width:auto;padding:0;border:0}
  .batch-results-table td:first-child,.batch-results-table td:last-child{grid-column:1/-1}
  .batch-results-table td::before{content:attr(data-label);font-weight:750;color:var(--ink)}
  .batch-results-table td:first-child{font-weight:750;color:var(--ink)}
  .batch-results-table td:last-child{padding-top:4px}
  .batch-preview-link{padding:3px 0;min-height:38px}
}
