/* =========================================================
   Daily Sarhad — PDF Desk
   Visual direction: deep indigo-navy surfaces, a warm amber→
   magenta gradient as the single signature accent, soft
   rounded geometry throughout. Two themes, one gradient.
   ========================================================= */

:root, [data-theme="dark"]{
  --bg:#0B0E15;
  --bg-2:#0E1220;
  --surface:#151A26;
  --surface-2:#1C2233;
  --surface-3:#232A3D;
  --text:#EEF0F7;
  --text-muted:#8B93A8;
  --border:rgba(238,240,247,0.08);
  --border-strong:rgba(238,240,247,0.14);

  --accent-1:#FFB454;   /* amber   */
  --accent-2:#FF5C8D;   /* magenta */
  --accent-3:#8B7CF6;   /* violet  */
  --accent-grad: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(255,180,84,0.16), rgba(255,92,141,0.16));
  --accent-solid:#FF7A6B;
  --on-accent:#1A1220;

  --danger:#FF6B6B;
  --success:#3DDC97;

  --shadow-sm:0 1px 2px rgba(0,0,0,0.30);
  --shadow-md:0 8px 24px -8px rgba(0,0,0,0.45);
  --shadow-lg:0 20px 48px -16px rgba(0,0,0,0.55);
  --shadow-glow:0 8px 30px -6px rgba(255,92,141,0.35);
}
[data-theme="light"]{
  --bg:#F5F6FB;
  --bg-2:#EFF1F9;
  --surface:#FFFFFF;
  --surface-2:#F2F3F9;
  --surface-3:#E7E9F3;
  --text:#171A26;
  --text-muted:#5C6178;
  --border:rgba(23,26,38,0.08);
  --border-strong:rgba(23,26,38,0.13);

  --accent-1:#E08A2E;
  --accent-2:#E0436D;
  --accent-3:#6952D6;
  --accent-grad: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(224,138,46,0.12), rgba(224,67,109,0.12));
  --accent-solid:#D9573F;
  --on-accent:#FFFFFF;

  --danger:#D9463F;
  --success:#1F9D6E;

  --shadow-sm:0 1px 2px rgba(23,26,38,0.06);
  --shadow-md:0 10px 28px -10px rgba(23,26,38,0.14);
  --shadow-lg:0 24px 56px -20px rgba(23,26,38,0.18);
  --shadow-glow:0 10px 30px -8px rgba(224,67,109,0.22);
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(255,180,84,0.14), transparent 60%),
    radial-gradient(700px 460px at 92% 8%, rgba(255,92,141,0.12), transparent 60%),
    var(--bg);
  background-attachment:fixed;
  color:var(--text);
  font-family:'IBM Plex Sans',sans-serif;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  transition:background .25s ease, color .25s ease;
}
h1,h2,h3{font-family:'Fraunces',serif;font-weight:600;margin:0;letter-spacing:-0.015em;}
a{color:inherit;text-decoration:none;}
.wrap{max-width:1180px;margin:0 auto;padding:0 28px;}
p{color:var(--text);}

a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{
  outline:2px solid var(--accent-2); outline-offset:2px; border-radius:4px;
}
::selection{ background:var(--accent-2); color:#fff; }

/* ---------- Masthead ---------- */
.masthead{
  position:sticky; top:0; z-index:40;
  border-bottom:1px solid var(--border);
  background:color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter:blur(14px) saturate(140%);
  -webkit-backdrop-filter:blur(14px) saturate(140%);
  padding:18px 0;
}
.masthead .wrap{display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap;}
.brand{display:flex; align-items:baseline; gap:12px;}
.brand .name{font-family:'Fraunces',serif; font-size:23px; font-weight:700; letter-spacing:-0.015em; color:var(--text);}
.brand .div{
  background:var(--accent-grad); -webkit-background-clip:text; background-clip:text; color:transparent;
  font-weight:700;
}
.brand .desk{
  font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--text-muted); border-left:1px solid var(--border-strong); padding-left:12px;
}
.main-nav{display:flex; gap:26px; font-size:14px; font-weight:500; align-items:center;}
.main-nav .nav-link{color:var(--text-muted); position:relative; padding-bottom:2px; display:flex; align-items:center; gap:5px;}
.main-nav .nav-link::after{
  content:''; position:absolute; left:0; right:100%; bottom:-2px; height:2px; border-radius:2px;
  background:var(--accent-grad); transition:right .18s ease;
}
.main-nav .nav-link:hover{color:var(--text);}
.main-nav .nav-link:hover::after{right:0;}
.nav-caret{width:13px; height:13px; transition:transform .18s ease;}
.nav-dropdown{position:relative;}
.nav-dropdown:hover .nav-caret, .nav-dropdown:focus-within .nav-caret{transform:rotate(180deg);}

