/* ==========================================================================
   AMG Tools — Design System
   "Midnight Neon" — Vercel x Linear x Stripe. Dark-first, light theme via
   [data-theme="light"] overrides. Plain CSS, no preprocessor, no build step.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg-base:      #07080F;
  --bg-elevated:  #0E1020;
  --bg-glass:     rgba(255, 255, 255, 0.045);
  --bg-glass-strong: rgba(255, 255, 255, 0.08);
  --border:       rgba(255, 255, 255, 0.09);
  --border-hover: rgba(124, 131, 253, 0.45);

  --text-primary:   #F2F4FF;
  --text-secondary: #9BA3C7;
  --text-muted:     #5C648C;

  --accent-1: #7C83FD; /* indigo */
  --accent-2: #00E5C0; /* mint */
  --accent-3: #FF5DA2; /* magenta */
  --accent-4: #FFB800; /* amber — warnings/highlights only */

  --accent-1-rgb: 124, 131, 253;
  --accent-2-rgb: 0, 229, 192;
  --accent-3-rgb: 255, 93, 162;
  --accent-4-rgb: 255, 184, 0;

  --gradient-brand: linear-gradient(135deg, #7C83FD 0%, #00E5C0 100%);
  --gradient-heat:  linear-gradient(135deg, #FF5DA2 0%, #FFB800 100%);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-glow: 0 0 0 1px rgba(124, 131, 253, .2), 0 18px 45px -12px rgba(124, 131, 253, .35);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -20px rgba(0, 0, 0, 0.6);

  --success: #00E5C0;
  --danger:  #FF5D5D;
  --warning: #FFB800;

  --header-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --max-width: 1240px;

  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: dark;
}

/* Light theme overrides */
[data-theme="light"] {
  --bg-base:      #F6F7FB;
  --bg-elevated:  #FFFFFF;
  --bg-glass:     rgba(14, 16, 32, 0.035);
  --bg-glass-strong: rgba(14, 16, 32, 0.06);
  --border:       rgba(14, 16, 32, 0.10);
  --border-hover: rgba(124, 131, 253, 0.5);

  --text-primary:   #10121F;
  --text-secondary: #4A4F6B;
  --text-muted:     #7B8099;

  --shadow-glow: 0 0 0 1px rgba(124, 131, 253, .18), 0 18px 45px -12px rgba(124, 131, 253, .28);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 20px 40px -20px rgba(20, 20, 40, 0.18);

  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-base:      #F6F7FB;
    --bg-elevated:  #FFFFFF;
    --bg-glass:     rgba(14, 16, 32, 0.035);
    --bg-glass-strong: rgba(14, 16, 32, 0.06);
    --border:       rgba(14, 16, 32, 0.10);
    --border-hover: rgba(124, 131, 253, 0.5);

    --text-primary:   #10121F;
    --text-secondary: #4A4F6B;
    --text-muted:     #7B8099;

    --shadow-glow: 0 0 0 1px rgba(124, 131, 253, .18), 0 18px 45px -12px rgba(124, 131, 253, .28);
    --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 20px 40px -20px rgba(20, 20, 40, 0.18);
    color-scheme: light;
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.5em;
}
p { margin: 0 0 1em; color: var(--text-secondary); }
ul, ol { margin: 0; padding: 0; list-style: none; }
code, pre, kbd, samp { font-family: var(--font-mono); }
input, select, textarea { font: inherit; color: inherit; }

/* ---------- Focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 1000;
  background: var(--accent-2);
  color: #07080F;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 10px;
}
.section { padding: 72px 0; position: relative; }
.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.section-head p { font-size: 1.05rem; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background-color 220ms var(--ease), border-color 220ms var(--ease), backdrop-filter 220ms var(--ease);
}
.site-header.is-scrolled {
  background: rgba(7, 8, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
[data-theme="light"] .site-header.is-scrolled { background: rgba(246, 247, 251, 0.78); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .site-header.is-scrolled { background: rgba(246, 247, 251, 0.78); }
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  flex-shrink: 0;
}
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
  white-space: nowrap;
}
.main-nav a:hover { color: var(--text-primary); background: var(--bg-glass); }
.main-nav a[aria-current] {
  color: var(--text-primary);
  background: var(--bg-glass);
  box-shadow: inset 0 0 0 1px var(--border-hover);
}

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.theme-toggle, .hamburger {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 160ms var(--ease), transform 160ms var(--ease);
}
.theme-toggle:hover, .hamburger:hover { border-color: var(--border-hover); }
.theme-toggle svg, .hamburger svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }
}

.hamburger { display: none; }

/* Mobile drawer */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(7, 8, 15, 0.97);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms var(--ease), visibility 220ms var(--ease);
}
[data-theme="light"] .nav-drawer { background: rgba(246, 247, 251, 0.98); }
.nav-drawer.is-open { opacity: 1; visibility: visible; }
.nav-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.nav-drawer-close {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.nav-drawer nav { display: flex; flex-direction: column; gap: 4px; }
.nav-drawer nav a {
  padding: 16px 8px;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}
.nav-drawer nav a[aria-current] {
  background: linear-gradient(90deg, rgba(124,131,253,.16), transparent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), border-color 200ms var(--ease), background-color 200ms var(--ease), opacity 160ms var(--ease);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--gradient-brand);
  color: #06070D;
  box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-glow), 0 1px 0 rgba(255,255,255,0.35) inset; }
