/* ============================================================
   NexLove.org — Design System (v3, Premium SaaS)
   Light-first, brand purple #7B2FF7 → pink #F107A3 with #A855F7
   accent. Inter type, 14–18px rounded corners, tasteful
   glassmorphism, soft brand-tinted shadows, gradient buttons,
   full FOUC-free dark theme, and prefers-reduced-motion aware
   micro-interactions. All class names are preserved so every
   existing page and script keeps working.
   ============================================================ */

/* ---------- CSS Variables / Theme Tokens ---------- */
:root {
  /* Brand */
  --brand-primary: #7B2FF7;
  --brand-primary-hover: #6a24d6;
  --brand-secondary: #F107A3;
  --brand-accent: #A855F7;
  --grad-brand: linear-gradient(90deg, #7B2FF7 0%, #F107A3 100%);
  --grad-brand-135: linear-gradient(135deg, #7B2FF7 0%, #A855F7 52%, #F107A3 100%);

  /* Light theme surfaces */
  --bg: #ffffff;
  --bg-soft: #F8FAFC;
  --surface: #ffffff;
  --surface-2: #F8FAFC;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-blur: 16px;

  /* Text — slate-tinted secondaries, sampled from the reference UI */
  --text: #111827;
  --text-soft: #475569;
  --text-muted: #5F6F86;   /* screenshot #64748B nudged: 4.26->4.58 on --result-bg */
  --border: #E5E7EB;
  --border-strong: #D1D5DB;

  /* Brand ink — accent colour for numbers & values.
     Theme-aware so it keeps contrast on dark surfaces. */
  --brand-ink: #7B2FF7;

  /* Result surface (soft lavender) */
  --result-bg: #F6F0FE;
  --result-line: #EADDFD;

  /* Tinted icon tile */
  --tile-bg: #F2EAFE;
  --tile-ink: #7B2FF7;

  /* Feedback */
  --success: #22C55E;
  --danger: #EF4444;
  --warning: #F59E0B;
  --info: #3B82F6;

  /* Category accent colours */
  --cat-pdf: #EF4444;
  --cat-image: #7B2FF7;
  --cat-ai: #A855F7;
  --cat-text: #3B82F6;
  --cat-calc: #22C55E;
  --cat-seo: #0D9488;
  --cat-dev: #F59E0B;
  --cat-util: #F107A3;

  /* Shadows (soft, subtle) */
  --shadow-sm: 0 1px 2px rgba(17,24,39,.04), 0 2px 6px rgba(17,24,39,.05);
  --shadow-md: 0 6px 20px rgba(17,24,39,.09), 0 2px 6px rgba(17,24,39,.05);
  --shadow-lg: 0 20px 44px rgba(17,24,39,.14), 0 6px 14px rgba(17,24,39,.08);
  --shadow-glow: 0 12px 30px rgba(123,47,247,.22);

  /* Radius (sharp / minimal) */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 16px;
  --r-xl: 18px;
  --r-pill: 999px;

  /* Layout */
  --nav-h: 70px;
  --container: 1200px;
  --gap: 24px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 0.18s;
  --med: 0.28s;
  --slow: 0.5s;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

[data-theme="dark"] {
  /* Neutral (untinted) dark stack, sampled from the reference UI */
  --bg: #111111;
  --bg-soft: #181818;
  --surface: #222222;
  --surface-2: #181818;
  --glass-bg: rgba(34, 34, 34, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);

  --text: #FFFFFF;
  --text-soft: #E2E8F0;
  --text-muted: #CBD5E1;
  --border: #313131;
  --border-strong: #3D3D3D;

  /* Lighter accent so values stay legible on dark surfaces.
     3.53:1 on --result-bg => WCAG AA for LARGE text (>=24px or >=18.66px bold),
     which is the only place it is used (.stat-pill .v, .r-row.is-primary .r-v).
     Do NOT reuse for small text on dark; use #C084FC (6.02:1) there. */
  --brand-ink: #A855F7;

  --result-bg: #32283C;
  --result-line: #49365B;

  --tile-bg: #291C36;
  --tile-ink: #A855F7;

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 12px 30px rgba(168,85,247,.34);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-soft);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--med) var(--ease), color var(--med) var(--ease);
}
h1, h2, h3, h4 { color: var(--text); }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 1rem; color: inherit; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; border-radius: 3px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(48px, 8vw, 80px) 0; }
.section:nth-of-type(even) { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto clamp(30px, 5vw, 48px); }
.section-head .eyebrow {
  display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand-primary);
  margin-bottom: 12px;
}
.section-head h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; color: var(--text); }
.section-head p { color: var(--text-muted); margin-top: 12px; font-size: 1.02rem; line-height: 1.7; }
.grad-text { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 0.92rem; padding: 12px 24px; border-radius: 12px;
  position: relative; overflow: hidden; border: 1px solid transparent;
  transition: background var(--fast) var(--ease), background-position var(--med) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 4px 14px rgba(123,47,247,.28); background-size: 160% 100%; }
