/* =====================================================================
   QuickTools — Design System & Components
   Fast. Free. Powerful.
   ===================================================================== */

/* ----------------------------- Tokens ------------------------------ */
:root {
  --primary: #4F46E5;
  --primary-rgb: 79, 70, 229;
  --secondary: #7C3AED;
  --accent: #06B6D4;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;

  --bg: #F8FAFC;
  --bg-soft: #EEF2F7;
  --surface: #FFFFFF;
  --surface-2: #FFFFFF;
  --border: #E5E9F0;
  --border-strong: #D5DBE6;

  --text: #0F172A;
  --text-muted: #64748B;
  --text-soft: #94A3B8;

  --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 55%, var(--accent) 130%);
  --gradient-soft: linear-gradient(135deg, rgba(79,70,229,.12), rgba(124,58,237,.12) 60%, rgba(6,182,212,.12));

  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-xs: 0 1px 2px rgba(15,23,42,.06);
  --shadow-sm: 0 4px 14px rgba(15,23,42,.06);
  --shadow: 0 10px 30px rgba(15,23,42,.08);
  --shadow-lg: 0 24px 60px rgba(15,23,42,.12);
  --shadow-glow: 0 18px 50px rgba(var(--primary-rgb), .28);

  --header-h: 70px;

  --font-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-head: 'Plus Jakarta Sans', var(--font-body);

  --ease: cubic-bezier(.22, 1, .36, 1);
}

[data-theme="dark"] {
  --bg: #0B1120;
  --bg-soft: #0F172A;
  --surface: #111A2E;
  --surface-2: #16213B;
  --border: #1F2A44;
  --border-strong: #2A3856;

  --text: #E8EDF6;
  --text-muted: #93A0B8;
  --text-soft: #64748B;

  --gradient-soft: linear-gradient(135deg, rgba(79,70,229,.22), rgba(124,58,237,.18) 60%, rgba(6,182,212,.18));
  --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
  --shadow-sm: 0 4px 14px rgba(0,0,0,.35);
  --shadow: 0 12px 34px rgba(0,0,0,.45);
  --shadow-lg: 0 30px 70px rgba(0,0,0,.55);
}

/* ----------------------------- Base -------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .35s var(--ease), color .35s var(--ease);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, .h-display {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--secondary); }

.container-x { max-width: 1240px; margin-inline: auto; padding-inline: 20px; }
.text-grad {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.muted { color: var(--text-muted); }
.section { padding: 84px 0; }
.section-sm { padding: 54px 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--primary); background: var(--gradient-soft);
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
}
.section-head { max-width: 680px; margin: 0 auto 44px; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 16px 0 12px; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; margin: 0; }

::selection { background: rgba(var(--primary-rgb), .22); }

/* --------------------------- Buttons ------------------------------- */
.btn { border-radius: 999px; font-weight: 600; padding: .62rem 1.25rem; border: none; transition: transform .2s var(--ease), box-shadow .25s, background .25s, color .2s; }
.btn:active { transform: scale(.97); }
.btn-grad { background: var(--gradient); color: #fff; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.btn-grad:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn-soft { background: var(--gradient-soft); color: var(--primary); border: 1px solid var(--border); }
.btn-soft:hover { color: var(--secondary); transform: translateY(-1px); }
.btn-icon { width: 42px; height: 42px; display: inline-grid; place-items: center; padding: 0; }
.btn-lg { padding: .8rem 1.6rem; font-size: 1.02rem; }

/* Ripple */
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.5); animation: ripple .6s linear; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------------------------- Navbar ------------------------------- */
.qt-nav {
  position: sticky; top: 0; z-index: 1030;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex; align-items: center;
}
.qt-nav .container-x { display: flex; align-items: center; gap: 18px; width: 100%; }
.qt-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; color: var(--text); }
.qt-logo .mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--gradient);
  display: grid; place-items: center; color: #fff; font-size: 1.05rem; box-shadow: var(--shadow-glow);
}
.qt-logo:hover { color: var(--text); }
.qt-nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.qt-nav-links a, .qt-nav-links .qt-mega-trigger {
  padding: 9px 14px; border-radius: 11px; color: var(--text-muted); font-weight: 600; font-size: .94rem;
  background: transparent; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.qt-nav-links a:hover, .qt-nav-links .qt-mega-trigger:hover { color: var(--primary); background: var(--gradient-soft); }
.qt-nav-spacer { flex: 1; }
.qt-searchbtn {
  display: flex; align-items: center; gap: 10px; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-soft);
  padding: 9px 12px; border-radius: 12px; cursor: pointer; font-size: .9rem; transition: border-color .2s, box-shadow .2s;
}
.qt-searchbtn:hover { border-color: var(--primary); box-shadow: var(--shadow-xs); }
.qt-searchbtn kbd {
  margin-left: auto; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px;
  padding: 1px 7px; font-size: .72rem; color: var(--text-muted); font-family: var(--font-body);
}
.qt-iconbtn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); display: grid; place-items: center; cursor: pointer; transition: all .2s;
}
.qt-iconbtn:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }
.qt-burger { display: none; }

