/* ============================================================
   JF PDF Design System
   Original identity: deep indigo + cyan accents, coral highlights.
   Light/dark themes via CSS custom properties.
   ============================================================ */

:root {
  --df-brand-900: #1e1b4b;
  --df-brand-800: #312e81;
  --df-brand-700: #4338ca;
  --df-brand-600: #4f46e5;
  --df-brand-500: #6366f1;
  --df-brand-400: #818cf8;
  --df-brand-300: #a5b4fc;
  --df-accent: #06b6d4;
  --df-accent-600: #0891b2;
  --df-coral: #f43f5e;

  /* light theme */
  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --bg-soft: #eef0f7;
  --bg-hover: #f1f2f9;
  --text: #171a33;
  --text-soft: #4b5069;
  --text-mute: #7d8299;
  --border: #e3e5f0;
  --border-strong: #cfd3e6;
  --shadow-sm: 0 1px 2px rgba(23, 26, 51, .06);
  --shadow-md: 0 4px 14px rgba(23, 26, 51, .08);
  --shadow-lg: 0 16px 40px rgba(23, 26, 51, .14);
  --shadow-brand: 0 8px 24px rgba(79, 70, 229, .28);
  --ring: rgba(99, 102, 241, .35);
  --glass: rgba(255, 255, 255, .82);
  --code-bg: #23263f;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --grad-brand: linear-gradient(135deg, #4f46e5 0%, #6366f1 55%, #06b6d4 100%);
  --grad-hero: radial-gradient(1200px 600px at 15% -10%, rgba(99,102,241,.16), transparent 60%),
               radial-gradient(900px 500px at 90% 10%, rgba(6,182,212,.14), transparent 60%),
               radial-gradient(700px 400px at 50% 110%, rgba(244,63,94,.08), transparent 60%);

  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0f1222;
  --bg-elev: #171b30;
  --bg-soft: #1d2238;
  --bg-hover: #222743;
  --text: #eef0fb;
  --text-soft: #b8bdd4;
  --text-mute: #868ca8;
  --border: #252a45;
  --border-strong: #343a5c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
  --shadow-brand: 0 8px 30px rgba(99, 102, 241, .35);
  --glass: rgba(23, 27, 48, .85);
  --grad-hero: radial-gradient(1200px 600px at 15% -10%, rgba(99,102,241,.22), transparent 60%),
               radial-gradient(900px 500px at 90% 10%, rgba(6,182,212,.16), transparent 60%);
}

/* ---------------- base ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background-color .25s ease, color .25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--df-brand-500); text-decoration: none; }
a:hover { color: var(--df-brand-400); }
h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--df-brand-500); color: #fff; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 9999;
  background: var(--df-brand-600); color: #fff; padding: .6rem 1.1rem; border-radius: 0 0 10px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

.container { width: min(1200px, 100% - clamp(1rem, 4vw, 2.5rem)); margin-inline: auto; }
.container--narrow { width: min(820px, 100% - clamp(1rem, 4vw, 2.5rem)); margin-inline: auto; }

/* 2-column responsive grid helper */
.responsive-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}
@media (max-width: 768px) {
  .responsive-grid-2 { grid-template-columns: 1fr; }
}

main { flex: 1; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 .95rem/1 var(--font);
  padding: .78rem 1.4rem;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn--primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn--primary:hover:not(:disabled) { box-shadow: 0 12px 32px rgba(79,70,229,.42); transform: translateY(-1px); color: #fff; }

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--ghost:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--accent, var(--df-brand-500)); color: var(--text); }

.btn--soft {
  background: var(--bg-soft);
  color: var(--text);
  border-color: transparent;
}
.btn--soft:hover:not(:disabled) { background: var(--bg-hover); }