.btn-primary:hover { background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(123,47,247,.36); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: transparent; border: 1px solid var(--brand-primary); color: var(--brand-primary); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-soft); }
.btn-outline:hover { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--bg-soft); }
.btn-sm { padding: 8px 16px; font-size: 0.84rem; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.94); }
.btn-success { background: var(--success); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Ripple (kept subtle) */
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.4); transform: scale(0); animation: ripple 0.6s var(--ease); pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------- Cards ---------- */
.glass {
  background: var(--glass-bg); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); transition: box-shadow var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.card:hover { box-shadow: var(--shadow-lg); border-color: transparent; transform: translateY(-4px); }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  background: var(--glass-bg); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4); backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border-bottom: 1px solid var(--border); transition: box-shadow var(--fast), background var(--fast);
}
.nav.scrolled { box-shadow: var(--shadow-sm); }
.nav-inner { height: 100%; display: flex; align-items: center; gap: 18px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1.5rem; letter-spacing: -0.02em; color: var(--text); flex-shrink: 0; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad-brand);
  display: grid; place-items: center; color: #fff; font-size: 0.9rem; box-shadow: 0 4px 12px rgba(123,47,247,.3);
}
.logo span { color: var(--text); }
.logo .dot { display: none; }

.nav-menu { display: flex; align-items: center; gap: 4px; margin-left: 20px; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 5px; padding: 24px 12px; position: relative;
  font-weight: 400; font-size: 0.95rem; color: var(--text-soft); transition: color var(--fast);
}
.nav-link::after {
  content: ""; position: absolute; bottom: 20px; left: 12px; right: 12px; height: 2px;
  background: var(--brand-primary); transform: scaleX(0); transform-origin: left; transition: transform var(--fast) var(--ease);
}
.nav-link:hover, .nav-item.open .nav-link { color: var(--brand-primary); }
.nav-link:hover::after, .nav-item.open .nav-link::after { transform: scaleX(1); }
.nav-link .caret { font-size: 0.62rem; transition: transform var(--fast); }
.nav-item.open .nav-link .caret { transform: rotate(180deg); }

/* Mega menu */
.mega {
  position: absolute; top: calc(100% - 8px); left: 50%; transform: translateX(-50%) translateY(8px);
  min-width: 460px; padding: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-md); opacity: 0; visibility: hidden;
  transition: opacity var(--fast), transform var(--fast), visibility var(--fast);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px;
}
.nav-item.open .mega { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.mega-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm);
  font-size: 0.9rem; color: var(--text-soft); transition: background var(--fast), color var(--fast);
}
.mega-link:hover { background: var(--bg-soft); color: var(--brand-primary); }
.mega-link i { width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--bg-soft); color: var(--brand-primary); font-size: 0.85rem; flex-shrink: 0; }
.mega-head { grid-column: 1 / -1; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; padding: 4px 10px 8px; }

.nav-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; color: var(--text-soft);
  transition: color var(--fast), background var(--fast);
}
.icon-btn:hover { color: var(--brand-primary); background: var(--bg-soft); }

/* Nav search */
.nav-search { position: relative; }
.nav-search input {
  width: 200px; padding: 9px 14px 9px 36px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); transition: width var(--med) var(--ease), border-color var(--fast);
}
.nav-search input:focus { width: 240px; outline: none; border-color: var(--brand-primary); }
.nav-search .s-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.85rem; pointer-events: none; }
.nav-search .results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-md);
  max-height: 340px; overflow-y: auto; display: none; z-index: 120;
}
.nav-search .results.show { display: block; }
.search-result { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 0.88rem; transition: background var(--fast); }
.search-result:hover { background: var(--bg-soft); }
.search-result i { color: var(--brand-primary); width: 18px; }
.search-result .cat { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); }
.search-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 0.88rem; }

.hamburger { display: none; }

/* Mobile slide-out */
.mobile-menu {
  position: fixed; top: 0; right: 0; width: min(340px, 88vw); height: 100dvh; z-index: 200;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform var(--med) var(--ease);
  overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 4px;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 199; opacity: 0; visibility: hidden; transition: opacity var(--med); }
.mobile-overlay.open { opacity: 1; visibility: visible; }
.mobile-menu .mm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mm-group summary {
  list-style: none; cursor: pointer; padding: 13px 14px; border-radius: var(--r-sm); font-weight: 500;
  display: flex; align-items: center; justify-content: space-between; background: var(--bg-soft);
}
.mm-group summary::-webkit-details-marker { display: none; }
.mm-group[open] summary { color: var(--brand-primary); }
.mm-group summary .caret { transition: transform var(--fast); }
.mm-group[open] summary .caret { transform: rotate(180deg); }
.mm-sub { padding: 6px 0 6px 8px; display: flex; flex-direction: column; }
.mm-sub a { padding: 9px 12px; border-radius: var(--r-sm); font-size: 0.9rem; color: var(--text-soft); }
.mm-sub a:hover { background: var(--bg-soft); color: var(--brand-primary); }
.mm-link { padding: 13px 14px; border-radius: var(--r-sm); font-weight: 500; }
.mm-link:hover { background: var(--bg-soft); color: var(--brand-primary); }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 9vw, 100px) 0; text-align: center; background: var(--surface); border-bottom: 1px solid var(--border); }
/* Decorative blobs/floating icons from the old theme are hidden for the clean look */
.hero-bg, .blob, .float-icon { display: none !important; }

