/* easypdf.surf tools - shared styles.
   Mobile first: the phone layout is the base and the desktop one is the
   media query, because that is the way round these tools get used. */
:root{
  --bg:#ffffff; --panel:#f7f8fa; --line:#e2e5ea; --line-soft:#eef0f3;
  --fg:#14181f; --fg-2:#3d4654; --muted:#68717f;
  --accent:#12467d; --accent-hover:#0e3763; --accent-fg:#ffffff;
  --ok:#1c7a4a; --bad:#b3261e; --warn:#8a6100;
  --bar:72px;
}
html[data-theme="dark"]{
  --bg:#0f1216; --panel:#161a20; --line:#262c35; --line-soft:#1e232a;
  --fg:#eef1f5; --fg-2:#c3cad4; --muted:#8b95a3;
  --accent:#4b8fd6; --accent-hover:#69a4e2; --accent-fg:#0f1216;
  --ok:#5cc78d; --bad:#f2857c; --warn:#e0b558;
}
*{box-sizing:border-box}
/* .drop and .card set display, and a class beats a bare attribute selector,
   so without this the hidden ones stayed on screen. */
[hidden]{display:none!important}
body{margin:0;background:var(--bg);color:var(--fg);
  font:16px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  /* room for the sticky action bar, plus the phone's home indicator */
  padding-bottom:calc(var(--bar) + env(safe-area-inset-bottom))}
a{color:inherit;text-decoration:none}
img{max-width:100%;height:auto}
.wrap{max-width:1020px;margin:0 auto;padding:0 18px}
.skip{position:absolute;left:-9999px}
.skip:focus{left:12px;top:12px;background:var(--accent);color:var(--accent-fg);
  padding:9px 14px;border-radius:4px;z-index:9}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* --- header --- */
header{position:sticky;top:0;z-index:6;background:var(--bg);border-bottom:1px solid var(--line)}
.bar{display:flex;align-items:center;gap:10px;height:56px}
.brand{display:flex;align-items:center;gap:9px;font-weight:600;font-size:15.5px;letter-spacing:-.15px}
.brand img{width:22px;height:22px}
nav{margin-left:auto;display:flex;align-items:center;gap:2px}
.nl{color:var(--fg-2);font-size:14.5px;padding:8px 12px;border-radius:4px}
.nl:hover{color:var(--fg);background:var(--panel)}
.ib{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:34px;
  padding:0 9px;border:1px solid var(--line);background:var(--bg);color:var(--fg-2);
  border-radius:4px;font-size:12.5px;font-weight:600;cursor:pointer;letter-spacing:.04em}
.ib:hover{color:var(--fg);border-color:var(--muted)}
@media (max-width:700px){.nl{display:none}}

/* --- page head --- */
.head{padding:26px 0 18px}
.crumb{font-size:13.5px;color:var(--muted);margin:0 0 10px}
.crumb a:hover{color:var(--fg-2);text-decoration:underline}
h1{margin:0 0 8px;font-size:27px;line-height:1.2;letter-spacing:-.5px;font-weight:680}
.lede{margin:0;font-size:16px;color:var(--fg-2);max-width:60ch}
.privacy{display:inline-flex;align-items:center;gap:7px;margin:14px 0 0;padding:7px 12px;
  border:1px solid var(--line);border-radius:999px;background:var(--panel);
  font-size:13.5px;color:var(--fg-2)}
.privacy svg{flex:none;color:var(--ok)}
@media (min-width:760px){h1{font-size:33px}.head{padding:34px 0 22px}}

/* --- drop zone: the biggest thing on the page, like every tool site --- */
.drop{margin:20px 0 0;border:2px dashed var(--line);border-radius:14px;background:var(--panel);
  padding:34px 20px;text-align:center;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  min-height:min(52vh,360px);transition:border-color .12s,background .12s}
.drop:hover,.drop.over{border-color:var(--accent);background:var(--bg)}
.drop.over{border-style:solid}
.drop svg{color:var(--accent);margin-bottom:14px}
.drop .pick-btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;
  background:var(--accent);color:var(--accent-fg);border:0;border-radius:8px;
  padding:0 26px;min-height:54px;font:inherit;font-size:17px;font-weight:660;
  cursor:pointer;pointer-events:none}
