@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Design tokens (matches Next.js globals.css) ──────── */
:root {
  --bg:           #f4f7fb;
  --surface:      #ffffff;
  --border:       #dbe3ee;
  --input-border: #ccd7e5;
  --text:         #10213f;
  --muted:        #64748b;
  --primary:      #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light:#eaf1ff;
  --secondary:    #eaf1ff;
  --site-chrome-bg: rgba(255,255,255,0.92);
  --site-chrome-border: var(--border);
  --radius:       0.75rem;
  --shadow:       0 1px 3px rgba(16,33,63,0.07), 0 1px 2px rgba(16,33,63,0.05);
  --shadow-md:    0 14px 34px rgba(30,55,90,0.07);
  --shadow-hover: 0 16px 36px rgba(30,64,175,0.13), 0 2px 8px rgba(30,64,175,0.07);
  --shadow-input: 0 1px 2px rgba(16,33,63,0.06), 0 1px 3px rgba(16,33,63,0.10);

  /* Legacy aliases - some tool templates (ask-pdf, youtube-summarizer) still
     reference these old names. Without them their inputs render borderless. */
  --color-bg:           var(--bg);
  --color-surface:      var(--surface);
  --color-border:       var(--border);
  --color-input-border: var(--input-border);
  --color-fg:           var(--text);
  --color-text:         var(--text);
  --color-muted:        var(--muted);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }

/* ── Visible textboxes everywhere ─────────────────────────────────────────
   Every text entry control gets a clear border + soft shadow so it visibly
   separates from the page/card it sits on. File/checkbox/radio/range/color
   inputs and buttons are excluded on purpose. Page-level styles (contact,
   admin, tool-specific) can override, they only need to keep a visible box. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]),
textarea,
select {
  border: 1.5px solid var(--input-border);
  border-radius: 0.6rem;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-input);
  transition: border-color 150ms, box-shadow 150ms;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 24%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

/* Card container - used across tool and content pages to lift content off
   the page background. */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ── Header ───────────────────────────────────────────── */
header.site {
  background: var(--site-chrome-bg);
  border-bottom: 1px solid var(--site-chrome-border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
}
header.site .bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; min-height: 68px; max-width: 1180px; margin: 0 auto;
}
header.site .brand {
  display: flex; align-items: center;
  color: var(--text); text-decoration: none; flex: none;
}
header.site .brand:hover { text-decoration: none; }
header.site .brand picture { display: flex; line-height: 0; }
.brand-logo {
  display: block; width: auto; height: 38px;
  max-width: min(200px, 38vw); object-fit: contain;
}
/* Keep the primary blue/red brand logo visible in both themes. */
.brand-logo-dark  { display: none; }
.brand-logo-light { display: block; }
html.dark .brand-logo-light { display: block; }
html.dark .brand-logo-dark  { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .brand-logo-light { display: block; }
  html:not([data-theme="light"]) .brand-logo-dark  { display: none; }
}

/* Theme toggle button */
.theme-toggle {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer;
  transition: background 150ms, border-color 150ms, color 150ms;
  flex: none;
}
.theme-toggle:hover { background: var(--bg); color: var(--text); border-color: var(--primary); }
/* Sun shown only in dark mode, moon only in light mode */
.icon-sun  { display: none; }
.icon-moon { display: block; }
html.dark .icon-sun  { display: block; }
html.dark .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .icon-sun  { display: block; }
  html:not([data-theme="light"]) .icon-moon { display: none; }
}
.site-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex: 1 1 auto; min-width: 0; margin-left: 38px;
}
.nav-topic-list,
.nav-action-list,
.nav-account-actions {
  display: inline-flex; align-items: center; min-width: 0;
}
.nav-topic-list { gap: 3px; }
.nav-action-list { gap: 8px; flex: none; }
.nav-account-actions { gap: 8px; }
header.site nav a {
  color: var(--muted); font-size: 0.875rem; font-weight: 500;
  padding: 8px 10px; border-radius: 8px; line-height: 1.2;
  transition: color 120ms, background 120ms;
}
header.site nav a:hover { color: var(--text); background: var(--bg); text-decoration: none; }
header.site .btn-nav-login {
  background: var(--primary); color: #fff !important;
  padding: 9px 16px; border-radius: 8px; font-weight: 700; font-size: 0.875rem;
  transition: background 150ms, box-shadow 150ms;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
header.site .btn-nav-login:hover { background: var(--primary-dark); text-decoration: none; }
/* ── Language picker ───────────────────────────────────── */
.lang-picker { position: relative; flex: none; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 9px;
  background: var(--surface); color: var(--text); font-size: 0.85rem;
  cursor: pointer; white-space: nowrap; line-height: 1;
}
.lang-btn:hover { background: var(--bg); }
.flag-img { width: 1.15em; height: .77em; vertical-align: middle; border-radius: 1px; object-fit: cover; }
.lang-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 5px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.13);
  z-index: 200; min-width: 190px; max-height: 340px; overflow-y: auto;
  padding: 4px;
}
.lang-menu.open { display: block; }
.lang-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px; border-radius: 6px;
  color: var(--text); text-decoration: none; font-size: 0.88rem; cursor: pointer;
}
.lang-opt:hover { background: var(--bg); }
.lang-opt.selected { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* ── Header nav extras ─────────────────────────────────── */
.btn-nav-tools {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: 9px 15px; border-radius: 8px;
  font-size: .875rem; font-weight: 700;
  color: #fff !important;
  background: var(--primary);
  border: 1px solid var(--primary);
  text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s;
  box-shadow: 0 7px 18px rgba(37,99,235,0.18);
}
.btn-nav-tools:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 9px 22px rgba(37,99,235,0.24);
  text-decoration: none;
}
.btn-donate-nav {
  color: var(--muted) !important;
  font-weight: 600;
}
.btn-donate-nav:hover { color: var(--text) !important; background: var(--bg); }
.nav-credits {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .85rem; font-weight: 700; color: var(--primary) !important;
  text-decoration: none; padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 38%, transparent); border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 7%, transparent);
}
.nav-credits:hover { background: color-mix(in srgb,var(--primary) 12%,transparent); }
.nav-logout-form { display: inline-flex; margin: 0; }
.btn-nav-logout {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; font-size: .875rem; font-weight: 700;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-nav-logout:hover { background: var(--bg); border-color: var(--input-border); }
/* ── User avatar in header ─────────────────────────────── */
.user-area {
  position: relative; display: inline-flex; align-items: center; gap: .5rem; flex: none;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border); cursor: pointer;
  flex: 0 0 auto;
}
.user-initials {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary); font-weight: 600; font-size: .85rem;
  flex: 0 0 auto; text-transform: uppercase;
}
.user-avatar-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px; min-width: 132px; box-shadow: var(--shadow-md);
  z-index: 210;
}
.user-avatar-dropdown p {
  margin: 0 0 6px; padding: 0 6px; font-size: .76rem; color: var(--muted);
}
.user-avatar-dropdown a {
  display: block; width: 100%; padding: 8px 10px; font-size: .85rem;
  color: var(--text); text-decoration: none; border-radius: 6px;
}
.user-avatar-dropdown a:hover { background: var(--bg); text-decoration: none; }