.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--border-hover); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 14px;
}
.btn-ghost:hover:not(:disabled) { color: var(--text-primary); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ---------- Glass card ---------- */
.card {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), box-shadow 220ms var(--ease);
}
.card-hover:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow), var(--shadow-card);
}

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; text-align: center; }
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  max-width: 900px;
  margin: 0 auto 18px;
}
.hero-sub {
  max-width: 620px;
  margin: 0 auto 32px;
  font-size: 1.15rem;
  color: var(--text-secondary);
}
.search-shell { max-width: 640px; margin: 0 auto 20px; position: relative; }
.search-input {
  width: 100%;
  padding: 18px 24px 18px 54px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 1.05rem;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--border-hover); box-shadow: var(--shadow-glow); }
.search-icon {
  position: absolute;
  left: 22px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}
.trust-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.chip svg { width: 14px; height: 14px; color: var(--accent-2); }

/* ---------- Category pills ---------- */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 24px 0 8px;
}
.pill {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 160ms var(--ease);
}
.pill:hover { border-color: var(--border-hover); color: var(--text-primary); }
.pill[aria-pressed="true"] {
  background: var(--gradient-brand);
  color: #06070D;
  border-color: transparent;
  font-weight: 700;
}

/* ---------- Tool grid ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  padding: 32px 0;
}
.tool-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 420ms var(--ease), transform 420ms var(--ease), border-color 220ms var(--ease), box-shadow 220ms var(--ease);
}
.tool-card.is-visible { opacity: 1; transform: translateY(0); }
.tool-card-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-glass-strong);
  border-radius: var(--radius-sm);
}
.tool-card-icon svg { width: 24px; height: 24px; }
.tool-card h3 { font-size: 1.08rem; margin-bottom: 4px; }
.tool-card p { font-size: 0.92rem; margin-bottom: 0; flex-grow: 1; }
.tool-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.tool-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.tool-arrow { width: 18px; height: 18px; color: var(--accent-2); transition: transform 220ms var(--ease); }
.tool-card:hover .tool-arrow { transform: translateX(5px); }
.tool-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-glow); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state a { color: var(--accent-2); font-weight: 600; }

/* ---------- Why band ---------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.why-item { text-align: left; padding: 8px; }
.why-item svg { width: 30px; height: 30px; margin-bottom: 14px; }
.why-item h3 { font-size: 1.05rem; margin-bottom: 6px; }
.why-item p { font-size: 0.92rem; margin: 0; }

/* ---------- FAQ accordion ---------- */
.faq-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  overflow: hidden;
}
.faq-item summary {
  padding: 18px 22px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.98rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '';
  width: 10px; height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 200ms var(--ease);
  flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(-135deg); }
.faq-item p { padding: 0 22px 20px; margin: 0; font-size: 0.92rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 56px 0 28px; margin-top: 40px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
  margin-bottom: 40px;
}
.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--text-secondary); font-size: 0.92rem; }
.footer-col a:hover { color: var(--accent-2); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-legal { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-legal a { color: var(--text-muted); }
.footer-legal a:hover { color: var(--text-secondary); }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 20px 0 0;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-2); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--text-secondary); }