.hero h1 { font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 18px; color: var(--text); max-width: 800px; margin-left: auto; margin-right: auto; }
.hero .lead { font-size: clamp(1rem, 2vw, 1.12rem); color: var(--text-muted); max-width: 640px; margin: 0 auto 30px; line-height: 1.7; }
.hero-search { max-width: 600px; margin: 0 auto 24px; position: relative; }
.hero-search input {
  width: 100%; padding: 16px 20px 16px 52px; font-size: 1rem; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color var(--fast);
}
.hero-search input:focus { outline: none; border-color: var(--brand-primary); }
.hero-search .s-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1rem; }
.hero-search .results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-md); max-height: 360px; overflow-y: auto; display: none; z-index: 30; text-align: left; }
.hero-search .results.show { display: block; }

.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 32px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); font-size: 0.86rem; font-weight: 400; color: var(--text-soft); transition: color var(--fast), border-color var(--fast); }
.chip:hover { color: var(--brand-primary); border-color: var(--brand-primary); }
.chip i { color: var(--brand-primary); }

.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(24px, 6vw, 64px); margin-top: 56px; }
.stat { text-align: center; }
.stat .num { font-size: clamp(1.5rem, 4vw, 1.75rem); font-weight: 700; color: var(--text); }
.stat .label { color: var(--text-muted); font-size: 0.88rem; font-weight: 400; margin-top: 4px; }

.scroll-ind { margin-top: 44px; display: inline-flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.78rem; }
.scroll-ind .mouse { width: 22px; height: 36px; border: 2px solid var(--text-muted); border-radius: 12px; position: relative; }
.scroll-ind .mouse::after { content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 4px; height: 7px; background: var(--brand-primary); border-radius: 2px; animation: scrollDot 1.6s infinite; }
@keyframes scrollDot { 0% { opacity: 0; top: 6px; } 40% { opacity: 1; } 80% { opacity: 0; top: 18px; } }

/* ============================================================
   CATEGORY GRID
   ============================================================ */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.cat-card { padding: 24px; display: flex; flex-direction: column; gap: 12px; position: relative; border-top: 3px solid var(--border); }
.cat-card:hover { border-color: var(--border-strong); border-top-color: var(--brand-primary); }
.cat-icon { width: 48px; height: 48px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 1.25rem; color: var(--brand-primary); background: var(--bg-soft); }
.cat-card h3 { font-size: 1.15rem; font-weight: 600; color: var(--text); }
.cat-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
.cat-card .count { font-size: 0.78rem; font-weight: 600; color: var(--brand-primary); }
.cat-card .arrow { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--brand-primary); font-size: 0.88rem; transition: gap var(--fast); }
.cat-card:hover .arrow { gap: 10px; }

/* Tool card grid */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--gap); }
.tool-card { padding: 24px; display: flex; flex-direction: column; gap: 12px; position: relative; border-top: 3px solid var(--border); }
.tool-card:hover { border-top-color: var(--brand-primary); box-shadow: var(--shadow-md); border-color: var(--brand-primary); }
.tool-card .t-icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 1.1rem; color: var(--brand-primary); background: var(--bg-soft); transition: background var(--fast), color var(--fast); }
.tool-card:hover .t-icon { background: var(--brand-primary); color: #fff; }
.tool-card h3 { font-size: 1rem; font-weight: 600; color: var(--text); }
.tool-card p { color: var(--text-muted); font-size: 0.86rem; line-height: 1.6; flex: 1; }
.tool-card .badge { position: absolute; top: 16px; right: 16px; font-size: 0.64rem; font-weight: 600; padding: 3px 8px; border-radius: var(--r-sm); background: #fff7ed; color: #ea580c; text-transform: uppercase; letter-spacing: 0.04em; }

/* ============================================================
   TOOL PAGE (interactive)
   ============================================================ */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-muted); margin: 24px auto 4px; }
.breadcrumb a:hover { color: var(--brand-primary); }
.breadcrumb .sep { opacity: 0.5; }

