/* pdflu.css — Shared styles for pdflu.com
   ──────────────────────────────────────── */

/* ═══════ DESIGN TOKENS ═══════ */
:root {
    --bg:         #F0FDFB;
    --surface:    #FFFFFF;
    --surface-2:  #F4FFFE;
    --border:     #CCFBF1;
    --border-2:   #99F6E4;
    --brand:      #0f766e;
    --brand-dk:   #115e59;
    --brand-xl:   #CCFBF1;
    --text:       #1E293B;
    --muted:      #64748B;
    --sh-sm:      0 1px 3px rgba(0,0,0,.06),0 2px 8px rgba(0,0,0,.04);
    --sh-md:      0 4px 16px rgba(15,118,110,.14),0 8px 24px rgba(0,0,0,.07);
    --sh-lg:      0 12px 40px rgba(0,0,0,.18);
    --r:          14px;
    --r-sm:       10px;
    --ease:       200ms cubic-bezier(.4,0,.2,1);
}
.dark {
    --bg:         #09101C;
    --surface:    #111827;
    --surface-2:  #1A2438;
    --border:     #1E3450;
    --border-2:   #2D4A6A;
    --brand:      #14b8a6;
    --brand-dk:   #0d9488;
    --brand-xl:   rgba(20,184,166,.12);
    --text:       #E2E8F0;
    --muted:      #94A3B8;
    --sh-sm:      0 1px 3px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.4);
    --sh-md:      0 4px 20px rgba(20,184,166,.18),0 8px 32px rgba(0,0,0,.45);
}

/* ═══════ UTILITY ═══════ */
.hidden  { display: none !important; }
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }

/* ═══════ BASE ═══════ */
*,*::before,*::after { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
    font-family:'Plus Jakarta Sans',system-ui,sans-serif;
    background:var(--bg); color:var(--text);
    min-height:100vh; margin:0;
    -webkit-font-smoothing:antialiased;
    transition:background .3s,color .3s;
}
a { color:inherit; }
button,input,select,textarea { font-family:inherit; }

.skip-link {
    position:absolute; top:-50px; left:16px; z-index:500;
    background:var(--brand); color:#fff; font-weight:700; font-size:.875rem;
    padding:10px 18px; border-radius:0 0 10px 10px; text-decoration:none;
    transition:top .2s;
}
.skip-link:focus { top:0; }