/* ---------- Privacy badge ---------- */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 229, 192, 0.1);
  border: 1px solid rgba(0, 229, 192, 0.3);
  color: var(--accent-2);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 16px 0 28px;
}
.privacy-badge svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------- Tool page header ---------- */
.tool-header { padding: 8px 0 20px; }
.tool-header h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 8px; }
.tool-header .tool-desc { font-size: 1.05rem; max-width: 680px; }

/* ---------- Tool card / workspace ---------- */
.tool-card-lg { padding: 28px; margin-bottom: 48px; }
@media (min-width: 640px) { .tool-card-lg { padding: 36px; } }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease);
  background: var(--bg-glass);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--border-hover); }
.dropzone.is-dragover {
  border-color: var(--accent-2);
  background: rgba(0, 229, 192, 0.06);
  box-shadow: 0 0 0 4px rgba(0, 229, 192, 0.08);
}
.dropzone svg { width: 40px; height: 40px; margin: 0 auto 14px; color: var(--accent-1); }
.dropzone-title { font-weight: 600; font-size: 1.05rem; margin-bottom: 4px; }
.dropzone-hint { font-size: 0.85rem; color: var(--text-muted); margin: 6px 0 0; }
.dropzone input[type="file"] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass-strong);
  border: 1px solid var(--border);
  font-size: 0.88rem;
}
.file-row-name { flex-grow: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row-size { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.8rem; flex-shrink: 0; }
.file-row-remove {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
}
.file-row-remove:hover { color: var(--danger); background: rgba(255,93,93,0.1); }

.options-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.field select, .field input[type="text"], .field input[type="number"] {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.field select:focus, .field input:focus { border-color: var(--border-hover); }
.field input.mono { font-family: var(--font-mono); }
.field input[type="range"] {
  width: 100%;
  accent-color: var(--accent-1);
}
.field-value { font-family: var(--font-mono); color: var(--accent-2); font-size: 0.85rem; }

.action-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 24px; }

.progress-wrap { margin-top: 20px; }
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-glass-strong);
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--gradient-brand);
  border-radius: 999px;
  transition: width 160ms var(--ease);
}
.progress-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; text-align: right; }

.result-area {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.result-preview {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 20px;
}
.result-preview img { max-width: 260px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.result-stat { font-size: 0.88rem; color: var(--text-secondary); }
.result-stat strong { color: var(--accent-2); font-family: var(--font-mono); }

/* ---------- Rephraser: engine strip, counter, variant cards ---------- */
.engine-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-glass);
}
.engine-strip svg { width: 18px; height: 18px; color: var(--accent-2); flex-shrink: 0; }
.engine-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
}
.engine-note {
  flex: 1 1 260px;
  min-width: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}
.char-counter {
  display: block;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: right;
}
.char-counter.is-over { color: var(--accent-4); }

.variant-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.variant-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  transition: border-color 220ms cubic-bezier(.2,.8,.2,1), box-shadow 220ms cubic-bezier(.2,.8,.2,1);
}
.variant-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-glow); }
.variant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.variant-head h3 {
  font-size: 1.05rem;
  margin: 0;
  letter-spacing: -0.02em;
}
.variant-blurb { margin: 4px 0 0; font-size: 0.82rem; color: var(--text-muted); }
/* Writing-tool layout above the action row. */
.mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
}
.mode-label {
  font-size: .82rem;
  color: var(--text-muted);
  margin-right: 2px;
}

.variant-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  white-space: nowrap;
}
.variant-badge.is-ai {
  border-color: rgba(0, 229, 192, 0.4);
  background: rgba(0, 229, 192, 0.1);
  color: var(--accent-2);
}
.variant-text {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text-primary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.variant-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-2);
}
.variant-notes { margin: 0; font-size: 0.82rem; line-height: 1.5; color: var(--text-secondary); }
.variant-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

@media (max-width: 480px) {
  .variant-list { grid-template-columns: 1fr; }
  .variant-card { padding: 16px; }
}

.example-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.example-chips .pill { font-size: 0.82rem; padding: 7px 14px; }

/* ---------- PDF editor ---------- */
.editor-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.editor-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.editor-tools .pill { font-size: 0.82rem; padding: 7px 13px; }
.editor-history { display: flex; gap: 6px; }

.editor-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}
.editor-main { min-width: 0; }
.editor-pagebar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.editor-nav { display: flex; align-items: center; gap: 8px; }
.editor-nav .btn { min-width: 38px; }