.tool-hero { text-align: center; padding: clamp(28px,5vw,48px) 0 20px; }
.tool-hero .t-badge { width: 66px; height: 66px; border-radius: 18px; margin: 0 auto 18px; display: grid; place-items: center; font-size: 1.6rem; color: #fff; background: var(--grad-brand-135); box-shadow: 0 10px 24px rgba(123,47,247,.32); }
.tool-hero h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.tool-hero p { color: var(--text-muted); max-width: 620px; margin: 12px auto 0; font-size: 1.02rem; line-height: 1.7; }

.tool-workspace { padding: 26px; margin-bottom: 28px; border-radius: var(--r-lg); border: 1px solid var(--glass-border); border-top: 3px solid var(--brand-secondary); background: var(--glass-bg); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur)); box-shadow: var(--shadow-md); }
.tool-layout { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 900px) { .tool-layout.split { grid-template-columns: 1fr 1fr; } }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 7px; color: var(--text); }
.field .hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 5px; }
.input, .textarea, select.input {
  width: 100%; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); transition: border-color var(--fast), box-shadow var(--fast); resize: vertical;
}
.input:focus, .textarea:focus, select.input:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(123,47,247,0.12); }
.textarea { min-height: 200px; font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; line-height: 1.55; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }

.result-box { padding: 16px; border-radius: var(--r-md); background: var(--result-bg); border: 1px solid var(--result-line); }
.output { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; }

.dropzone {
  position: relative;
  border: 2px dashed var(--border-strong); border-radius: var(--r-md); padding: 44px 24px; text-align: center;
  cursor: pointer; transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
  background: var(--bg-soft);
  overflow: hidden;
}
.dropzone:hover { border-color: var(--brand-primary); }
.dropzone.drag {
  border-color: var(--brand-primary); border-style: solid;
  background: rgba(123,47,247,0.06);
}
.dropzone > i {
  display: inline-grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 14px;
  font-size: 1.5rem; color: #fff; border-radius: var(--r-md); background: var(--brand-primary);
}
.dropzone h4 { font-weight: 600; font-size: 1.02rem; margin-bottom: 6px; color: var(--text); }
.dropzone p { color: var(--text-muted); font-size: 0.9rem; }
.dropzone button { margin-top: 16px; }

/* Instant file preview injected after a dropzone */
.nl-preview { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.nl-preview-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  animation: nl-page-in 0.3s var(--ease) both;
}
.nl-preview-thumb {
  width: 52px; height: 52px; border-radius: var(--r-sm); object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--bg-soft);
}
.nl-preview-thumb.icon { display: grid; place-items: center; color: var(--brand-primary); font-size: 1.3rem; }
.nl-preview-meta { flex: 1; min-width: 0; }
.nl-preview-name { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.nl-preview-size { color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }
.nl-preview-remove {
  width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; flex-shrink: 0;
  color: var(--danger); background: rgba(220,38,38,0.08); transition: background var(--fast);
}
.nl-preview-remove:hover { background: rgba(220,38,38,0.16); }

/* Stat pills now sit inside one soft lavender result surface. */
.stat-pills {
  display: flex; flex-wrap: wrap; gap: 0;
  background: var(--result-bg);
  border: 1px solid var(--result-line);
  border-radius: var(--r-md);
  padding: 6px 10px;
  margin: 16px 0;
  animation: resultIn var(--med) var(--ease) both;
}
.stat-pills:empty { display: none; }
.stat-pill {
  flex: 1; min-width: 130px; padding: 14px 12px;
  background: transparent; border: 0; text-align: center;
}
.stat-pill .v { font-size: 1.5rem; font-weight: 800; color: var(--brand-ink); line-height: 1.2; word-break: break-word; }
.stat-pill .k { font-size: 0.76rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

@keyframes resultIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------
   Result panel — label / value rows, matching the reference layout.
   Use where label+value pairs read better than centred pills.
   ------------------------------------------------------------------ */
.result-panel {
  background: var(--result-bg);
  border: 1px solid var(--result-line);
  border-radius: var(--r-md);
  padding: 2px 22px; margin: 16px 0;
  animation: resultIn var(--med) var(--ease) both;
}
.result-panel .r-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 15px 0;
  border-bottom: 1px solid var(--result-line);
}
.result-panel .r-row:last-child { border-bottom: 0; }
.result-panel .r-k { color: var(--text-muted); font-size: 0.95rem; }
.result-panel .r-v { color: var(--text); font-weight: 700; text-align: right; word-break: break-word; }
.result-panel .r-row.is-primary .r-k { color: var(--text); font-weight: 700; }
.result-panel .r-row.is-primary .r-v { color: var(--brand-ink); font-weight: 800; font-size: 1.5rem; line-height: 1.2; }
@media (max-width: 520px) {
  .result-panel { padding: 2px 16px; }
  .result-panel .r-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .result-panel .r-v { text-align: left; }
}

/* Tinted tool icon tile */
.tool-tile {
  width: 56px; height: 56px; flex: 0 0 56px;
  display: grid; place-items: center; border-radius: var(--r-md);
  background: var(--tile-bg); color: var(--tile-ink); font-size: 1.5rem;
}

.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--bg-soft); border: 1px solid var(--border); font-size: 0.88rem; }
.file-item i { color: var(--brand-primary); }
.file-item .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .fsize { color: var(--text-muted); font-size: 0.8rem; }
.file-item .rm { color: var(--danger); cursor: pointer; }