.nav-dropdown-panel{
  position:absolute; top:100%; left:50%; transform:translate(-50%,6px);
  padding-top:16px; width:min(560px, 80vw);
  opacity:0; visibility:hidden; pointer-events:none;
  transition:opacity .16s ease, transform .16s ease, visibility .16s;
  z-index:50;
}
.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown:focus-within .nav-dropdown-panel{
  opacity:1; visibility:visible; pointer-events:auto; transform:translate(-50%,0);
}
.ndp-grid{
  display:grid; grid-template-columns:repeat(4, 1fr); gap:18px;
  background:var(--surface); border:1px solid var(--border-strong); border-radius:18px;
  padding:22px; box-shadow:var(--shadow-lg);
}
.ndp-col-title{
  font-family:'IBM Plex Mono',monospace; font-size:10.5px; text-transform:uppercase; letter-spacing:.12em;
  color:var(--text-muted); margin-bottom:10px; padding-bottom:8px; border-bottom:1px solid var(--border);
}
.ndp-item{
  display:flex; align-items:center; gap:9px; padding:7px 6px; border-radius:9px; font-size:13px;
  color:var(--text); transition:background .14s ease, color .14s ease; white-space:nowrap;
}
.ndp-item:hover{background:var(--accent-grad-soft); color:var(--text);}
.ndp-icon{
  width:22px; height:22px; border-radius:7px; flex:none; display:flex; align-items:center; justify-content:center;
  background:var(--surface-2); color:var(--text-muted);
}
.ndp-icon svg{width:12px;height:12px;}
.ndp-item:hover .ndp-icon{background:var(--accent-grad); color:var(--on-accent);}

@media (max-width:900px){
  .ndp-grid{grid-template-columns:repeat(2, 1fr);}
  .nav-dropdown-panel{width:92vw;}
}

/* ---------- Homepage layout + sidebar ---------- */
.home-layout{display:grid; grid-template-columns:1fr 280px; gap:44px; align-items:start;}
.home-sidebar{position:sticky; top:96px;}
.sidebar-card{
  background:var(--surface); border:1px solid var(--border-strong); border-radius:18px;
  padding:20px; box-shadow:var(--shadow-sm);
}
.sidebar-title{
  font-family:'IBM Plex Mono',monospace; font-size:11px; text-transform:uppercase; letter-spacing:.14em;
  background:var(--accent-grad); -webkit-background-clip:text; background-clip:text; color:transparent;
  margin-bottom:14px; padding-bottom:12px; border-bottom:1px solid var(--border);
}
.sidebar-links{display:flex; flex-direction:column; gap:3px;}
.sidebar-links .ndp-item{white-space:normal; padding:9px 8px;}

@media (max-width:960px){
  .home-layout{grid-template-columns:1fr;}
  .home-sidebar{position:static; top:auto;}
  .sidebar-card{margin-top:8px;}
}