.btn--danger { background: #ef4444; color: #fff; }
.btn--danger:hover:not(:disabled) { background: #dc2626; }

.btn--success { background: #10b981; color: #fff; }
.btn--success:hover:not(:disabled) { background: #059669; }

.btn--sm { padding: .5rem .9rem; font-size: .85rem; border-radius: 10px; }
.btn--lg { padding: 1rem 1.9rem; font-size: 1.05rem; border-radius: 14px; }
.btn--block { width: 100%; }

.btn .spinner {
  width: 1em; height: 1em; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: df-spin .7s linear infinite; display: none;
}
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading > .btn__label { opacity: .8; }

@keyframes df-spin { to { transform: rotate(360deg); } }

/* ---------------- nav backdrop & mobile auth ---------------- */
.nav-backdrop {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(10, 12, 26, .58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.nav-backdrop.is-open { opacity: 1; visibility: visible; }
.nav__mobile-auth { display: none; }

/* ---------------- header / nav ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; gap: 1.25rem;
  height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.18rem; letter-spacing: -.03em; color: var(--text);
}
.brand:hover { color: var(--text); }
.brand__mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px;
  background: var(--grad-brand);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: var(--shadow-brand);
}
.brand__mark svg { width: 21px; height: 21px; }
.brand__name { color: inherit; }

.nav__links {
  display: flex; align-items: center; gap: .2rem;
  list-style: none; margin: 0; padding: 0;
}
.nav__link {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .55rem .85rem; border-radius: 10px;
  font-weight: 600; font-size: .93rem; color: var(--text-soft);
  background: none; border: none; cursor: pointer; font-family: var(--font);
}
.nav__link:hover { background: var(--bg-hover); color: var(--text); }
.nav__link.is-active { color: var(--df-brand-500); }
.nav__link svg { width: 15px; height: 15px; opacity: .7; }

.nav__spacer { flex: 1; }

.nav__actions { display: flex; align-items: center; gap: .55rem; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border-strong); border-radius: 10px;
  width: 42px; height: 42px; cursor: pointer; color: var(--text);
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* mega menu */
.mega-wrap { position: relative; }
.mega-menu {
  position: absolute; left: 50%; transform: translateX(-50%) translateY(8px);
  top: calc(100% + 10px);
  width: min(860px, calc(100vw - 2rem));
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.4rem;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.mega-wrap.is-open .mega-menu { display: grid; animation: df-pop .18s ease; }
@keyframes df-pop { from { opacity: 0; transform: translateX(-50%) translateY(4px); } to { opacity: 1; transform: translateX(-50%) translateY(8px); } }

.mega-col h4 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-mute); margin: 0 0 .5rem .6rem;
}
.mega-links { list-style: none; margin: 0; padding: 0; }
.mega-links a {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .6rem; border-radius: 10px;
  color: var(--text-soft); font-weight: 500; font-size: .92rem;
}
.mega-links a:hover { background: var(--bg-hover); color: var(--text); }
.mega-links .mi {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-soft); color: var(--df-brand-500);
}
.mega-links .mi svg { width: 15px; height: 15px; }

/* search */
.search-btn { position: relative; }
.search-panel {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: min(420px, calc(100vw - 2rem));
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: .8rem; display: none; z-index: 110;
}
.search-panel.is-open { display: block; animation: df-pop-down .18s ease; }
@keyframes df-pop-down { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.search-input-wrap { display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; background: var(--bg-soft); border-radius: 12px; }
.search-input-wrap svg { width: 18px; height: 18px; color: var(--text-mute); flex: 0 0 18px; }
.search-input-wrap input {
  flex: 1; border: none; background: transparent; color: var(--text);
  font: 500 1rem var(--font); outline: none;
}
.search-results { margin-top: .5rem; max-height: 340px; overflow-y: auto; }
.search-result {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem;
  border-radius: 10px; color: var(--text); font-weight: 600; font-size: .93rem;
}
.search-result:hover { background: var(--bg-hover); }
.search-result .mi {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-soft); color: var(--df-brand-500);
}
.search-result small { display: block; font-weight: 400; color: var(--text-mute); }
.search-empty { padding: 1rem; text-align: center; color: var(--text-mute); font-size: .9rem; }

/* ---------------- hero ---------------- */
.hero {
  position: relative;
  padding: clamp(3rem, 7vw, 6.5rem) 0 clamp(2.5rem, 5vw, 4rem);
  background: var(--grad-hero);
  overflow: hidden;
}
.hero__inner { position: relative; z-index: 1; text-align: center; }
.hero__badge {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--bg-elev); border: 1px solid var(--border);
  padding: .45rem 1rem; border-radius: 999px;
  font-weight: 600; font-size: .85rem; color: var(--text-soft);
  box-shadow: var(--shadow-sm); margin-bottom: 1.4rem;
}
.hero__badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.18); animation: df-pulse 2s infinite; }
@keyframes df-pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(16,185,129,.25);} 50% { box-shadow: 0 0 0 7px rgba(16,185,129,.08);} }

