/* ============================================================
   Photo KB Converter — main.css
   Design system: TubeGrab reference (tubegrab.html)
   Exact same tokens, header, footer, layout, colors.
   ============================================================ */

:root {
  --bg:              #f7f7f5;
  --surface:         #eceef1;
  --surface-2:       #e4e6ea;
  --footer-bg:       #ffffff;
  --border:          rgba(20,21,26,0.12);
  --text:            #14151a;
  --text-muted:      #52545c;
  --text-dim:        #7d7f87;
  --accent:          #ff5c33;
  --accent-strong:   #c94523;
  --accent-ink:      #14151a;
  --success:         #1f9d5c;
  --danger:          #d1373f;
  --sans:            -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display:         var(--sans);
  --mono:            ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius:          10px;
  --max:             1120px;
  --shadow-dropdown: 0 18px 40px -14px rgba(20,21,26,0.28), 0 2px 8px rgba(20,21,26,0.06);
}
html[data-theme="dark"] {
  --bg:              #131419;
  --surface:         #1e2027;
  --surface-2:       #242730;
  --footer-bg:       #0d0d12;
  --border:          rgba(255,255,255,0.12);
  --text:            #ffffff;
  --text-muted:      #c5c5c5;
  --text-dim:        #8a8b91;
  --success:         #4ade80;
  --danger:          #f87171;
  --shadow-dropdown: 0 18px 40px -12px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.06);
}
*,*::before,*::after{box-sizing:border-box;}
html{scroll-behavior:smooth;}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto;}*{animation-duration:0.01ms!important;transition-duration:0.01ms!important;}}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--sans);font-size:16px;line-height:1.55;-webkit-font-smoothing:antialiased;transition:background .2s ease,color .2s ease;}
h1,h2,h3{font-family:var(--display);margin:0;line-height:1.15;letter-spacing:-0.01em;}
p{margin:0;}a{color:inherit;text-decoration:none;}img{max-width:100%;height:auto;display:block;}button{font-family:inherit;}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:4px;}
.wrap{max-width:var(--max);margin:0 auto;padding:0 24px;}