.canvas-scroll {
  overflow: auto;
  max-height: 70vh;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background:
    linear-gradient(45deg, rgba(255,255,255,.02) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.02) 75%) 0 0/24px 24px,
    var(--bg-base);
  display: flex;
  justify-content: center;
}
.page-stage {
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 18px 45px -12px rgba(0,0,0,.6);
}
.page-stage canvas { display: block; border-radius: 2px; }

.object-layer { position: absolute; inset: 0; touch-action: none; }
.object-layer[data-mode="select"] { cursor: default; }
.object-layer[data-mode="text"] { cursor: text; }
.object-layer[data-mode="draw"] { cursor: crosshair; }
.object-layer[data-mode="highlight"],
.object-layer[data-mode="whiteout"],
.object-layer[data-mode="box"] { cursor: crosshair; }

.pdf-obj { position: absolute; box-sizing: border-box; }
.object-layer[data-mode="select"] .pdf-obj { cursor: move; }
.pdf-obj.is-ink { pointer-events: none; }
.object-layer[data-mode="select"] .pdf-obj.is-ink { pointer-events: auto; }
.pdf-obj.is-selected { outline: 1.5px dashed var(--accent-1); outline-offset: 1px; }
.pdf-obj img { width: 100%; height: 100%; object-fit: fill; display: block; }
.pdf-text-body {
  width: 100%;
  min-height: 100%;
  line-height: 1.2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  outline: none;
}
.pdf-text-body.is-editing {
  /* No fill: a tint here sits on top of the page's own colour or gradient
     and reads as a visibly wrong patch. The outline ring alone is enough
     to show which box is live, the way a caret already shows where. */
  box-shadow: 0 0 0 1.5px var(--accent-1);
  cursor: text;
}
.pdf-obj-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent-1);
  border: 1px solid #fff;
  cursor: nwse-resize;
}
.pdf-hotspot {
  position: absolute;
  padding: 0;
  border: 1px solid rgba(0, 229, 192, .55);
  background: rgba(0, 229, 192, .16);
  border-radius: 2px;
  cursor: pointer;
}
.pdf-hotspot:hover { background: rgba(0, 229, 192, .34); }

.editor-pageops { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* Contextual formatting bar, positioned by JS directly above the selected
   object — mirrors clicking text in a word processor and getting a floating
   format bar right there, rather than only a fixed side panel. */
.float-toolbar {
  position: absolute;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  box-shadow: var(--shadow-glow);
  white-space: nowrap;
}
.ft-group { display: flex; align-items: center; gap: 6px; }
.ft-select, .ft-size {
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 0.82rem;
}
.ft-size { width: 54px; }
.ft-select { max-width: 96px; }
.ft-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 160ms var(--ease), color 160ms var(--ease);
}
.ft-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.ft-btn[aria-pressed="true"] {
  background: var(--gradient-brand);
  border-color: transparent;
  color: #07080F;
  font-weight: 600;
}
.ft-color {
  width: 30px;
  height: 30px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-base);
  cursor: pointer;
}
.ft-opacity-label { font-size: 0.76rem; color: var(--text-muted); }
#ft-opacity { width: 80px; }
.ft-done {
  background: var(--gradient-brand);
  border-color: transparent;
  color: #07080F;
  font-weight: 600;
}
@media (max-width: 480px) {
  .float-toolbar { flex-wrap: wrap; max-width: min(94vw, 320px); }
}


.editor-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.prop-panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-glass);
}
.prop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.prop-toggles { display: flex; gap: 6px; margin-top: 10px; }
.prop-toggles .pill { font-size: 0.8rem; padding: 6px 12px; }
.prop-hint { margin: 12px 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--text-muted); }
.prop-panel input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.thumb-wrap {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-glass);
}
.thumb-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}
.pdf-thumb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 160ms var(--ease);
}
.pdf-thumb:hover { border-color: var(--border-hover); }
.pdf-thumb.is-current { border-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-2) inset; }
.pdf-thumb-img {
  display: block;
  width: 46px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 4px;
  background: #fff center/contain no-repeat;
}
.pdf-thumb-no { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); }

@media (max-width: 900px) {
  .editor-body { grid-template-columns: minmax(0, 1fr); }
  .editor-side { flex-direction: column; }
  .thumb-strip { flex-direction: row; max-height: none; padding-bottom: 4px; }
  .pdf-thumb { flex-direction: column; gap: 4px; }
  .canvas-scroll { max-height: 60vh; padding: 10px; }
}
@media (max-width: 480px) {
  .editor-tools .pill { font-size: 0.78rem; padding: 6px 10px; }
  .editor-pageops .btn { flex: 1 1 auto; }
}