.theme-toggle{
  width:40px; height:40px; border-radius:12px; border:1px solid var(--border-strong);
  background:var(--surface); color:var(--text); cursor:pointer; display:flex; align-items:center; justify-content:center;
  position:relative; flex:none; box-shadow:var(--shadow-sm); transition:border-color .15s ease, transform .15s ease;
}
.theme-toggle:hover{border-color:var(--accent-2); transform:translateY(-1px);}
.theme-toggle svg{width:18px;height:18px;}
.theme-toggle .icon-moon{display:none;}
[data-theme="dark"] .theme-toggle .icon-sun{display:none;}
[data-theme="dark"] .theme-toggle .icon-moon{display:block;}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs{display:flex; gap:8px; align-items:center; font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--text-muted); margin:24px 0 0;}
.breadcrumbs a:hover{color:var(--accent-2);}
.breadcrumbs span[aria-current]{color:var(--text);}

/* ---------- Hero ---------- */
.hero{padding:64px 0 44px; position:relative;}
.hero .eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--text); background:var(--accent-grad-soft); border:1px solid var(--border-strong);
  padding:7px 14px; border-radius:999px; margin-bottom:20px;
}
.hero .eyebrow::before{
  content:''; width:7px; height:7px; border-radius:50%; background:var(--accent-grad);
}
.hero h1{font-size:clamp(34px,5.4vw,56px); max-width:16ch; line-height:1.05;}
.hero h1 .grad{
  background:var(--accent-grad); -webkit-background-clip:text; background-clip:text; color:transparent;
}
.hero p.lead{color:var(--text-muted); max-width:60ch; font-size:17px; margin-top:18px;}
.hero .badges{display:flex; gap:10px; flex-wrap:wrap; margin-top:26px;}
.badge{
  font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--text-muted);
  border:1px solid var(--border-strong); background:var(--surface); border-radius:999px; padding:7px 14px;
  display:flex; align-items:center; gap:7px; box-shadow:var(--shadow-sm);
}
.badge .dot{width:6px;height:6px;border-radius:50%;background:var(--accent-grad);}

/* ---------- Section titles / grid ---------- */
.section-title{display:flex; align-items:center; gap:14px; margin:52px 0 22px;}
.section-title h2{
  font-size:13px; font-family:'IBM Plex Mono',monospace; text-transform:uppercase; letter-spacing:.16em;
  font-weight:600; background:var(--accent-grad); -webkit-background-clip:text; background-clip:text; color:transparent;
}
.section-title .rule{flex:1; height:1px; background:linear-gradient(90deg, var(--border-strong), transparent);}

.tool-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:18px; padding-bottom:8px;}

.tool-card{
  position:relative; display:block; isolation:isolate;
  background:var(--surface);
  border:1px solid var(--border-strong);
  border-radius:18px;
  padding:22px 20px 20px;
  cursor:pointer; text-align:left; color:inherit; font:inherit;
  transition:transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s ease, box-shadow .2s ease;
  box-shadow:var(--shadow-sm);
  overflow:hidden;
}
.tool-card::before{
  content:''; position:absolute; inset:0; border-radius:inherit; padding:1px;
  background:var(--accent-grad); opacity:0; transition:opacity .2s ease;
  -webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite:xor; mask-composite:exclude;
  pointer-events:none; z-index:1;
}
.tool-card:hover{ transform:translateY(-4px); box-shadow:var(--shadow-lg), var(--shadow-glow); }
.tool-card:hover::before{opacity:1;}
.tool-card .stamp{
  width:46px; height:46px; border-radius:14px; color:var(--text);
  background:var(--accent-grad-soft); border:1px solid var(--border-strong);
  display:flex; align-items:center; justify-content:center; margin-bottom:16px;
  transition:transform .2s ease, background .2s ease;
}
.tool-card:hover .stamp{ background:var(--accent-grad); color:var(--on-accent); transform:scale(1.06) rotate(-4deg); }
.tool-card .stamp svg{width:22px;height:22px;}
.tool-card h3{font-size:17px; margin-bottom:7px; color:var(--text);}
.tool-card p{font-size:13.5px; color:var(--text-muted); margin:0; line-height:1.5;}