.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.7rem);
  font-weight: 800; letter-spacing: -.035em;
  margin: 0 auto .6rem; max-width: 18ch;
}
.hero h1 .grad {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub {
  font-size: clamp(1.02rem, 1.8vw, 1.22rem);
  color: var(--text-soft); max-width: 56ch; margin: 0 auto 2rem;
}

.hero__cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.6rem; }

.hero__popular { display: flex; gap: .55rem; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
.hero__popular a {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--bg-elev); border: 1px solid var(--border);
  padding: .45rem .95rem; border-radius: 999px;
  font-size: .85rem; font-weight: 600; color: var(--text-soft);
}
.hero__popular a:hover { border-color: var(--df-brand-500); color: var(--df-brand-500); transform: translateY(-1px); }
.hero__popular svg { width: 14px; height: 14px; }

/* floating pages illustration */
.hero__art {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  display: flex; align-items: center; justify-content: space-between;
  opacity: .9;
}
.hero__doc {
  width: 190px; aspect-ratio: 3/4;
  background: linear-gradient(160deg, var(--bg-elev), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 1.1rem;
  display: flex; flex-direction: column; gap: .55rem;
}
.hero__doc i { display: block; border-radius: 4px; background: linear-gradient(90deg, var(--border) 60%, transparent); height: 9px; }
.hero__doc i:nth-child(1) { width: 62%; }
.hero__doc i:nth-child(2) { width: 84%; }
.hero__doc i:nth-child(3) { width: 48%; }
.hero__doc i:nth-child(4) { width: 76%; }
.hero__doc .ph { flex: 1; border-radius: 8px; background: var(--bg-hover); }

.hero__float, .dbg-blob { animation: df-float 7s ease-in-out infinite; }
.hero__float--2 { animation-delay: -2.5s; }

/* floating JF brand mark in the hero artwork */
.hero__mark {
  position: absolute; top: 8%; right: 2%;
  width: 96px; height: 96px; border-radius: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-brand);
  color: #fff; font-weight: 900; font-size: 2.4rem; letter-spacing: -.06em;
  box-shadow: var(--shadow-brand), 0 24px 48px rgba(79, 70, 229, .30);
  animation: df-float 8s ease-in-out infinite; animation-delay: -4.2s;
  z-index: 2;
}
.hero__mark svg { position: absolute; top: 7px; right: 7px; color: #cffafe; }
.hero__mark::after {
  content: ""; position: absolute; inset: -18px; border-radius: 40px;
  background: radial-gradient(circle at 30% 20%, rgba(139,92,246,.35), transparent 62%);
  z-index: -1; filter: blur(6px);
}
@keyframes df-float { 0%,100% { transform: translateY(0) rotate(-3deg);} 50% { transform: translateY(-16px) rotate(2deg);} }

@media (max-width: 1060px) { .hero__art { display: none; } }

/* ---------------- sections ---------------- */
.section { padding: clamp(2.8rem, 5vw, 4.5rem) 0; }
.section--soft { background: var(--bg-soft); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 2.4rem; }
.section__head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; }
.section__head p { color: var(--text-soft); font-size: 1.05rem; }
.eyebrow {
  display: inline-block; font-size: .75rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--df-brand-500); margin-bottom: .7rem;
}