.progress { height: 8px; border-radius: var(--r-pill); background: var(--bg-soft); overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--grad-brand); border-radius: var(--r-pill); transition: width var(--med) var(--ease); }

.notice { padding: 12px 16px; border-radius: var(--r-sm); font-size: 0.88rem; display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; border: 1px solid transparent; }
.notice.info { background: rgba(123,47,247,0.08); color: var(--info); border-color: rgba(123,47,247,0.2); }
.notice.warn { background: rgba(217,119,6,0.1); color: var(--warning); border-color: rgba(217,119,6,0.2); }
.notice.err { background: rgba(220,38,38,0.08); color: var(--danger); border-color: rgba(220,38,38,0.2); }
.notice.ok { background: rgba(22,163,74,0.08); color: var(--success); border-color: rgba(22,163,74,0.2); }

/* Content sections on tool page */
.tool-content { display: grid; gap: 24px; }
.content-block { padding: 28px; }
.content-block h2 { font-size: 1.3rem; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.content-block h3 { font-size: 1.05rem; font-weight: 600; margin: 16px 0 8px; color: var(--text); }
.content-block p { color: var(--text-soft); margin-bottom: 10px; line-height: 1.7; }
.content-block ul.feature-list { display: grid; gap: 10px; }
.content-block ul.feature-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-soft); }
.content-block ul.feature-list li i { color: var(--success); margin-top: 4px; }
.steps { counter-reset: step; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; color: var(--text-soft); }
.steps li::before { counter-increment: step; content: counter(step); flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; background: var(--grad-brand); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 0.85rem; }

/* FAQ accordion */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { width: 100%; text-align: left; padding: 18px 4px; font-weight: 500; font-size: 0.98rem; display: flex; justify-content: space-between; align-items: center; gap: 14px; color: var(--text); }
.faq-q .ic { transition: transform var(--fast); color: var(--brand-primary); }
.faq-item.open .faq-q .ic { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height var(--med) var(--ease); color: var(--text-soft); }
.faq-a-inner { padding: 0 4px 18px; line-height: 1.7; }
.faq-item.open .faq-a { max-height: 500px; }

/* Related tools */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.related-card { padding: 16px; display: flex; align-items: center; gap: 12px; }
.related-card:hover { border-color: var(--brand-primary); }
.related-card i { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--bg-soft); color: var(--brand-primary); flex-shrink: 0; }
.related-card span { font-weight: 500; font-size: 0.9rem; color: var(--text); }