/* Mega menu */
.qt-mega-wrap { position: relative; }
.qt-mega {
  position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%) translateY(8px);
  width: min(860px, 92vw); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 18px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  opacity: 0; visibility: hidden; transition: opacity .22s var(--ease), transform .22s var(--ease); z-index: 1040;
}
.qt-mega-wrap:hover .qt-mega, .qt-mega.open { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.qt-mega a {
  display: flex; gap: 12px; padding: 12px; border-radius: var(--radius-sm); color: var(--text); align-items: flex-start;
}
.qt-mega a:hover { background: var(--bg-soft); color: var(--text); }
.qt-mega .mi {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none;
  color: #fff; font-size: 1.05rem;
}
.qt-mega .mt { font-weight: 700; font-size: .95rem; }
.qt-mega .md { font-size: .8rem; color: var(--text-muted); }

/* Mobile drawer */
.qt-drawer {
  position: fixed; inset: 0 0 0 auto; width: min(330px, 86vw); background: var(--surface);
  border-left: 1px solid var(--border); transform: translateX(100%); transition: transform .32s var(--ease);
  z-index: 1060; padding: 20px; overflow-y: auto;
}
.qt-drawer.open { transform: translateX(0); }
.qt-drawer a { display: block; padding: 12px 14px; border-radius: 12px; color: var(--text); font-weight: 600; }
.qt-drawer a:hover { background: var(--bg-soft); color: var(--text); }
.qt-overlay { position: fixed; inset: 0; background: rgba(2,6,23,.5); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: .3s; z-index: 1050; }
.qt-overlay.open { opacity: 1; visibility: visible; }

/* ----------------------------- Hero -------------------------------- */
.hero { position: relative; padding: 70px 0 56px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: float 14s ease-in-out infinite; }
.blob.b1 { width: 460px; height: 460px; background: rgba(79,70,229,.45); top: -160px; left: -120px; }
.blob.b2 { width: 420px; height: 420px; background: rgba(124,58,237,.4); top: -80px; right: -120px; animation-delay: -4s; }
.blob.b3 { width: 380px; height: 380px; background: rgba(6,182,212,.32); bottom: -180px; left: 30%; animation-delay: -8s; }
@keyframes float { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-26px) scale(1.06); } }
.hero h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); line-height: 1.05; margin: 22px 0 18px; }
.hero p.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--text-muted); max-width: 640px; margin-inline: auto; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.hero-search { max-width: 640px; margin: 30px auto 0; position: relative; }
.hero-search input {
  width: 100%; padding: 18px 20px 18px 54px; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 1.05rem; box-shadow: var(--shadow); outline: none; transition: border-color .2s, box-shadow .2s;
}
.hero-search input:focus { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.hero-search .si { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--text-soft); font-size: 1.2rem; }
.hero-tags { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.hero-tags a { font-size: .85rem; padding: 6px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-weight: 600; }
.hero-tags a:hover { border-color: var(--primary); color: var(--primary); }

/* --------------------------- Stats --------------------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px 22px; text-align: center; box-shadow: var(--shadow-sm); }
.stat-card .n { font-family: var(--font-head); font-weight: 800; font-size: 2.2rem; line-height: 1; }
.stat-card .l { color: var(--text-muted); font-weight: 600; margin-top: 8px; font-size: .92rem; }
.stat-card .ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin: 0 auto 14px; color: #fff; font-size: 1.2rem; }

/* ------------------------- Category cards -------------------------- */
.cat-grid, .tool-grid { display: grid; gap: 18px; }
.cat-grid { grid-template-columns: repeat(3, 1fr); }
.tool-grid { grid-template-columns: repeat(4, 1fr); }

.card-base {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: transform .28s var(--ease), box-shadow .3s, border-color .3s; position: relative; overflow: hidden;
}
.card-base::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx,50%) var(--my,0%), rgba(var(--primary-rgb), .12), transparent 45%);
  pointer-events: none;
}
.card-base:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.card-base:hover::after { opacity: 1; }