/* ---------------- tool cards ---------------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 1.1rem;
}
.tool-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex; flex-direction: column; gap: .8rem;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .25s ease, border-color .2s ease;
  overflow: hidden;
}
.tool-card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(360px 140px at 12% 0%, var(--card-glow, rgba(99,102,241,.09)), transparent 70%);
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.tool-card:hover::after { opacity: 1; }
.tool-card__icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--card-accent, #6366f1) 12%, transparent);
  color: var(--card-accent, #6366f1);
  transition: transform .2s ease;
}
.tool-card:hover .tool-card__icon { transform: scale(1.07) rotate(-3deg); }
.tool-card__icon svg { width: 25px; height: 25px; }
.tool-card h3 { font-size: 1.08rem; font-weight: 700; margin: 0; }
.tool-card p { margin: 0; font-size: .9rem; color: var(--text-soft); flex: 1; }
.tool-card__foot { display: flex; align-items: center; justify-content: space-between; }
.tool-card__cat { font-size: .75rem; font-weight: 600; color: var(--text-mute); text-transform: uppercase; letter-spacing: .06em; }
.tool-card__cta {
  display: inline-flex; align-items: center; gap: .35rem;
  font-weight: 700; font-size: .88rem; color: var(--card-accent, var(--df-brand-500));
}
.tool-card__cta svg { width: 15px; height: 15px; transition: transform .2s ease; }
.tool-card:hover .tool-card__cta svg { transform: translateX(3px); }
.tool-card__badge {
  position: absolute; top: 1rem; right: 1rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em;
  padding: .22rem .55rem; border-radius: 999px;
  background: var(--grad-brand); color: #fff; text-transform: uppercase;
}

/* category chips */
.chips { display: flex; gap: .55rem; flex-wrap: wrap; justify-content: center; margin-bottom: 2.2rem; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.05rem; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--border);
  font-weight: 600; font-size: .88rem; color: var(--text-soft);
  cursor: pointer; transition: all .18s ease; font-family: var(--font);
}
.chip:hover { border-color: var(--df-brand-500); color: var(--df-brand-500); }
.chip.is-active {
  background: var(--grad-brand); color: #fff; border-color: transparent;
  box-shadow: var(--shadow-brand);
}
.chip .cnt { font-size: .72rem; opacity: .65; }

/* ---------------- upload area ---------------- */
.uploader {
  background: var(--bg-elev);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: clamp(1.6rem, 4vw, 3rem) 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, transform .15s ease;
  position: relative;
}
.uploader:hover, .uploader.is-drag {
  border-color: var(--df-brand-500);
  background: color-mix(in srgb, var(--df-brand-500) 4%, var(--bg-elev));
}
.uploader.is-drag { transform: scale(1.01); }
.uploader__icon {
  width: 74px; height: 74px; margin: 0 auto 1rem; border-radius: 20px;
  background: var(--grad-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-brand);
  animation: df-breathe 3s ease-in-out infinite;
}
@keyframes df-breathe { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-6px);} }
.uploader__icon svg { width: 34px; height: 34px; }
.uploader h3 { margin-bottom: .3rem; font-size: 1.15rem; }
.uploader p { color: var(--text-mute); font-size: .9rem; margin-bottom: .2rem; }
.uploader__hint { font-size: .78rem; color: var(--text-mute); margin-top: .8rem; }
.uploader input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* file list */
.file-list { display: flex; flex-direction: column; gap: .6rem; margin-top: 1.1rem; }
.file-item {
  display: flex; align-items: center; gap: .9rem;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .8rem 1rem;
  animation: df-file-in .25s ease;
  transition: border-color .2s ease, box-shadow .2s ease;
}
@keyframes df-file-in { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none;} }
.file-item.is-selected { border-color: var(--df-brand-500); box-shadow: 0 0 0 3px var(--ring); }
.file-item.is-uploading { opacity: .85; }
.file-thumb {
  width: 42px; height: 42px; border-radius: 11px; flex: 0 0 42px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-soft); color: var(--df-brand-500); font-weight: 800; font-size: .8rem;
  text-transform: uppercase;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.file-info { flex: 1; min-width: 0; }