.prevnext { display: flex; justify-content: space-between; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.pn-link { flex: 1; min-width: 200px; padding: 16px 20px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); transition: border-color var(--fast); }
.pn-link:hover { border-color: var(--brand-primary); }
.pn-link .dir { font-size: 0.74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pn-link .name { font-weight: 600; color: var(--brand-primary); }
.pn-link.next { text-align: right; }

/* Ad slots */
.ad-slot { margin: 28px auto; max-width: 100%; text-align: center; }
.ad-placeholder { border: 1px dashed var(--border-strong); border-radius: var(--r-md); padding: 22px; color: var(--text-muted); font-size: 0.82rem; background: var(--bg-soft); }

/* ============================================================
   FOOTER  (dark, matching reference)
   ============================================================ */
.footer { position: relative; margin-top: 0; background: #1a1a1a; color: #fff; overflow: hidden; }
.footer-divider { display: none; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 40px; padding: 64px 0 40px; border-bottom: 1px solid #333; }
.footer .logo, .footer .logo span { color: #fff; }
.footer .logo-mark { background: var(--brand-primary); }
.footer-col h4 { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: #a3a3a3; margin-bottom: 18px; font-weight: 600; }
.footer-col ul { display: grid; gap: 11px; }
.footer-col a { color: #a3a3a3; font-size: 0.92rem; transition: color var(--fast); display: inline-block; }
.footer-col a:hover { color: #fff; }
.footer-brand .logo { margin-bottom: 14px; }
.footer-brand p { color: #a3a3a3; font-size: 0.92rem; line-height: 1.7; max-width: 320px; margin-bottom: 18px; }
.social { display: flex; gap: 10px; }
.social a { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; background: #333; border: none; color: #a3a3a3; transition: background var(--fast), color var(--fast); }
.social a:hover { color: #fff; background: var(--brand-primary); }
.footer-bottom { padding: 24px 0; text-align: center; color: #a3a3a3; font-size: 0.86rem; }
.footer-bottom .container { color: #a3a3a3; }
.newsletter { display: flex; gap: 8px; margin-top: 14px; }
.newsletter input { flex: 1; padding: 11px 14px; border-radius: var(--r-sm); border: 1px solid #333; background: #222; color: #fff; }
.newsletter input:focus { outline: none; border-color: var(--brand-primary); }
.newsletter button { flex-shrink: 0; }

.back-top { position: fixed; bottom: 24px; right: 24px; width: 46px; height: 46px; border-radius: 14px; background: var(--grad-brand); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-md); z-index: 90; opacity: 0; visibility: hidden; transform: translateY(20px); transition: all var(--fast); }
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { background: var(--brand-primary-hover); }

/* ============================================================
   ANIMATIONS / REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal.zoom { transform: scale(0.94); }
.reveal.zoom.in { transform: scale(1); }
.reveal[data-delay="1"] { transition-delay: 0.07s; }
.reveal[data-delay="2"] { transition-delay: 0.14s; }
.reveal[data-delay="3"] { transition-delay: 0.21s; }
.reveal[data-delay="4"] { transition-delay: 0.28s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

.skeleton { background: linear-gradient(90deg, var(--bg-soft) 25%, var(--surface) 50%, var(--bg-soft) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-md); }
@keyframes shimmer { to { background-position: -200% 0; } }

.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.success-check { width: 56px; height: 56px; border-radius: 50%; background: var(--success); display: grid; place-items: center; color: #fff; font-size: 1.6rem; margin: 0 auto; animation: pop 0.4s var(--ease); }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .nav-menu, .nav-search { display: none; }
  .hamburger { display: grid; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .prevnext .pn-link.next { text-align: left; }
}

/* Utility */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; } .wrap { flex-wrap: wrap; } .gap { gap: 12px; }
.muted { color: var(--text-muted); } .small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.color-preview { width: 100%; height: 120px; border-radius: var(--r-md); border: 1px solid var(--border); }
.swatch { width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--border); cursor: pointer; }
canvas { max-width: 100%; }

/* ============================================================
   Accessibility & polish
   ============================================================ */
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 2000; padding: 10px 18px;
  border-radius: var(--r-sm); background: var(--brand-primary); color: #fff; font-weight: 600;
  box-shadow: var(--shadow-md); transition: top var(--fast) var(--ease);
}
.skip-link:focus-visible { top: 12px; outline: 2px solid #fff; }

.nav-item:focus-within > .mega { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-item:focus-within > .nav-link .caret { transform: rotate(180deg); }

.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.55); border-top-color: #fff; border-radius: 50%;
  animation: nl-spin 0.6s linear infinite;
}
.btn.btn-ghost.is-loading::after, .btn.btn-outline.is-loading::after {
  border-color: rgba(123, 47, 247, 0.35); border-top-color: var(--brand-primary);
}
@keyframes nl-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: no-preference) {
  #nl-main { animation: nl-page-in 0.4s var(--ease) both; }
}
@keyframes nl-page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
#nl-main:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  .scroll-ind .mouse { animation: none !important; }
  * { scroll-behavior: auto !important; }
}

/* Preview label + tags */
.nl-preview-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brand-primary); margin-bottom: 2px;
}
.nl-preview-label i { font-size: 0.85rem; }
.nl-preview-size { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nl-tag {
  display: inline-block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: var(--r-sm); color: #fff; background: var(--brand-primary);
}
.nl-dim { display: inline-flex; align-items: center; gap: 5px; }

/* Page transitions (load fade-in + navigate fade-out) */
@media (prefers-reduced-motion: no-preference) {
  html:not(.nl-ready) body { opacity: 0; }
  body { transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
  html.nl-ready body { opacity: 1; }
  html.nl-leaving body { opacity: 0; transform: translateY(-6px); }
}

/* Extra reveal variants (opt-in via data-reveal) */
.reveal[data-reveal="left"]  { transform: translateX(-22px); }
.reveal[data-reveal="right"] { transform: translateX(22px); }
.reveal[data-reveal="zoom"]  { transform: scale(0.96); }
.reveal[data-reveal].in { transform: none; }

/* ============================================================
   Wide "Tools" mega menu (grouped categories)
   ============================================================ */
.mega.mega-wide {
  display: block; width: 820px; max-width: 92vw; min-width: 0; padding: 0;
  left: 0; transform: translateX(-30%) translateY(8px);
}
.nav-item.open .mega.mega-wide { transform: translateX(-30%) translateY(0); }
.mega-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--bg-soft); border-bottom: 1px solid var(--border);
  font-size: 0.8rem; font-weight: 600; color: var(--text);
}
.mega-bar a { color: var(--brand-primary); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.mega-bar a:hover { color: var(--brand-primary-hover); }
.mega-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 20px; padding: 20px; }
.mega-col { display: flex; flex-direction: column; }
.mega-col-head {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text); padding: 4px 10px 8px;
}
.mega-col-head:hover { color: var(--brand-primary); }
.mega-wide .mega-link { padding: 7px 10px; font-size: 0.86rem; }
.mega-wide .mega-link i { width: 22px; height: 22px; font-size: 0.72rem; background: transparent; }
@media (max-width: 1100px) { .mega-cols { grid-template-columns: repeat(2, 1fr); } .mega.mega-wide { width: 560px; } }

/* ============================================================
   PREMIUM EXPERIENCE LAYER (NexLove brand — v3)
   Light-first, brand purple→pink, subtle micro-interactions.
   Everything motion-related respects prefers-reduced-motion.
   ============================================================ */

/* Selection + scrollbar in brand */
::selection { background: rgba(123,47,247,.16); color: var(--text); }
* { scrollbar-color: var(--brand-accent) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(123,47,247,.35); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(123,47,247,.55); background-clip: padding-box; }

/* Sticky nav: gradient hairline + stronger glass when scrolled */
.nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--grad-brand); opacity: 0; transition: opacity var(--fast) var(--ease);
}
.nav.scrolled::after { opacity: 1; }
.nav.scrolled { box-shadow: 0 6px 20px rgba(17,24,39,.06); }

/* Hero: re-enable a refined, light background — soft brand radials + floating icons */
.hero-bg { display: block !important; position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero > .container { position: relative; z-index: 1; }
.hero-bg::before, .hero-bg::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5;
}
.hero-bg::before { width: 460px; height: 460px; top: -160px; left: -120px; background: radial-gradient(circle, rgba(123,47,247,.22), transparent 70%); }
.hero-bg::after  { width: 420px; height: 420px; top: -120px; right: -120px; background: radial-gradient(circle, rgba(241,7,163,.16), transparent 70%); }
[data-theme="dark"] .hero-bg::before { opacity: .35; }
[data-theme="dark"] .hero-bg::after  { opacity: .3; }

.float-icon {
  display: grid !important; place-items: center; position: absolute; z-index: 0;
  width: 46px; height: 46px; border-radius: 14px; color: var(--brand-primary);
  background: var(--glass-bg); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm); font-size: 1.1rem;
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(4deg); } }