/* ── Hero ─────────────────────────────────────────────── */
.hero-band {
  position: relative;
  border-bottom: 1px solid rgba(99,102,241,0.12);
  background:
    radial-gradient(50rem 28rem at 10% -5%, rgba(96,165,250,0.25) 0%, transparent 60%),
    radial-gradient(40rem 22rem at 94% 2%, rgba(167,139,250,0.22) 0%, transparent 62%),
    linear-gradient(180deg, #eef4ff 0%, #f6f8ff 55%, var(--bg) 100%);
  padding: 80px 0 64px;
  text-align: center;
}
.hero-orb {
  position: absolute; border-radius: 999px; filter: blur(50px);
  opacity: 0.45; pointer-events: none;
  animation: hero-float 9s ease-in-out infinite;
}
.hero-orb-1 { top: -5rem; left: -2rem; width: 18rem; height: 18rem; background: #93c5fd; }
.hero-orb-2 { top: 1rem; right: -3rem; width: 22rem; height: 22rem; background: #c4b5fd; animation-delay: -3s; }
@keyframes hero-float {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(0,-1.2rem,0) scale(1.04); }
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(79,70,229,0.2);
  border-radius: 999px;
  background: rgba(255,255,255,0.8);
  box-shadow: 0 8px 24px rgba(67,56,202,0.10);
  backdrop-filter: blur(8px);
  padding: 5px 14px 5px 10px;
  font-size: 0.78rem; font-weight: 800; color: #4338ca;
  letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 24px;
}
.hero-kicker-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #6d28d9);
}
.hero-band h1 {
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  font-weight: 900; letter-spacing: -0.03em; line-height: 1.06;
  margin: 0 auto 18px; max-width: 760px;
}
.hero-gradient-text {
  background: linear-gradient(92deg, #2563eb 0%, #6d28d9 52%, #e11d48 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  color: var(--muted); font-size: 1.1rem;
  max-width: 560px; margin: 0 auto 36px; line-height: 1.75;
}
.hero-actions {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 44px;
}
.btn-hero-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 0.95rem;
  padding: 13px 26px; border-radius: 10px;
  box-shadow: 0 6px 18px rgba(37,99,235,0.38);
  transition: background 150ms, transform 150ms, box-shadow 150ms;
}
.btn-hero-primary:hover {
  background: var(--primary-dark); transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(37,99,235,0.45); text-decoration: none; color: #fff;
}
.btn-hero-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.9); color: var(--text); font-weight: 600; font-size: 0.95rem;
  padding: 13px 26px; border-radius: 10px; border: 1.5px solid var(--border);
  box-shadow: 0 10px 24px rgba(30,64,175,0.07);
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.btn-hero-secondary:hover {
  border-color: #818cf8; box-shadow: 0 6px 18px rgba(99,102,241,0.15);
  transform: translateY(-2px); text-decoration: none; color: var(--text);
}
.trust-bar {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 28px;
  color: var(--muted); font-size: 0.83rem;
}
.trust-bar span { display: flex; align-items: center; gap: 6px; }
.trust-bar svg { color: #16a34a; flex: none; }

/* ── Tool grid (home page) ────────────────────────────── */
main.page { padding: 40px 0 80px; }

.category-label {
  text-transform: uppercase; letter-spacing: 0.09em;
  font-size: 0.7rem; font-weight: 800; color: var(--muted);
  margin: 48px 0 14px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px; margin-bottom: 8px;
}
.tool-card {
  display: flex; align-items: flex-start; gap: 14px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  color: var(--text); text-decoration: none;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
  position: relative;
}
.tool-card:hover {
  border-color: #60a5fa; box-shadow: var(--shadow-hover);
  transform: translateY(-2px); text-decoration: none;
}
.tool-card .tool-icon {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
}
.tool-svg-icon { width: 22px; height: 22px; display: block; }
.tool-card-body { flex: 1; min-width: 0; }
.tool-card-body h3 { margin: 0 0 4px; font-size: 0.95rem; font-weight: 800; line-height: 1.25; }
.tool-card-body p  { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.55; }
.tool-card-arrow {
  flex: none; color: var(--border); margin-top: 2px;
  transition: color 150ms, transform 150ms;
}
.tool-card:hover .tool-card-arrow { color: var(--primary); transform: translateX(3px); }

/* ── Premium stamp ────────────────────────────────────── */
.badge-premium {
  position: absolute;
  top: 10px; right: -6px;
  background: #dc2626;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  transform: rotate(12deg);
  box-shadow: 0 2px 6px rgba(220,38,38,0.45);
  pointer-events: none;
  line-height: 1.6;
  white-space: nowrap;
}
/* Notched ribbon tail */
.badge-premium::before {
  content: '';
  position: absolute;
  left: -5px; top: 0; bottom: 0;
  width: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 5px solid #dc2626;
}
/* ── Free stamp ──────────────────────────────────────── */
.badge-free {
  position: absolute;
  top: 10px; right: -6px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  transform: rotate(12deg);
  box-shadow: 0 2px 8px rgba(16,185,129,0.45), 0 0 12px rgba(6,182,212,0.25);
  pointer-events: none;
  line-height: 1.6;
  white-space: nowrap;
  animation: free-shine 2.5s ease-in-out infinite;
}
.badge-free::before {
  content: '';
  position: absolute;
  left: -5px; top: 0; bottom: 0;
  width: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 5px solid #10b981;
}
@keyframes free-shine {
  0%, 100% { box-shadow: 0 2px 8px rgba(16,185,129,0.45), 0 0 12px rgba(6,182,212,0.25); }
  50%      { box-shadow: 0 2px 12px rgba(16,185,129,0.7), 0 0 20px rgba(6,182,212,0.45); }
}
/* ── Shared buttons ───────────────────────────────────── */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px;
  background: var(--primary); color: #fff; border: none;
  font-size: 0.93rem; font-weight: 600; cursor: pointer; transition: background 150ms;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--bg); }

/* ── Tool page ────────────────────────────────────────── */
.tool-hero-block {
  display: flex; align-items: center; gap: 20px; margin-bottom: 32px;
}
.tool-hero-icon {
  flex: none; width: 58px; height: 58px; border-radius: 16px;
  display: grid; place-items: center;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
}
.tool-hero-icon .tool-svg-icon { width: 30px; height: 30px; }
.tool-hero-block h1 { font-size: 1.85rem; margin: 0 0 6px; font-weight: 800; letter-spacing: -0.02em; }
.tool-hero-block p  { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }

.tool-form-card {
  background: rgba(255,255,255,0.93);
  border: 1px solid var(--border); border-radius: 1rem;
  box-shadow: var(--shadow-md); padding: 32px;
  max-width: 680px; margin: 0 auto 40px;
}
.tool-form-card.has-page-workspace { max-width: 980px; }