.file-info__name { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info__meta { font-size: .78rem; color: var(--text-mute); }
.file-info__bar { margin-top: .4rem; }
.file-actions { display: flex; gap: .3rem; align-items: center; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: none;
  background: transparent; color: var(--text-mute); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn--danger:hover { background: rgba(239,68,68,.12); color: #ef4444; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.is-disabled { opacity: .35; cursor: not-allowed; }

.drag-handle { cursor: grab; }
.file-item.is-dragging { opacity: .4; }
.file-item.is-drag-over { border-color: var(--df-brand-500); border-style: dashed; }

/* progress */
.progress {
  height: 8px; border-radius: 999px; background: var(--bg-soft);
  overflow: hidden; position: relative;
}
.progress__bar {
  height: 100%; width: 0%;
  background: var(--grad-brand);
  border-radius: 999px;
  transition: width .3s ease;
  position: relative;
}
.progress__bar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: df-shimmer 1.4s infinite;
  display: none;
}
.progress.is-animated .progress__bar::after { display: block; }
@keyframes df-shimmer { from { transform: translateX(-100%);} to { transform: translateX(100%);} }
.progress--thin { height: 5px; }

/* status pills */
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .8rem; border-radius: 999px;
  font-size: .77rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.pill--success { background: rgba(16,185,129,.14); color: #059669; }
.pill--warning { background: rgba(245,158,11,.15); color: #b45309; }
.pill--danger { background: rgba(239,68,68,.13); color: #dc2626; }
.pill--info { background: rgba(99,102,241,.14); color: var(--df-brand-600); }
.pill--muted { background: var(--bg-soft); color: var(--text-mute); }
[data-theme="dark"] .pill--success { color: #34d399; }
[data-theme="dark"] .pill--warning { color: #fbbf24; }
[data-theme="dark"] .pill--danger { color: #f87171; }
[data-theme="dark"] .pill--info { color: #a5b4fc; }

/* ---------------- steps / workflow ---------------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; counter-reset: step; }
.step {
  position: relative;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.2rem;
}
.step__num {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad-brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem; margin-bottom: .7rem;
}
.step h4 { margin: 0 0 .3rem; font-size: .98rem; }
.step p { margin: 0; font-size: .84rem; color: var(--text-soft); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 470px) { .steps { grid-template-columns: 1fr; } }

/* ---------------- tool page ---------------- */
.tool-hero { padding: clamp(2.4rem, 4.5vw, 3.6rem) 0 2rem; background: var(--grad-hero); }
.tool-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; }
.tool-hero .crumbs { font-size: .84rem; color: var(--text-mute); margin-bottom: .7rem; }
.tool-hero .crumbs a { color: var(--text-mute); }
.tool-hero .crumbs a:hover { color: var(--df-brand-500); }

.tool-shell {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
  padding: clamp(1.3rem, 3vw, 2.4rem);
}
.tool-shell .uploader { margin-bottom: 1.4rem; }

/* options */
.options-panel {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-top: 1.2rem;
}
.opt { display: flex; flex-direction: column; gap: .4rem; }
.opt label { font-weight: 600; font-size: .86rem; color: var(--text-soft); }
.opt select, .opt input[type="text"], .opt input[type="number"], .opt input[type="email"], .opt input[type="password"], .opt input[type="url"], .opt input[type="color"], .opt textarea {
  width: 100%;
  padding: .62rem .8rem;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--bg-elev); color: var(--text);
  font: 500 .93rem var(--font);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.opt input:focus, .opt select:focus, .opt textarea:focus {
  outline: none; border-color: var(--df-brand-500); box-shadow: 0 0 0 3px var(--ring);
}
.opt input[type="color"] { padding: .2rem .3rem; height: 42px; cursor: pointer; }
.opt .radio-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.opt .radio-row label {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .8rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-elev);
  font-weight: 500; cursor: pointer; font-size: .85rem;
}
.opt .radio-row input { accent-color: var(--df-brand-600); }
.opt .radio-row label:has(input:checked) { border-color: var(--df-brand-500); background: color-mix(in srgb, var(--df-brand-500) 8%, var(--bg-elev)); color: var(--df-brand-500); }

/* result panel */
.result-panel { text-align: center; padding: 1.2rem 0 .4rem; }
.result-panel__icon {
  width: 84px; height: 84px; margin: 0 auto 1.1rem; border-radius: 50%;
  background: rgba(16,185,129,.13); color: #10b981;
  display: flex; align-items: center; justify-content: center;
  animation: df-pop-in .35s ease;
}
@keyframes df-pop-in { from { transform: scale(.5); opacity: 0;} to { transform: scale(1); opacity: 1;} }
.result-panel__icon svg { width: 40px; height: 40px; }
.result-metrics { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin: 1.1rem 0 1.4rem; }
.metric {
  background: var(--bg-soft); border-radius: var(--radius);
  padding: .8rem 1.3rem; min-width: 120px;
}
.metric b { display: block; font-size: 1.25rem; letter-spacing: -.02em; }
.metric span { font-size: .76rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: .05em; }

/* processing stage */
.processing-stage { text-align: center; padding: 2.6rem 1rem; }
.processing-stage .pulse-dot {
  width: 64px; height: 64px; margin: 0 auto 1.2rem; border-radius: 18px;
  background: var(--grad-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  animation: df-pulse-box 1.8s ease-in-out infinite;
}
@keyframes df-pulse-box { 0%,100% { box-shadow: 0 0 0 0 rgba(79,70,229,.4);} 50% { box-shadow: 0 0 0 18px rgba(79,70,229,0);} }
.processing-stage .pulse-dot svg { width: 30px; height: 30px; }
.processing-stage h3 { margin-bottom: .4rem; }
.processing-stage p { color: var(--text-mute); margin-bottom: 1.4rem; }

/* ---------------- dashboard ---------------- */
.dash-grid { display: grid; grid-template-columns: 240px 1fr; gap: 1.6rem; align-items: start; }
.dash-side {
  position: sticky; top: 88px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1rem;
}
.dash-side a {
  display: flex; align-items: center; gap: .65rem;
  padding: .62rem .8rem; border-radius: 10px;
  color: var(--text-soft); font-weight: 600; font-size: .92rem;
}
.dash-side a:hover { background: var(--bg-hover); color: var(--text); }
.dash-side a.is-active { background: color-mix(in srgb, var(--df-brand-500) 10%, transparent); color: var(--df-brand-500); }
.dash-side svg { width: 17px; height: 17px; }
@media (max-width: 860px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-side { position: static; display: flex; overflow-x: auto; gap: .3rem; }
  .dash-side a { white-space: nowrap; }
}

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.1rem 1.2rem;
}
.stat-card b { font-size: 1.55rem; letter-spacing: -.03em; display: block; }
.stat-card span { font-size: .8rem; color: var(--text-mute); font-weight: 600; }

.card-panel {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.3rem;
  margin-bottom: 1.3rem;
}
.card-panel h3 { font-size: 1.02rem; margin-bottom: 1rem; }

.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th {
  text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-mute); padding: .55rem .7rem; border-bottom: 1px solid var(--border);
}
.data-table td { padding: .62rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }
.data-table--scroll {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------------- footer ---------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 3rem 0 1.6rem;
  margin-top: 3rem;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1.8rem; }
.footer-col h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-col a { color: var(--text-soft); font-size: .92rem; font-weight: 500; }
.footer-col a:hover { color: var(--df-brand-500); }
.footer-brand p { color: var(--text-mute); font-size: .92rem; max-width: 40ch; }
.footer-bottom {
  margin-top: 2.4rem; padding-top: 1.3rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .84rem; color: var(--text-mute);
}

/* ---------------- toast ---------------- */
.toasts {
  position: fixed; bottom: 1.4rem; right: 1.4rem; z-index: 1000;
  display: flex; flex-direction: column; gap: .6rem; max-width: min(380px, calc(100vw - 2rem));
}
.toast {
  display: flex; align-items: flex-start; gap: .7rem;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: .85rem 1rem;
  animation: df-toast-in .3s ease;
  border-left: 4px solid var(--df-brand-500);
}
.toast--success { border-left-color: #10b981; }
.toast--error { border-left-color: #ef4444; }
.toast--info { border-left-color: #3b82f6; }
.toast--warning { border-left-color: #f59e0b; }
.toast__msg { font-size: .9rem; font-weight: 500; flex: 1; }
.toast.is-leaving { animation: df-toast-out .25s ease forwards; }
@keyframes df-toast-in { from { opacity: 0; transform: translateX(20px);} to { opacity: 1; transform: none;} }
@keyframes df-toast-out { to { opacity: 0; transform: translateX(30px);} }

/* ---------------- modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(10, 12, 26, .55);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.modal-backdrop.is-open { display: flex; animation: df-fade .18s ease; }
@keyframes df-fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: min(520px, 100%); max-height: 90vh; overflow-y: auto;
  padding: 1.5rem;
  animation: df-modal-in .22s ease;
}
@keyframes df-modal-in { from { opacity: 0; transform: translateY(14px) scale(.98);} to { opacity: 1; transform: none;} }
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.modal__head h3 { margin: 0; }
.modal__close { border: none; background: var(--bg-soft); border-radius: 9px; width: 34px; height: 34px; cursor: pointer; color: var(--text-soft); font-size: 1rem; }

/* ---------------- forms ---------------- */
.form-grid { display: grid; gap: 1rem; }
.form-field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem; }
.form-field .hint { font-size: .78rem; color: var(--text-mute); margin-top: .3rem; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: .68rem .9rem;
  border: 1px solid var(--border-strong); border-radius: 11px;
  background: var(--bg-elev); color: var(--text);
  font: 500 .95rem var(--font);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none; border-color: var(--df-brand-500); box-shadow: 0 0 0 3px var(--ring);
}
.form-error { color: #dc2626; font-size: .86rem; margin-top: .2rem; }
.checkbox-row { display: flex; align-items: center; gap: .55rem; font-weight: 500; font-size: .92rem; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--df-brand-600); }

.auth-wrap { max-width: 430px; margin: 3rem auto; }
.auth-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
  padding: 2rem;
}

/* ---------------- misc ---------------- */
.page-head { padding: 2.6rem 0 1.4rem; }
.page-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; }
.page-head p { color: var(--text-soft); max-width: 60ch; }

.alert {
  display: flex; gap: .7rem; align-items: flex-start;
  border-radius: var(--radius); padding: .9rem 1.1rem;
  font-weight: 500; font-size: .92rem; margin-bottom: 1rem;
}
.alert--info { background: rgba(59,130,246,.1); color: #2563eb; }
.alert--success { background: rgba(16,185,129,.1); color: #059669; }
.alert--warning { background: rgba(245,158,11,.12); color: #b45309; }
.alert--danger { background: rgba(239,68,68,.1); color: #dc2626; }
[data-theme="dark"] .alert--info { color: #93c5fd; }
[data-theme="dark"] .alert--success { color: #6ee7b7; }
[data-theme="dark"] .alert--warning { color: #fcd34d; }
[data-theme="dark"] .alert--danger { color: #fca5a5; }

.accordion { display: grid; gap: .7rem; }
.acc-item {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.acc-btn {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: none; border: none; cursor: pointer;
  font: 600 .96rem var(--font); color: var(--text);
  padding: 1rem 1.2rem; text-align: left;
}
.acc-btn svg { width: 17px; height: 17px; transition: transform .2s ease; flex: 0 0 17px; color: var(--text-mute); }
.acc-item.is-open .acc-btn svg { transform: rotate(180deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.acc-body__inner { padding: 0 1.2rem 1.1rem; color: var(--text-soft); font-size: .93rem; }

.breadcrumbs { display: flex; gap: .45rem; align-items: center; font-size: .85rem; color: var(--text-mute); flex-wrap: wrap; }
.breadcrumbs a { color: var(--text-mute); font-weight: 500; }
.breadcrumbs a:hover { color: var(--df-brand-500); }

.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 1.6rem; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; padding: 0 .6rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text-soft); font-weight: 600; font-size: .88rem;
}
.pagination a:hover { border-color: var(--df-brand-500); color: var(--df-brand-500); }
.pagination .current { background: var(--grad-brand); color: #fff; border-color: transparent; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-mute); }
.empty-state svg { width: 52px; height: 52px; margin: 0 auto 1rem; opacity: .5; }

.ad-slot { margin: 1.4rem auto; text-align: center; }
.ad-slot__label { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-mute); margin-bottom: .4rem; }
.ad-inline-ad {
  display: inline-block; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 12px; padding: .8rem 1.4rem; font-weight: 600; color: var(--text-soft);
}

.theme-toggle {
  width: 42px; height: 42px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--bg-elev);
  color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .2s ease;
}
.theme-toggle:hover { background: var(--bg-hover); }
.theme-toggle svg { width: 18px; height: 18px; }

.skeleton { background: linear-gradient(90deg, var(--bg-soft) 25%, var(--bg-hover) 50%, var(--bg-soft) 75%); background-size: 200% 100%; animation: df-skeleton 1.3s infinite; border-radius: 8px; }
@keyframes df-skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }

code, pre { font-family: var(--font-mono); }
pre { background: var(--code-bg); color: #e2e8f0; padding: 1rem 1.2rem; border-radius: 12px; overflow-x: auto; font-size: .85rem; }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .nav { height: 62px; gap: .6rem; }
  .brand { font-size: 1.1rem; gap: .5rem; }
  .brand__mark { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; }
  .brand__mark svg { width: 18px; height: 18px; }
  .nav__links {
    position: fixed; top: 62px; left: 0; right: 0; bottom: 0;
    max-height: calc(100vh - 62px); overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: var(--bg-elev); border-top: 1px solid var(--border);
    flex-direction: column; align-items: stretch; padding: 1rem 1.2rem 2.8rem;
    gap: .35rem; display: none; z-index: 100; box-shadow: var(--shadow-lg);
  }
  .nav__links.is-open { display: flex; animation: df-pop-down .2s ease; }
  .nav__link { padding: .7rem .9rem; font-size: .96rem; min-height: 44px; width: 100%; justify-content: flex-start; }
  .nav-toggle { display: inline-flex; width: 40px; height: 40px; min-width: 40px; }
  .nav__actions .btn--desktop-only { display: none; }
  .nav__mobile-auth {
    display: flex; flex-direction: column; gap: .6rem;
    padding-top: 1rem; margin-top: .6rem; border-top: 1px solid var(--border);
  }
  .nav__mobile-auth .btn { width: 100%; justify-content: center; min-height: 44px; }
  .mega-menu {
    position: static; transform: none; width: 100%;
    grid-template-columns: 1fr; box-shadow: none; border: none;
    padding: .4rem 0 0 .4rem; max-height: none;
  }
  .mega-wrap.is-open .mega-menu { animation: none; }
  .hero__cta .btn { width: 100%; }
}

@media (max-width: 640px) {
  .search-panel {
    position: fixed; left: .75rem; right: .75rem; top: 68px;
    width: auto; max-width: calc(100vw - 1.5rem); z-index: 110;
  }
  .hero h1 { font-size: clamp(1.8rem, 7.5vw, 2.4rem); }
  .hero__popular { gap: .4rem; }
  .hero__popular a { padding: .35rem .75rem; font-size: .8rem; }
  .footer-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1.4rem; }
}

@media (max-width: 560px) {
  .container { width: calc(100% - 1.25rem); }
  .container--narrow { width: calc(100% - 1.25rem); }
  .tool-shell { padding: 1.1rem .85rem; border-radius: 16px; }
  .brand__name { font-size: 1.02rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .stat-card { padding: .85rem 1rem; }
  .stat-card b { font-size: 1.3rem; }
  .uploader { padding: 1.6rem 1rem; }
  .uploader__icon { width: 60px; height: 60px; border-radius: 16px; margin-bottom: .8rem; }
  .uploader__icon svg { width: 28px; height: 28px; }
  .uploader h3 { font-size: 1.05rem; }
  .uploader p { font-size: .82rem; }
  .uploader__hint { font-size: .74rem; }
  .file-item { flex-wrap: wrap; gap: .6rem; padding: .7rem .8rem; }
  .file-info { min-width: calc(100% - 60px); }
  .file-actions { margin-left: auto; width: 100%; justify-content: flex-end; padding-top: .3rem; border-top: 1px dashed var(--border); }
  .options-panel { grid-template-columns: 1fr; gap: .8rem; }
  .result-metrics { gap: .5rem; }
  .metric { padding: .65rem .9rem; min-width: 100px; }
  .metric b { font-size: 1.1rem; }
  .btn--lg { padding: .85rem 1.4rem; font-size: .98rem; }
  .modal { padding: 1.1rem; margin: .5rem; }
  .auth-card { padding: 1.4rem 1.1rem; }
}

@media (max-width: 380px) {
  .nav { gap: .35rem; }
  .nav__actions { gap: .3rem; }
  .brand { gap: .4rem; }
  .brand__name { font-size: .94rem; }
  .brand__mark { width: 30px; height: 30px; flex: 0 0 30px; }
  .theme-toggle, .nav-toggle { width: 36px; height: 36px; min-width: 36px; padding: 0; }
  .stat-cards { grid-template-columns: 1fr; }
  .chips { gap: .35rem; }
  .chip { padding: .4rem .75rem; font-size: .78rem; }
  .hero__badge { font-size: .76rem; padding: .35rem .75rem; }
  .tool-card { padding: 1.1rem; }
  .footer-bottom { flex-direction: column; text-align: center; gap: .6rem; }
}

@media (min-width: 1920px) {
  .container { width: min(1560px, 100% - 4rem); }
  .container--narrow { width: min(1060px, 100% - 4rem); }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.3rem; }
}

/* print */
@media print {
  .site-header, .site-footer, .toasts, .ad-slot, .nav-backdrop { display: none !important; }
}