/* ═══════ HEADER ═══════ */
.site-header {
    background:linear-gradient(135deg,#0a5954 0%,#0f766e 60%,#0e6e66 100%);
    box-shadow:0 2px 24px rgba(15,118,110,.35);
    position:sticky; top:0; z-index:200;
}
.hdr {
    max-width:1280px; margin:0 auto; padding:0 20px;
    height:64px; display:flex; align-items:center; gap:8px;
}
.logo {
    display:flex; align-items:center; gap:9px; text-decoration:none;
    color:#fff; flex-shrink:0; cursor:pointer;
}
.logo-icon {
    width:32px; height:32px; border-radius:8px;
    background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.25);
    display:flex; align-items:center; justify-content:center;
}
.logo-name { font-size:1.375rem; font-weight:800; letter-spacing:-.04em; color:#fff; }
.logo-name span { color:rgba(255,255,255,.62); font-weight:600; }

/* Desktop nav */
.main-nav { display:none; align-items:center; gap:2px; margin-left:12px; flex:1; }
@media(min-width:900px){ .main-nav { display:flex; } }

.nav-link {
    font-size:.84rem; font-weight:600; color:rgba(255,255,255,.85);
    padding:7px 11px; border-radius:8px; cursor:pointer; text-decoration:none;
    border:none; background:none; font-family:inherit;
    display:inline-flex; align-items:center; gap:4px; white-space:nowrap;
    transition:background var(--ease),color var(--ease);
}
.nav-link:hover,.nav-link.active { background:rgba(255,255,255,.14); color:#fff; }
.nav-link:focus-visible { outline:2px solid rgba(255,255,255,.7); outline-offset:2px; }

/* Dropdowns */
.nav-dd { position:relative; }
.nav-dd-btn .chev { transition:transform .2s; flex-shrink:0; }
.nav-dd:hover .chev,.nav-dd.open .chev { transform:rotate(180deg); }

.dd-panel {
    position:absolute; top:calc(100% + 10px); left:50%;
    transform:translateX(-50%) translateY(-6px);
    background:var(--surface); border:1.5px solid var(--border);
    border-radius:12px; padding:6px; min-width:220px;
    box-shadow:var(--sh-lg); z-index:300;
    opacity:0; visibility:hidden; pointer-events:none;
    transition:opacity .18s ease,visibility .18s ease,transform .18s ease;
}
.nav-dd:hover .dd-panel,.nav-dd.open .dd-panel {
    opacity:1; visibility:visible; transform:translateX(-50%) translateY(0); pointer-events:all;
}
.dd-panel::before { content:''; position:absolute; top:-12px; left:0; right:0; height:12px; }

.dd-cat {
    font-size:.65rem; font-weight:800; letter-spacing:.1em;
    text-transform:uppercase; color:var(--muted); padding:8px 10px 4px;
}
.dd-item {
    display:flex; align-items:center; gap:10px; padding:8px 10px;
    border-radius:8px; text-decoration:none; color:var(--text);
    transition:background var(--ease);
}
.dd-item:hover { background:var(--brand-xl); }
.dd-item:focus-visible { outline:2px solid var(--brand); outline-offset:-2px; }
.dd-ico {
    width:30px; height:30px; border-radius:7px;
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.dark .dd-ico { filter:brightness(.8) saturate(.8); }
.dd-name { font-size:.82rem; font-weight:700; color:var(--text); }
.dd-desc { font-size:.72rem; color:var(--muted); margin-top:1px; }
.dd-sep  { height:1px; background:var(--border); margin:4px 6px; }

/* Right controls */
.hdr-right { display:flex; align-items:center; gap:6px; margin-left:auto; }

.ham-btn,.theme-btn {
    width:38px; height:38px; border-radius:9px; background:rgba(255,255,255,.12);
    border:1px solid rgba(255,255,255,.18); cursor:pointer;
    display:flex; align-items:center; justify-content:center; color:#fff;
    flex-shrink:0; transition:background var(--ease);
}
.ham-btn:hover,.theme-btn:hover { background:rgba(255,255,255,.22); }
.ham-btn:focus-visible,.theme-btn:focus-visible { outline:2px solid rgba(255,255,255,.7); outline-offset:2px; }
@media(min-width:900px){ .ham-btn { display:none; } }

/* Mobile nav */
.mobile-nav {
    max-height:0; overflow:hidden; background:var(--surface);
    border-bottom:1.5px solid var(--border); transition:max-height .35s ease;
}
.mobile-nav.open { max-height:92vh; overflow-y:auto; }
@media(min-width:900px){ .mobile-nav { display:none !important; } }

.mob-section { border-bottom:1px solid var(--border); }
.mob-section-hdr {
    display:flex; justify-content:space-between; align-items:center;
    padding:13px 20px; font-size:.82rem; font-weight:800; letter-spacing:.08em;
    text-transform:uppercase; color:var(--muted); cursor:pointer;
    background:none; border:none; width:100%; text-align:left;
}
.mob-section-hdr .mob-chev { transition:transform .2s; }
.mob-section.open .mob-chev { transform:rotate(180deg); }
.mob-links { display:none; padding:4px 0 12px; }
.mob-section.open .mob-links { display:block; }
.mob-link {
    display:flex; align-items:center; gap:10px; padding:9px 20px;
    text-decoration:none; color:var(--text); font-size:.875rem; font-weight:600;
    transition:background var(--ease);
}
.mob-link:hover { background:var(--brand-xl); }
.mob-home {
    display:block; padding:13px 20px; font-size:.875rem; font-weight:700;
    color:var(--brand); text-decoration:none; border-bottom:1px solid var(--border);
}

/* ═══════ LAYOUT ═══════ */
.container { max-width:1200px; margin:0 auto; padding:0 20px 88px; }
#main-content:focus { outline:none; }

/* ═══════ HOME HERO ═══════ */
.hero { text-align:center; padding:56px 20px 44px; }
.hero h1 {
    font-size:clamp(1.75rem,4.5vw,2.75rem); font-weight:800; color:var(--text);
    letter-spacing:-.035em; line-height:1.18; margin-bottom:14px;
}
.hero h1 em { font-style:normal; color:var(--brand); }
.hero p { font-size:1rem; color:var(--muted); line-height:1.65; margin-bottom:28px; }
.badges { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
.badge {
    display:inline-flex; align-items:center; gap:5px; background:var(--brand-xl);
    color:var(--brand); font-size:.78rem; font-weight:700; padding:5px 13px;
    border-radius:100px; border:1px solid rgba(15,118,110,.18);
}
.dark .badge { color:#5eead4; border-color:rgba(20,184,166,.28); }

/* ═══════ TOOL SECTIONS ═══════ */
.t-sec { margin-bottom:36px; }
.t-lrow { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.t-lbl {
    font-size:.65rem; font-weight:800; letter-spacing:.12em;
    text-transform:uppercase; color:var(--muted); white-space:nowrap;
}
.t-rule { flex:1; height:1px; background:var(--border); }

.tools-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
@media(min-width:480px)  { .tools-grid { grid-template-columns:repeat(3,1fr); } }
@media(min-width:768px)  { .tools-grid { grid-template-columns:repeat(4,1fr); } }
@media(min-width:1060px) { .tools-grid { grid-template-columns:repeat(5,1fr); } }

.tool-card {
    display:flex; flex-direction:column; align-items:center; text-align:center;
    padding:22px 14px 18px; background:var(--surface); border:1.5px solid var(--border);
    border-radius:var(--r); cursor:pointer; box-shadow:var(--sh-sm);
    transition:transform var(--ease),box-shadow var(--ease),border-color var(--ease);
    position:relative; overflow:hidden; text-decoration:none;
    -webkit-user-select:none; user-select:none;
}
.tool-card::after {
    content:''; position:absolute; inset:0; opacity:0; pointer-events:none;
    background:radial-gradient(ellipse at 50% 0%,var(--brand-xl) 0%,transparent 70%);
    transition:opacity var(--ease);
}
.tool-card:hover { transform:translateY(-3px); box-shadow:var(--sh-md); border-color:var(--brand); }
.tool-card:hover::after { opacity:1; }
.tool-card:active { transform:translateY(-1px); }
.tool-card:focus-visible { outline:2.5px solid var(--brand); outline-offset:3px; }
.tc-ico {
    width:48px; height:48px; border-radius:12px;
    display:flex; align-items:center; justify-content:center;
    margin-bottom:12px; position:relative; z-index:1;
}
.dark .tc-ico { background:rgba(255,255,255,.07) !important; }
.tc-name { font-size:.925rem; font-weight:700; color:var(--text); line-height:1.3; margin-bottom:4px; position:relative; z-index:1; }
.tc-desc { font-size:.73rem; color:var(--muted); line-height:1.4; position:relative; z-index:1; }

/* ═══════ FEATURES / FAQ ═══════ */
.feat-block {
    background:var(--surface); border:1.5px solid var(--border);
    border-radius:var(--r); padding:36px; margin-bottom:28px; box-shadow:var(--sh-sm);
}
.feat-grid { display:grid; gap:28px; }
@media(min-width:768px){ .feat-grid { grid-template-columns:repeat(3,1fr); } }
.feat h3 { font-size:.9375rem; font-weight:700; color:var(--text); margin-bottom:8px; }
.feat p  { font-size:.875rem; color:var(--muted); line-height:1.65; }

.faq-block {
    background:var(--surface); border:1.5px solid var(--border);
    border-radius:var(--r); overflow:hidden; margin-bottom:40px; box-shadow:var(--sh-sm);
}
.faq-hdr { padding:18px 26px; border-bottom:1.5px solid var(--border); font-size:.9375rem; font-weight:700; color:var(--text); }
.faq-item { border-top:1px solid var(--border); }
.faq-item summary {
    display:flex; justify-content:space-between; align-items:center; gap:14px;
    padding:16px 26px; font-size:.875rem; font-weight:600; color:var(--text);
    cursor:pointer; list-style:none;
}
.faq-item summary::-webkit-details-marker { display:none; }
.faq-chev { flex-shrink:0; color:var(--brand); transition:transform .22s; }
.faq-item[open] .faq-chev { transform:rotate(180deg); }
.faq-item p { padding:0 26px 16px; font-size:.875rem; color:var(--muted); line-height:1.65; }

/* ═══════ TOOL PAGE WRAP ═══════ */
.tool-page-wrap { max-width:720px; margin:0 auto; padding-top:36px; }

.back-btn {
    display:inline-flex; align-items:center; gap:6px; background:none; border:none;
    cursor:pointer; color:var(--brand); font-size:.875rem; font-weight:700;
    padding:4px 0; margin-bottom:20px; text-decoration:none;
    transition:opacity var(--ease);
}
.back-btn:hover { opacity:.7; }
.back-btn:focus-visible { outline:2px solid var(--brand); outline-offset:4px; border-radius:4px; }

/* SEO hero for tool pages */
.tool-hero { margin-bottom:22px; }
.tool-hero h1 {
    font-size:clamp(1.375rem,3.5vw,2rem); font-weight:800; color:var(--text);
    letter-spacing:-.03em; margin-bottom:8px; line-height:1.25;
}
.tool-hero p { font-size:.9rem; color:var(--muted); line-height:1.65; margin-bottom:14px; }
.how-steps { display:flex; gap:8px; flex-wrap:wrap; padding:0; margin:0; list-style:none; }
.how-step {
    display:flex; align-items:flex-start; gap:8px; font-size:.8rem; color:var(--muted);
    background:var(--surface); border:1px solid var(--border); border-radius:8px;
    padding:8px 12px; flex:1; min-width:160px;
}
.how-num {
    font-size:.68rem; font-weight:800; color:var(--brand); background:var(--brand-xl);
    border-radius:50%; width:20px; height:20px; min-width:20px;
    display:flex; align-items:center; justify-content:center; margin-top:1px;
}

/* Upload Card */
.upload-card {
    background:var(--surface); border:1.5px solid var(--border);
    border-radius:var(--r); box-shadow:var(--sh-sm); overflow:hidden;
}
.upload-card-hdr {
    padding:24px 28px 20px; border-bottom:1.5px solid var(--border);
    text-align:center; background:var(--surface-2);
}
.upload-card-hdr h2 { font-size:1.375rem; font-weight:800; color:var(--text); letter-spacing:-.025em; margin-bottom:5px; }
.upload-card-hdr p  { font-size:.875rem; color:var(--muted); }

/* Drop Zone */
#drop-zone {
    margin:22px; border:2px dashed var(--border-2); border-radius:12px; min-height:250px;
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    cursor:pointer; padding:40px 24px;
    transition:background var(--ease),border-color var(--ease);
    animation:dz-pulse 3.5s ease-in-out infinite;
}
@keyframes dz-pulse { 0%,100%{ border-color:var(--border-2); } 50%{ border-color:var(--brand); } }
#drop-zone:hover,#drop-zone.drag-over { border-color:var(--brand); background:var(--brand-xl); animation:none; }
#drop-zone:focus-visible { outline:2.5px solid var(--brand); outline-offset:4px; animation:none; }
.dz-circle {
    width:68px; height:68px; border-radius:50%; background:var(--brand);
    display:flex; align-items:center; justify-content:center; margin-bottom:18px;
    box-shadow:0 4px 20px rgba(15,118,110,.32); transition:transform var(--ease),box-shadow var(--ease);
}
#drop-zone:hover .dz-circle,#drop-zone.drag-over .dz-circle { transform:scale(1.1); box-shadow:0 8px 28px rgba(15,118,110,.48); }
.dz-title { font-size:1.05rem; font-weight:700; color:var(--text); margin-bottom:5px; text-align:center; }
.dz-sub   { font-size:.875rem; color:var(--muted); text-align:center; }
.dz-sub strong { color:var(--brand); }

/* ═══════ WORKSPACE ═══════ */
.ws-card {
    background:var(--surface); border:1.5px solid var(--border);
    border-radius:var(--r); box-shadow:var(--sh-sm); overflow:hidden;
    margin-top:24px; margin-bottom:40px;
}
.ws-hdr {
    padding:13px 20px; border-bottom:1.5px solid var(--border); background:var(--surface-2);
    display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:10px;
}
.ws-left { display:flex; align-items:center; gap:12px; }
.ws-tname { font-size:.65rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color:var(--brand); margin-bottom:2px; }
.ws-tdesc { font-size:.78rem; color:var(--muted); }
.ws-acts  { display:flex; flex-wrap:wrap; align-items:center; gap:7px; }

/* Settings panels */
.sp { padding:13px 20px; border-bottom:1.5px solid var(--border); }
.sp-lbl { display:block; font-size:.65rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase; margin-bottom:9px; }
.sp-row { display:flex; flex-wrap:wrap; gap:14px; align-items:flex-end; }
.sp-field { display:flex; flex-direction:column; gap:5px; }
.sp-field label { font-size:.75rem; font-weight:600; color:var(--muted); }

.api-notice {
    padding:9px 20px; font-size:.8rem; font-weight:500;
    background:rgba(245,158,11,.07); color:#92400e;
    border-bottom:1px solid rgba(245,158,11,.22);
}
.dark .api-notice { background:rgba(245,158,11,.1); color:#fcd34d; }
.api-notice code { font-family:monospace; font-size:.82em; }

/* File / page grid */
#sortable-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:11px; padding:16px 20px; }
@media(min-width:480px)  { #sortable-grid { grid-template-columns:repeat(3,1fr); } }
@media(min-width:640px)  { #sortable-grid { grid-template-columns:repeat(4,1fr); } }
@media(min-width:1024px) { #sortable-grid { grid-template-columns:repeat(5,1fr); } }
@media(min-width:1280px) { #sortable-grid { grid-template-columns:repeat(6,1fr); } }

.sortable-ghost { opacity:.2; background:var(--brand) !important; border:2px dashed var(--brand); }

.pc {
    position:relative; border-radius:10px; overflow:hidden; aspect-ratio:3/4;
    display:flex; align-items:center; justify-content:center;
    background:var(--surface-2); border:1.5px solid var(--border);
    transition:border-color var(--ease);
}
.pc:hover { border-color:var(--border-2); }
.pc img { width:100%; height:100%; object-fit:cover; display:block; }
.pc-lbl {
    position:absolute; bottom:0; left:0; right:0;
    background:rgba(0,0,0,.72); color:#fff; font-size:.63rem; font-weight:600;
    padding:4px 5px; text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.pc-btn {
    position:absolute; width:25px; height:25px; border-radius:50%;
    background:#fff; border:none; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    box-shadow:0 2px 8px rgba(0,0,0,.22); transition:transform var(--ease);
}
.pc-btn:hover { transform:scale(1.12); }
.pc-btn.rm  { top:5px; right:5px; color:#EF4444; }
.pc-btn.rot { top:5px; left:5px;  color:var(--brand); }
.pc.selected { border-color:#7C3AED !important; box-shadow:0 0 0 3px rgba(124,58,237,.22); }
.sel-chk {
    position:absolute; top:5px; right:5px; width:23px; height:23px; border-radius:50%;
    background:#7C3AED; color:#fff; display:flex; align-items:center; justify-content:center;
    box-shadow:0 2px 6px rgba(124,58,237,.4);
}
.pc.doc-full {
    aspect-ratio:unset; min-height:190px; grid-column:1/-1;
    flex-direction:column; gap:10px; padding:32px;
    cursor:default; border-style:dashed;
}

/* ═══════ BUTTONS ═══════ */
.btn {
    display:inline-flex; align-items:center; gap:7px; font-family:inherit;
    font-size:.875rem; font-weight:700; padding:9px 18px;
    border-radius:var(--r-sm); border:none; cursor:pointer;
    transition:all var(--ease); white-space:nowrap; text-decoration:none; line-height:1;
}
.btn:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
.btn:disabled { opacity:.6; cursor:not-allowed; pointer-events:none; }
.btn-sm { padding:7px 13px; font-size:.8rem; }

.b-primary { background:var(--brand); color:#fff; }
.b-primary:hover:not(:disabled) { background:var(--brand-dk); transform:translateY(-1px); box-shadow:0 4px 14px rgba(15,118,110,.3); }
.b-outline  { background:transparent; color:var(--text); border:1.5px solid var(--border); }
.b-outline:hover:not(:disabled) { border-color:var(--brand); color:var(--brand); background:var(--brand-xl); }
.b-ghost    { background:transparent; color:var(--muted); padding:8px 11px; }
.b-ghost:hover:not(:disabled) { color:var(--text); background:var(--surface-2); }
.b-slate    { background:#475569; color:#fff; }
.b-slate:hover:not(:disabled)   { background:#334155; transform:translateY(-1px); }
.b-violet   { background:#7C3AED; color:#fff; }
.b-violet:hover:not(:disabled)  { background:#6D28D9; transform:translateY(-1px); }
.b-green    { background:#16A34A; color:#fff; }
.b-green:hover:not(:disabled)   { background:#15803d; transform:translateY(-1px); }
.b-sky      { background:#0284C7; color:#fff; }
.b-sky:hover:not(:disabled)     { background:#0369a1; transform:translateY(-1px); }
.b-indigo   { background:#4F46E5; color:#fff; }
.b-indigo:hover:not(:disabled)  { background:#4338CA; transform:translateY(-1px); }
.b-rose     { background:#E11D48; color:#fff; }
.b-rose:hover:not(:disabled)    { background:#BE123C; transform:translateY(-1px); }
.b-orange   { background:#EA580C; color:#fff; }
.b-orange:hover:not(:disabled)  { background:#C2410C; transform:translateY(-1px); }
.b-red      { background:#DC2626; color:#fff; }
.b-red:hover:not(:disabled)     { background:#B91C1C; transform:translateY(-1px); }
.b-emerald  { background:#059669; color:#fff; }
.b-emerald:hover:not(:disabled) { background:#047857; transform:translateY(-1px); }

/* Form inputs */
.finp {
    background:var(--surface); border:1.5px solid var(--border); border-radius:8px;
    color:var(--text); font-family:inherit; font-size:.875rem; padding:8px 12px;
    transition:border-color var(--ease),box-shadow var(--ease);
}
.finp:focus { outline:none; border-color:var(--brand); box-shadow:0 0 0 3px rgba(15,118,110,.1); }
.pw-wrap { position:relative; }
.pw-eye {
    position:absolute; right:9px; top:50%; transform:translateY(-50%);
    background:none; border:none; cursor:pointer; color:var(--muted);
    padding:2px; display:flex; align-items:center;
}
.pw-eye:hover { color:var(--text); }

/* Spinner */
.spinner {
    width:24px; height:24px; border-radius:50%;
    border:3px solid rgba(15,118,110,.15); border-top-color:var(--brand);
    animation:spin .75s linear infinite; margin:auto; flex-shrink:0;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* ═══════ TOAST ═══════ */
#toast-root {
    position:fixed; bottom:24px; right:24px; z-index:9999;
    display:flex; flex-direction:column; gap:10px; pointer-events:none;
}
.toast {
    display:flex; align-items:flex-start; gap:12px; padding:13px 15px;
    border-radius:12px; max-width:380px; min-width:250px;
    font-size:.875rem; font-weight:500; line-height:1.4;
    box-shadow:0 8px 32px rgba(0,0,0,.22),0 2px 8px rgba(0,0,0,.14);
    pointer-events:all; opacity:1; transform:translateX(0);
    transition:opacity .28s ease,transform .28s ease;
}
.toast.tout { opacity:0; transform:translateX(18px); }
.t-ok   { background:#064E3B; color:#A7F3D0; }
.t-err  { background:#7F1D1D; color:#FCA5A5; }
.t-warn { background:#78350F; color:#FDE68A; }
.t-info { background:#1E3A5F; color:#BFDBFE; }
.toast-msg { flex:1; }
.toast-x {
    flex-shrink:0; background:none; border:none; cursor:pointer;
    color:inherit; opacity:.6; padding:0; display:flex; align-items:center; margin-left:4px;
}
.toast-x:hover { opacity:1; }
@media(max-width:480px){
    #toast-root { bottom:16px; right:12px; left:12px; }
    .toast { min-width:unset; max-width:100%; }
}

/* ═══════ FOOTER ═══════ */
.site-footer { border-top:1.5px solid var(--border); background:var(--surface); margin-top:8px; }
.footer-inner { max-width:1200px; margin:0 auto; padding:44px 24px 28px; }
.footer-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:36px; margin-bottom:36px; }
@media(min-width:768px){ .footer-grid { grid-template-columns:repeat(4,1fr); } }
.fc h4 { font-size:.8rem; font-weight:800; color:var(--text); margin-bottom:14px; letter-spacing:.02em; }
.fc a,.fc .fi {
    font-size:.8rem; color:var(--muted); display:block;
    margin-bottom:8px; text-decoration:none; transition:color var(--ease);
}
.fc a:hover { color:var(--brand); }
.footer-bottom { border-top:1px solid var(--border); padding-top:20px; text-align:center; font-size:.8rem; color:var(--muted); }

/* ═══════ RESPONSIVE ═══════ */
@media(max-width:639px){
    .ws-hdr { flex-direction:column; align-items:flex-start; }
    .ws-acts { width:100%; }
}
@media(max-width:479px){
    .hero { padding:36px 4px 28px; }
    .upload-card-hdr { padding:20px 16px 16px; }
    #drop-zone { margin:12px; padding:32px 16px; }
    .ws-hdr { padding:11px 13px; }
    #sortable-grid { padding:12px 13px; gap:9px; }
    .feat-block { padding:24px 16px; }
    .faq-item summary { padding:13px 16px; }
    .faq-item p { padding:0 16px 13px; }
    .sp { padding:11px 13px; }
}

/* ═══════ COMPRESS TOOL ═══════ */
.compress-opts { display:flex; flex-direction:column; gap:8px; }
.compress-opt  {
    display:flex; align-items:flex-start; gap:10px; padding:10px 14px;
    border:1.5px solid var(--border); border-radius:10px; cursor:pointer;
    transition:border-color var(--ease), background var(--ease);
}
.compress-opt:hover { border-color:var(--brand); background:var(--brand-xl); }
.compress-opt input[type=radio] { margin-top:3px; accent-color:var(--brand); flex-shrink:0; }
.compress-opt-lbl strong { display:block; font-size:.875rem; font-weight:700; color:var(--text); }
.compress-opt-lbl span   { font-size:.78rem; color:var(--muted); }
.compress-result {
    display:flex; align-items:center; gap:10px; margin-top:12px;
    padding:10px 14px; background:var(--brand-xl); border:1.5px solid rgba(15,118,110,.2);
    border-radius:10px; font-size:.875rem; font-weight:600; color:var(--brand);
}
.dark .compress-result { border-color:rgba(20,184,166,.3); }
.compress-arrow { font-size:1.2rem; }
.compress-pct-badge {
    margin-left:auto; background:var(--brand); color:#fff;
    font-size:.75rem; font-weight:800; padding:3px 10px; border-radius:100px;
}

/* ═══════ PROGRESS BAR ═══════ */
.progress-wrap {
    padding: 14px 20px;
    border-bottom: 1.5px solid var(--border);
    background: var(--surface-2);
}
.progress-bar-track {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}
.progress-fill {
    height: 100%;
    background: var(--brand);
    border-radius: 3px;
    width: 0%;
    transition: width 0.25s ease;
}
.progress-fill.indeterminate {
    width: 40% !important;
    transition: none;
    animation: progress-slide 1.5s ease-in-out infinite;
}
@keyframes progress-slide {
    0%   { transform: translateX(-200%); }
    100% { transform: translateX(450%); }
}
.progress-text {
    font-size: .78rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.4;
}

/* ═══════ MOBILE WORKSPACE FIXES ═══════ */

/* Bigger tap targets for delete/rotate buttons on mobile */
@media(max-width:600px) {
    .pc-btn {
        width: 32px;
        height: 32px;
    }
    .pc-lbl {
        font-size: .7rem;
        padding: 5px 4px;
    }
    /* Execute button: full width on small screens */
    .ws-acts {
        flex-direction: column;
        width: 100%;
    }
    .ws-acts .btn {
        width: 100%;
        justify-content: center;
        padding: 12px 18px;
        font-size: .9rem;
    }
    .ws-acts .btn-sm {
        padding: 9px 14px;
        font-size: .82rem;
    }
    /* More breathing room in workspace header */
    .ws-hdr {
        padding: 14px;
        gap: 14px;
    }
    /* Larger page cards on small phones */
    #sortable-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 14px;
    }
    .pc {
        /* min-height ensures cards aren't too squished */
        min-height: 120px;
    }
    /* Upload card: tighter on mobile */
    #drop-zone {
        min-height: 200px;
        padding: 28px 16px;
    }
    .dz-circle {
        width: 56px;
        height: 56px;
        margin-bottom: 14px;
    }
}

/* Very small phones (< 360px): single column workspace */
@media(max-width:360px) {
    #sortable-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════
   SEO CONTENT SECTIONS (tool pages)
═══════════════════════════════════════════════════ */
.seo-content {
    max-width: 720px;
    margin: 32px auto 0;
}
.seo-block {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    padding: 22px 26px;
    margin-bottom: 18px;
    box-shadow: var(--sh-sm);
}
.seo-block h2 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.02em;
    margin-bottom: 12px;
}
.seo-block p {
    font-size: .875rem;
    color: var(--muted);
    line-height: 1.7;
    margin: 0 0 8px;
}
.seo-block p:last-child { margin-bottom: 0; }

.seo-tips {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.seo-tips li {
    font-size: .875rem;
    color: var(--muted);
    line-height: 1.6;
    padding-left: 22px;
    position: relative;
}
.seo-tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--brand);
    font-weight: 800;
    font-size: .8rem;
}

/* Tool-page FAQ accordion (reuses faq-block vars) */
.seo-faq { overflow: hidden; }
.seo-faq-item { border-top: 1px solid var(--border); }
.seo-faq-item:first-child { border-top: none; }
.seo-faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
}
.seo-faq-item summary::-webkit-details-marker { display: none; }
.seo-faq-chev {
    flex-shrink: 0;
    color: var(--brand);
    transition: transform .22s;
}
.seo-faq-item[open] .seo-faq-chev { transform: rotate(180deg); }
.seo-faq-item p {
    font-size: .875rem;
    color: var(--muted);
    line-height: 1.65;
    padding: 0 0 14px;
    margin: 0;
}

/* Related tools strip */
.related-strip { margin-top: 32px; margin-bottom: 56px; }
.related-lbl {
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.related-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 13px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    text-decoration: none;
    color: var(--text);
    transition: border-color var(--ease), background var(--ease), transform var(--ease);
}
.related-card:hover {
    border-color: var(--brand);
    background: var(--brand-xl);
    transform: translateY(-2px);
}
.related-ico {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.dark .related-ico { filter: brightness(.8) saturate(.8); }
.related-name { font-size: .8rem; font-weight: 700; color: var(--text); }
.related-desc { font-size: .7rem; color: var(--muted); margin-top: 1px; }

@media(max-width:560px) {
    .related-grid { grid-template-columns: 1fr; }
    .seo-block { padding: 16px; }
}

/* ═══════ TIP NOTICE (html-to-pdf info box) ═══════ */
.tip-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(2,132,199,.07);
    border: 1.5px solid rgba(2,132,199,.2);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: .83rem;
    color: #0369a1;
    line-height: 1.55;
}
.dark .tip-notice {
    background: rgba(2,132,199,.12);
    border-color: rgba(2,132,199,.3);
    color: #7dd3fc;
}

/* ═══════ COMING SOON BADGES & DISABLED STATES ═══════ */
.tool-card { position: relative; }
.tc-soon {
    display: inline-block;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .08em;
    padding: 2px 7px;
    border-radius: 20px;
    background: #FEF3C7;
    color: #92400E;
    vertical-align: middle;
    margin-left: 4px;
}
.dark .tc-soon { background: rgba(251,191,36,.15); color: #FCD34D; }
.tool-card.tc-disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}
.dd-soon {
    display: inline-block;
    font-size: .55rem;
    font-weight: 800;
    letter-spacing: .07em;
    padding: 1px 6px;
    border-radius: 16px;
    background: #FEF3C7;
    color: #92400E;
    vertical-align: middle;
    margin-left: 3px;
}
.dark .dd-soon { background: rgba(251,191,36,.15); color: #FCD34D; }
.dd-item.dd-disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}
.mob-link.mob-disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ═══════ COMING SOON BANNER (server tool pages) ═══════ */
.cs-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(245,158,11,.09);
    border: 1.5px solid rgba(245,158,11,.35);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: .85rem;
    color: #92400E;
    line-height: 1.55;
}
.dark .cs-banner { background: rgba(245,158,11,.12); color: #FCD34D; }
.cs-banner a { color: inherit; font-weight: 700; }

/* ═══════ WORKSPACE CONTROLS BAR (crop, blank pages, pdf-info, sign) ═══════ */
.ws-controls {
    padding: 16px 20px;
    border-bottom: 1.5px solid var(--border);
    background: var(--surface-2);
}
.ctl-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 10px;
}
.ctl-row:last-child { margin-bottom: 0; }
.ctl-field { flex: 1; min-width: 180px; }
.ctl-field.ctl-sm { flex: 0 1 auto; min-width: 140px; }
.ctl-field label, .ctl-lbl {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 5px;
    letter-spacing: .02em;
}
.ctl-field input[type="text"],
.ctl-field input[type="number"],
.ctl-field select {
    width: 100%;
    padding: 8px 11px;
    font-size: .85rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border-2);
    border-radius: 8px;
    outline: none;
    transition: border-color var(--ease);
}
.ctl-field input:focus, .ctl-field select:focus { border-color: var(--brand); }
.ctl-field input[type="range"] { width: 100%; accent-color: var(--brand); }
.ctl-field.ctl-check label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .82rem;
    color: var(--text);
    cursor: pointer;
    margin-top: 20px;
}
.ctl-field.ctl-check input { accent-color: var(--brand); width: 16px; height: 16px; }

/* ═══════ PDF INFO GRID ═══════ */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.info-item {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}
.info-lbl {
    display: block;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 3px;
}
.info-val {
    display: block;
    font-size: .85rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}

/* ═══════ SIGNATURE PAD ═══════ */
.sig-pad-wrap { margin-bottom: 14px; }
#sig-pad {
    display: block;
    width: 100%;
    max-width: 440px;
    height: 160px;
    background: var(--surface);
    border: 2px dashed var(--border-2);
    border-radius: 10px;
    cursor: crosshair;
    touch-action: none;
}
#sig-pad:hover { border-color: var(--brand); }
.dark #sig-pad { background: rgba(255,255,255,.03); }

@media(max-width:600px) {
    .ctl-row { flex-direction: column; gap: 10px; }
    .ctl-field, .ctl-field.ctl-sm { min-width: 100%; }
    .info-grid { grid-template-columns: repeat(2, 1fr); }
    #sig-pad { max-width: 100%; height: 140px; }
}

/* ═══════ INTERACTIVE PAGE PREVIEW (Sign & Crop) ═══════ */
.preview-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin-top: 8px;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
    user-select: none;
    touch-action: none;
}
#preview-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1.5px solid var(--border);
    border-radius: 8px;
}
.preview-box {
    position: absolute;
    box-sizing: border-box;
    cursor: move;
    touch-action: none;
}
.preview-box-sign {
    border: 2px dashed var(--brand);
    background: rgba(15,118,110,.08);
}
.preview-box-sign #pv-sig-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    display: none;
}
.preview-box-crop {
    border: 2px solid #fff;
    outline: 1px solid rgba(0,0,0,.4);
    /* box-shadow dim is set inline by JS */
}
.pv-handle {
    position: absolute;
    width: 14px; height: 14px;
    background: var(--brand);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
    touch-action: none;
}
.preview-box-crop .pv-handle { background: #fff; border-color: var(--brand); }
.pv-nw { top: -8px;  left: -8px;  cursor: nwse-resize; }
.pv-ne { top: -8px;  right: -8px; cursor: nesw-resize; }
.pv-sw { bottom: -8px; left: -8px;  cursor: nesw-resize; }
.pv-se { bottom: -8px; right: -8px; cursor: nwse-resize; }
.pv-n  { top: -8px;  left: 50%; margin-left: -7px; cursor: ns-resize; }
.pv-s  { bottom: -8px; left: 50%; margin-left: -7px; cursor: ns-resize; }
.pv-w  { left: -8px; top: 50%; margin-top: -7px; cursor: ew-resize; }
.pv-e  { right: -8px; top: 50%; margin-top: -7px; cursor: ew-resize; }

/* ═══════ SIGNATURE TABS (Draw / Type / Upload) ═══════ */
.sig-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    background: var(--surface-2);
    padding: 4px;
    border-radius: 10px;
    max-width: 380px;
}
.sig-tab {
    flex: 1;
    padding: 8px 10px;
    font-size: .82rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--muted);
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background var(--ease), color var(--ease);
}
.sig-tab:hover { color: var(--text); }
.sig-tab.active {
    background: var(--surface);
    color: var(--brand);
    box-shadow: var(--sh-sm);
}
.sig-panel { margin-bottom: 6px; }

/* Typed signature font options */
.sig-font-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.sig-font-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 68px;
    padding: 10px 16px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color var(--ease), background var(--ease);
    overflow: hidden;
}
.sig-font-opt:hover { border-color: var(--brand-2); }
.sig-font-opt.selected { border-color: var(--brand); background: var(--brand-xl); }
.sig-font-preview {
    font-size: 2rem;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Upload signature zone */
.sig-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px 20px;
    background: var(--surface-2);
    border: 2px dashed var(--border-2);
    border-radius: 10px;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: border-color var(--ease), background var(--ease);
}
.sig-upload-zone:hover { border-color: var(--brand); background: var(--brand-xl); color: var(--brand); }
.sig-crop-area { margin-top: 6px; }

@media(max-width:600px) {
    .sig-tabs { max-width: 100%; }
    .sig-font-preview { font-size: 1.6rem; }
}