/* Dropzone */
.dropzone-area {
  border: 2px dashed #a5b4fc; border-radius: 12px;
  background: #f8faff; margin-bottom: 24px;
  transition: border-color 150ms, background 150ms; overflow: hidden;
}
.dropzone-area.drag-over { border-color: var(--primary); background: var(--primary-light); }
.dropzone-inner {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 44px 20px; text-align: center; gap: 10px;
}
.dropzone-icon { color: #818cf8; margin-bottom: 4px; }
.dropzone-title { font-weight: 700; font-size: 1rem; margin: 0; color: var(--text); }
.dropzone-sub   { font-size: 0.82rem; color: var(--muted); margin: 0; }
.btn-upload {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 6px;
  padding: 10px 20px; background: var(--primary); color: #fff; border-radius: 8px;
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 12px rgba(37,99,235,0.28); transition: background 150ms, transform 150ms;
}
.btn-upload:hover { background: var(--primary-dark); transform: translateY(-1px); }
.file-input-hidden { display: none; }
.dropzone-filelist { padding: 0 16px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.dz-file-row {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; min-width: 0; max-width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: 0.85rem;
}
.dz-file-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-file-row small { color: var(--muted); flex: none; }
.dz-file-row svg { color: #818cf8; flex: none; }
.dz-file-remove {
  width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--muted); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; flex: none; transition: color 150ms, border-color 150ms, background 150ms;
}
.dz-file-remove:hover { color: #dc2626; border-color: rgba(220,38,38,0.35); background: rgba(220,38,38,0.07); }
.dz-file-remove svg { width: 15px; height: 15px; color: currentColor; }

/* Page workspace */
.page-workspace {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  margin: 0 0 24px;
  overflow: hidden;
}
.page-workspace.is-hidden { display: none; }
.page-workspace-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.page-workspace-head h2 {
  margin: 0 0 4px; font-size: 1rem; line-height: 1.3; font-weight: 800;
}
.page-workspace-head p {
  margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.55;
}
.page-workspace-reset {
  flex: none; padding: 8px 12px; font-size: 0.82rem;
}
.page-workspace-status {
  padding: 12px 18px 0;
  color: var(--muted); font-size: 0.84rem;
}
.page-workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  padding: 14px 18px 18px;
}
.page-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8faff;
  padding: 8px;
  cursor: grab;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.page-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(30,64,175,0.11);
}
.page-card.is-dragging {
  cursor: grabbing;
  opacity: 0.58;
  transform: scale(0.98);
}
.page-card-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 7px;
}
.page-card-top span {
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--primary); color: #fff;
  font-size: 0.76rem; font-weight: 800;
}
.page-card-top small {
  color: var(--muted); font-size: 0.76rem; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}
.page-card-preview {
  display: grid; place-items: center;
  height: 150px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #eef2f7 25%, transparent 25%),
    linear-gradient(-45deg, #eef2f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef2f7 75%),
    linear-gradient(-45deg, transparent 75%, #eef2f7 75%);
  background-color: #ffffff;
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  overflow: hidden;
}
.page-card-preview img {
  display: block;
  max-width: 86%;
  max-height: 86%;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(15,23,42,0.22);
  transition: transform 150ms;
}
.page-card-name {
  margin: 7px 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.page-card-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.page-action-btn {
  display: grid; place-items: center;
  width: 100%; height: 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.page-action-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: #93c5fd;
  background: #eef4ff;
}
.page-action-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.page-action-btn svg { width: 15px; height: 15px; }

/* Options */
.tool-options { margin-bottom: 24px; display: grid; gap: 4px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 0.875rem; margin-bottom: 6px; color: var(--text); }
.field input[type=text], .field input[type=password], .field input[type=number],
.field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--input-border); border-radius: 0.75rem;
  font-size: 0.875rem; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-input);
  transition: border-color 150ms, box-shadow 150ms; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 24%, transparent);
}
.field .hint { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* Submit */
.btn-submit {
  display: block; width: 100%; padding: 14px;
  background: var(--primary); color: #fff; border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px rgba(37,99,235,0.32);
  transition: background 150ms, transform 150ms, box-shadow 150ms;
}
.btn-submit:hover {
  background: var(--primary-dark); transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37,99,235,0.42);
}

.error-banner {
  background: #fef2f2; color: #991b1b; border: 1px solid #fecaca;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 18px; font-size: 0.88rem;
}

/* Tool about section */
.tool-about-section { max-width: 680px; margin: 0 auto 40px; }
.tool-about-section .section-heading { text-align: left; }
.tool-about-text {
  color: var(--muted); font-size: 0.95rem; line-height: 1.75;
  margin: 0; padding: 20px 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px;
}

/* Home why-section */
.home-why-section {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 56px 0;
}
.home-why-title {
  font-size: 1.75rem; font-weight: 900; text-align: center;
  letter-spacing: -0.03em; margin: 0 0 10px;
}
.home-why-sub {
  text-align: center; color: var(--muted); font-size: 0.95rem;
  max-width: 520px; margin: 0 auto 40px;
}
.home-why-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.home-why-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px 22px;
}
.home-why-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #2563eb22, #6366f122);
  color: #2563eb; display: grid; place-items: center;
  margin-bottom: 14px;
}
html.dark .home-why-icon { color: #60a5fa; }
.home-why-card h3 { font-size: 0.95rem; font-weight: 800; margin: 0 0 6px; }
.home-why-card p  { font-size: 0.85rem; color: var(--muted); margin: 0; line-height: 1.6; }
@media (max-width: 860px) { .home-why-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px)  { .home-why-grid { grid-template-columns: 1fr; } }

/* Steps & FAQ */
.section-heading { font-size: 1.2rem; font-weight: 800; margin: 0 0 20px; text-align: center; letter-spacing: -0.01em; }
.steps-section, .faq-section, .tool-search-section { max-width: 680px; margin: 0 auto 40px; }
.steps { display: grid; gap: 18px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step .num {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 0.88rem; box-shadow: 0 4px 10px rgba(37,99,235,0.3);
}
.step h4 { margin: 0 0 4px; font-size: 0.95rem; font-weight: 700; }
.step p  { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.6; }
.faq { max-width: 680px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { font-weight: 700; cursor: pointer; font-size: 0.95rem; }
.faq p { color: var(--muted); margin: 8px 0 0; font-size: 0.9rem; line-height: 1.65; }
.tool-answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tool-answer-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px;
}
.tool-answer-card h3 { margin: 0 0 7px; font-size: 0.98rem; font-weight: 800; line-height: 1.35; }
.tool-answer-card p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.65; }

/* ── Related tools ───────────────────────────────────────── */
.related-tools-section { max-width: 680px; margin: 0 auto 40px; }
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.related-tool-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 10px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; color: inherit;
  text-align: center; transition: box-shadow .15s, border-color .15s;
}
.related-tool-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(37,99,235,.12); }
.related-tool-icon { display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px; background: var(--primary-light); color: var(--primary); }
.related-tool-icon svg { width: 20px; height: 20px; }
.related-tool-name { font-weight: 700; font-size: 0.88rem; }
.related-tool-tagline { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }

/* ── Auth pages ───────────────────────────────────────── */
.auth-box {
  max-width: 460px; margin: 48px auto;
  border-radius: 1.6rem;
  background:
    radial-gradient(28rem 16rem at 8% -10%, rgba(186,230,253,0.45) 0%, transparent 60%),
    radial-gradient(22rem 12rem at 100% 0%, rgba(196,181,253,0.25) 0%, transparent 62%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 28%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.auth-topband {
  height: 4px;
  background: linear-gradient(90deg, #2563eb 0%, #6366f1 50%, #8b5cf6 100%);
}
.auth-header {
  padding: 28px 32px 20px; text-align: center;
}
.auth-header h1 { margin: 0 0 6px; font-size: 1.6rem; font-weight: 900; letter-spacing: -0.02em; }
.auth-header p  { margin: 0; color: var(--muted); font-size: 0.9rem; }
.auth-form { padding: 4px 32px 32px; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }
.auth-field input {
  width: 100%; padding: 11px 13px;
  border: 1.5px solid var(--input-border); border-radius: 0.75rem;
  font-size: 0.93rem; background: var(--surface); color: var(--text); outline: none;
  box-shadow: var(--shadow-input);
  transition: border-color 150ms, box-shadow 150ms;
}
.auth-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 24%, transparent); }
.remember-me-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.88rem; color: var(--muted); margin-bottom: 14px; cursor: pointer;
}
.remember-me-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 11px; border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 0.93rem;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 2px 8px rgba(16,33,63,0.07);
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.btn-google:hover {
  border-color: #4285F4; box-shadow: 0 4px 14px rgba(66,133,244,0.18);
  transform: translateY(-1px); text-decoration: none;
}
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 20px 0 4px;
  color: var(--muted); font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-switch { text-align: center; margin-top: 20px; font-size: 0.88rem; color: var(--muted); }