/* ---------- Text tool input/output areas ---------- */
.text-input-area {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
}
.text-input-area.mono { font-family: var(--font-mono); font-size: 0.85rem; }
.text-input-area:focus { border-color: var(--border-hover); }
.text-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .text-pair { grid-template-columns: 1fr; }
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.stat-tile {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass-strong);
  border: 1px solid var(--border);
  text-align: center;
}
.stat-tile .stat-num {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-2);
  display: block;
}
.stat-tile .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.gauge {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-glass-strong);
  overflow: hidden;
  margin: 8px 0;
}
.gauge-fill { height: 100%; border-radius: 999px; }
.diff-add { background: rgba(0,229,192,0.22); color: #baffef; border-radius: 3px; }
.diff-del { background: rgba(255,93,93,0.22); color: #ffc4c4; text-decoration: line-through; border-radius: 3px; }
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.checkbox-row input { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Thumbnail / page grid (drag to reorder) ---------- */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.thumb-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-glass-strong);
  padding: 8px;
  cursor: grab;
  transition: border-color 160ms var(--ease), transform 160ms var(--ease), opacity 160ms var(--ease);
  user-select: none;
}
.thumb-card:hover { border-color: var(--border-hover); }
.thumb-card.is-dragging { opacity: 0.4; }
.thumb-card.is-drop-target { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(0,229,192,0.25); }
.thumb-card canvas, .thumb-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-base);
  display: block;
}
.thumb-index {
  position: absolute;
  top: 14px; left: 14px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
}
.thumb-name {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thumb-actions {
  position: absolute;
  top: 12px; right: 12px;
  display: flex;
  gap: 4px;
}
.thumb-btn {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.thumb-btn:hover { background: rgba(0,0,0,0.85); }
.thumb-btn svg { width: 13px; height: 13px; }

/* ---------- How to use / features / FAQ blocks on tool pages ---------- */
.info-block { padding: 40px 0; }
.steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  counter-reset: step;
}
.step-item { position: relative; padding-left: 46px; }
.step-item::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #06070D;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
}
.step-item h4 { font-size: 0.98rem; margin-bottom: 4px; }
.step-item p { font-size: 0.88rem; margin: 0; }

.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.feature-item {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
.feature-item svg { width: 18px; height: 18px; color: var(--accent-2); flex-shrink: 0; margin-top: 1px; }

/* ---------- Related tools ---------- */
.related-strip { padding: 12px 0 40px; }

/* ---------- Ad slots ---------- */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 32px auto;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
#ad-slot-top, #ad-slot-mid, #ad-slot-footer { min-height: 100px; max-width: var(--max-width); }
#ad-slot-sidebar { display: none; }
@media (min-width: 1200px) {
  #ad-slot-sidebar {
    display: flex;
    position: sticky;
    top: calc(var(--header-h) + 20px);
    width: 300px;
    min-height: 600px;
  }
}

/* ---------- Toast ---------- */
.toast-region {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
}
.toast {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card), 0 10px 30px -8px rgba(0,0,0,0.5);
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toast-in 220ms var(--ease);
}
.toast.toast-error { border-color: rgba(255, 93, 93, 0.4); }
.toast.toast-success { border-color: rgba(0, 229, 192, 0.4); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast.toast-error svg { color: var(--danger); }
.toast.toast-success svg { color: var(--accent-2); }
.toast.toast-info svg { color: var(--accent-1); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast.is-leaving { animation: toast-out 180ms var(--ease) forwards; }
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px); }
}

/* ---------- Legal / static pages ---------- */
.prose { max-width: 760px; margin: 0 auto; padding: 40px 0 80px; }
.prose h2 { margin-top: 2em; font-size: 1.4rem; }
.prose h3 { margin-top: 1.4em; font-size: 1.1rem; }
.prose ul, .prose ol { list-style: disc; padding-left: 1.4em; margin-bottom: 1em; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.4em; color: var(--text-secondary); }
.prose a { color: var(--accent-2); text-decoration: underline; }
.updated-note { color: var(--text-muted); font-size: 0.85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .main-nav { display: none; }
  .hamburger { display: inline-flex; }
}
@media (max-width: 600px) {
  .section { padding: 48px 0; }
  .hero { padding: 40px 0 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