/* ── Header ── */
.site-header{position:relative;top:0;z-index:40;background:rgba(255,255,255,0.86);backdrop-filter:blur(8px);border-bottom:1px solid var(--border);}
html[data-theme="dark"] .site-header{background:rgba(13,13,18,0.86);}
.site-header .wrap{display:flex;align-items:center;justify-content:space-between;height:68px;gap:24px;}
.logo{display:flex;align-items:center;gap:9px;font-family:var(--sans);font-weight:800;letter-spacing:-0.01em;font-size:18px;flex-shrink:0;color:var(--text);}
.logo svg{width:22px;height:22px;flex-shrink:0;color:var(--accent);}
.logo span{color:var(--accent);}
.header-right{display:flex;align-items:center;gap:14px;}
nav.primary-nav{display:flex;align-items:center;gap:28px;flex-wrap:wrap;}
nav.primary-nav a{font-size:15px;color:var(--text-muted);transition:color .15s ease;padding:4px 0;}
nav.primary-nav a:hover{color:var(--accent);}
nav.primary-nav a.is-active{color:var(--text);}
.nav-item{position:relative;}
.more-btn{display:flex;align-items:center;gap:4px;background:none;border:none;cursor:pointer;color:var(--text-muted);font-family:inherit;font-size:15px;padding:4px 0;transition:color .15s ease;}
.more-btn:hover{color:var(--accent);}
.more-btn svg{width:12px;height:12px;transition:transform .15s ease;}
.nav-item.open .more-btn{color:var(--accent);}
.nav-item.open .more-btn svg{transform:rotate(180deg);}
.dropdown-menu{display:flex;flex-direction:row;align-items:stretch;gap:14px;position:absolute;top:calc(100% + 14px);right:0;left:auto;min-width:300px;background:#ffffff;border-radius:20px;padding:14px;box-shadow:var(--shadow-dropdown);z-index:50;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(-6px);transition:opacity .16s ease,transform .16s ease,visibility .16s;}
.nav-item.open .dropdown-menu{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0);}
.dropdown-links{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0;}
.dropdown-menu a{font-size:15px;color:#14151a;padding:10px 12px;border-radius:10px;transition:background .15s ease,color .15s ease;}
.dropdown-menu a:hover{background:#f2f1ef;color:var(--accent);}
.dropdown-divider{height:1px;background:rgba(20,21,26,0.12);margin:6px 8px;}
.dropdown-visual{flex-shrink:0;width:116px;border-radius:14px;background:rgba(255,92,51,0.1);display:flex;align-items:center;justify-content:center;}
.dropdown-visual svg{width:64px;height:64px;color:var(--accent);}
.menu-toggle{display:none;background:none;border:1px solid var(--border);border-radius:7px;padding:7px;cursor:pointer;color:var(--text);flex-shrink:0;}
.menu-toggle svg{width:20px;height:20px;display:block;}
.theme-toggle{display:flex;align-items:center;justify-content:center;background:none;border:1px solid var(--border);border-radius:7px;padding:7px;cursor:pointer;color:var(--text);flex-shrink:0;transition:border-color .15s ease;}
.theme-toggle:hover{border-color:var(--accent);}
.theme-toggle svg{width:18px;height:18px;display:block;}
.theme-toggle .icon-sun{display:none;}
html[data-theme="dark"] .theme-toggle .icon-moon{display:none;}
html[data-theme="dark"] .theme-toggle .icon-sun{display:block;}

/* ── Hero ── */
.hero{padding:64px 0 80px;}
.hero .wrap{display:flex;flex-direction:column;align-items:center;gap:48px;}
.hero-copy{text-align:center;max-width:640px;}
.hero-copy h1{font-size:clamp(32px,4vw,44px);}
.hero-copy p.lede{margin-top:18px;font-size:17px;color:var(--text-muted);max-width:480px;margin-left:auto;margin-right:auto;}
.badges{display:flex;gap:10px;margin-top:26px;flex-wrap:wrap;justify-content:center;}
.badge{font-family:var(--mono);font-size:12px;color:var(--text-muted);border:1px solid var(--border);border-radius:999px;padding:6px 12px;display:flex;align-items:center;gap:6px;}
.badge::before{content:'';width:6px;height:6px;border-radius:50%;background:var(--success);flex-shrink:0;}
.preset-chips{margin-top:34px;}
.preset-chips p{font-size:13px;color:var(--text-muted);margin-bottom:10px;}
.chip-row{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;}
.chip{font-size:12.5px;font-family:var(--mono);color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:7px;padding:7px 10px;cursor:pointer;transition:border-color .15s ease,color .15s ease,background .15s ease;}
.chip:hover,.chip.active{border-color:var(--accent);color:var(--accent);background:rgba(255,92,51,0.06);}

/* ── Tool card ── */
.tool-card{background:#ffffff;border-radius:18px;padding:28px;width:100%;max-width:560px;}
html[data-theme="dark"] .tool-card{background:var(--surface);}
.upload-zone{display:flex;flex-direction:column;align-items:center;gap:10px;padding:36px 24px;border:1.5px dashed var(--border);border-radius:12px;background:var(--surface-2);text-align:center;cursor:pointer;position:relative;transition:border-color .15s ease,background .15s ease;}
.upload-zone:hover,.upload-zone.dragover{border-color:var(--accent);background:rgba(255,92,51,0.05);}
.upload-zone input[type="file"]{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%;}
.upload-icon{font-size:2rem;line-height:1;}
.upload-zone p{font-size:14px;color:var(--text-muted);}
.upload-zone strong{color:var(--text);}
.upload-zone small{font-size:12px;color:var(--text-dim);font-family:var(--mono);}
.upload-meta{display:none;margin-top:10px;}
.upload-meta.show{display:block;}
.upload-meta .file-loaded{display:flex;align-items:center;gap:10px;padding:10px 12px;background:rgba(31,157,92,0.08);border:1px solid rgba(31,157,92,0.2);border-radius:10px;}
.upload-meta .file-loaded svg{width:16px;height:16px;color:var(--success);flex-shrink:0;}
.upload-meta .file-info{min-width:0;flex:1;}
.upload-meta .file-name{font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.upload-meta .file-size{font-family:var(--mono);font-size:11px;color:var(--text-muted);margin-top:2px;}
.upload-meta .clear-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:18px;line-height:1;padding:4px;flex-shrink:0;}
.upload-meta .clear-btn:hover{color:var(--danger);}
.target-row{display:flex;gap:10px;margin-top:16px;align-items:center;}
.target-box{display:flex;align-items:center;gap:8px;flex:1;height:44px;background:var(--surface-2);border:1.5px solid var(--border);border-radius:12px;padding:0 6px 0 16px;transition:border-color .15s ease;}
.target-box:focus-within{border-color:var(--accent);}
.target-box input[type="number"]{flex:1;background:transparent;border:none;color:var(--text);font-family:var(--mono);font-size:15px;font-weight:600;padding:0;height:100%;min-width:0;-moz-appearance:textfield;}
.target-box input[type="number"]::-webkit-outer-spin-button,.target-box input[type="number"]::-webkit-inner-spin-button{-webkit-appearance:none;}
.target-box input[type="number"]:focus-visible{outline:none;}
.target-box .unit{font-family:var(--mono);font-size:13px;color:var(--text-muted);padding-right:10px;flex-shrink:0;}
.convert-btn{display:flex;align-items:center;justify-content:center;flex-shrink:0;height:44px;background:var(--accent);color:#ffffff;border:none;border-radius:9px;font-weight:600;font-size:14px;padding:0 20px;cursor:pointer;transition:background .15s ease;}
.convert-btn:hover{background:var(--accent-strong);}
.convert-btn:disabled{background:var(--surface-2);color:var(--text-muted);cursor:not-allowed;}
.status-line{margin-top:12px;font-family:var(--mono);font-size:12.5px;color:var(--text-muted);display:none;align-items:center;gap:8px;}
.status-line.show{display:flex;}
.spinner{width:12px;height:12px;border-radius:50%;border:2px solid var(--border);border-top-color:var(--accent);animation:spin .7s linear infinite;flex-shrink:0;}
@keyframes spin{to{transform:rotate(360deg);}}
.result-panel{display:none;margin-top:16px;animation:fadeIn .25s ease;}
.result-panel.show{display:block;}
@keyframes fadeIn{from{opacity:0;transform:translateY(4px);}to{opacity:1;transform:translateY(0);}}
.result-preview-img{border-radius:10px;overflow:hidden;background:var(--surface-2);margin-bottom:14px;text-align:center;min-height:80px;display:flex;align-items:center;justify-content:center;}
.result-preview-img img{max-height:220px;object-fit:contain;display:block;margin:0 auto;}
.result-stats{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px;}
.stat-box{flex:1;min-width:100px;border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px;text-align:center;background:var(--surface);}
.stat-box .label{font-family:var(--mono);font-size:11px;color:var(--text-muted);}
.stat-box .value{font-size:1.1rem;font-weight:700;color:var(--text);margin-top:4px;}
.stat-box .value.success{color:var(--success);}
.stat-box .value.warn{color:var(--accent);}
.result-actions{display:flex;gap:10px;margin-top:16px;}
.btn{flex:1;text-align:center;padding:11px 14px;border-radius:10px;font-size:14px;font-weight:600;cursor:pointer;border:none;background:var(--surface-2);color:var(--text);transition:background .15s ease,color .15s ease;}
.btn.primary{background:var(--accent);color:#ffffff;}
.btn.primary:hover{background:var(--accent-strong);}
.btn:not(.primary):hover{color:var(--accent);}
.sticky-download{position:fixed;bottom:0;left:0;right:0;background:var(--accent);color:#fff;padding:16px 24px;font-size:1rem;font-weight:700;text-align:center;z-index:200;cursor:pointer;display:none;border:none;font-family:inherit;box-shadow:0 -4px 20px rgba(0,0,0,.15);}

/* ── KB↔MB widget ── */
.converter-widget{width:100%;max-width:560px;background:#ffffff;border-radius:18px;padding:22px 28px;border:1px solid var(--border);}
html[data-theme="dark"] .converter-widget{background:var(--surface);}
.converter-widget h3{font-size:14px;font-weight:600;margin-bottom:14px;color:var(--text);}
.converter-row{display:flex;gap:10px;align-items:center;margin-bottom:10px;}
.converter-row:last-child{margin-bottom:0;}
.converter-row input{flex:1;height:40px;padding:0 14px;background:var(--surface-2);border:1.5px solid var(--border);border-radius:10px;font-family:var(--mono);font-size:14px;color:var(--text);transition:border-color .15s ease;}
.converter-row input:focus{outline:none;border-color:var(--accent);}
.converter-row .arrow{font-family:var(--mono);color:var(--text-dim);font-size:14px;flex-shrink:0;}
.converter-result{flex:1;height:40px;padding:0 14px;background:rgba(255,92,51,0.08);border:1.5px solid rgba(255,92,51,0.2);border-radius:10px;font-family:var(--mono);font-size:14px;font-weight:600;color:var(--accent);display:flex;align-items:center;}

/* ── Section base ── */
.section{padding:76px 0;}
.section-head{max-width:560px;margin:0 auto 40px;text-align:center;}
.section-head .kicker{font-family:var(--mono);font-size:12.5px;color:var(--accent);margin-bottom:10px;display:block;}
.section-head h2{font-size:clamp(26px,3vw,32px);}
.section-head p{color:var(--text-muted);margin-top:12px;font-size:15.5px;}

/* ── Steps ── */
.steps-list{display:grid;grid-template-columns:repeat(4,1fr);gap:0;}
.step{padding:24px 20px;text-align:center;}
.step .num{font-family:var(--mono);font-size:13px;color:var(--accent);}
.step h3{font-size:16px;margin-top:10px;}
.step p{font-size:13.5px;color:var(--text-muted);margin-top:8px;}

/* ── Tools grid (12 cards) ── */
.tools-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;}
.tool-link-card{border:1px solid var(--border);border-radius:var(--radius);padding:18px;cursor:pointer;transition:border-color .15s ease;text-decoration:none;color:inherit;display:flex;flex-direction:column;gap:4px;}
.tool-link-card:hover{border-color:var(--accent);}
.tool-link-card .card-kb{font-family:var(--mono);font-size:12px;color:var(--accent);}
.tool-link-card .card-title{font-size:15px;font-weight:600;margin-top:4px;}
.tool-link-card .card-desc{font-size:13px;color:var(--text-muted);margin-top:4px;}

/* ── Why list ── */
.why-list{display:grid;grid-template-columns:repeat(2,1fr);gap:0;}
.why-item{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;padding:26px 24px;}
.why-item svg{width:22px;height:22px;color:var(--accent);flex-shrink:0;}
.why-item h3{font-size:15.5px;}
.why-item p{font-size:13.5px;color:var(--text-muted);margin-top:6px;}

/* ── FAQ ── */
.faq-list{border-top:1px solid var(--border);}
details.faq-item{border-bottom:1px solid var(--border);}
details.faq-item summary{padding:18px 0;cursor:pointer;font-weight:500;font-size:15px;list-style:none;display:flex;justify-content:space-between;align-items:center;gap:12px;}
details.faq-item summary::-webkit-details-marker{display:none;}
details.faq-item summary::after{content:'+';font-family:var(--mono);color:var(--text-muted);font-size:18px;flex-shrink:0;}
details.faq-item[open] summary::after{content:'–';}
details.faq-item .faq-body{padding:0 0 20px;color:var(--text-muted);font-size:14.5px;max-width:700px;}

/* ── Content / SEO ── */
.content-section{padding:56px 0;}
.content-inner{max-width:760px;margin:0 auto;}
.content-inner h2{font-size:1.35rem;font-weight:700;margin:28px 0 10px;}
.content-inner h2:first-child{margin-top:0;}
.content-inner p{color:var(--text-muted);line-height:1.75;margin-bottom:13px;font-size:.96rem;}
.content-inner ul{margin:0 0 13px 20px;}
.content-inner li{color:var(--text-muted);font-size:.96rem;line-height:1.75;}
.content-inner a{color:var(--accent);}
.content-inner a:hover{text-decoration:underline;}
.highlight-box{background:rgba(255,92,51,0.06);border-left:3px solid var(--accent);border-radius:0 var(--radius) var(--radius) 0;padding:14px 18px;margin:18px 0;font-size:.93rem;color:var(--text-muted);}

/* ── Related tags ── */
.related-links{padding:36px 0;border-top:1px solid var(--border);}
.related-links h3{font-size:.75rem;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.07em;margin-bottom:14px;}
.related-tags{display:flex;flex-wrap:wrap;gap:7px;}
.related-tag{font-family:var(--mono);font-size:12.5px;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:7px;padding:7px 10px;cursor:pointer;transition:border-color .15s ease,color .15s ease;}
.related-tag:hover{border-color:var(--accent);color:var(--accent);}

/* ── Toast ── */
.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(80px);background:var(--text);color:#fff;padding:12px 24px;border-radius:8px;font-size:.88rem;font-weight:500;z-index:9999;transition:transform .35s ease;white-space:nowrap;font-family:var(--mono);box-shadow:0 10px 32px rgba(0,0,0,.10);}
.toast.show{transform:translateX(-50%) translateY(0);}
.toast.success{background:var(--success);}
.toast.error{background:var(--danger);}

/* ── Footer ── */
footer{background:var(--footer-bg);padding:56px 0 32px;}
.footer-top{display:flex;justify-content:space-between;gap:40px;flex-wrap:wrap;padding-bottom:36px;border-bottom:1px solid var(--border);}
.footer-brand{max-width:280px;}
.footer-brand .logo{margin-bottom:12px;}
.footer-brand p{font-size:14px;color:var(--text-muted);}
.footer-cols{display:flex;gap:48px;flex-wrap:wrap;}
.footer-col h4{font-size:12.8px;color:var(--text-muted);font-weight:500;margin-bottom:12px;}
.footer-col ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:9px;}
.footer-col a{font-size:15px;color:var(--text);}
.footer-col a:hover{color:var(--accent);}
.footer-bottom{display:flex;justify-content:space-between;align-items:center;padding-top:24px;font-size:13px;color:var(--text-muted);flex-wrap:wrap;gap:10px;}
.footer-bottom a{color:var(--text-muted);}
.footer-bottom a:hover{color:var(--text);}

/* ── Responsive ── */
@media(max-width:880px){
  .menu-toggle{display:block;}
  nav.primary-nav{display:none;position:absolute;top:100%;left:0;right:0;flex-direction:column;align-items:stretch;gap:2px;background:#ffffff;border-bottom:1px solid rgba(20,21,26,0.12);padding:10px 24px 16px;box-shadow:0 12px 24px -12px rgba(20,21,26,0.18);}
  nav.primary-nav.open{display:flex;}
  nav.primary-nav a{padding:11px 0;border-bottom:1px solid rgba(20,21,26,0.12);color:#14151a;}
  nav.primary-nav .nav-item{position:static;border-bottom:1px solid rgba(20,21,26,0.12);}
  nav.primary-nav .more-btn{width:100%;justify-content:space-between;padding:11px 0;color:#14151a;}
  nav.primary-nav .more-btn:hover,.nav-item.open .more-btn{color:var(--accent);}
  nav.primary-nav .dropdown-menu{position:static;display:flex;flex-direction:column;opacity:1;visibility:visible;pointer-events:auto;transform:none;box-shadow:none;border:1px solid rgba(20,21,26,0.1);border-radius:14px;background:#fbfaf9;padding:0 12px;margin:0;max-height:0;overflow:hidden;transition:max-height .3s ease,padding .3s ease,margin .3s ease;}
  nav.primary-nav .nav-item.open .dropdown-menu{max-height:320px;padding:10px 12px;margin:8px 0 12px;}
  nav.primary-nav .dropdown-visual{display:none;}
  .site-header .wrap{position:relative;}
  .hero{padding:40px 0 56px;}
  .hero .wrap{gap:36px;}
  .steps-list{grid-template-columns:repeat(2,1fr);}
  .why-list{grid-template-columns:1fr;}
  .tools-grid{grid-template-columns:repeat(2,1fr);}
  .section{padding:52px 0;}
  .footer-top{flex-direction:column;gap:28px;}
  .footer-cols{gap:32px;}
}
@media(max-width:640px){
  .wrap{padding:0 18px;}
  .site-header .wrap{height:60px;}
  .sticky-download{display:block;}
}
@media(max-width:560px){
  .steps-list{grid-template-columns:1fr;}
  .tools-grid{grid-template-columns:1fr 1fr;}
}
@media(max-width:460px){
  .target-row{flex-direction:column;}
  .target-box{width:100%;}
  .convert-btn{width:100%;}
  .result-actions{flex-direction:column;}
  .footer-cols{flex-direction:column;gap:24px;}
  .tools-grid{grid-template-columns:1fr;}
}


/* ── Styles from page-kb-tool.php ── */
.page-hero{background:linear-gradient(160deg,#eef2ff 0%,#fdf4ff 50%,#fff7ed 100%);padding:44px 20px 32px;border-bottom:1px solid var(--border)}
  .page-hero-inner{max-width:1140px;margin:0 auto}
  .page-hero h1{font-size:clamp(1.5rem,3.5vw,2.2rem);font-weight:800;margin-bottom:10px;letter-spacing:-.02em;color:var(--text);line-height:1.2}
  .page-hero h1 em{font-style:normal;color:var(--primary)}
  .page-hero p{color:var(--text-muted);font-size:1rem;max-width:600px;line-height:1.6}
  .breadcrumb{background:var(--bg-soft);border-bottom:1px solid var(--border);padding:10px 20px;font-size:.82rem;color:var(--text-muted)}
  .breadcrumb-inner{max-width:1140px;margin:0 auto}
  .breadcrumb a{color:var(--primary);text-decoration:none}
  .breadcrumb span{margin:0 6px}

/* ── Styles from page-photo-resizer.php ── */
/* ── CSS Variables (File 1 palette) ── */
  :root {
    --primary:      #6366f1;
    --primary-dark: #4f46e5;
    --primary-light:#eef2ff;
    --green:        #16a34a;
    --green-light:  #dcfce7;
    --red:          #dc2626;
    --text:         #1e293b;
    --text-muted:   #64748b;
    --border:       #e2e8f0;
    --bg-soft:      #f8fafc;
    --white:        #ffffff;
    --shadow:       0 4px 24px rgba(0,0,0,0.07);
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  /* ── HERO ── */
  .page-hero {
    background: linear-gradient(160deg, #eef2ff 0%, #fdf4ff 50%, #fff7ed 100%);
    padding: 44px 20px 32px;
    border-bottom: 1px solid var(--border);
  }
  .page-hero-inner { max-width: 1140px; margin: 0 auto; }
  .page-hero h1 {
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -.02em;
    color: var(--text);
    line-height: 1.2;
  }
  .page-hero h1 em { font-style: normal; color: var(--primary); }
  .page-hero p { color: var(--text-muted); font-size: 1rem; max-width: 600px; line-height: 1.6; }

  /* ── BREADCRUMB ── */
  .breadcrumb {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
    font-size: .82rem;
    color: var(--text-muted);
  }
  .breadcrumb-inner { max-width: 1140px; margin: 0 auto; }
  .breadcrumb a { color: var(--primary); text-decoration: none; }
  .breadcrumb span { margin: 0 6px; }

  /* ── SINGLE-COLUMN SECTIONS (all File 1 widths) ── */
  .tool-section  { padding: 32px 20px; }
  .tool-inner    { max-width: 1140px; margin: 0 auto; }

  /* ── TOOL CARD ── */
  .tool-card {
    background: var(--white);
    border-radius: 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 24px;
  }
  .tool-body { padding: 28px 32px; }

  /* ── QUICK PRESET BUTTONS ── */
  .quick-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
  .quick-btn {
    padding: 7px 16px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: var(--white);
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
  }
  .quick-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
  .quick-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

  /* ── UPLOAD ZONE ── */
  .upload-zone {
    border: 2.5px dashed #a5b4fc;
    background: var(--primary-light);
    border-radius: 14px;
    padding: 44px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .22s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: #e0e7ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99,102,241,.12);
  }
  .upload-icon { font-size: 2.6rem; margin-bottom: 4px; }
  .upload-zone p  { font-size: 1rem; font-weight: 700; color: var(--text); }
  .upload-zone small { font-size: .82rem; color: var(--text-muted); }
  .upload-meta { margin-top: 10px; }

  /* ── BADGE ── */
  .badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px; font-size: .8rem; font-weight: 600; }
  .badge.green { background: var(--green-light); color: var(--green); }

  /* ── CROP EDITOR ── */
  .editor-area { display: none; margin-top: 20px; }
  .editor-hint { font-size: .83rem; font-weight: 600; color: var(--red); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
  .img-container { background: #1e293b; border-radius: 10px; overflow: hidden; max-height: 420px; margin-bottom: 20px; }
  #imageToCrop { display: block; max-width: 100%; }

  /* ── PROGRESS BAR ── */
  .progress-wrap { display: none; margin: 16px 0; }
  .progress-bar-bg { background: #e2e8f0; border-radius: 99px; height: 8px; overflow: hidden; }
  .progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); border-radius: 99px; width: 0%; transition: width .3s; }
  .progress-text { font-size: .82rem; color: var(--text-muted); text-align: center; margin-top: 8px; }

  /* ── CONVERT BUTTON ── */
  .btn-convert {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff; border: none; border-radius: 12px; padding: 16px;
    font-size: 1.05rem; font-weight: 700; cursor: pointer;
    transition: all .2s; box-shadow: 0 4px 16px rgba(99,102,241,.28);
    display: flex; align-items: center; justify-content: center; gap: 10px;
  }
  .btn-convert:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,102,241,.35); }
  .btn-convert:disabled { opacity: .6; cursor: not-allowed; transform: none; }

  /* ── RESULT PANEL ── */
  .result-panel { display: none; margin-top: 4px; }

  .result-preview {
    border-radius: 10px; overflow: hidden; background: #f8fafc;
    border: 1px solid var(--border); margin-bottom: 20px; text-align: center; padding: 16px;
  }
  .result-preview img {
    max-width: 100%; max-height: 400px; width: auto; height: auto;
    border-radius: 8px; display: block; margin: 0 auto;
  }
  .pkbr-type-signature .result-preview img { max-height: 200px; }
  .pkbr-type-photo    .result-preview img  { max-height: 380px; max-width: 320px; }
  .pkbr-type-thumb    .result-preview img  { max-height: 260px; max-width: 260px; }

  /* ── STAT BOXES ── */
  .result-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 20px; }
  .stat-box { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
  .stat-box .label { font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 4px; }
  .stat-box .value { font-size: 1rem; font-weight: 800; color: var(--text); display: block; }
  .stat-box .value.good { color: var(--green); }

  /* ── DOWNLOAD BUTTON ── */
  .btn-download {
    display: block; width: 100%;
    background: linear-gradient(135deg, var(--green) 0%, #15803d 100%);
    color: #fff; border: none; border-radius: 12px; padding: 16px;
    font-size: 1.05rem; font-weight: 700; text-align: center;
    text-decoration: none; cursor: pointer; transition: all .2s;
    box-shadow: 0 4px 16px rgba(22,163,74,.28); margin-bottom: 12px;
  }
  .btn-download:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(22,163,74,.35); }

  /* ── RESET BUTTON ── */
  .btn-reset {
    display: block; width: 100%; background: none;
    border: 1.5px solid var(--border); border-radius: 12px; padding: 11px;
    font-size: .9rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all .18s;
  }
  .btn-reset:hover { border-color: var(--primary); color: var(--primary); }

  /* ── CONTENT SECTION (WP block editor output) ── */
  .content-section { padding: 0 20px 24px; }
  .content-inner {
    max-width: 1140px; margin: 0 auto;
    background: var(--white); border-radius: 18px;
    border: 1px solid var(--border); padding: 32px 36px; box-shadow: var(--shadow);
  }
  /* Headings */
  .content-inner h2 { font-size: 1.35rem; font-weight: 800; color: var(--text); margin: 0 0 14px; line-height: 1.3; }
  .content-inner h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 22px 0 10px; }
  .content-inner h4 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 16px 0 8px; }
  /* Body text */
  .content-inner p  { font-size: .96rem; line-height: 1.75; color: #374151; margin-bottom: 14px; }
  .content-inner p:last-child { margin-bottom: 0; }
  /* Lists */
  .content-inner ul,
  .content-inner ol  { margin: 0 0 14px 22px; font-size: .96rem; line-height: 1.75; color: #374151; }
  .content-inner li  { margin-bottom: 6px; }
  /* Links */
  .content-inner a   { color: var(--primary); text-decoration: underline; font-weight: 600; }
  .content-inner a:hover { color: var(--primary-dark); }
  /* Blockquote */
  .content-inner blockquote {
    border-left: 4px solid var(--primary); background: var(--primary-light);
    padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 18px 0;
    font-size: .95rem; line-height: 1.7; color: var(--text);
  }
  .content-inner blockquote p { margin-bottom: 0; }
  /* Tables */
  .content-inner table  { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 16px; display: block; overflow-x: auto; }
  .content-inner th,
  .content-inner td     { padding: 11px 14px; border: 1px solid var(--border); text-align: left; }
  .content-inner th     { background: var(--bg-soft); font-weight: 700; color: var(--text); }
  /* Images */
  .content-inner img    { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 16px 0; }
  .content-inner figure { margin: 16px 0; }
  .content-inner figcaption { font-size: .82rem; color: var(--text-muted); text-align: center; margin-top: 6px; }
  /* WP alignment */
  .content-inner .aligncenter { display: block; margin-left: auto; margin-right: auto; text-align: center; }
  .content-inner .alignleft   { float: left;  margin: 4px 16px 12px 0; max-width: 50%; }
  .content-inner .alignright  { float: right; margin: 4px 0 12px 16px; max-width: 50%; }
  .content-inner::after       { content:''; display:table; clear:both; }
  /* Code */
  .content-inner pre  { background:#1e293b; color:#e2e8f0; padding:16px 20px; border-radius:8px; overflow-x:auto; font-size:.85rem; line-height:1.6; margin-bottom:16px; }
  .content-inner code { font-size:.85rem; background:#f1f5f9; padding:2px 6px; border-radius:4px; color:var(--primary-dark); }
  .content-inner pre code { background:none; padding:0; color:inherit; }
  /* HR */
  .content-inner hr   { border:none; border-top:2px solid var(--border); margin:24px 0; }

  /* ── ERROR SECTION ── */
  .error-section { padding: 0 20px 24px; }
  .error-inner {
    max-width: 1140px; margin: 0 auto;
    background: var(--white); border-radius: 18px;
    border: 1px solid var(--border); padding: 28px 32px; box-shadow: var(--shadow);
  }
  .error-inner h2 { font-size: 1.15rem; font-weight: 800; color: var(--text); margin-bottom: 18px; }
  .error-block { border-left: 4px solid var(--red); background: #fff5f5; border-radius: 0 8px 8px 0; padding: 14px 18px; margin-bottom: 14px; }
  .error-block:last-child { margin-bottom: 0; }
  .error-block strong { font-size: .9rem; color: var(--red); }
  .error-block p { font-size: .88rem; color: var(--text-muted); line-height: 1.6; margin-top: 5px; }
  .error-block .fix { color: var(--green); display: block; margin-top: 7px; font-weight: 600; font-size: .88rem; }



  /* ── RELATED LINKS ── */
  .related-links { padding: 0 20px 40px; }
  .related-inner { max-width: 1140px; margin: 0 auto; }
  .related-inner h3 { font-size: .9rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
  .related-tags { display: flex; flex-wrap: wrap; gap: 8px; }
  .related-tag {
    padding: 6px 14px; background: var(--white); border: 1.5px solid var(--border);
    border-radius: 20px; font-size: .83rem; font-weight: 600; color: var(--text-muted);
    text-decoration: none; transition: all .18s;
  }
  .related-tag:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

  /* ── STICKY DOWNLOAD ── */
  .sticky-download {
    position: fixed; bottom: 20px; right: 20px; z-index: 9999;
    background: linear-gradient(135deg, var(--green) 0%, #15803d 100%);
    color: #fff; border: none; border-radius: 50px; padding: 14px 24px;
    font-size: .95rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 6px 24px rgba(22,163,74,.4); transition: all .2s;
  }
  .sticky-download:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(22,163,74,.45); }

  /* ── CROPPER ── */
  .cropper-container { max-width: 100% !important; }
  img, canvas, video, svg { max-width: 100%; height: auto; }

  /* ── RESPONSIVE ── */
  @media (max-width: 768px) {
    .tool-section  { padding: 20px 12px; }
    .content-section, .related-links, .error-section { padding-left: 12px; padding-right: 12px; }
    .tool-body  { padding: 20px 16px; }
    .content-inner, .error-inner { padding: 22px 18px; }
    .result-stats { grid-template-columns: repeat(2, 1fr); }
    .content-inner .alignleft,
    .content-inner .alignright { float: none; max-width: 100%; margin: 10px 0; }
  }
  @media (max-width: 480px) {
    .tool-section  { padding: 12px 8px; }
    .content-section, .related-links, .error-section { padding-left: 8px; padding-right: 8px; }
    .tool-body  { padding: 16px 12px; }
    .content-inner, .error-inner { padding: 18px 14px; }
    .quick-btn  { font-size: .78rem; padding: 5px 12px; }
    .btn-convert, .btn-download { font-size: .95rem; padding: 14px; }
    .result-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-box   { padding: 10px 8px; }
    .stat-box .value { font-size: .9rem; }
    .img-container { max-height: 300px; }

    .section-header h2, .content-inner h2 { font-size: 1.15rem; }
    .content-inner h3 { font-size: 1rem; }
    .content-inner p, .content-inner ul, .content-inner ol { font-size: .88rem; }
  }

/* ── Styles from single-pdf-tool.php ── */
/* ── Hero ───────────────────────────────────────── */
  .tool-hero{background:#fff;text-align:center;padding:48px 20px 12px}
  .tool-hero h1{font-size:clamp(1.8rem,4vw,2.6rem);font-weight:800;color:#333;margin:0 0 14px;letter-spacing:-.02em;line-height:1.2}
  .tool-hero p.hero-sub{font-size:1.05rem;color:#666;max-width:540px;margin:0 auto;line-height:1.6}

  /* ── Breadcrumb ─────────────────────────────────── */
  .breadcrumb{background:#f9f9f9;border-bottom:1px solid #eee;padding:9px 20px;font-size:.8rem;color:#999}
  .breadcrumb-inner{max-width:1140px;margin:0 auto}
  .breadcrumb a{color:#e9423a;text-decoration:none}
  .breadcrumb a:hover{text-decoration:underline}
  .breadcrumb span{margin:0 5px;color:#ccc}

  /* ── Tool section ───────────────────────────────── */
  .tool-section{background:#f5f5f5;padding:32px 20px 48px}
  .tool-inner{max-width:780px;margin:0 auto;display:flex;flex-direction:column;gap:24px}

  /* ── Card ───────────────────────────────────────── */
  .tool-card{background:#fff;border-radius:16px;box-shadow:0 2px 16px rgba(0,0,0,.08);overflow:hidden}
  .tool-body{padding:28px}

  /* ── Upload zone ────────────────────────────────── */
  .upload-zone{border:2.5px dashed #ddd;border-radius:12px;padding:40px 24px;text-align:center;cursor:pointer;transition:border-color .2s,background .2s;position:relative}
  .upload-zone:hover,.upload-zone.drag-over{border-color:#e9423a;background:#fff5f5}
  .upload-zone input[type=file]{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%}
  .upload-zone .upload-icon{font-size:2.8rem;margin-bottom:10px}
  .upload-zone p{margin:0 0 6px;font-size:1rem;color:#444}
  .upload-zone small{color:#999;font-size:.8rem}
  .upload-meta{margin-top:12px}

  /* ── Badges ─────────────────────────────────────── */
  .badge{display:inline-block;padding:4px 12px;border-radius:20px;font-size:.78rem;font-weight:600}
  .badge.green{background:#e6f9f0;color:#1a7a4a}
  .badge.red{background:#ffeaea;color:#c0392b}
  .badge.blue{background:#e8f0fe;color:#1a56db}

  /* ── Target control ─────────────────────────────── */
  .target-control{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:20px}
  .target-control label{font-size:.92rem;font-weight:600;color:#444;white-space:nowrap}
  .target-input-wrap{display:flex;align-items:center;border:1.5px solid #ddd;border-radius:8px;overflow:hidden}
  .target-input-wrap input{border:none;outline:none;padding:8px 12px;font-size:1rem;width:90px;font-weight:700;color:#333}
  .unit-badge{background:#f0f0f0;padding:8px 12px;font-size:.85rem;color:#666;font-weight:600;border-left:1px solid #ddd}

  /* ── Options panel ──────────────────────────────── */
  .options-panel{margin-top:18px;padding:16px;background:#f8f8f8;border-radius:10px;display:flex;flex-wrap:wrap;gap:14px;align-items:center}
  .options-panel label{font-size:.85rem;font-weight:600;color:#555;display:flex;align-items:center;gap:6px;cursor:pointer}
  .options-panel select{border:1px solid #ddd;border-radius:6px;padding:5px 10px;font-size:.85rem;background:#fff;cursor:pointer;color:#333}

  /* ── Progress ───────────────────────────────────── */
  .progress-wrap{display:none;margin-top:18px}
  .progress-bar-bg{background:#eee;border-radius:20px;height:10px;overflow:hidden}
  .progress-bar-fill{height:100%;background:linear-gradient(90deg,#e9423a,#ff7043);border-radius:20px;width:0;transition:width .3s}
  .progress-text{font-size:.85rem;color:#666;margin:8px 0 0;text-align:center}

  /* ── Convert button ─────────────────────────────── */
  .btn-convert{display:block;width:100%;margin-top:22px;padding:15px;background:linear-gradient(135deg,#e9423a,#ff5f52);color:#fff;font-size:1.1rem;font-weight:700;border:none;border-radius:10px;cursor:pointer;letter-spacing:.01em;transition:opacity .2s,transform .1s}
  .btn-convert:hover:not(:disabled){opacity:.92;transform:translateY(-1px)}
  .btn-convert:disabled{background:#ccc;cursor:not-allowed;transform:none}

  /* ── Result panel ───────────────────────────────── */
  .result-panel{display:none;margin-top:24px;padding:20px;background:#f8fffe;border:1.5px solid #d0ece8;border-radius:12px}

  /* PDF preview box */
  .result-preview-pdf{display:flex;flex-direction:column;align-items:center;gap:10px;margin-bottom:16px}
  .pdf-icon-large{font-size:4rem;line-height:1}
  .pdf-preview-name{font-size:.9rem;color:#555;word-break:break-all;text-align:center;max-width:400px}

  /* Stats grid */
  .result-stats{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:16px}
  @media(min-width:480px){.result-stats{grid-template-columns:repeat(4,1fr)}}
  .stat-box{background:#fff;border:1px solid #e0e0e0;border-radius:8px;padding:10px;text-align:center}
  .stat-box .label{font-size:.72rem;color:#999;text-transform:uppercase;letter-spacing:.04em;margin-bottom:4px}
  .stat-box .value{font-size:1rem;font-weight:700;color:#333}
  .stat-box .value.improved{color:#1a7a4a}
  .stat-box .value.worse{color:#c0392b}

  /* Buttons */
  .btn-download{display:block;width:100%;padding:13px;background:#1a7a4a;color:#fff;font-size:1rem;font-weight:700;border:none;border-radius:8px;cursor:pointer;margin-bottom:10px;transition:opacity .2s}
  .btn-download:hover{opacity:.9}
  .btn-reset{display:block;width:100%;padding:11px;background:#fff;color:#e9423a;font-size:.92rem;font-weight:600;border:1.5px solid #e9423a;border-radius:8px;cursor:pointer;transition:background .2s,color .2s}
  .btn-reset:hover{background:#e9423a;color:#fff}

  /* Warning banner */
  .warn-banner{padding:10px 14px;background:#fff8e1;border:1px solid #f9c84a;border-radius:8px;font-size:.82rem;color:#7a5c00;margin-top:12px;display:none}

  /* ── Converter widget ───────────────────────────── */
  .converter-widget{background:#fff;border-radius:16px;box-shadow:0 2px 16px rgba(0,0,0,.08);padding:22px 24px}
  .converter-widget h3{margin:0 0 16px;font-size:1rem;font-weight:700;color:#333}
  .converter-grid{display:flex;align-items:center;gap:10px}
  .converter-grid input{flex:1;border:1.5px solid #ddd;border-radius:8px;padding:8px 12px;font-size:.95rem;outline:none}
  .converter-grid input:focus{border-color:#e9423a}
  .converter-arrow{font-size:1.2rem;color:#999}
  .converter-result{flex:1;background:#f5f5f5;border-radius:8px;padding:8px 12px;font-size:.95rem;font-weight:700;color:#333;min-width:80px}

  /* ── Content section ────────────────────────────── */
  .content-section{background:#fff;padding:40px 20px}
  .content-inner{max-width:780px;margin:0 auto}
  .content-inner h2{font-size:1.35rem;font-weight:700;color:#333;margin:28px 0 10px}
  .content-inner p{color:#555;line-height:1.7;margin:0 0 14px}

  /* ── Related links ──────────────────────────────── */
  .related-links{background:#f9f9f9;border-top:1px solid #eee;padding:24px 20px}
  .related-inner{max-width:780px;margin:0 auto}
  .related-inner h3{font-size:.95rem;font-weight:700;color:#999;text-transform:uppercase;letter-spacing:.06em;margin:0 0 12px}
  .related-tags{display:flex;flex-wrap:wrap;gap:8px}
  .related-tag{display:inline-block;padding:6px 14px;background:#fff;border:1px solid #ddd;border-radius:20px;font-size:.82rem;color:#555;text-decoration:none;transition:border-color .2s,color .2s}
  .related-tag:hover{border-color:#e9423a;color:#e9423a}

  /* ── Sticky download ────────────────────────────── */

/* ── Styles from single.php ── */
/* ── Single article page — mb2kb style ── */
  :root {
    --text:         #111827;
    --text-muted:   #6b7280;
    --text-light:   #9ca3af;
    --border:       #e5e7eb;
    --bg:           #ffffff;
    --bg-soft:      #f9fafb;
    --primary:      #1a56db;
    --primary-dark: #1440b0;
    --primary-light:#ebf0ff;
    --success:      #16a34a;
    --radius:       10px;
    --font: system-ui, -apple-system, 'Segoe UI', sans-serif;
  }

  /* ── PAGE SHELL ── */
  .article-page {
    background: var(--bg);
    min-height: 100vh;
  }

  /* ── BREADCRUMB ── */
  .breadcrumb {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    font-size: .82rem;
    color: var(--text-muted);
  }
  .breadcrumb-inner { max-width: 760px; margin: 0 auto; }
  .breadcrumb a { color: var(--primary); text-decoration: none; }
  .breadcrumb a:hover { text-decoration: underline; }
  .breadcrumb span { margin: 0 6px; color: var(--text-light); }

  /* ── ARTICLE LAYOUT ── */
  .article-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px 80px;
  }

  /* ── TITLE ── */
  .article-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -.025em;
    margin: 0 0 14px;
    font-family: var(--font);
  }

  /* ── META LINE ── */
  .article-meta {
    font-size: .84rem;
    color: var(--text-muted);
    margin-bottom: 36px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .article-meta .sep { color: var(--text-light); }

  /* ── FEATURED IMAGE ── */
  .article-featured-img {
    margin-bottom: 36px;
    border-radius: var(--radius);
    overflow: hidden;
  }
  .article-featured-img img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* ── BODY CONTENT ── */
  .article-content { font-family: var(--font); }

  .article-content p {
    font-size: 1rem;
    line-height: 1.85;
    color: #374151;
    margin-bottom: 1.4em;
  }

  .article-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin: 2.2em 0 .7em;
    line-height: 1.25;
    letter-spacing: -.01em;
  }

  .article-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 1.8em 0 .6em;
  }

  .article-content h4,
  .article-content h5,
  .article-content h6 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 1.5em 0 .5em;
  }

  .article-content h2:first-child,
  .article-content h3:first-child { margin-top: 0; }

  .article-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .article-content a:hover { color: var(--primary-dark); }

  .article-content ul,
  .article-content ol {
    margin: 0 0 1.4em 1.4em;
    padding: 0;
  }
  .article-content li {
    font-size: 1rem;
    line-height: 1.8;
    color: #374151;
    margin-bottom: .35em;
  }

  .article-content strong { color: var(--text); font-weight: 700; }

  .article-content blockquote {
    border-left: 3px solid var(--primary);
    background: var(--primary-light);
    border-radius: 0 8px 8px 0;
    margin: 1.8em 0;
    padding: 14px 20px;
    font-style: normal;
    color: #374151;
  }
  .article-content blockquote p { margin: 0; }

  /* Tables */
  .article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.8em 0;
    font-size: .92rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .article-content th {
    background: var(--bg-soft);
    font-weight: 700;
    text-align: left;
    padding: 11px 14px;
    border: 1px solid var(--border);
    color: var(--text);
    white-space: nowrap;
  }
  .article-content td {
    padding: 11px 14px;
    border: 1px solid var(--border);
    color: #374151;
    vertical-align: top;
  }
  .article-content tr:nth-child(even) td { background: var(--bg-soft); }

  /* Images */
  .article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 1.6em auto;
  }
  .article-content figcaption,
  .article-content .wp-caption-text {
    text-align: center;
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: 6px;
  }

  /* Code */
  .article-content code {
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: .87em;
    font-family: 'Courier New', monospace;
    color: var(--text);
  }
  .article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 18px 22px;
    overflow-x: auto;
    margin: 1.6em 0;
    font-size: .87rem;
    line-height: 1.7;
  }
  .article-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
  }

  .article-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.4em 0;
  }

  /* ── DIVIDER ── */
  .article-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 52px 0 0;
  }

  /* ── RELATED ARTICLES ── */
  .related-section { padding: 44px 24px 52px; background: var(--bg); }
  .related-inner   { max-width: 760px; margin: 0 auto; }

  .related-heading {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    letter-spacing: -.01em;
  }

  .related-list { display: flex; flex-direction: column; gap: 12px; }

  .related-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 18px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color .18s, box-shadow .18s, transform .15s;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
  }
  .related-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(26,86,219,.1);
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
  }
  .related-card-date {
    font-size: .77rem;
    color: var(--text-light);
    font-weight: 500;
  }
  .related-card-title {
    font-size: .97rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
    transition: color .15s;
  }
  .related-card:hover .related-card-title { color: var(--primary); }
  .related-card-excerpt {
    font-size: .84rem;
    color: var(--text-muted);
    line-height: 1.55;
  }
  .related-card-read {
    font-size: .8rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 2px;
  }

  /* ── CTA BOX ── */
  .article-cta {
    margin: 0 24px 0;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 24px 60px;
  }
  .cta-box {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    text-align: center;
  }
  .cta-box h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
  }
  .cta-box p {
    font-size: .92rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
  }
  .cta-btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 13px 28px;
    border-radius: 8px;
    font-size: .97rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .18s, transform .18s, box-shadow .18s;
    box-shadow: 0 4px 14px rgba(26,86,219,.25);
  }
  .cta-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(26,86,219,.3);
    text-decoration: none;
    color: #fff;
  }

  /* ── RESPONSIVE ── */
  @media (max-width: 640px) {
    .article-wrap    { padding: 28px 16px 56px; }
    .related-section { padding: 32px 16px 40px; }
    .article-cta     { padding: 0 16px 48px; }
    .article-title   { font-size: 1.45rem; }
    .article-content p,
    .article-content li { font-size: .97rem; }
    .article-content h2 { font-size: 1.15rem; }
    .related-card    { padding: 14px 16px; }
    .cta-box         { padding: 24px 18px; }
  }
/* ══ UPLOAD META (shown after file selected) ══ */
.upload-meta { width: 100%; }
.upload-meta .file-loaded {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin-top: 10px;
  background: rgba(31,157,92,0.08);
  border: 1px solid rgba(31,157,92,0.25);
  border-radius: 10px;
  font-size: 13px; font-weight: 500;
  color: var(--text);
}
.upload-meta .file-loaded svg { color: var(--success); flex-shrink: 0; }
.upload-meta .file-loaded .sep { color: var(--text-dim); }
#uploadFileName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
#uploadFileSize { color: var(--text-muted); font-family: var(--mono); font-size: 12px; flex-shrink: 0; }

/* ══ PROGRESS BAR (JS adds class 'active' to show) ══ */
.progress-wrap { display: none; margin-top: 14px; }
.progress-wrap.active { display: block; }
.progress-track {
  height: 6px; background: var(--surface-2);
  border-radius: 99px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s ease;
}
.progress-text {
  font-family: var(--mono); font-size: 12px;
  color: var(--text-muted); margin-top: 6px; text-align: center;
}

/* ══ RESULT PANEL (JS adds class 'visible' to show) ══ */
.result-panel {
  display: none;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.25s ease;
}
.result-panel.visible { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

.result-preview {
  border-radius: 12px; overflow: hidden;
  background: var(--surface-2);
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  min-height: 120px;
}
.result-preview img {
  max-width: 100%; max-height: 280px;
  object-fit: contain; display: block;
  border-radius: 10px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}
.stat-box .label {
  font-family: var(--mono); font-size: 10px;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-box .value {
  font-size: 15px; font-weight: 700;
  color: var(--text); margin-top: 4px;
  word-break: break-all;
}
.stat-box .value.success { color: var(--success); }
.stat-box .value.warn { color: var(--accent); }

.result-actions {
  display: flex; gap: 10px;
}
.result-actions .btn {
  flex: 1; padding: 13px 14px;
  border-radius: 10px; font-size: 14px;
  font-weight: 600; cursor: pointer;
  border: none; font-family: inherit;
  background: var(--surface-2); color: var(--text);
  transition: background 0.15s ease, color 0.15s ease;
}
.result-actions .btn.primary {
  background: var(--accent); color: #fff;
}
.result-actions .btn.primary:hover { background: var(--accent-strong); }
.result-actions .btn:not(.primary):hover { color: var(--accent); }

/* ══ MOBILE RESPONSIVE FIXES ══ */
@media (max-width: 640px) {
  /* Hero */
  .hero { padding: 32px 0 48px; }
  .hero .wrap { gap: 28px; }
  .hero-copy h1 { font-size: 26px; }
  .hero-copy p.lede { font-size: 15px; }

  /* Tool card */
  .tool-card { padding: 20px 16px; border-radius: 14px; }

  /* Upload zone */
  .upload-zone { padding: 28px 16px; }
  .upload-zone p { font-size: 13px; }

  /* Target row stacks on small screens */
  .target-row { flex-direction: column; gap: 10px; }
  .target-box { width: 100%; }
  .convert-btn { width: 100%; height: 48px; font-size: 15px; }

  /* Result stats: 2 columns on mobile */
  .result-stats { grid-template-columns: repeat(2, 1fr); }

  /* Result actions stack */
  .result-actions { flex-direction: column; }

  /* Converter widget */
  .converter-widget { padding: 18px 16px; }
  .converter-row { flex-direction: column; gap: 6px; }
  .converter-row input, .converter-result { width: 100%; }
  .arrow { display: none; }

  /* Chips wrap nicely */
  .chip-row { gap: 6px; }
  .chip { font-size: 12px; padding: 6px 9px; }

  /* Steps: 1 column */
  .steps-list { grid-template-columns: 1fr; }

  /* Tools grid: 2 columns */
  .tools-grid { grid-template-columns: repeat(2, 1fr); }

  /* Why list: 1 column */
  .why-list { grid-template-columns: 1fr; }

  /* Section padding */
  .section { padding: 40px 0; }
  .section-head { margin-bottom: 28px; }

  /* Footer */
  .footer-top { flex-direction: column; gap: 24px; }
  .footer-cols { flex-direction: column; gap: 20px; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 6px; }
}

@media (max-width: 400px) {
  .tools-grid { grid-template-columns: 1fr; }
  .badges { gap: 6px; }
  .badge { font-size: 11px; padding: 5px 10px; }
}

/* ══════════════════════════════════════════════
   PAGE.PHP — Static pages (About, Contact, Privacy, etc.)
══════════════════════════════════════════════ */

.page-wrap {
  padding: 48px 0 80px;
  min-height: 60vh;
  background: var(--bg);
}

.pg-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pg-breadcrumb a { color: var(--accent); text-decoration: none; }
.pg-breadcrumb a:hover { text-decoration: underline; }
.pg-breadcrumb span { color: var(--text-dim); }

.pg-article {
  max-width: 760px;
}

.pg-title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

/* Content typography */
.pg-content { font-size: 16px; line-height: 1.8; color: var(--text-muted); }
.pg-content h2 { font-size: 1.4rem; font-weight: 700; color: var(--text); margin: 2em 0 0.6em; letter-spacing: -0.01em; }
.pg-content h3 { font-size: 1.15rem; font-weight: 700; color: var(--text); margin: 1.6em 0 0.5em; }
.pg-content h4 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 1.4em 0 0.4em; }
.pg-content p { margin-bottom: 1.2em; }
.pg-content p:last-child { margin-bottom: 0; }
.pg-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.pg-content a:hover { color: var(--accent-strong); }
.pg-content strong { color: var(--text); font-weight: 600; }
.pg-content em { font-style: italic; }
.pg-content ul, .pg-content ol { margin: 0.8em 0 1.2em 1.4em; padding: 0; }
.pg-content li { margin-bottom: 0.4em; line-height: 1.7; }
.pg-content blockquote {
  border-left: 3px solid var(--accent);
  background: rgba(255,92,51,0.05);
  border-radius: 0 8px 8px 0;
  margin: 1.6em 0; padding: 14px 20px;
  color: var(--text-muted); font-style: normal;
}
.pg-content blockquote p { margin-bottom: 0; }
.pg-content hr {
  border: none; border-top: 1px solid var(--border);
  margin: 2.4em 0;
}
.pg-content table {
  width: 100%; border-collapse: collapse;
  margin: 1.6em 0; font-size: 14px;
  display: block; overflow-x: auto;
}
.pg-content th {
  background: var(--surface); font-weight: 600;
  text-align: left; padding: 10px 14px;
  border: 1px solid var(--border); color: var(--text);
}
.pg-content td {
  padding: 10px 14px; border: 1px solid var(--border);
  color: var(--text-muted); vertical-align: top;
}
.pg-content tr:nth-child(even) td { background: var(--surface); }
.pg-content img {
  max-width: 100%; height: auto;
  border-radius: 10px; margin: 1.4em 0;
  display: block;
}
.pg-content code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px;
  font-size: 0.87em; font-family: var(--mono);
  color: var(--text);
}
.pg-content pre {
  background: #1e2027; color: #e2e8f0;
  border-radius: 10px; padding: 18px 22px;
  overflow-x: auto; margin: 1.6em 0;
  font-size: 14px; line-height: 1.7;
  font-family: var(--mono);
}
.pg-content pre code {
  background: none; border: none; padding: 0; color: inherit;
}

/* Mobile */
@media (max-width: 640px) {
  .page-wrap { padding: 32px 0 60px; }
  .pg-title { font-size: 22px; margin-bottom: 22px; padding-bottom: 16px; }
  .pg-content { font-size: 15px; }
  .pg-content h2 { font-size: 1.2rem; }
  .pg-content h3 { font-size: 1.05rem; }
}

/* ══════════════════════════════════════════════
   SINGLE.PHP — Blog article page
══════════════════════════════════════════════ */

.article-page { background: var(--bg); min-height: 60vh; }

/* Breadcrumb (reuses pg-breadcrumb but also styled below as .breadcrumb) */
.breadcrumb {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.breadcrumb-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 24px;
  font-size: 13px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.breadcrumb-inner a { color: var(--accent); text-decoration: none; }
.breadcrumb-inner a:hover { text-decoration: underline; }
.breadcrumb-inner span { color: var(--text-dim); }

.article-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.article-title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800; color: var(--text);
  line-height: 1.15; letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.article-meta {
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 32px;
  display: flex; align-items: center;
  gap: 6px; flex-wrap: wrap;
}
.article-meta .sep { color: var(--text-dim); }

.article-featured-img {
  margin-bottom: 32px;
  border-radius: 12px; overflow: hidden;
}
.article-featured-img img { width: 100%; height: auto; display: block; }

/* Article body — same as pg-content */
.article-content { font-size: 16px; line-height: 1.85; color: var(--text-muted); }
.article-content h2 { font-size: 1.3rem; font-weight: 700; color: var(--text); margin: 2em 0 0.6em; }
.article-content h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 1.6em 0 0.5em; }
.article-content p { margin-bottom: 1.3em; }
.article-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.article-content a:hover { color: var(--accent-strong); }
.article-content strong { color: var(--text); font-weight: 600; }
.article-content ul, .article-content ol { margin: 0.8em 0 1.3em 1.4em; padding: 0; }
.article-content li { margin-bottom: 0.4em; line-height: 1.75; }
.article-content blockquote {
  border-left: 3px solid var(--accent);
  background: rgba(255,92,51,0.05);
  border-radius: 0 8px 8px 0;
  margin: 1.8em 0; padding: 14px 20px; color: var(--text-muted);
}
.article-content blockquote p { margin-bottom: 0; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 14px; display: block; overflow-x: auto; }
.article-content th { background: var(--surface); font-weight: 600; text-align: left; padding: 10px 14px; border: 1px solid var(--border); color: var(--text); }
.article-content td { padding: 10px 14px; border: 1px solid var(--border); color: var(--text-muted); vertical-align: top; }
.article-content tr:nth-child(even) td { background: var(--surface); }
.article-content img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 1.4em auto; }
.article-content code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; font-size: 0.87em; font-family: var(--mono); color: var(--text); }
.article-content pre { background: #1e2027; color: #e2e8f0; border-radius: 10px; padding: 18px 22px; overflow-x: auto; margin: 1.6em 0; font-size: 14px; line-height: 1.7; font-family: var(--mono); }
.article-content pre code { background: none; border: none; padding: 0; color: inherit; }
.article-content hr { border: none; border-top: 1px solid var(--border); margin: 2.4em 0; }
.article-divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* Related articles */
.related-section { padding: 44px 24px 52px; }
.related-inner { max-width: 760px; margin: 0 auto; }
.related-heading { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 18px; }
.related-list { display: flex; flex-direction: column; gap: 10px; }
.related-card {
  display: flex; flex-direction: column; gap: 5px;
  padding: 18px 20px;
  background: var(--footer-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none; color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.related-card-date { font-size: 12px; color: var(--text-dim); font-family: var(--mono); }
.related-card-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; }
.related-card:hover .related-card-title { color: var(--accent); }
.related-card-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.related-card-read { font-size: 12px; font-weight: 600; color: var(--accent); margin-top: 2px; }

/* Article CTA box */
.article-cta { max-width: 760px; margin: 0 auto; padding: 0 24px 60px; }
.cta-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 32px 28px; text-align: center;
}
.cta-box h2 { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.cta-box p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.cta-btn {
  display: inline-block;
  background: var(--accent); color: #fff;
  padding: 13px 28px; border-radius: 9px;
  font-size: 15px; font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.cta-btn:hover { background: var(--accent-strong); transform: translateY(-1px); text-decoration: none; color: #fff; }

/* Mobile */
@media (max-width: 640px) {
  .article-wrap { padding: 28px 16px 56px; }
  .article-title { font-size: 22px; }
  .article-content { font-size: 15px; }
  .related-section { padding: 32px 16px 40px; }
  .article-cta { padding: 0 16px 48px; }
  .cta-box { padding: 24px 18px; }
}