/* ── Content pages (about, faq) ───────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 0.88rem; margin: 0 0 28px;
}
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb span:last-child { color: var(--text); font-weight: 600; }
.content-hero {
  max-width: 760px; margin: 0 auto 36px; text-align: center;
}
.content-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 16px;
}
.content-hero p:last-child { color: var(--muted); font-size: 1.08rem; line-height: 1.75; margin: 0; }
.info-section, .faq-panel-block {
  max-width: 820px; margin: 18px auto;
  background: rgba(255,255,255,0.93); border: 1px solid var(--border);
  border-radius: 1rem; box-shadow: var(--shadow-md); padding: 28px;
}
.info-section h2, .faq-panel-block h2 { margin: 0 0 8px; font-size: 1.35rem; font-weight: 800; }
.info-section > p { color: var(--muted); margin: 0 0 18px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.check-list li { position: relative; padding-left: 30px; color: var(--text); }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 0.32em;
  width: 20px; height: 20px; border-radius: 50%;
  background: #dcfce7; box-shadow: inset 0 0 0 6px #15803d;
}
.faq-category-row {
  max-width: 960px; margin: 0 auto 28px;
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px;
}
.faq-category {
  background: rgba(255,255,255,0.93); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  color: var(--text); text-decoration: none;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.faq-category:hover {
  border-color: #60a5fa; box-shadow: var(--shadow-hover);
  transform: translateY(-1px); text-decoration: none;
}
.faq-category strong { display: block; color: var(--text); font-weight: 700; margin-bottom: 6px; }
.faq-category span   { display: block; color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.faq-panel-head { margin-bottom: 12px; }
.faq-panel-kicker {
  margin: 0 0 4px; color: var(--primary);
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; font-size: 0.75rem;
}
.faq-panel-copy { margin: 0; color: var(--muted); }
.faq-panel-block .faq { max-width: none; margin: 0; }
.tool-faq-heading { margin: 24px 0 4px; font-size: 1.05rem; }
.tool-faq-heading:first-child { margin-top: 0; }

/* ── Footer ───────────────────────────────────────────── */
footer.site {
  background: var(--site-chrome-bg); border-top: 1px solid var(--site-chrome-border);
  padding: 52px 0 28px; font-size: 0.88rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 44px; margin-bottom: 44px; }
.footer-brand p { color: var(--muted); margin: 12px 0 0; max-width: 260px; line-height: 1.65; font-size: 0.88rem; }
.footer-logo { display: inline-flex; align-items: center; align-self: flex-start; line-height: 0; border-radius: 6px; transition: opacity 120ms; }
.footer-logo:hover { opacity: 0.85; text-decoration: none; }
.footer-logo:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.footer-brand-logo { display: block; width: auto; height: 36px; max-width: 220px; object-fit: contain; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links strong {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text); font-weight: 800; margin-bottom: 2px;
}
.footer-links a { color: var(--muted); font-size: 0.875rem; transition: color 120ms; }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 22px;
  color: var(--muted); font-size: 0.82rem; text-align: center;
}
.footer-bottom p {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 0.35rem 0.55rem;
  margin: 0 auto; line-height: 1.7;
}
.footer-bottom a { color: var(--muted); font-weight: 600; }
.footer-bottom a:hover { color: var(--text); text-decoration: none; }
.site-footer-flag { margin-inline: 0.05rem; margin-bottom: 0.15rem; }
.fr-flag {
  display: inline-block; flex: none;
  width: 30px; height: 30px;
  object-fit: contain; vertical-align: middle;
}

