/* Soft Learn Hub PDF Tools (/tools/pdf-tools/ and its seven tool pages). Same design language as the invoice and P&L generators. Loaded only on those pages; excluded from LiteSpeed CSS optimisation because most states are toggled by JS. */
#slh-pdf{--d-surface:#EEEDF5;--d-sheet:#fff;--d-ink:#111;--d-text:#3b3b45;--d-muted:#62626E;--d-line:#E4E2EE;--d-hover:#F3F3F9;--d-accent:#5A65DA;--d-accent-ink:#fff;--d-accent-soft:#ECEDFB;--d-danger:#B42318;--d-danger-soft:#FEF3F2;--d-ok:#1E7F52;--d-ok-soft:#ECFDF3;--d-warn:#9A5B00;--d-warn-soft:#FFF8E6;--d-shadow:0 1px 3px rgba(17,17,17,.06),0 12px 32px rgba(17,17,17,.06);
  position:relative;margin:24px 0 8px;padding:16px;border-radius:24px;background:var(--d-surface);color:var(--d-text);font-size:16px;line-height:1.5;color-scheme:light}
#slh-pdf *,#slh-pdf *::before,#slh-pdf *::after{box-sizing:border-box}
#slh-pdf [hidden]{display:none!important}
#slh-pdf svg{width:20px;height:20px;flex:0 0 auto}
#slh-pdf .pd-vh{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#slh-pdf button,#slh-pdf input,#slh-pdf select{font:inherit;font-size:16px;line-height:1.4;color:var(--d-ink);margin:0;text-transform:none;box-shadow:none}
#slh-pdf button{cursor:pointer}
#slh-pdf a:focus-visible,#slh-pdf button:focus-visible,#slh-pdf input:focus-visible,#slh-pdf select:focus-visible,#slh-pdf .pd-drop:focus-within{outline:3px solid var(--d-accent);outline-offset:2px}
/* Tabs: real links (crawlable); JS switches tools without a reload. Wraps instead of scrolling sideways. */
#slh-pdf .pd-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 0 14px;padding:0;list-style:none}
#slh-pdf .pd-tab{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:8px 12px;border:1px solid var(--d-line);border-radius:14px;background:var(--d-sheet);color:var(--d-ink);font-size:15px;font-weight:600;text-decoration:none;text-align:center;transition:border-color .15s,color .15s,background-color .15s}
#slh-pdf .pd-tab:hover{border-color:var(--d-accent);color:var(--d-accent)}
#slh-pdf .pd-tab[aria-current]{border-color:var(--d-accent);background:var(--d-accent);color:var(--d-accent-ink)}
#slh-pdf .pd-tab svg{width:18px;height:18px}
/* Seven tools: one row on wide screens, icon above a label that may wrap to two lines. */
@media (min-width:861px){
  #slh-pdf .pd-tabs{grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
  #slh-pdf .pd-tab{flex-direction:column;gap:4px;min-height:64px;padding:8px 6px;font-size:14px;line-height:1.25}
}
#slh-pdf .pd-stage{min-height:300px;padding:clamp(16px,3vw,28px);border-radius:18px;background:var(--d-sheet);box-shadow:var(--d-shadow)}
#slh-pdf .pd-title{margin:0 0 4px;font-size:20px;font-weight:700;line-height:1.3;color:var(--d-ink)}
#slh-pdf .pd-sub{margin:0 0 16px;font-size:15px;color:var(--d-muted)}
/* Drop zone: a real <label> for the file input, so click, tap, Enter and Space all work. */
#slh-pdf .pd-drop{position:relative;display:block;border:2px dashed var(--d-line);border-radius:16px;background:var(--d-hover);transition:border-color .15s,background-color .15s}
#slh-pdf .pd-drop.is-drag,#slh-pdf .pd-drop:hover{border-color:var(--d-accent);background:var(--d-accent-soft)}
#slh-pdf .pd-drop-l{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:170px;margin:0;padding:24px 16px;text-align:center;cursor:pointer;color:var(--d-text)}
#slh-pdf .pd-drop-l svg{width:40px;height:40px;color:var(--d-accent)}
#slh-pdf .pd-drop-btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:10px 22px;border-radius:999px;background:var(--d-accent);color:var(--d-accent-ink);font-size:16px;font-weight:600}
#slh-pdf .pd-drop-or{font-size:14px;color:var(--d-muted)}
#slh-pdf .pd-drop.is-disabled{opacity:.5;pointer-events:none}
#slh-pdf .pd-hint{margin:10px 0 0;font-size:13px;line-height:1.5;color:var(--d-muted)}
#slh-pdf .pd-drop.is-compact .pd-drop-l{flex-direction:row;flex-wrap:wrap;min-height:64px;padding:10px 14px;gap:10px}
#slh-pdf .pd-drop.is-compact .pd-drop-l svg{width:24px;height:24px}
#slh-pdf .pd-drop.is-compact .pd-drop-btn{min-height:44px;padding:8px 18px;font-size:15px}
/* File list */
#slh-pdf .pd-list{display:flex;flex-direction:column;gap:8px;margin:14px 0 0;padding:0;list-style:none;counter-reset:pd}
#slh-pdf .pd-item{display:grid;grid-template-columns:auto 52px minmax(0,1fr) auto;align-items:center;gap:10px;margin:0;padding:8px 10px;border:1px solid var(--d-line);border-radius:14px;background:var(--d-sheet);counter-increment:pd}
#slh-pdf .pd-item::before{content:counter(pd);min-width:22px;font-size:13px;font-weight:600;color:var(--d-muted);text-align:center}
#slh-pdf .pd-item.is-dragging{opacity:.5}
#slh-pdf .pd-item.is-over{border-color:var(--d-accent);box-shadow:0 -3px 0 var(--d-accent)}
#slh-pdf .pd-thumb{display:grid;place-items:center;width:52px;height:52px;overflow:hidden;border-radius:8px;background:var(--d-hover);color:var(--d-accent)}
#slh-pdf .pd-thumb img{width:100%;height:100%;object-fit:cover}
#slh-pdf .pd-thumb svg{width:26px;height:26px}
#slh-pdf .pd-name{min-width:0}
#slh-pdf .pd-name strong{display:block;overflow:hidden;font-size:15px;font-weight:600;color:var(--d-ink);text-overflow:ellipsis;white-space:nowrap}
#slh-pdf .pd-name small{display:block;font-size:13px;color:var(--d-muted)}
#slh-pdf .pd-item-acts{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:2px}
#slh-pdf .pd-ico{display:grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:10px;background:none;color:var(--d-muted)}
#slh-pdf .pd-ico:hover{background:var(--d-accent-soft);color:var(--d-accent)}
#slh-pdf .pd-ico[disabled]{opacity:.35;cursor:default;background:none}
#slh-pdf .pd-ico.is-del:hover{background:var(--d-danger-soft);color:var(--d-danger)}
#slh-pdf .pd-handle{cursor:grab}
/* Options */
#slh-pdf .pd-opts{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin:16px 0 0;padding:14px;border-radius:14px;background:var(--d-hover)}
#slh-pdf .pd-opts fieldset{min-width:0;margin:0;padding:0;border:0}
#slh-pdf .pd-opts legend,#slh-pdf .pd-opts label.pd-l{display:block;margin:0 0 6px;padding:0;font-size:14px;font-weight:600;color:var(--d-ink)}
#slh-pdf .pd-seg{display:flex;flex-wrap:wrap;gap:6px}
#slh-pdf .pd-seg label{position:relative;display:inline-flex;align-items:center;min-height:44px;margin:0;padding:8px 14px;border:1px solid var(--d-line);border-radius:999px;background:var(--d-sheet);font-size:15px;color:var(--d-ink);cursor:pointer}
#slh-pdf .pd-seg input{position:absolute;opacity:0;width:1px;height:1px}
#slh-pdf .pd-seg input:checked+span{color:var(--d-accent-ink)}
#slh-pdf .pd-seg label:has(input:checked){border-color:var(--d-accent);background:var(--d-accent)}
#slh-pdf .pd-seg label:has(input:focus-visible){outline:3px solid var(--d-accent);outline-offset:2px}
#slh-pdf .pd-opts select,#slh-pdf .pd-opts input[type=text],#slh-pdf .pd-opts input[type=number]{display:block;width:100%;min-height:44px;padding:8px 10px;border:1px solid var(--d-line);border-radius:10px;background:var(--d-sheet)}
#slh-pdf .pd-opts small{display:block;margin-top:6px;font-size:13px;line-height:1.45;color:var(--d-muted)}
#slh-pdf .pd-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:16px 0 0}
#slh-pdf .pd-primary{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:52px;padding:12px 28px;border:0;border-radius:999px;background:var(--d-accent);color:var(--d-accent-ink);font-size:17px;font-weight:700;transition:filter .15s,transform .15s}
#slh-pdf .pd-primary:hover{filter:brightness(1.08);background:var(--d-accent);color:var(--d-accent-ink)}
#slh-pdf .pd-primary:active{transform:scale(.98)}
#slh-pdf .pd-primary[disabled]{opacity:.5;cursor:not-allowed;filter:none;transform:none}
#slh-pdf .pd-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 18px;border:1px solid var(--d-line);border-radius:999px;background:var(--d-sheet);color:var(--d-ink);font-size:15px;font-weight:600;text-decoration:none}
#slh-pdf .pd-btn:hover{border-color:var(--d-accent);color:var(--d-accent);background:var(--d-sheet)}
#slh-pdf .pd-msg{margin:14px 0 0;padding:12px 14px;border-radius:12px;font-size:15px;line-height:1.5}
#slh-pdf .pd-msg p{margin:0}
#slh-pdf .pd-msg p+p{margin-top:6px}
#slh-pdf .pd-err{background:var(--d-danger-soft);color:var(--d-ink)}
#slh-pdf .pd-err strong{color:var(--d-danger)}
#slh-pdf .pd-warn{background:var(--d-warn-soft);color:var(--d-ink)}
#slh-pdf .pd-warn strong{color:var(--d-warn)}
/* Progress */
#slh-pdf .pd-progress{margin:16px 0 0}
#slh-pdf .pd-bar{position:relative;height:10px;overflow:hidden;border-radius:999px;background:var(--d-accent-soft)}
#slh-pdf .pd-bar span{position:absolute;inset:0 auto 0 0;width:0;border-radius:999px;background:var(--d-accent);transition:width .2s}
#slh-pdf .pd-bar.is-busy span{width:30%!important;animation:pd-slide 1.2s ease-in-out infinite}
@keyframes pd-slide{0%{transform:translateX(-100%)}100%{transform:translateX(340%)}}
#slh-pdf .pd-step{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;margin:10px 0 0;font-size:15px;color:var(--d-text)}
/* Result */
#slh-pdf .pd-result{margin:16px 0 0;padding:16px;border:1px solid var(--d-line);border-radius:16px;background:var(--d-ok-soft)}
#slh-pdf .pd-result-h{display:flex;align-items:center;gap:8px;margin:0 0 6px;font-size:18px;font-weight:700;color:var(--d-ink)}
#slh-pdf .pd-result-h svg{color:var(--d-ok)}
#slh-pdf .pd-result p{margin:0 0 6px;font-size:15px}
#slh-pdf .pd-stat{font-variant-numeric:tabular-nums;font-weight:600;color:var(--d-ink)}
#slh-pdf .pd-next{margin:12px 0 0;padding:12px 0 0;border-top:1px solid var(--d-line)}
#slh-pdf .pd-next p{margin:0 0 8px;font-size:14px;font-weight:600;color:var(--d-ink)}
#slh-pdf .pd-next-l{display:flex;flex-wrap:wrap;gap:8px}
#slh-pdf .pd-privacy{display:flex;align-items:flex-start;gap:8px;margin:12px 4px 0;font-size:14px;line-height:1.5;color:var(--d-muted)}
#slh-pdf .pd-privacy svg{width:18px;height:18px;margin-top:2px;color:var(--d-ok)}
@media (max-width:600px){
  #slh-pdf{margin-left:-4px;margin-right:-4px;padding:10px;border-radius:18px}
  #slh-pdf .pd-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
  #slh-pdf .pd-tab{font-size:14px;padding:8px}
  #slh-pdf .pd-tab svg{display:none}
  #slh-pdf .pd-tabs li:last-child:nth-child(odd){grid-column:1/-1}
  #slh-pdf .pd-item{grid-template-columns:44px minmax(0,1fr);row-gap:4px}
  #slh-pdf .pd-item::before{display:none}
  #slh-pdf .pd-thumb{width:44px;height:44px}
  #slh-pdf .pd-item-acts{grid-column:1/-1;justify-content:flex-start}
  #slh-pdf .pd-primary{width:100%}
}
@media (prefers-reduced-motion:reduce){
  #slh-pdf *{transition:none!important;animation:none!important}
}