/* ---------- Workspace ---------- */
.ws-head{display:flex; align-items:flex-start; gap:18px; margin:36px 0 30px;}
.ws-head .stamp{
  width:54px;height:54px;border-radius:16px; color:var(--on-accent); background:var(--accent-grad);
  display:flex;align-items:center;justify-content:center;flex:none; box-shadow:var(--shadow-glow);
}
.ws-head .stamp svg{width:26px;height:26px;}
.ws-head h1{font-size:28px; color:var(--text);}
.ws-head p{color:var(--text-muted); font-size:15px; margin-top:5px; max-width:60ch;}

.panel{
  background:var(--surface); border:1px solid var(--border-strong); border-radius:20px; padding:30px;
  box-shadow:var(--shadow-md);
}
.panel + .panel{margin-top:18px;}

/* dropzone */
.dropzone{
  border:1.5px dashed var(--border-strong); border-radius:16px; padding:42px 20px; text-align:center; cursor:pointer;
  transition:border-color .18s ease, background .18s ease, transform .12s ease;
  background:var(--surface-2);
}
.dropzone:hover{ transform:translateY(-1px); }
.dropzone:hover, .dropzone.drag{border-color:var(--accent-2); background:var(--accent-grad-soft);}
.dropzone input{display:none;}
.dropzone .dz-icon{
  color:var(--text); margin:0 auto 14px; width:52px; height:52px; border-radius:14px;
  background:var(--accent-grad); display:flex; align-items:center; justify-content:center; color:var(--on-accent);
  box-shadow:var(--shadow-glow);
}
.dropzone .dz-icon svg{width:24px;height:24px;}
.dropzone .dz-title{font-weight:600; font-size:15px; color:var(--text);}
.dropzone .dz-sub{color:var(--text-muted); font-size:12.5px; margin-top:5px; font-family:'IBM Plex Mono',monospace;}