/* ── Dark mode (html.dark class, mirrors next-themes) ─── */
html.dark {
  --bg:           #1e1b2e;
  --surface:      #2a2640;
  --border:       #3d3857;
  --input-border: #5b5480;
  --text:         #f1edf5;
  --muted:        #b8b0cc;
  --primary:      #818cf8;
  --primary-dark: #6366f1;
  --primary-light:rgba(129,140,248,0.15);
  --site-chrome-bg: rgba(196,206,218,0.97);
  --site-chrome-border: rgba(100,116,139,0.40);
  --shadow:       0 1px 3px rgba(0,0,0,0.35);
  --shadow-md:    0 14px 34px rgba(0,0,0,0.35);
  --shadow-hover: 0 16px 40px rgba(0,0,0,0.5);
  --shadow-input: 0 1px 2px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.40);
  color-scheme: dark;
}
html.dark body { background: var(--bg); color: var(--text); }
html.dark header.site {
  box-shadow: 0 10px 28px rgba(0,0,0,0.26);
}
html.dark header.site nav a { color: #334155; }
html.dark header.site .btn-donate-nav { color: #334155 !important; }
html.dark header.site nav a:hover {
  color: #0f172a;
  background: rgba(37,99,235,0.10);
}
html.dark .lang-btn,
html.dark .theme-toggle,
html.dark .btn-nav-logout {
  background: #f8fafc; border-color: rgba(100,116,139,0.34); color: #10213f;
}
html.dark .lang-menu { background: #f8fafc; border-color: rgba(100,116,139,0.34); }
html.dark .lang-opt { color: #10213f; }
html.dark .lang-opt:hover { background: #e2eaf5; }
html.dark .theme-toggle:hover {
  background: #dbeafe;
  border-color: rgba(37,99,235,0.55);
  color: #1d4ed8;
}
html.dark .btn-nav-logout:hover,
html.dark header.site .btn-donate-nav:hover {
  background: rgba(37,99,235,0.10);
  color: #0f172a !important;
}
html.dark .hero-band {
  background:
    radial-gradient(50rem 28rem at 10% -5%, rgba(129,140,248,0.18) 0%, transparent 60%),
    radial-gradient(40rem 22rem at 94% 2%, rgba(167,139,250,0.15) 0%, transparent 62%),
    linear-gradient(180deg, #1a1730 0%, #1e1b2e 100%);
}
html.dark .hero-kicker { background: rgba(30,27,46,0.8); color: #a5b4fc; border-color: rgba(129,140,248,0.3); }
html.dark .hero-gradient-text { background: linear-gradient(92deg, #818cf8 0%, #c084fc 52%, #f472b6 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
html.dark .tool-seo-hero {
  background:
    radial-gradient(50rem 28rem at 10% -5%, rgba(129,140,248,0.18) 0%, transparent 60%),
    radial-gradient(40rem 22rem at 94% 2%, rgba(167,139,250,0.15) 0%, transparent 62%),
    linear-gradient(180deg, #1a1730 0%, #1e1b2e 100%);
  border-bottom-color: rgba(148,163,184,0.12);
}
html.dark .problem-hero {
  background:
    radial-gradient(50rem 28rem at 10% -5%, rgba(129,140,248,0.18) 0%, transparent 60%),
    radial-gradient(40rem 22rem at 94% 2%, rgba(167,139,250,0.15) 0%, transparent 62%),
    linear-gradient(180deg, #1a1730 0%, #1e1b2e 100%);
  border-bottom-color: rgba(148,163,184,0.12);
}
html.dark .tool-card { background: var(--surface); }
html.dark .tool-form-card { background: var(--surface); }
html.dark .page-workspace { background: rgba(255,255,255,0.03); }
html.dark .page-card { background: rgba(255,255,255,0.04); }
html.dark .page-card-preview {
  background:
    linear-gradient(45deg, rgba(255,255,255,0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.05) 75%);
  background-color: #1f1b30;
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
html.dark .page-action-btn:hover:not(:disabled) { background: rgba(129,140,248,0.16); border-color: #818cf8; }
html.dark .info-section, html.dark .faq-panel-block, html.dark .faq-category { background: var(--surface); }
html.dark .dropzone-area { background: rgba(255,255,255,0.05); border-color: #56517a; }
html.dark .dropzone-area.drag-over { border-color: var(--primary); background: var(--primary-light); }
html.dark .auth-box { background: var(--surface); }
html.dark .auth-topband { background: linear-gradient(90deg, #818cf8, #a78bfa, #c084fc); }
html.dark footer.site,
html.dark footer.site .footer-links strong,
html.dark footer.site .footer-links a:hover,
html.dark footer.site .footer-bottom a:hover {
  color: #0f172a;
}
html.dark footer.site .footer-brand p,
html.dark footer.site .footer-links a,
html.dark footer.site .footer-bottom,
html.dark footer.site .footer-bottom a {
  color: #334155;
}
html.dark footer.site .footer-bottom {
  border-top-color: rgba(100,116,139,0.40);
}
html.dark .btn-hero-secondary { background: var(--surface); }

/* Also respect system preference when no explicit choice is stored */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg:           #1e1b2e;
    --surface:      #2a2640;
    --border:       #3d3857;
    --input-border: #5b5480;
    --text:         #f1edf5;
    --muted:        #b8b0cc;
    --primary:      #818cf8;
    --primary-dark: #6366f1;
    --primary-light:rgba(129,140,248,0.15);
    --shadow:       0 1px 3px rgba(0,0,0,0.35);
    --shadow-md:    0 14px 34px rgba(0,0,0,0.35);
    --shadow-hover: 0 16px 40px rgba(0,0,0,0.5);
    --shadow-input: 0 1px 2px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.40);
    color-scheme: dark;
  }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 980px) {
  header.site .bar {
    flex-wrap: wrap; align-content: center; gap: 8px 14px;
    padding-top: 10px; padding-bottom: 10px;
  }
  .site-nav {
    order: 2; flex-basis: 100%; margin-left: 0; justify-content: flex-start;
    overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px;
  }
  .nav-topic-list,
  .nav-action-list {
    flex: 0 0 auto;
  }
}
@media (max-width: 768px) {
  .hero-band { padding: 56px 0 48px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  header.site .bar { padding: 0 16px; }
  .brand-logo { height: 34px; }
  .faq-category-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .info-section, .faq-panel-block { padding: 22px; }
  .tool-form-card { padding: 22px; }
  .page-workspace-head { flex-direction: column; }
  .page-workspace-reset { width: 100%; }
  .page-workspace-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); padding: 12px; }
  .page-card-preview { height: 136px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .tool-answer-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: center; }
  .trust-bar { gap: 16px; }
  .brand-logo { height: 30px; max-width: 140px; }
  .footer-brand-logo { height: 32px; max-width: 180px; }
  .faq-category-row { grid-template-columns: 1fr; }
  .auth-box { margin: 24px auto; border-radius: 1rem; }
  .auth-form, .auth-header { padding-left: 20px; padding-right: 20px; }
  .tool-form-card { padding: 16px; }
  .page-workspace-head, .page-workspace-status { padding-left: 12px; padding-right: 12px; }
}

/* ── Blog ─────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 40px 0 64px;
}
.blog-grid--compact { margin: 24px 0 0; }

.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow .18s, border-color .18s;
  overflow: hidden;
}
.blog-card:hover { box-shadow: var(--shadow-hover); border-color: #b8caf0; }

.blog-card__link {
  display: flex; flex-direction: column;
  padding: 24px;
  height: 100%;
  color: inherit; text-decoration: none;
  gap: 10px;
}
.blog-card__link:hover { text-decoration: none; }

.blog-card__category {
  display: inline-block;
  font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 4px;
  padding: 2px 8px;
  align-self: flex-start;
}

.blog-card__title {
  margin: 0;
  font-size: 1.05rem; font-weight: 700; line-height: 1.35;
  color: var(--text);
}

.blog-card__excerpt {
  margin: 0;
  font-size: .9rem; color: var(--muted); line-height: 1.5;
  flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__meta {
  display: flex; gap: 12px; align-items: center;
  font-size: .8rem; color: var(--muted);
  margin-top: 6px;
}

/* Article page */
.blog-article {
  max-width: 720px;
  margin: 40px auto 64px;
}

.blog-article__header {
  margin-bottom: 36px;
}
.blog-article__header h1 {
  margin: 8px 0 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800; line-height: 1.25;
  color: var(--text);
}
.blog-article__meta {
  display: flex; gap: 10px; align-items: center;
  font-size: .85rem; color: var(--muted);
}

/* Prose content */
.prose h2 {
  font-size: 1.25rem; font-weight: 700; margin: 2.25em 0 .75em;
  color: var(--text); line-height: 1.3;
}
.prose h3 {
  font-size: 1.05rem; font-weight: 600; margin: 1.75em 0 .5em;
  color: var(--text);
}
.prose p { margin: 0 0 1.1em; line-height: 1.7; }
.prose ul, .prose ol { margin: 0 0 1.1em 1.25em; padding: 0; line-height: 1.7; }
.prose li { margin-bottom: .45em; }
.prose a { color: var(--primary); }
.prose a:hover { text-decoration: underline; }
.prose strong { font-weight: 600; }

/* Tool CTA box */
.blog-cta-box {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--primary-light);
  border: 1px solid #c3d6f9;
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 40px 0;
}
.blog-cta-box__label {
  font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--primary); margin: 0 0 4px;
}
.blog-cta-box__title {
  font-size: 1rem; font-weight: 700; color: var(--text); margin: 0;
}
.blog-cta-box .btn-hero-primary {
  flex-shrink: 0; white-space: nowrap;
}

.blog-article__faq { margin-top: 48px; }
.blog-article__faq h2 {
  font-size: 1.2rem; font-weight: 700; margin: 0 0 16px;
  color: var(--text);
}

.blog-more { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--border); }
.blog-more__heading { font-size: 1.1rem; font-weight: 700; margin: 0 0 4px; }

/* Dark mode */
.dark .blog-card { background: var(--surface); }
.dark .blog-cta-box { background: rgba(37,99,235,.1); border-color: rgba(37,99,235,.3); }
.dark .blog-cta-box__title { color: var(--text); }

@media (max-width: 768px) {
  .blog-grid { grid-template-columns: 1fr; gap: 16px; }
  .blog-cta-box { flex-direction: column; align-items: flex-start; }
  .blog-article { margin: 24px auto 48px; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── RTL ──────────────────────────────────────────────── */
[dir="rtl"] header.site .bar { flex-direction: row-reverse; }
[dir="rtl"] .step { flex-direction: row-reverse; }
[dir="rtl"] .tool-card { flex-direction: row-reverse; }
[dir="rtl"] .tool-card-arrow { transform: rotate(180deg); }
[dir="rtl"] .tool-card:hover .tool-card-arrow { transform: rotate(180deg) translateX(-2px); }
[dir="rtl"] .check-list li { padding-left: 0; padding-right: 30px; }
[dir="rtl"] .check-list li::before { left: auto; right: 0; }

/* ── Non-PDF tools: image tools, QR, calculators ─────────────────────────── */

/* Size/crop inputs */
.size-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.size-row.crop-grid { grid-template-columns: repeat(4, 1fr); }
.size-x { text-align: center; color: var(--muted, #64748b); }

/* Result panel after processing */
.tool-result {
  margin-top: 16px; padding: 20px; border-radius: 14px;
  border: 1px solid rgba(22,163,74,0.35);
  background: rgba(22,163,74,0.07);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.tool-result.is-hidden { display: none; }
.tool-result-preview {
  flex: 0 0 auto; width: 140px; height: 140px; object-fit: contain;
  border-radius: 10px; border: 1px solid rgba(22,163,74,0.25); background: #fff;
  background-image: linear-gradient(45deg, #e2e8f0 25%, transparent 25%), linear-gradient(-45deg, #e2e8f0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e2e8f0 75%), linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.tool-result-info { flex: 1 1 200px; font-weight: 600; color: var(--text, #0f172a); }
.tool-result-info:empty { display: none; }
.tool-result .tool-result-btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.dark .tool-result { border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.08); }

/* Status line (JSON/Base64) */
.tool-status { min-height: 1.4em; font-size: 0.92rem; margin-top: 6px; }
.tool-status.ok { color: #16a34a; font-weight: 600; }
.tool-status.err { color: #dc2626; font-weight: 600; }
.dark .tool-status.ok { color: #4ade80; }
.dark .tool-status.err { color: #f87171; }

/* Buttons row */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.btn-row .btn.secondary { padding: 10px 16px; }

/* Word counter */
.wc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 18px; }
.wc-stat {
  background: var(--card, #f8fafc); border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px; padding: 14px 10px; text-align: center;
}
.wc-num { display: block; font-size: 1.35rem; font-weight: 800; color: var(--text, #0f172a); letter-spacing: -0.02em; }
.wc-label { display: block; margin-top: 3px; font-size: 0.78rem; color: var(--muted, #64748b); }
.dark .wc-stat { background: rgba(255,255,255,0.04); }

/* Password generator */
.pw-output-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.25rem;
  padding: 16px; border-radius: 12px; border: 1px dashed var(--border, #cbd5e1);
  background: var(--card, #f8fafc); text-align: center; word-break: break-all; user-select: all;
}
.pw-strength-wrap { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.pw-strength-bar { flex: 1; height: 8px; border-radius: 99px; background: rgba(148,163,184,0.25); overflow: hidden; }
.pw-strength-bar > div { height: 100%; width: 0; border-radius: 99px; transition: width .25s ease, background .25s ease; }
.pw-strength-bar > div.weak { background: #dc2626; }
.pw-strength-bar > div.good { background: #f59e0b; }
.pw-strength-bar > div.strong { background: #16a34a; }
.pw-strength-label { font-size: 0.85rem; color: var(--muted, #64748b); white-space: nowrap; }
.pw-sets { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 4px; }

/* Unit converter */
.uc-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.uc-result-box {
  margin-top: 16px; padding: 18px; border-radius: 12px; text-align: center;
  background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.25);
}
.uc-result { font-size: 1.25rem; font-weight: 800; color: var(--text, #0f172a); letter-spacing: -0.02em; }
.dark .uc-result-box { background: rgba(96,165,250,0.1); border-color: rgba(96,165,250,0.3); }

/* Percentage calculator */
.pc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.pc-result { font-size: 1.3rem; font-weight: 800; min-height: 1.6em; color: var(--text, #0f172a); letter-spacing: -0.02em; }
.pc-formula { margin-top: 4px; }

/* Age calculator */
.age-result-box { margin-top: 16px; padding: 20px; border-radius: 12px; text-align: center; background: rgba(234,88,12,0.07); border: 1px solid rgba(234,88,12,0.22); }
.age-main { font-size: 1.5rem; font-weight: 900; color: var(--text, #0f172a); letter-spacing: -0.02em; }
.age-totals { margin-top: 6px; color: var(--muted, #64748b); }
.dark .age-result-box { background: rgba(251,146,60,0.1); border-color: rgba(251,146,60,0.3); }

/* Hidden helper (already used by workspace) */
.is-hidden { display: none !important; }

/* ── QR code: dot style visual selector ─────────────────────────────── */
.qr-dot-style-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.qr-dot-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px 8px; border: 2px solid var(--border); border-radius: 10px;
  cursor: pointer; font-size: 0.78rem; font-weight: 600; color: var(--muted);
  transition: border-color 150ms, color 150ms, background 150ms;
  user-select: none;
}
.qr-dot-card input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }
.qr-dot-card:has(input:checked) {
  border-color: var(--primary); color: var(--primary);
  background: rgba(37,99,235,0.06);
}
.dark .qr-dot-card:has(input:checked) { background: rgba(96,165,250,0.12); }
.qr-dot-preview {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
}
.qr-dot-preview svg { width: 100%; height: 100%; }

/* ── QR code: frame selector ─────────────────────────────────────────── */
.qr-frame-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
}
@media (max-width: 560px) { .qr-frame-grid { grid-template-columns: repeat(3, 1fr); } }
.qr-frame-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 4px 7px; border: 2px solid var(--border); border-radius: 10px;
  cursor: pointer; font-size: 0.72rem; font-weight: 600; color: var(--muted);
  text-align: center; line-height: 1.2;
  transition: border-color 150ms, color 150ms, background 150ms;
  user-select: none;
}
.qr-frame-card input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }
.qr-frame-card:has(input:checked) {
  border-color: var(--primary); color: var(--primary);
  background: rgba(37,99,235,0.06);
}
.dark .qr-frame-card:has(input:checked) { background: rgba(96,165,250,0.12); }
.qr-frame-preview {
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
}
.qr-frame-mini {
  position: relative; width: 34px; height: 44px; border-radius: 5px; overflow: hidden;
  border: 1px solid var(--border); background: #fff;
}
.qr-frame-banner {
  position: absolute; top: 0; left: 0; right: 0; height: 15px;
  display: flex; align-items: center; justify-content: center; gap: 2px;
}
.qr-frame-banner i {
  display: inline-block; background: #fff; border-radius: 50%;
  width: 3px; height: 3px;
}
.qr-frame-banner i:last-child { width: 9px; height: 3px; border-radius: 2px; }
.qr-frame-banner-custom span {
  color: #fff; font-size: 6px; font-weight: 800; letter-spacing: 0.5px; line-height: 1;
}
.qr-frame-cells {
  position: absolute; left: 5px; right: 5px; top: 19px; bottom: 5px;
  background-image:
    linear-gradient(#111 1.6px, transparent 1.6px),
    linear-gradient(90deg, #111 1.6px, transparent 1.6px);
  background-size: 6px 6px;
}
.qr-frame-custom-fields {
  display: none; gap: 14px; flex-wrap: wrap; align-items: flex-end;
  margin-top: 10px; padding: 12px; border: 1px dashed var(--border); border-radius: 10px;
}
.qr-frame-custom-fields.is-visible { display: flex; }
.qr-frame-text-field { flex: 1 1 220px; display: flex; flex-direction: column; gap: 5px; }
.qr-frame-text-field span,
.qr-frame-color-field span {
  font-size: 0.78rem; font-weight: 600; color: var(--muted);
}
.qr-frame-text-field input {
  padding: 8px 10px; border: 1px solid var(--input-border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 0.875rem;
}
.qr-frame-text-field input:focus { outline: none; border-color: var(--primary); }
.qr-frame-color-field { display: flex; flex-direction: column; gap: 5px; }
.qr-frame-color-field input[type=color] {
  width: 44px; height: 34px; padding: 2px 3px;
  border: 1px solid var(--input-border); border-radius: 8px;
  background: var(--surface); cursor: pointer;
}

/* ── QR code: color row ──────────────────────────────────────────────── */
.qr-color-row {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.qr-color-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.875rem; font-weight: 600; color: var(--text);
}
.qr-color-item input[type=color] {
  width: 44px; height: 34px; padding: 2px 3px;
  border: 1px solid var(--input-border); border-radius: 8px;
  background: var(--surface); cursor: pointer;
}

/* ── QR code: logo upload ────────────────────────────────────────────── */
.qr-logo-upload {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border: 1.5px dashed var(--border); border-radius: 10px;
  cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--muted);
  transition: border-color 150ms, color 150ms; width: 100%;
}
.qr-logo-upload:hover { border-color: var(--primary); color: var(--primary); }

/* ── Compress PDF: target size input ────────────────────────────────── */
/* Page numbering templates */
.page-number-options { display: grid; gap: 12px; }
.page-number-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 10px;
}
.page-number-template-card {
  position: relative;
  min-height: 94px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms, background 150ms;
}
.page-number-template-card:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
  box-shadow: 0 8px 18px rgba(15,23,42,0.08);
}
.page-number-template-card input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.page-number-template-card:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.14);
  background: rgba(37,99,235,0.04);
}
.dark .page-number-template-card:has(input:checked) { background: rgba(96,165,250,0.1); }
.page-number-template-card > span:last-child {
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}
.pn-preview {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background:
    linear-gradient(to bottom, transparent 0 70%, rgba(148,163,184,0.18) 70% 100%),
    var(--bg);
  color: #2e3a4f;
}
.pn-legal {
  justify-content: flex-end;
  padding-right: 7px;
  font-size: 0.72rem;
  color: #334155;
}
.pn-pill {
  width: auto;
  min-width: 58px;
  margin: 0 auto;
  min-height: auto;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-weight: 800;
}
.pn-badge {
  width: 34px;
  min-height: 30px;
  margin-left: auto;
  border: 0;
  background: #2563eb;
  color: #fff;
  font-weight: 900;
}
.pn-minimal {
  border-color: transparent;
  background: transparent;
  color: #64748b;
}
.page-number-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}
.page-number-control-grid .field input[type=color] {
  height: 42px;
  padding: 4px 6px;
}
@media (max-width: 560px) {
  .page-number-control-grid { grid-template-columns: 1fr; }
}

.compress-target-row {
  display: flex; align-items: center; gap: 10px;
}
.compress-target-row input {
  flex: 1; min-width: 0;
}
.compress-target-unit {
  font-size: 0.875rem; font-weight: 600; color: var(--muted); white-space: nowrap;
}

/* ── Compress PDF: result panel ─────────────────────────────────────── */
.compress-result-panel {
  margin-top: 16px; padding: 22px 24px 20px;
  background: var(--surface); border: 1px solid rgba(22,163,74,0.35);
  border-radius: 1rem;
}
.dark .compress-result-panel { border-color: rgba(74,222,128,0.3); }
.compress-result-title {
  margin: 0 0 16px; font-size: 1rem; font-weight: 700; color: var(--text);
}
.compress-result-stats {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.compress-stat { display: flex; flex-direction: column; gap: 3px; }
.compress-stat-label {
  font-size: 0.72rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.compress-stat-value { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.compress-stat-arrow { color: var(--muted); flex: none; }
.compress-stat-saved .compress-stat-value { color: #16a34a; }
.dark .compress-stat-saved .compress-stat-value { color: #4ade80; }
.compress-no-change {
  font-size: 0.85rem; color: var(--muted); margin: 0 0 14px;
}
.compress-download-btn {
  display: inline-block; width: auto; text-decoration: none;
  padding: 12px 28px; font-size: 0.95rem;
}

/* ═══ SEO Extras ═══════════════════════════════════════════════════════════ */

/* ── Tool search ────────────────────────────────────────────────────────── */
.tool-search-wrap {
  position: relative;
  max-width: 520px;
  margin: 1.25rem auto 0;
}
.tool-search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.tool-search-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
}
.tool-search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tool-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.tool-search-input::placeholder { color: var(--muted); }
.tool-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 300; /* above sticky header (100) so the dropdown overlays the panels below */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 340px;
  overflow-y: auto;
}
.tool-search-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.tool-search-result:last-child { border-bottom: none; }
.tool-search-result:hover,
.tool-search-result:focus {
  background: var(--primary-light);
  outline: none;
}
.tool-search-result strong { font-size: 0.9rem; font-weight: 600; }
.tool-search-result span { font-size: 0.8rem; color: var(--muted); }

/* ── Share buttons ──────────────────────────────────────────────────────── */
.share-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.share-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.share-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.share-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.share-btn span { display: none; }
@media (min-width: 600px) {
  .share-btn[data-share="copy"] span { display: inline; }
}

/* ── Privacy note ───────────────────────────────────────────────────────── */
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 1rem;
  padding: 10px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 14%, transparent);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}
.privacy-note svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--primary);
}

/* ── Bookmark CTA ───────────────────────────────────────────────────────── */
.bookmark-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2rem;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}
.bookmark-cta svg { flex-shrink: 0; color: var(--primary); }
.bookmark-cta kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  font-size: 0.76rem;
  font-family: inherit;
}

/* ── Post-processing section ────────────────────────────────────────────── */
.post-processing-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.post-processing-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--text);
}

/* ── Breadcrumbs ────────────────────────────────────────────────────────── */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
}
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs span[aria-hidden] { color: var(--muted); }

/* ── 2026 visual refresh ──────────────────────────────────────────────── */
:root {
  --radius-sm: .75rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --focus-ring: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent);
}

html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 8% 12%, color-mix(in srgb, var(--primary) 7%, transparent) 0, transparent 25rem),
    radial-gradient(circle at 92% 38%, rgba(168,85,247,.055) 0, transparent 28rem);
  background-attachment: fixed;
}

header.site {
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 1px 0 rgba(255,255,255,.52), 0 10px 30px rgba(15,23,42,.035);
}
.theme-toggle { width: 38px; height: 38px; border-radius: 12px; }
.lang-btn { padding: 7px 10px; border-radius: 12px; }
header.site .btn-nav-login {
  padding: 10px 17px; border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 8px 20px rgba(37,99,235,.25);
  transition: background 150ms, box-shadow 150ms, transform 150ms;
}
header.site .btn-nav-login:hover {
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
  transform: translateY(-1px);
}

.tool-card {
  padding: 18px; border-radius: var(--radius-lg);
  border-color: color-mix(in srgb, var(--border) 82%, transparent);
  box-shadow: 0 8px 28px rgba(15,23,42,.045);
}
.tool-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--primary) 52%, var(--border)); }
.tool-card .tool-icon { width: 44px; height: 44px; border-radius: 13px; }
.btn { padding: 11px 19px; border-radius: 12px; font-weight: 700; transition: background 150ms, transform 150ms, box-shadow 150ms; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(37,99,235,.2); }
.card, .tool-form-card, .info-section, .faq-panel-block, .auth-box { border-radius: var(--radius-lg); }
.tool-form-card, .info-section, .faq-panel-block { box-shadow: 0 12px 36px rgba(15,23,42,.055); }
.home-why-card {
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 10px 30px rgba(15,23,42,.035);
  transition: transform 180ms, border-color 180ms, box-shadow 180ms;
}
.home-why-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); box-shadow: var(--shadow-md); }

/* Global in-page login experience. */
body.has-modal { overflow: hidden; }
.auth-dialog {
  width: min(94vw, 470px); max-height: min(92vh, 720px); padding: 0;
  border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: var(--radius-xl); background: transparent; color: var(--text);
  box-shadow: 0 32px 90px rgba(15,23,42,.28), 0 8px 30px rgba(37,99,235,.12);
  overflow: auto; opacity: 0; transform: translateY(18px) scale(.975);
  transition: opacity 180ms ease, transform 180ms ease, overlay 180ms allow-discrete, display 180ms allow-discrete;
}
.auth-dialog[open] { opacity: 1; transform: translateY(0) scale(1); }
@starting-style { .auth-dialog[open] { opacity: 0; transform: translateY(18px) scale(.975); } }
.auth-dialog::backdrop {
  background: rgba(15,23,42,.38);
  backdrop-filter: blur(10px) saturate(80%);
  -webkit-backdrop-filter: blur(10px) saturate(80%);
}
.auth-dialog-shell {
  position: relative; overflow: hidden;
  background:
    radial-gradient(25rem 15rem at 0 -8%, rgba(147,197,253,.35), transparent 62%),
    radial-gradient(20rem 15rem at 105% 5%, rgba(196,181,253,.3), transparent 60%),
    color-mix(in srgb, var(--surface) 96%, transparent);
}
.auth-dialog-accent { height: 5px; background: linear-gradient(90deg, #2563eb, #6366f1 55%, #a855f7); }
.auth-dialog-close {
  position: absolute; z-index: 1; top: 18px; right: 18px;
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 76%, transparent); color: var(--muted); cursor: pointer;
  backdrop-filter: blur(8px); transition: color 150ms, background 150ms, transform 150ms;
}
.auth-dialog-close:hover { color: var(--text); background: var(--surface); transform: rotate(4deg); }
.auth-dialog-heading { display: flex; align-items: center; gap: 14px; padding: 32px 34px 8px; }
.auth-dialog-icon {
  display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 16px;
  color: #fff; background: linear-gradient(145deg, #2563eb, #6366f1); box-shadow: 0 10px 24px rgba(37,99,235,.25);
}
.auth-dialog-eyebrow { margin: 0 0 2px; color: var(--primary); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.auth-dialog-heading h2 { margin: 0; font-size: 1.65rem; letter-spacing: -.035em; line-height: 1.15; }
.auth-dialog-copy { margin: 0; padding: 4px 34px 20px; color: var(--muted); font-size: .92rem; }
.auth-dialog-form { padding: 0 34px 32px; }
.auth-social-block { margin-bottom: 18px; }
.auth-social-block .auth-divider { margin-bottom: 0; }
.auth-field .hint { margin-top: 6px; color: var(--muted); font-size: .8rem; }
.auth-input-wrap { position: relative; }
.auth-input-wrap > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.auth-field .auth-input-wrap input { padding-left: 42px; padding-right: 42px; min-height: 48px; border-radius: 13px; }
.auth-field .auth-input-wrap input:focus { box-shadow: var(--focus-ring); }
.password-toggle {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer;
}
.password-toggle:hover, .password-toggle.is-visible { color: var(--primary); background: var(--primary-light); }
.auth-submit { display: flex; align-items: center; justify-content: center; gap: 9px; border-radius: 13px; }
.auth-submit svg { transition: transform 150ms; }
.auth-submit:hover svg { transform: translateX(3px); }
.btn:focus-visible, .btn-submit:focus-visible, .btn-nav-login:focus-visible,
.theme-toggle:focus-visible, .lang-btn:focus-visible, .auth-dialog-close:focus-visible,
.password-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }

html.dark {
  --site-chrome-bg: rgba(30,27,46,.88);
  --site-chrome-border: rgba(129,140,248,.16);
}
/* Lighter header in dark mode so the navy brand logo stays visible. */
html.dark header.site {
  background: rgba(196,192,216,.94);
  border-bottom-color: rgba(91,84,128,.45);
  box-shadow: 0 10px 28px rgba(0,0,0,.26);
}
html.dark header.site .bar { --primary: #4f46e5; --primary-dark: #4338ca; }
html.dark header.site nav a, html.dark header.site .btn-donate-nav { color: #2a2640 !important; }
html.dark header.site nav a:hover { color: #0f172a !important; background: rgba(42,38,64,.10); }
html.dark header.site .lang-btn, html.dark header.site .theme-toggle, html.dark header.site .btn-nav-logout {
  background: rgba(255,255,255,.55); color: #1e1b2e; border-color: rgba(91,84,128,.35);
}
html.dark header.site .theme-toggle:hover { background: rgba(255,255,255,.8); color: #1e1b2e; }
html.dark header.site .lang-btn:hover { background: rgba(255,255,255,.8); color: #1e1b2e; }
/* Language menu sits inside the header nav, so match the light header panel. */
html.dark header.site .lang-menu {
  background: #f4f2fa; border-color: rgba(91,84,128,.35);
  box-shadow: 0 10px 28px rgba(0,0,0,.3);
}
html.dark header.site .lang-menu .lang-opt { color: #1e1b2e !important; }
html.dark header.site .lang-menu .lang-opt:hover { background: rgba(91,84,128,.12); color: #0f172a !important; }
html.dark header.site .lang-menu .lang-opt.selected { background: rgba(79,70,229,.12); color: #4338ca !important; }
/* Footer mirrors the header panel in dark mode. */
html.dark footer.site {
  background: rgba(196,192,216,.94);
  border-top-color: rgba(91,84,128,.45);
  box-shadow: 0 -10px 28px rgba(0,0,0,.26);
  color: #1e1b2e;
}
html.dark footer.site .footer-links strong { color: #1e1b2e; }
html.dark footer.site .footer-brand p,
html.dark footer.site .footer-links a,
html.dark footer.site .footer-bottom,
html.dark footer.site .footer-bottom a { color: #2a2640; }
html.dark footer.site .footer-links a:hover,
html.dark footer.site .footer-bottom a:hover { color: #0f172a; }
html.dark footer.site .footer-bottom { border-top-color: rgba(91,84,128,.35); }
html.dark footer.site .footer-logo:focus-visible { outline-color: #4f46e5; }
html.dark .lang-btn, html.dark .theme-toggle, html.dark .btn-nav-logout {
  background: rgba(255,255,255,.06); color: var(--text); border-color: var(--border);
}
html.dark .lang-menu { background: #2a2640; border-color: var(--border); }
html.dark .lang-opt { color: var(--text); }
html.dark .lang-opt:hover { background: rgba(255,255,255,.06); }

@media (max-width: 480px) {
  .auth-dialog { width: calc(100vw - 20px); border-radius: 1.35rem; }
  .auth-dialog-heading { padding: 28px 22px 8px; }
  .auth-dialog-copy { padding: 4px 22px 18px; }
  .auth-dialog-form { padding: 0 22px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