.drop:hover .pick-btn{background:var(--accent-hover)}
.drop span{display:block;font-size:14.5px;color:var(--muted);margin-top:13px}
.drop input{display:none}

/* --- controls --- */
.ctl{margin:18px 0 0;padding:16px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}
.ctl h2{margin:0 0 12px;font-size:15px;font-weight:660;letter-spacing:-.1px}
.row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.row+.row{margin-top:12px}
label{font-size:14.5px;color:var(--fg-2)}
input[type=text],input[type=number],select{font:inherit;font-size:15px;color:var(--fg);
  background:var(--bg);border:1px solid var(--line);border-radius:6px;padding:9px 11px;
  min-height:42px;max-width:100%}
input[type=text]{flex:1;min-width:0}
input[type=range]{flex:1;min-width:120px;accent-color:var(--accent)}
.hint{margin:8px 0 0;font-size:13.5px;color:var(--muted)}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:6px;overflow:hidden;background:var(--bg)}
.seg button{font:inherit;font-size:14.5px;font-weight:560;color:var(--fg-2);background:none;
  border:0;border-right:1px solid var(--line);padding:9px 14px;min-height:42px;cursor:pointer}
.seg button:last-child{border-right:0}
.seg button[aria-pressed=true]{background:var(--accent);color:var(--accent-fg)}

/* --- page grid --- */
.grid{list-style:none;margin:18px 0 0;padding:0;
  display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(104px,1fr))}
@media (min-width:760px){.grid{grid-template-columns:repeat(auto-fill,minmax(134px,1fr))}}
.card{position:relative;border:1px solid var(--line);border-radius:8px;background:var(--panel);
  overflow:hidden;display:flex;flex-direction:column}
.card.gone{opacity:.34}
.card .sheet{position:relative;aspect-ratio:1/1.414;display:grid;place-items:center;
  background:var(--bg);overflow:hidden}
.card canvas,.card img.thumb{max-width:100%;max-height:100%;display:block;
  transition:transform .15s ease}