/* file list */
.file-list{list-style:none; margin:16px 0 0; padding:0; display:flex; flex-direction:column; gap:8px;}
.file-row{
  display:flex; align-items:center; gap:10px; background:var(--surface-2); border:1px solid var(--border);
  border-radius:12px; padding:11px 14px; font-size:13px; transition:border-color .15s ease;
}
.file-row:hover{border-color:var(--border-strong);}
.file-row[draggable="true"]{cursor:grab;}
.file-row .grip{color:var(--text-muted); letter-spacing:2px; font-size:12px; user-select:none;}
.file-row .fname{flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-family:'IBM Plex Mono',monospace; color:var(--text);}
.file-row .fsize{color:var(--text-muted); font-size:11.5px; font-family:'IBM Plex Mono',monospace;}
.file-row .rm{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:16px;line-height:1;padding:4px; border-radius:6px;}
.file-row .rm:hover{color:#fff; background:var(--danger);}

/* fields */
.field{margin-top:20px;}
.field label{display:block; font-size:12px; font-family:'IBM Plex Mono',monospace; letter-spacing:.04em; color:var(--text-muted); margin-bottom:9px; text-transform:uppercase;}
.field input[type=text], .field input[type=number], .field select, .field textarea{
  width:100%; background:var(--surface-2); border:1px solid var(--border-strong); color:var(--text);
  border-radius:11px; padding:11px 13px; font-size:14px; font-family:'IBM Plex Sans',sans-serif;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus{border-color:var(--accent-2); box-shadow:0 0 0 3px var(--accent-grad-soft);}
.row{display:flex; gap:16px; flex-wrap:wrap;}
.row > .field{flex:1; min-width:160px;}
.radio-group{display:flex; gap:10px; flex-wrap:wrap;}
.radio-opt{
  border:1px solid var(--border-strong); border-radius:999px; padding:9px 16px; font-size:13px;
  cursor:pointer; color:var(--text-muted); user-select:none; transition:all .15s ease; background:var(--surface-2);
}
.radio-opt:hover{border-color:var(--accent-2);}
.radio-opt input{display:none;}
.radio-opt.sel{border-color:transparent; color:var(--on-accent); background:var(--accent-grad); font-weight:500;}
.hint{font-size:12px; color:var(--text-muted); margin-top:8px;}

/* buttons */
.btn{
  font-family:'IBM Plex Sans',sans-serif; font-size:14px; font-weight:600; letter-spacing:.01em;
  border-radius:999px; padding:13px 26px; border:1px solid transparent;
  background:var(--accent-grad); color:var(--on-accent); cursor:pointer;
  transition:transform .15s cubic-bezier(.2,.8,.2,1), box-shadow .15s ease, filter .15s ease;
  box-shadow:var(--shadow-glow);
}
.btn:hover{transform:translateY(-2px); filter:brightness(1.06);}
.btn:active{transform:translateY(0);}
.btn:disabled{opacity:.4; cursor:not-allowed; transform:none; box-shadow:none;}
.btn.ghost{background:var(--surface-2); color:var(--text); border-color:var(--border-strong); box-shadow:none;}
.btn.ghost:hover{border-color:var(--accent-2); background:var(--surface-3);}
.actions{display:flex; gap:12px; margin-top:26px; flex-wrap:wrap; align-items:center;}

/* thumbnails */
.thumb-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(126px,1fr)); gap:16px; margin-top:20px;}
.thumb{
  background:var(--surface-2); border:1px solid var(--border-strong); border-radius:12px;
  padding:8px; position:relative; cursor:grab; user-select:none; transition:border-color .15s ease, transform .15s ease;
}
.thumb:hover{border-color:var(--border-strong); transform:translateY(-2px);}
.thumb.dragging{opacity:.35;}
.thumb.removed{opacity:.3;}
.thumb.selected{border-color:var(--accent-2); box-shadow:0 0 0 2px var(--accent-2);}
.thumb canvas{width:100%; display:block; border-radius:8px; transition:transform .15s ease;}
.thumb img{width:100%; display:block; border-radius:8px; transition:transform .15s ease; object-fit:contain; background:var(--surface-3);}
.thumb .pg-num{text-align:center; font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--text-muted); margin-top:7px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; padding:0 2px;}
.thumb .thumb-actions{position:absolute; top:6px; right:6px; display:flex; gap:4px;}
.thumb .tbtn{
  width:24px;height:24px;border-radius:50%; background:rgba(0,0,0,0.6); border:1px solid rgba(255,255,255,0.2);
  color:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:background .15s ease;
}
.thumb .tbtn svg{width:12px;height:12px;}
.thumb .tbtn:hover{background:var(--accent-2); border-color:var(--accent-2);}
.thumb .tbtn.restore{display:none;}
.thumb.removed .tbtn.restore{display:flex;}
.thumb.removed .tbtn.delete{display:none;}
.thumb .select-check{ position:absolute; top:6px; left:6px; width:20px; height:20px; border-radius:6px; border:1.5px solid rgba(255,255,255,0.5); background:rgba(0,0,0,0.35); }
.thumb.selected .select-check{background:var(--accent-grad); border-color:transparent;}

.add-tile{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
  min-height:100px; border:1.5px dashed var(--border-strong); border-radius:12px; cursor:pointer;
  background:var(--surface-2); transition:border-color .15s ease, background .15s ease, transform .15s ease;
  padding:12px;
}
.add-tile:hover{ border-color:var(--accent-2); background:var(--accent-grad-soft); transform:translateY(-2px); }
.add-tile-plus{
  width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:var(--accent-grad); color:var(--on-accent); box-shadow:var(--shadow-glow); flex:none;
}
.add-tile-plus svg{width:16px; height:16px;}
.add-tile-label{font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--text-muted); text-align:center;}
.add-tile:hover .add-tile-label{color:var(--text);}