/* Buttons: magnetic-ready + focus ring; ghost hover glow */
.btn-ghost:hover { box-shadow: 0 0 0 4px rgba(123,47,247,.10); }
.btn:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }

/* Chips: brand hover */
.chip:hover { border-color: var(--brand-primary); color: var(--brand-primary); box-shadow: 0 2px 10px rgba(123,47,247,.10); }

/* Category / tool icon tiles: subtle brand-tinted, lift on card hover */
.cat-card:hover .cat-icon, .tool-card:hover .t-icon { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 16px rgba(123,47,247,.28); }
.cat-icon, .tool-card .t-icon { transition: background var(--fast) var(--ease), color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }

/* Card accent top border (premium SaaS look) */
.cat-card, .tool-card { position: relative; }
.cat-card::before, .tool-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--grad-brand); opacity: 0; transition: opacity var(--fast) var(--ease);
}
.cat-card:hover::before, .tool-card:hover::before { opacity: 1; }

/* Dropzone: richer drag + upload feedback */
.dropzone { transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.dropzone:hover { border-color: var(--brand-accent); }
.dropzone.drag {
  border-color: var(--brand-primary) !important; background: rgba(123,47,247,.06) !important;
  box-shadow: 0 0 0 4px rgba(123,47,247,.12); transform: translateY(-2px);
}
.dropzone .dz-icon, .dropzone i { transition: transform var(--fast) var(--ease); }
.dropzone.drag .dz-icon, .dropzone.drag i { transform: translateY(-4px) scale(1.06); }

/* Global toast (success / error feedback) */
.nx-toast-wrap { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.nx-toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); font-size: .9rem; font-weight: 500; pointer-events: auto;
  animation: toast-in .28s var(--ease);
}
.nx-toast .ti { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .7rem; flex-shrink: 0; }
.nx-toast.ok  .ti { background: var(--success); }
.nx-toast.err .ti { background: var(--danger); }
.nx-toast.info .ti { background: var(--info); }
.nx-toast.out { animation: toast-out .24s var(--ease) forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }

/* Inputs / textareas: brand focus ring */
.input:focus, .textarea:focus, .nav-search input:focus, .hero-search input:focus {
  border-color: var(--brand-primary); box-shadow: 0 0 0 4px rgba(123,47,247,.12); outline: none;
}
.input, .textarea { transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }

/* Section eyebrow in gradient */
.section-head .eyebrow { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }

/* FAQ open marker + related/prev-next hover in brand */
.pn-link:hover, .related-card:hover { border-color: var(--brand-primary) !important; box-shadow: var(--shadow-md); }

/* Reduced motion: neutralise the added ambient motion */
@media (prefers-reduced-motion: reduce) {
  .float-icon { animation: none !important; }
  .nx-toast, .nx-toast.out { animation: none !important; }
  .card:hover, .btn-primary:hover, .dropzone.drag { transform: none !important; }
}