.card .num{padding:6px 8px;font-size:12.5px;color:var(--muted);text-align:center;
  border-top:1px solid var(--line);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card .acts{position:absolute;inset:auto 0 0 0;display:flex;gap:4px;padding:5px;
  background:linear-gradient(transparent,rgba(0,0,0,.45))}
.card .acts button{flex:1;min-height:34px;border:0;border-radius:5px;cursor:pointer;
  background:rgba(255,255,255,.92);color:#14181f;font-size:14px;line-height:1;
  display:grid;place-items:center}
.card .acts button:hover{background:#fff}
.card .acts button:disabled{opacity:.4;cursor:default}
.card .grip{position:absolute;top:6px;left:6px;width:30px;height:30px;border-radius:7px;
  border:0;background:rgba(255,255,255,.92);color:#3d4654;display:grid;place-items:center;
  cursor:grab;padding:0;touch-action:none;font-size:13px;line-height:1}
.card .grip:active{cursor:grabbing}
.card.dragging{opacity:.5}
.card.drop-here{outline:2px solid var(--accent);outline-offset:-2px}

/* --- file list (merge) --- */
.files{list-style:none;margin:18px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}
.file{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line);
  border-radius:8px;background:var(--panel)}
.file.dragging{opacity:.5}
.file.drop-here{outline:2px solid var(--accent);outline-offset:-1px}
.file .grip{flex:none;min-width:34px;min-height:38px;border:0;background:none;color:var(--muted);
  cursor:grab;touch-action:none;font-size:13px;padding:0}
.file .grip:active{cursor:grabbing}
.file .nm{flex:1;min-width:0;font-size:14.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file .sz{font-size:13px;color:var(--muted);flex:none}
.file button{min-width:38px;min-height:38px;border:1px solid var(--line);background:var(--bg);
  color:var(--fg-2);border-radius:6px;cursor:pointer;font-size:15px;line-height:1}
.file button:hover{color:var(--fg);border-color:var(--muted)}
.file button:disabled{opacity:.4;cursor:default}

/* --- action bar --- */
.actbar{position:fixed;left:0;right:0;bottom:0;z-index:7;background:var(--bg);
  border-top:1px solid var(--line);padding:11px 18px calc(11px + env(safe-area-inset-bottom))}
.actbar .in{max-width:1020px;margin:0 auto;display:flex;align-items:center;gap:12px}
.actbar .st{flex:1;min-width:0;font-size:13.5px;color:var(--muted);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.actbar .st.bad{color:var(--bad)}
.actbar .st.ok{color:var(--ok)}
.go{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--accent);
  color:var(--accent-fg);border:0;border-radius:6px;padding:0 22px;min-height:48px;
  font:inherit;font-size:16px;font-weight:640;cursor:pointer;flex:none}
.go:hover:not(:disabled){background:var(--accent-hover)}
.go:disabled{opacity:.45;cursor:default}
.go .sp{width:15px;height:15px;border:2px solid currentColor;border-right-color:transparent;
  border-radius:50%;animation:spin .7s linear infinite;display:none}
.go.busy .sp{display:block}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.go .sp{animation-duration:2s}}

/* --- result --- */
.done{margin:20px 0 0;padding:28px 20px 24px;border:1px solid var(--line);border-radius:14px;
  background:var(--panel);text-align:center}
.done .tick{width:56px;height:56px;margin:0 auto 14px;border-radius:50%;
  background:var(--ok);color:#fff;display:grid;place-items:center}
.done h2{margin:0 0 6px;font-size:21px;font-weight:680;letter-spacing:-.3px}
.done p{margin:0 0 18px;font-size:15px;color:var(--fg-2)}
.dl{display:inline-flex;align-items:center;justify-content:center;gap:9px;
  background:var(--accent);color:var(--accent-fg);
  padding:0 28px;min-height:54px;border-radius:8px;font-size:17px;font-weight:660}
.dl:hover{background:var(--accent-hover)}
.dl .sz{font-weight:500;opacity:.8;font-size:14.5px}
.outs{display:flex;flex-wrap:wrap;gap:10px;justify-content:center}
.again{display:inline-flex;align-items:center;gap:7px;margin-top:16px;
  font-size:14.5px;color:var(--fg-2);background:none;border:0;font:inherit;cursor:pointer;
  text-decoration:underline;text-underline-offset:3px}
.again:hover{color:var(--fg)}

/* --- what else you can do, at the end and at the foot of every tool --- */
.next{margin:34px 0 0;padding-top:26px;border-top:1px solid var(--line-soft)}
.next h2{margin:0 0 14px;font-size:15px;font-weight:660;color:var(--fg-2)}
.next ul{list-style:none;margin:0;padding:0;display:grid;gap:9px;
  grid-template-columns:1fr}
@media (min-width:620px){.next ul{grid-template-columns:1fr 1fr}}
@media (min-width:900px){.next ul{grid-template-columns:1fr 1fr 1fr}}
.next a{display:flex;align-items:center;gap:11px;padding:13px 14px;border:1px solid var(--line);
  border-radius:9px;font-size:14.5px;font-weight:560}
.next a:hover{border-color:var(--accent);background:var(--panel)}
.next svg{flex:none;color:var(--accent)}

/* --- hub --- */
.tools{list-style:none;margin:22px 0 0;padding:0;display:grid;gap:12px;
  grid-template-columns:1fr}
@media (min-width:620px){.tools{grid-template-columns:1fr 1fr}}
@media (min-width:900px){.tools{grid-template-columns:1fr 1fr 1fr}}
.tools a{display:flex;gap:13px;padding:16px;border:1px solid var(--line);border-radius:10px;
  background:var(--panel);height:100%}
.tools a:hover{border-color:var(--accent);background:var(--bg)}
.tools svg{flex:none;color:var(--accent);margin-top:2px}
.tools b{display:block;font-size:15.5px;font-weight:640;margin-bottom:3px}
.tools span{font-size:14px;color:var(--muted);line-height:1.45}

/* --- footer --- */
footer{border-top:1px solid var(--line);margin-top:40px;padding:26px 0 34px;
  font-size:14px;color:var(--muted)}
footer a{color:var(--fg-2)}
footer a:hover{text-decoration:underline}
footer p{margin:0 0 7px}
.noscript{margin:18px 0 0;padding:14px 16px;border:1px solid var(--warn);border-radius:8px;
  font-size:14.5px}