/* progress */
.progress-wrap{margin-top:22px; display:none;}
.progress-wrap.active{display:block;}
.progress-bar{height:8px; background:var(--surface-2); border-radius:999px; overflow:hidden; border:1px solid var(--border-strong);}
.progress-fill{height:100%; width:0%; background:var(--accent-grad); transition:width .25s ease; border-radius:999px;}
.progress-label{font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--text-muted); margin-top:9px;}

/* output */
.output{
  margin-top:24px; padding:20px 22px; border:1px solid var(--border-strong); border-radius:16px;
  background:var(--surface-2); display:none; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
}
.output.active{display:flex;}
.output .ostat{font-family:'IBM Plex Mono',monospace; font-size:12.5px; color:var(--text-muted);}
.output .ostat b{color:var(--text); font-weight:600;}
.output.error{border-color:var(--danger); background:color-mix(in srgb, var(--danger) 10%, var(--surface-2));}
.output.error .ostat b{color:var(--danger);}
.output .file-result{display:flex; align-items:center; gap:12px; font-family:'IBM Plex Mono',monospace; font-size:12.5px; padding:6px 0;}

/* SEO content blocks */
.seo-block{margin-top:60px; padding-top:12px; border-top:1px solid var(--border);}
.seo-block h2{font-size:21px; margin-top:34px; margin-bottom:15px; color:var(--text);}
.seo-block h2:first-child{margin-top:0;}
.seo-block p{color:var(--text-muted); font-size:15.5px; max-width:72ch;}
.steps-list{color:var(--text-muted); font-size:15.5px; max-width:72ch; padding-left:22px;}
.steps-list li{margin-bottom:9px;}
.faq-list details{
  border:1px solid var(--border-strong); border-radius:14px; padding:16px 18px; margin-bottom:10px;
  background:var(--surface); transition:border-color .15s ease;
}
.faq-list details:hover{border-color:var(--accent-2);}
.faq-list summary{cursor:pointer; font-weight:600; color:var(--text); font-size:14.5px;}
.faq-list p{margin-top:11px; margin-bottom:0; font-size:14px;}
.related-tools{margin-top:52px;}
.related-tools h2{
  font-size:13px; font-family:'IBM Plex Mono',monospace; text-transform:uppercase; letter-spacing:.16em; font-weight:600;
  background:var(--accent-grad); -webkit-background-clip:text; background-clip:text; color:transparent; margin-bottom:20px;
}

/* ad slot */
.ad-slot{margin:34px 0; text-align:center;}

/* static pages */
.static-page{padding:44px 0 84px;}
.static-page h1{font-size:34px; margin-bottom:20px;}
.static-page h2{font-size:21px; margin-top:32px; margin-bottom:13px;}
.static-page p, .static-page li{color:var(--text-muted); font-size:15.5px; max-width:72ch;}
.static-page ul{padding-left:22px;}
.static-page a{color:var(--accent-2); text-decoration:underline; text-underline-offset:2px;}

/* footer */
footer{border-top:1px solid var(--border); padding:36px 0; margin-top:64px;}
.footer-grid{display:flex; justify-content:space-between; gap:24px; flex-wrap:wrap; padding-bottom:20px;}
.footer-brand{font-family:'Fraunces',serif; font-weight:600; font-size:17px; margin-bottom:7px; color:var(--text);}
footer p{font-size:12.5px; color:var(--text-muted); font-family:'IBM Plex Mono',monospace; margin:0;}
.footer-links{display:flex; gap:20px; flex-wrap:wrap; align-self:flex-start;}
.footer-links a{font-size:12.5px; color:var(--text-muted); font-family:'IBM Plex Mono',monospace; transition:color .15s ease;}
.footer-links a:hover{color:var(--accent-2);}
.copyright{border-top:1px solid var(--border); padding-top:18px;}