.cat-card { padding: 26px; display: block; color: var(--text); }
.cat-card:hover { color: var(--text); }
.cat-card .ic { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; color: #fff; font-size: 1.4rem; margin-bottom: 16px; }
.cat-card h3 { font-size: 1.2rem; margin: 0 0 6px; }
.cat-card p { color: var(--text-muted); font-size: .92rem; margin: 0 0 14px; }
.cat-card .count { font-size: .82rem; font-weight: 700; color: var(--primary); display: inline-flex; align-items: center; gap: 6px; }

.tool-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--text); }
.tool-card:hover { color: var(--text); }
.tool-card .top { display: flex; align-items: center; gap: 12px; }
.tool-card .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 1.1rem; flex: none; }
.tool-card h3 { font-size: 1.02rem; margin: 0; }
.tool-card p { color: var(--text-muted); font-size: .86rem; margin: 0; flex: 1; }
.tool-card .meta { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.tool-card .badge-cat { font-size: .72rem; font-weight: 700; color: var(--text-muted); background: var(--bg-soft); padding: 4px 10px; border-radius: 999px; }
.tool-card .go { color: var(--primary); font-weight: 700; font-size: .82rem; }
.fav-star { background: none; border: none; color: var(--text-soft); cursor: pointer; font-size: 1.05rem; padding: 4px; transition: color .2s, transform .2s; }
.fav-star:hover { transform: scale(1.2); color: var(--warning); }
.fav-star.active { color: var(--warning); }

.badge-new { font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: var(--success); padding: 3px 8px; border-radius: 999px; }
.badge-hot { background: var(--danger); }

/* tint helpers */
.t-indigo { background: linear-gradient(135deg,#4F46E5,#6366F1); }
.t-violet { background: linear-gradient(135deg,#7C3AED,#A855F7); }
.t-cyan   { background: linear-gradient(135deg,#06B6D4,#22D3EE); }
.t-green  { background: linear-gradient(135deg,#10B981,#34D399); }
.t-amber  { background: linear-gradient(135deg,#F59E0B,#FBBF24); }
.t-rose   { background: linear-gradient(135deg,#EF4444,#F472B6); }
.t-slate  { background: linear-gradient(135deg,#475569,#64748B); }

/* --------------------------- Why / Feature ------------------------- */
.feature-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.feature .ic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 1.25rem; margin-bottom: 16px; }
.feature h3 { font-size: 1.12rem; margin: 0 0 8px; }
.feature p { color: var(--text-muted); margin: 0; font-size: .94rem; }

/* --------------------------- Testimonials -------------------------- */
.tst-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.tst { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.tst .stars { color: var(--warning); margin-bottom: 12px; }
.tst p { font-size: .98rem; }
.tst .who { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.tst .av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; }
.tst .who b { display: block; font-size: .92rem; }
.tst .who span { font-size: .8rem; color: var(--text-muted); }

/* ----------------------------- FAQ --------------------------------- */
.faq { max-width: 780px; margin-inline: auto; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; overflow: hidden; }
.faq-q { width: 100%; text-align: left; background: none; border: none; padding: 20px 22px; font-weight: 700; font-size: 1.02rem; color: var(--text); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq-q i { transition: transform .3s var(--ease); color: var(--primary); }
.faq-item.open .faq-q i { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s var(--ease); }
.faq-a div { padding: 0 22px 20px; color: var(--text-muted); }

/* --------------------------- Newsletter ---------------------------- */
.news {
  background: var(--gradient); border-radius: var(--radius-xl); padding: 54px 40px; text-align: center; color: #fff; position: relative; overflow: hidden;
}
.news::before { content:''; position:absolute; inset:0; background: radial-gradient(600px circle at 80% -20%, rgba(255,255,255,.25), transparent 50%); }
.news h2 { color: #fff; font-size: clamp(1.6rem,3vw,2.3rem); position: relative; }
.news p { color: rgba(255,255,255,.86); max-width: 520px; margin: 12px auto 26px; position: relative; }
.news-form { display: flex; gap: 10px; max-width: 480px; margin-inline: auto; position: relative; flex-wrap: wrap; }
.news-form input { flex: 1; min-width: 200px; padding: 15px 18px; border-radius: 999px; border: none; outline: none; font-size: 1rem; }
.news-form button { background: #0B1120; color: #fff; padding: 15px 26px; border-radius: 999px; border: none; font-weight: 700; cursor: pointer; transition: transform .2s; }
.news-form button:hover { transform: translateY(-2px); }

/* ---------------------------- Footer ------------------------------- */
.qt-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 60px 0 28px; margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; }
.foot-brand p { color: var(--text-muted); font-size: .92rem; max-width: 280px; margin: 14px 0 18px; }
.foot-social { display: flex; gap: 10px; }
.foot-social a { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-muted); }
.foot-social a:hover { color: #fff; background: var(--gradient); border-color: transparent; }
.foot-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-soft); margin: 6px 0 16px; }
.foot-col a { display: block; color: var(--text-muted); font-size: .92rem; padding: 5px 0; }
.foot-col a:hover { color: var(--primary); }
.foot-bottom { border-top: 1px solid var(--border); margin-top: 40px; padding-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--text-muted); font-size: .88rem; }

/* --------------------------- Search modal -------------------------- */
.qt-search-modal { position: fixed; inset: 0; z-index: 1080; display: none; }
.qt-search-modal.open { display: block; }
.qt-search-modal .ov { position: absolute; inset: 0; background: rgba(2,6,23,.6); backdrop-filter: blur(5px); }
.qt-search-box {
  position: relative; max-width: 640px; margin: 9vh auto 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .3s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
.qt-search-input { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.qt-search-input i { color: var(--text-soft); font-size: 1.2rem; }
.qt-search-input input { flex: 1; border: none; background: none; outline: none; font-size: 1.1rem; color: var(--text); }
.qt-search-input kbd { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; font-size: .74rem; color: var(--text-muted); }
.qt-search-results { max-height: 56vh; overflow-y: auto; padding: 8px; }
.qt-sr {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text);
}
.qt-sr:hover, .qt-sr.active { background: var(--gradient-soft); }
.qt-sr .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none; }
.qt-sr b { font-size: .96rem; }
.qt-sr span { font-size: .8rem; color: var(--text-muted); }
.qt-sr .cat { margin-left: auto; font-size: .74rem; color: var(--text-muted); background: var(--bg-soft); padding: 3px 10px; border-radius: 999px; }
.qt-search-empty { padding: 40px; text-align: center; color: var(--text-muted); }

/* ----------------------------- Toasts ------------------------------ */
.qt-toasts { position: fixed; bottom: 24px; right: 24px; z-index: 1090; display: flex; flex-direction: column; gap: 10px; }
.qt-toast {
  display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 360px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); animation: toastIn .35s var(--ease); color: var(--text);
}
.qt-toast.out { animation: toastOut .35s var(--ease) forwards; }
.qt-toast.success { border-left-color: var(--success); }
.qt-toast.error { border-left-color: var(--danger); }
.qt-toast.warn { border-left-color: var(--warning); }
.qt-toast i { font-size: 1.2rem; }
.qt-toast.success i { color: var(--success); }
.qt-toast.error i { color: var(--danger); }
.qt-toast.warn i { color: var(--warning); }
.qt-toast.info i { color: var(--primary); }
.qt-toast b { font-size: .92rem; }
.qt-toast span { font-size: .82rem; color: var(--text-muted); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ---------------------------- Back to top -------------------------- */
.qt-totop {
  position: fixed; bottom: 24px; left: 24px; width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); color: var(--primary); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(12px); transition: .3s; z-index: 1040;
}
.qt-totop.show { opacity: 1; visibility: visible; transform: translateY(0); }
.qt-fab {
  position: fixed; bottom: 80px; left: 24px; padding: 12px 18px; border-radius: 999px; border: none;
  background: var(--gradient); color: #fff; font-weight: 700; box-shadow: var(--shadow-glow); cursor: pointer; z-index: 1040;
  display: flex; align-items: center; gap: 8px; transition: transform .2s;
}
.qt-fab:hover { transform: translateY(-2px); }

/* --------------------------- Tool pages ---------------------------- */
.tool-hero { padding: 30px 0 6px; }
.breadcrumb-x { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-muted); flex-wrap: wrap; margin-bottom: 18px; }
.breadcrumb-x a { color: var(--text-muted); }
.breadcrumb-x a:hover { color: var(--primary); }
.breadcrumb-x .sep { color: var(--text-soft); }
.tool-head { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.tool-head .tic { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-size: 1.5rem; flex: none; box-shadow: var(--shadow-glow); }
.tool-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 6px; }
.tool-head p { color: var(--text-muted); margin: 0; max-width: 640px; }
.tool-head .hbtns { margin-left: auto; display: flex; gap: 8px; }

.workspace { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 24px; margin-top: 24px; }
.ws-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ws-panel { display: flex; flex-direction: column; gap: 10px; }
.ws-label { font-weight: 700; font-size: .9rem; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ws-label .cc { font-weight: 500; color: var(--text-muted); font-size: .82rem; }

textarea.ws, input.ws, select.ws {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
  padding: 14px 16px; font-size: .96rem; outline: none; transition: border-color .2s, box-shadow .2s; font-family: inherit;
}
textarea.ws { min-height: 220px; resize: vertical; line-height: 1.6; }
textarea.ws:focus, input.ws:focus, select.ws:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .15); }
.ws-mono { font-family: 'SF Mono', ui-monospace, 'Cascadia Code', Menlo, monospace; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.toolbar .grow { flex: 1; }

.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 40px 24px; text-align: center;
  background: var(--bg-soft); cursor: pointer; transition: border-color .25s, background .25s; color: var(--text-muted);
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--gradient-soft); color: var(--primary); }
.dropzone .di { font-size: 2.4rem; color: var(--primary); margin-bottom: 10px; }
.dropzone b { color: var(--text); }

.privacy-note {
  display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--success) 10%, transparent); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
  color: var(--success); font-size: .86rem; font-weight: 600;
}

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 7px; }
.range-row { display: flex; align-items: center; gap: 14px; }
.range-row input[type=range] { flex: 1; accent-color: var(--primary); }
.range-val { min-width: 64px; text-align: right; font-weight: 700; color: var(--primary); }

.result-box { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.result-big { font-family: var(--font-head); font-weight: 800; font-size: 2.2rem; color: var(--primary); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: .85rem; font-weight: 600; cursor: pointer; transition: .2s; }
.chip:hover, .chip.active { border-color: var(--primary); color: var(--primary); background: var(--gradient-soft); }

.related { margin-top: 30px; }

/* --------------------------- Page header band ---------------------- */
.page-band { background: var(--gradient-soft); border-bottom: 1px solid var(--border); padding: 40px 0; }
.page-band h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 30px; }

/* ---------------------------- Reveal ------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ----------------------------- Skeleton ---------------------------- */
.skeleton { background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border) 37%, var(--bg-soft) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------- Utilities ---------------------------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hidden { display: none !important; }
.mt-30 { margin-top: 30px; }

/* --------------------------- Responsive ---------------------------- */
@media (max-width: 992px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid, .feature-grid, .tst-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .qt-nav-links, .qt-searchbtn { display: none; }
  .qt-burger { display: grid; }
  .qt-searchbtn.mobile-show { display: none; }
}
@media (max-width: 680px) {
  .section { padding: 56px 0; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .cat-grid, .feature-grid, .tst-grid, .stats-grid, .grid-2, .ws-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .tool-head .hbtns { margin-left: 0; width: 100%; }
  .qt-toasts { left: 16px; right: 16px; bottom: 16px; }
  .qt-toast { max-width: none; }
}
@media (max-width: 420px) {
  .tool-grid { grid-template-columns: 1fr; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .blob { animation: none; }
}

/* focus visibility */
:focus-visible { outline: 3px solid rgba(var(--primary-rgb), .5); outline-offset: 2px; border-radius: 6px; }