/* ============================================================
   AI TOOLS (Gemini-powered) — added in Round 7
   ============================================================ */
.ai-chip{display:inline-flex;align-items:center;gap:8px;margin-top:14px;padding:7px 14px;
  border-radius:var(--r-pill);font-size:.8rem;font-weight:600;color:#fff;
  background:var(--grad-brand);box-shadow:var(--shadow-sm)}
.ai-form{display:flex;flex-direction:column;gap:16px}
.ai-field{display:flex;flex-direction:column;gap:7px}
.ai-label{font-weight:600;font-size:.92rem;color:var(--text)}
.ai-label .req{color:var(--danger)}
.ai-textarea{resize:vertical;min-height:110px;line-height:1.55}
.ai-actions-top{margin-top:4px}
.ai-status{margin-top:14px}
.ai-status .notice{margin:0}
.ai-output-wrap{margin-top:20px;border:1px solid var(--border);border-radius:var(--r-md);
  overflow:hidden;background:var(--bg-soft)}
.ai-output-head{display:flex;align-items:center;justify-content:space-between;gap:12px;
  flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid var(--border);background:var(--bg)}
.ai-output-title{font-weight:700;font-size:.95rem;display:inline-flex;align-items:center;gap:8px}
.ai-output-title i{color:var(--brand-primary)}
.ai-output-tools{display:flex;gap:8px;flex-wrap:wrap}
.ai-output{padding:18px 20px;white-space:pre-wrap;word-wrap:break-word;line-height:1.7;
  font-size:.96rem;color:var(--text);max-height:600px;overflow:auto}
.ai-output:focus{outline:2px solid var(--brand-primary);outline-offset:-2px}
/* AI hub grouped sections */
.ai-group{margin-top:40px}
.ai-group-head{display:flex;align-items:center;gap:14px;margin-bottom:18px}
.ai-group-head .gi{width:46px;height:46px;flex:none;display:grid;place-items:center;
  border-radius:var(--r-md);font-size:1.15rem;color:#fff;background:var(--grad-brand);box-shadow:var(--shadow-sm)}
.ai-group-head h2{margin:0;font-size:1.4rem}
.ai-group-head p{margin:2px 0 0;color:var(--muted);font-size:.9rem}
@media (max-width:560px){.ai-output-tools{width:100%}.ai-output-tools .btn{flex:1}}

/* ============================================================
   ROUND 10 — Calculator Hub
   Scoped to `body.is-calc` (the 15 tools in the `calc` category).
   The brief asks to "redesign every input" but also forbids
   redesigning anything outside the Calculator Hub; `.input` is
   shared by all 128 tool pages, so the restyle is scoped rather
   than applied globally.
   ============================================================ */

/* --- Inputs: 16px radius + larger padding, per the brief ----- */
body.is-calc .input,
body.is-calc .textarea,
body.is-calc select.input {
  padding: 14px 16px;
  border-radius: var(--r-lg);
}
body.is-calc .field label { font-size: 0.92rem; margin-bottom: 8px; }

/* --- Error surface fix --------------------------------------
   `.stat-pills` is a tinted, bordered result panel. Ten
   calculators inject a red `.notice.err` into it on invalid
   input, which rendered an error box nested inside a lavender
   result panel. `.is-plain` (set by calc-enhance.js, with a
   :has() fallback below) drops the panel chrome while an error
   is showing, so validation reads as an error and not a result.
   ------------------------------------------------------------ */
body.is-calc .stat-pills.is-plain,
body.is-calc .calc-out.is-plain {
  background: transparent;
  border-color: transparent;
  padding: 0;
  animation: none;
}
@supports selector(:has(*)) {
  body.is-calc .stat-pills:has(> .notice),
  body.is-calc .calc-out:has(> .notice) {
    background: transparent;
    border-color: transparent;
    padding: 0;
    animation: none;
  }
}
body.is-calc .stat-pills.is-plain > .notice,
body.is-calc .calc-out > .notice { margin: 0; flex: 1 1 100%; }

/* --- Result container for tools that had no result surface --- */
body.is-calc .calc-out:empty { display: none; }

/* --- Copy / Reset toolbar ----------------------------------- */
.calc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.calc-actions-msg {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 1em;
}
/* Touch target floor (brief: accessibility → touch targets). */
.calc-actions .btn { min-height: 44px; }

@media (max-width: 480px) {
  .calc-actions { gap: 8px; }
  .calc-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* --- Animated result appearance, for parity ------------------
   `.stat-pills` and `.result-panel` both animate in; `.result-box`
   (used by the BMI calculator) did not, so 14 of 15 calculators
   animated their result and one appeared instantly. Scoped to the
   Calculator Hub, and inherits the existing reduced-motion guard.
   ------------------------------------------------------------ */
body.is-calc .result-box { animation: resultIn var(--med) var(--ease) both; }