/* ---------- PDF Editor ---------- */
.editor-toolbar{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  padding:14px; background:var(--surface-2); border:1px solid var(--border-strong); border-radius:16px; margin-bottom:18px;
}
.editor-toolbar .tgroup{display:flex; gap:5px; align-items:center; padding-right:12px; margin-right:8px; border-right:1px solid var(--border-strong);}
.editor-toolbar .tgroup:last-child{border-right:none;}
.tbtn-tool{
  width:38px; height:38px; border-radius:11px; border:1px solid var(--border-strong);
  background:var(--surface); color:var(--text); cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:all .15s ease;
}
.tbtn-tool svg{width:17px;height:17px;}
.tbtn-tool:hover{border-color:var(--accent-2); transform:translateY(-1px);}
.tbtn-tool.active{background:var(--accent-grad); border-color:transparent; color:var(--on-accent); box-shadow:var(--shadow-glow);}
.editor-toolbar input[type=color]{width:34px; height:34px; border:1px solid var(--border-strong); border-radius:9px; background:none; padding:2px; cursor:pointer;}
.editor-toolbar input[type=range]{width:80px; accent-color:var(--accent-2);}
.editor-toolbar input[type=number]{width:58px; background:var(--surface); border:1px solid var(--border-strong); color:var(--text); border-radius:9px; padding:7px 8px; font-size:13px;}
.editor-toolbar label.mini{font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--text-muted); margin-right:4px;}

.editor-pagenav{display:flex; align-items:center; gap:14px; margin-bottom:16px; font-family:'IBM Plex Mono',monospace; font-size:13px;}
.editor-pagenav button{
  background:var(--surface-2); border:1px solid var(--border-strong); color:var(--text); border-radius:999px;
  padding:8px 16px; cursor:pointer; transition:all .15s ease;
}
.editor-pagenav button:hover{border-color:var(--accent-2); transform:translateY(-1px);}
.editor-pagenav button:disabled{opacity:.4; cursor:not-allowed; transform:none;}

.editor-canvas-wrap{
  position:relative; overflow:auto; max-width:100%; border:1px solid var(--border-strong);
  background:var(--surface-2); border-radius:16px; padding:22px; display:flex; justify-content:center;
}
.editor-stage{position:relative; box-shadow:var(--shadow-lg); background:#fff; border-radius:4px; overflow:hidden;}
.editor-stage canvas{display:block; position:absolute; top:0; left:0;}
.editor-stage .pe-textlayer{position:absolute; top:0; left:0; width:100%; height:100%; pointer-events:none;}
.pe-textbox{
  position:absolute; min-width:40px; min-height:20px; pointer-events:auto;
  border:1px dashed rgba(80,80,80,0.5); padding:2px 4px; outline:none; cursor:move;
  font-family:'IBM Plex Sans',sans-serif; white-space:pre-wrap; word-break:break-word; background:rgba(255,255,255,0.01);
}
.pe-textbox:focus{border-color:var(--accent-2); cursor:text;}
.pe-textbox .pe-del{
  position:absolute; top:-11px; right:-11px; width:20px; height:20px; border-radius:50%;
  background:var(--danger); color:#fff; border:none; font-size:12px; line-height:1; cursor:pointer; display:none;
}
.pe-textbox:hover .pe-del, .pe-textbox:focus .pe-del{display:block;}
.pe-resize-handle{
  position:absolute; bottom:-6px; right:-6px; width:13px; height:13px; border-radius:3px;
  background:#4f8dff; border:1.5px solid #fff; cursor:nwse-resize; display:none;
}
.pe-textbox:hover .pe-resize-handle, .pe-textbox:focus .pe-resize-handle{display:block;}
#editor-overlay{cursor:crosshair;}

@media (max-width:640px){
  .wrap{padding:0 18px;}
  .hero{padding:44px 0 32px;}
  .ws-head{flex-direction:column;}
  .main-nav{display:none;}
}
@media (prefers-reduced-motion: reduce){
  *{transition:none !important; scroll-behavior:auto !important; animation:none !important;}
}
