/* =========================================================
   PDFperch – Clean Neumorphic Design System
   Organized, mobile-first, no bloat
   ========================================================= */

/* ─── 1. CSS Variables ─────────────────────────────────── */
:root {
  color-scheme: light;

  --accent:        #4553e8;
  --accent-vivid:  #3730d6;
  --accent-light:  #5b6bf5;
  --accent-glow:   rgba(69, 83, 232, 0.14);

  --bg-root:       #e9edf5;
  --bg-surface:    #e9edf5;
  --bg-card:       #e9edf5;
  --bg-card-hover: #eef1f8;
  --bg-input:      #e9edf5;
  --bg-overlay:    rgba(233, 237, 245, 0.92);
  --bg-header:     rgba(233, 237, 245, 0.9);
  --bg-nav-panel:  rgba(233, 237, 245, 0.98);
  --bg-accent-soft:   rgba(69, 83, 232, 0.10);
  --bg-accent-softer: rgba(69, 83, 232, 0.06);

  --text-primary:   #1b2033;
  --text-secondary: #4b5468;
  --text-muted:     #6b7387;
  --text-inverse:   #ffffff;
  --text-on-accent: #ffffff;

  --border-subtle: rgba(27, 32, 51, 0.06);
  --border-card:   rgba(27, 32, 51, 0.07);
  --border-focus:  rgba(69, 83, 232, 0.45);

  --neu-light: #ffffff;
  --neu-dark:  rgba(163, 177, 198, 0.55);
  --shadow-neu-sm:       3px 3px 7px var(--neu-dark), -3px -3px 7px var(--neu-light);
  --shadow-neu-flat:     6px 6px 12px var(--neu-dark), -6px -6px 12px var(--neu-light);
  --shadow-neu-lg:       10px 10px 22px var(--neu-dark), -10px -10px 22px var(--neu-light);
  --shadow-neu-pressed:  inset 3px 3px 7px var(--neu-dark), inset -3px -3px 7px var(--neu-light);
  --shadow-neu-pressed-lg: inset 5px 5px 11px var(--neu-dark), inset -5px -5px 11px var(--neu-light);

  --shadow-sm:   var(--shadow-neu-sm);
  --shadow-md:   var(--shadow-neu-flat);
  --shadow-lg:   var(--shadow-neu-lg);
  --shadow-glow: var(--shadow-neu-flat), 0 4px 14px var(--accent-glow);
  --shadow-hover:var(--shadow-neu-lg);

  --success:        #15803d;
  --success-strong: #166534;
  --success-bg:     rgba(22, 163, 74, 0.10);
  --success-border: rgba(22, 101, 52, 0.25);
  --warning:        #b45309;
  --warning-bg:     rgba(245, 158, 11, 0.12);
  --warning-border: rgba(180, 83, 9, 0.28);
  --danger:         #b91c1c;
  --danger-strong:  #991b1b;
  --danger-bg:      rgba(220, 38, 38, 0.10);
  --danger-border:  rgba(153, 27, 27, 0.25);

  --r-sm:   10px;
  --r-md:   16px;
  --r-lg:   22px;
  --r-xl:   18px;
  --r-full: 9999px;

  --header-h: 64px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --input-h: 48px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --accent:        #4f9eff;
  --accent-vivid:  #2979ff;
  --accent-light:  #80bdff;
  --accent-glow:   rgba(79, 158, 255, 0.25);

  --bg-root:       #232a3a;
  --bg-surface:    #232a3a;
  --bg-card:       #232a3a;
  --bg-card-hover: #262e40;
  --bg-input:      #232a3a;
  --bg-overlay:    rgba(35, 42, 58, 0.9);
  --bg-header:     rgba(35, 42, 58, 0.88);
  --bg-nav-panel:  rgba(28, 34, 47, 0.98);
  --bg-accent-soft:   rgba(79, 158, 255, 0.14);
  --bg-accent-softer: rgba(79, 158, 255, 0.08);

  --text-primary:   #f0f4ff;
  --text-secondary: #c3d3ee;
  --text-muted:     #9fb1cf;
  --text-inverse:   #ffffff;
  --text-on-accent: #ffffff;

  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-card:   rgba(79, 158, 255, 0.14);
  --border-focus:  rgba(79, 158, 255, 0.50);

  --neu-light: rgba(255, 255, 255, 0.045);
  --neu-dark:  rgba(0, 0, 0, 0.55);

  --success:        #4ade80;
  --success-strong: #16a34a;
  --success-bg:     rgba(34, 197, 94, 0.14);
  --success-border: rgba(74, 222, 128, 0.35);
  --warning:        #fbbf24;
  --warning-bg:     rgba(251, 191, 36, 0.14);
  --warning-border: rgba(251, 191, 36, 0.38);
  --danger:         #f87171;
  --danger-strong:  #dc2626;
  --danger-bg:      rgba(248, 113, 113, 0.14);
  --danger-border:  rgba(248, 113, 113, 0.38);
}

/* ─── 2. Reset & Base ──────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-root);
  color: var(--text-primary);
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img, iframe, canvas, svg { max-width: 100%; }

/* ─── 3. Typography ────────────────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.35rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

p {
  margin-bottom: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s, opacity 0.15s;
}
a:hover { color: var(--accent-light); opacity: 0.9; }

code {
  background: rgba(79, 158, 255, 0.12);
  color: var(--accent-light);
  padding: 0.15rem 0.45rem;
  border-radius: var(--r-sm);
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.875em;
}

/* Focus styles */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent-light);
  outline-offset: 3px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px var(--bg-root), 0 0 0 4px var(--accent-light);
}
.tool-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  box-shadow: 0 0 0 2px var(--bg-root), 0 0 0 5px var(--accent);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -120px;
  background: #fff;
  color: #111827;
  border-radius: var(--r-sm);
  padding: 0.65rem 0.95rem;
  font-weight: 700;
  z-index: 5000;
  box-shadow: var(--shadow-md);
}
.skip-link:focus { top: 0.75rem; }

/* ─── 4. Layout ────────────────────────────────────────── */
.app-container {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(0.75rem, 2.5vw, 2rem);
  position: relative;
  z-index: 1;
  overflow-x: clip;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ─── 5. Header & Navigation ───────────────────────────── */
.site-header {
  background: var(--bg-header);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px var(--neu-dark);
}

.header-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--header-h);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1rem;
}

.logo { flex: 0 0 auto; }
.logo a {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
  white-space: nowrap;
}
.logo a:hover { color: var(--accent); }
.logo a::before {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  flex-shrink: 0;
}

.main-nav {
  min-width: 0;
  margin-left: auto;
}
.main-nav ul {
  display: flex;
  list-style: none;
  gap: 0.2rem;
  flex-wrap: nowrap;
  align-items: center;
}
.main-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: var(--r-full);
  transition: background 0.2s, color 0.2s;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.main-nav a:hover {
  background: var(--bg-accent-soft);
  color: var(--accent-light);
  text-decoration: none;
}
.main-nav a.active {
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: var(--shadow-neu-pressed);
}

/* Hamburger toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  min-width: auto;
  width: auto;
  height: auto;
  box-shadow: none;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-toggle .bar {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.active .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active .bar:nth-child(2) { opacity: 0; }
.nav-toggle.active .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav backdrop */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-h);
  background: var(--bg-overlay);
  z-index: 998;
  cursor: pointer;
}
.nav-backdrop.visible { display: block; }

/* Theme toggle */
.theme-toggle-btn {
  background: var(--bg-surface);
  border: none;
  color: var(--text-primary);
  border-radius: var(--r-full);
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, box-shadow 0.2s;
  padding: 0;
  min-width: unset;
  box-shadow: var(--shadow-neu-sm);
  flex: 0 0 40px;
}
.theme-toggle-btn:hover { color: var(--accent); }
.theme-toggle-btn:active { box-shadow: var(--shadow-neu-pressed); }
.theme-toggle-btn svg {
  width: 20px; height: 20px;
  stroke-width: 2;
}

/* ─── 6. Hero ──────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: clamp(3rem, 8vw, 5.5rem) clamp(1rem, 4vw, 2rem) clamp(2.5rem, 6vw, 4.5rem);
  margin: 1.5rem 0 2rem;
  text-align: center;
  background: var(--bg-root);
  box-shadow: var(--shadow-neu-lg);
}

.hero::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 55% 45% at 22% 20%, var(--bg-accent-soft) 0%, transparent 65%),
    radial-gradient(ellipse 45% 40% at 82% 10%, var(--bg-accent-softer) 0%, transparent 60%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 65%);
  opacity: 0.6;
}

.hero-eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto 1.25rem;
  padding: 0.4rem 1rem;
  background: var(--bg-card);
  box-shadow: var(--shadow-neu-sm);
  border-radius: var(--r-full);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--accent-vivid);
}

.hero h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.9rem, 5vw, 3.4rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

.hero h1 em, .hero h1 .accent-text {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent-vivid), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  position: relative;
  z-index: 1;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 2rem;
  line-height: 1.65;
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2.25rem;
}
.stat-item {
  background: var(--bg-card);
  box-shadow: var(--shadow-neu-sm);
  padding: 0.45rem 1.1rem;
  border-radius: var(--r-full);
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.stat-item strong { color: var(--text-primary); font-weight: 700; }

.hero-cta {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.875rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.25rem;
}

.hero-trust-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-subtle);
  max-width: 720px;
  margin: 0 auto;
}

.hero-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.hero-trust-item svg {
  width: 15px; height: 15px;
  color: var(--success);
  flex-shrink: 0;
}

/* Usage counter (tool pages) */
.usage-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto 1.5rem;
  padding: 0.4rem 1.1rem;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--r-full);
  font-size: 0.875rem;
  color: var(--success-strong);
  font-weight: 500;
  position: relative;
  z-index: 1;
}
.counter-dot {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.75; transform: scale(1.15); }
}

/* ─── 7. Tool Grid ─────────────────────────────────────── */
#homeSection { margin: 0; }
#homeSection h2 {
  font-size: 1.5rem;
  border: none;
  padding: 0;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  text-transform: none;
  font-weight: 700;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.125rem;
  margin: 0.5rem 0 3rem;
}

/* ─── 8. Tool Cards ────────────────────────────────────── */
.tool-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 1.75rem 1rem 1.375rem;
  box-shadow: var(--shadow-neu-flat);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
  cursor: pointer;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.tool-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(79, 158, 255, 0.08), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 2;
}
.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-neu-lg);
  text-decoration: none;
  color: inherit;
}
.tool-card:hover::before { opacity: 1; }
.tool-card:hover::after  { opacity: 1; }
.tool-card:active {
  transform: translateY(0);
  box-shadow: var(--shadow-neu-pressed-lg);
}

.tool-icon {
  margin-bottom: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px; height: 60px;
  background: var(--bg-card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-neu-sm);
  color: var(--accent-light);
  flex-shrink: 0;
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}
.tool-icon svg { width: 32px; height: 32px; display: block; }
.tool-card:hover .tool-icon {
  background: var(--bg-accent-soft);
  transform: scale(1.08);
  color: var(--accent);
}

.tool-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}
.tool-desc {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.45;
}

/* ─── 9. Buttons ───────────────────────────────────────── */
.button, button, .download-btn, .back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: var(--input-h);
  padding: 0 1.5rem;
  border-radius: var(--r-xl);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  min-width: 140px;
  background: var(--accent-vivid);
  color: var(--text-on-accent);
  box-shadow: 5px 5px 12px var(--neu-dark), -5px -5px 12px rgba(255,255,255,0.25);
  position: relative;
  overflow: hidden;
}
.button::after, button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.08), transparent);
  pointer-events: none;
}
.button:hover, button:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 7px 7px 16px var(--neu-dark), -7px -7px 16px rgba(255,255,255,0.3);
  color: var(--text-on-accent);
  text-decoration: none;
}
.button:active, button:active {
  box-shadow: inset 3px 3px 7px rgba(0,0,0,0.25), inset -3px -3px 7px rgba(255,255,255,0.08);
  transform: translateY(0);
}
.button.secondary, button.secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  box-shadow: var(--shadow-neu-sm);
}
.button.secondary:hover, button.secondary:hover {
  color: var(--accent-light);
  box-shadow: var(--shadow-neu-flat);
  transform: translateY(-2px);
}
.download-btn {
  background: linear-gradient(135deg, var(--success), var(--success-strong));
}
.back-btn {
  background: var(--bg-surface);
  color: var(--text-secondary);
  box-shadow: var(--shadow-neu-sm);
  min-width: 120px;
}
.back-btn:hover { color: var(--accent-light); box-shadow: var(--shadow-neu-flat); }
button:disabled, .button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Floating action */
.floating-action {
  position: fixed;
  right: 1rem; bottom: 1rem;
  z-index: 9999;
  display: none;
  min-width: 3.5rem;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  box-shadow: 8px 8px 20px var(--neu-dark), -8px -8px 20px var(--neu-light);
  text-align: center;
  line-height: 1;
}

/* ─── 10. Content Sections ─────────────────────────────── */
.tool-panel, .content-section, .premium-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 2.25rem;
  margin: 1.75rem 0;
  box-shadow: var(--shadow-neu-flat);
  min-height: 120px;
  position: relative;
  overflow-wrap: anywhere;
}
.content-section h2 {
  font-size: 1.45rem;
  border: none; padding: 0;
  margin-bottom: 1rem;
}
.content-section h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--accent-light);
}
.content-section ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}
.content-section li {
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.content-section li strong { color: var(--text-primary); }

/* Privacy/terms content links */
.seo-content a, .content-section a {
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Steps grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.step-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-neu-sm);
  padding: 2rem 1.5rem 1.5rem;
  border-radius: var(--r-lg);
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}
.step-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-neu-flat); }
.step-num {
  position: absolute;
  top: -15px; left: 20px;
  width: 38px; height: 38px;
  background: var(--accent-vivid);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(41,121,255,0.4);
}

/* FAQ */
.faq-list { margin-top: 1.75rem; }
.faq-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.faq-item h3 { color: var(--text-primary); margin-bottom: 0.5rem; }

.faq-section { margin: 2rem 0; }
.faq-section details {
  margin-bottom: 0.5rem;
  border-radius: var(--r-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-neu-sm);
  transition: box-shadow 0.2s;
}
.faq-section details[open] { box-shadow: var(--shadow-neu-flat); }
.faq-section summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  user-select: none;
}
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--accent);
  transition: transform 0.25s;
  flex-shrink: 0;
}
.faq-section details[open] summary::after { transform: rotate(45deg); }
.faq-section .faq-answer {
  padding: 0 1.25rem 1rem;
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.9rem;
}

/* Blog highlights */
.blog-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.375rem;
  margin-top: 1.75rem;
}
.blog-mini-card {
  background: var(--bg-card-hover);
  padding: 1.375rem;
  border-radius: var(--r-md);
  border-left: 4px solid var(--accent);
}
.blog-mini-card h3 { font-size: 1rem; margin-bottom: 0.6rem; }
.blog-mini-card p { font-size: 0.88rem; margin-bottom: 0; }

/* SEO content blocks */
.content-section .seo-content { max-width: min(100%, 980px); }
.content-section .seo-intro { font-size: 1.02rem; }
.content-section .seo-feature-list li { margin-bottom: 0.65rem; }

/* SEO meta grid */
.content-section .seo-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.content-section .seo-meta-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-neu-sm);
  border-radius: var(--r-md);
  padding: 0.95rem 1rem;
}
.content-section .seo-meta-card strong { color: var(--accent-light); }

/* ─── 11. Tool Header & Breadcrumb ─────────────────────── */
.tool-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.5rem 1.5rem 0;
  max-width: 1380px;
  margin: 0 auto;
}
.breadcrumb a { color: var(--text-secondary); }

/* Tool description callout */
.tool-description {
  background: var(--bg-accent-softer);
  border-radius: var(--r-md);
  padding: 1.1rem 1.4rem;
  margin: 0.875rem 0 1.375rem;
  border-left: 3px solid var(--accent);
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ─── 12. Forms & Inputs ───────────────────────────────── */
.area {
  background: var(--bg-input);
  border-radius: var(--r-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-neu-pressed-lg);
  margin-bottom: 1.25rem;
  transition: box-shadow 0.2s;
}
.area:hover {
  box-shadow: inset 6px 6px 12px var(--neu-dark),
              inset -6px -6px 12px var(--neu-light),
              0 0 0 2px var(--border-focus);
}

.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

input[type="file"],
input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="email"],
select, textarea {
  background: var(--bg-input);
  color: var(--text-primary);
  height: var(--input-h);
  padding: 0 1.2rem;
  border-radius: var(--r-xl);
  border: none;
  box-shadow: var(--shadow-neu-pressed);
  font-size: 0.95rem;
  width: 100%;
  max-width: 420px;
  font-family: var(--font);
  transition: box-shadow 0.2s;
}
textarea {
  height: auto;
  min-height: 120px;
  padding: 1rem 1.2rem;
  line-height: 1.6;
  border-radius: var(--r-md);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238fa3c8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: var(--shadow-neu-pressed), 0 0 0 3px rgba(79,158,255,0.18);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.3rem;
}
input[type="color"] {
  height: 42px;
  padding: 0.2rem;
  border-radius: var(--r-md);
  cursor: pointer;
  max-width: 100%;
}

.input-group { margin-bottom: 1rem; }

.permissions-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.permissions-grid label, .orientation-selector label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
}
.orientation-selector {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
  flex-wrap: wrap;
}

/* ─── 13. File List ────────────────────────────────────── */
.file-list { list-style: none; padding: 0; margin: 1rem 0; }
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 0.65rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-neu-sm);
  flex-wrap: wrap;
  gap: 0.5rem;
  transition: background 0.15s;
}
.file-item:hover { background: var(--bg-accent-softer); }
.file-name {
  flex: 1;
  word-break: break-word;
  padding-right: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.file-meta { color: var(--text-muted); font-size: 0.8em; }
.file-actions { display: flex; gap: 0.3rem; }
.file-actions button {
  background: var(--bg-card);
  color: var(--text-secondary);
  box-shadow: var(--shadow-neu-sm);
  padding: 0 0.8rem;
  height: 30px;
  min-height: auto;
  min-width: auto;
  border-radius: var(--r-full);
  font-size: 0.85rem;
}
.file-actions button:hover { color: var(--accent-light); transform: none; }

/* ─── 14. Drop Zone ────────────────────────────────────── */
.drop-zone {
  border-radius: var(--r-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg-input);
  box-shadow: var(--shadow-neu-pressed-lg);
  transition: box-shadow 0.2s, background 0.2s;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}
.drop-zone p { color: var(--text-secondary); margin: 0; }
.drop-zone p.note {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.3rem;
}
.drop-zone:hover {
  background: var(--bg-accent-softer);
  box-shadow: inset 6px 6px 12px var(--neu-dark),
              inset -6px -6px 12px var(--neu-light),
              0 0 0 2px var(--border-focus);
}
.drop-zone.dragover {
  background: var(--bg-accent-soft);
  animation: border-pulse 1.8s infinite ease-in-out;
}
.drop-zone--selected {
  background: var(--bg-accent-softer);
}
.drop-zone-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
  display: block;
}
.drop-zone svg.drop-icon { transition: transform 0.25s ease; color: var(--text-muted); }
.drop-zone:hover svg.drop-icon,
.drop-zone.drag-over svg.drop-icon { transform: translateY(-4px); color: var(--accent); }

@keyframes border-pulse {
  0%   { box-shadow: var(--shadow-neu-pressed-lg), 0 0 0 0 var(--accent-glow); }
  50%  { box-shadow: var(--shadow-neu-pressed-lg), 0 0 0 8px var(--bg-accent-softer); }
  100% { box-shadow: var(--shadow-neu-pressed-lg), 0 0 0 0 var(--accent-glow); }
}

/* ─── 15. Preview Box ──────────────────────────────────── */
.preview-box {
  background: var(--bg-input);
  border-radius: var(--r-md);
  padding: 1.5rem;
  min-height: 200px;
  margin: 1.25rem 0;
  overflow: auto;
  box-shadow: var(--shadow-neu-pressed);
  width: 100%;
}
.preview-box iframe, .preview-box img, .preview-box canvas {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-sm);
}
.img-thumbnail {
  object-fit: cover;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-neu-sm);
}
.preview-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* ─── 16. Tool Actions ─────────────────────────────────── */
.tool-reset-row, .tool-action-row, .tool-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0.75rem 0 1.25rem;
}
.tool-clear-btn { min-width: 112px; }

/* Status message */
#status, .status-msg {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.5rem 0;
  min-height: 1.2em;
}

/* ─── 17. Progress Bar ─────────────────────────────────── */
.progress-bar, .progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--r-full);
  box-shadow: inset 2px 2px 4px var(--neu-dark), inset -2px -2px 4px var(--neu-light);
  overflow: hidden;
  margin: 0.75rem 0;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-vivid), var(--accent-light));
  border-radius: var(--r-full);
  transition: width 0.4s ease;
  box-shadow: 0 0 10px rgba(79,158,255,0.5);
}

/* Loading spinner */
.spinner {
  animation: spin 0.8s linear infinite;
  border: 4px solid rgba(255,255,255,0.16);
  border-top-color: var(--accent-vivid);
  border-radius: 50%;
  height: 42px; width: 42px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.processing-spinner-overlay {
  align-items: center;
  background: rgba(8,12,24,0.72);
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 9999;
}
.processing-spinner-overlay[hidden] { display: none; }
.processing-spinner-box {
  align-items: center;
  background: var(--bg-card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-neu-lg);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 180px;
  padding: 1.5rem;
}
.processing-spinner-box p { color: var(--text-primary); margin: 0; }

.loading-state {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text-muted);
  text-align: center;
}

/* ─── 18. Sign PDF ─────────────────────────────────────── */
.sign-options { margin-bottom: 1rem; }
.sign-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.pen-size-row {
  margin-bottom: 0.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.sign-font-row { margin-top: 0.75rem; }
.qr-controls { margin-top: 1rem; }
.pen-size-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}
.sig-canvas {
  border: 2px solid var(--accent);
  border-radius: var(--r-sm);
  cursor: crosshair;
  max-width: 100%;
  display: block;
  touch-action: none;
  background: var(--bg-input);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sig-canvas:hover { box-shadow: 0 0 12px var(--accent-glow); }
.sig-canvas-preview {
  border: 2px solid var(--accent);
  border-radius: var(--r-sm);
  max-width: 100%;
  margin-top: 0.5rem;
  background: var(--bg-input);
}
.sig-action-btn { min-width: unset !important; padding: 0.5rem 1rem !important; height: auto !important; }
.sign-page-row { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem; }
.placement-viewer { padding: 1.25rem; margin-top: 1.5rem; }
.placement-header {
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.placement-page-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.visual-placement-wrap { flex-direction: column; align-items: center; gap: 0.5rem; width: 100%; }
.visual-placement-wrap:not(.hidden) { display: flex; }
.pdf-placement-viewer {
  position: relative;
  max-width: 100%;
  box-shadow: var(--shadow-neu-pressed);
  border-radius: var(--r-md);
  background: var(--bg-input);
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  overflow: auto;
  max-height: 480px;
  width: 100%;
}
.page-preview-container {
  position: relative;
  box-shadow: var(--shadow-neu-lg);
  border-radius: 4px;
  display: inline-block;
  user-select: none;
}
.pdf-page-canvas { display: block; max-width: 100%; border-radius: 4px; background: #fff; }
.floating-sig {
  position: absolute;
  left: 40px; top: 40px;
  width: 150px; height: 60px;
  border: 2px dashed var(--accent);
  background: var(--bg-accent-soft);
  cursor: move;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  transform-origin: top left;
  border-radius: 3px;
  backdrop-filter: blur(2px);
}
.floating-sig-content {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
  padding: 4px;
}
.floating-sig-text { color: var(--accent); font-size: 0.9rem; font-weight: bold; }
.sig-resize-handle {
  position: absolute;
  right: -5px; bottom: -5px;
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  cursor: se-resize;
  touch-action: none;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.placement-placeholder {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.sign-button-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1.5rem; }
.sign-btn { flex: 1; }

/* ─── 19. Organize PDF ─────────────────────────────────── */
.organize-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-neu-pressed);
  border-radius: var(--r-md);
  background: var(--bg-input);
}
.organize-zoom, .organize-actions, .page-thumb-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.organize-zoom label, .organize-zoom span {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.organize-zoom input[type="range"] { width: 120px; max-width: 40vw; }
.organize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.page-thumb {
  position: relative;
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.65rem;
  box-shadow: var(--shadow-neu-sm);
  border-radius: var(--r-md);
  background: var(--bg-card);
  cursor: grab;
  text-align: center;
  user-select: none;
  transition: box-shadow 0.15s, transform 0.15s;
}
.page-thumb:active { cursor: grabbing; }
.page-thumb.dragging { opacity: 0.55; }
.page-thumb.drag-over { box-shadow: var(--shadow-neu-flat), 0 0 0 2px var(--accent-glow); }
.page-drag-handle {
  align-self: center;
  min-height: 24px;
  padding: 0.15rem 0.55rem;
  box-shadow: var(--shadow-neu-sm);
  border-radius: var(--r-full);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.page-preview-frame {
  display: flex;
  min-height: 84px;
  flex: 1;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.page-preview-frame canvas {
  max-height: 112px;
  background: #fff;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
}
.page-thumb-label { color: var(--text-secondary); font-size: 0.78rem; font-weight: 700; }
.page-action-btn { height: 28px; min-width: 0; padding: 0 0.55rem; border-radius: var(--r-sm); font-size: 0.75rem; }

/* ─── 20. OCR Tool ─────────────────────────────────────── */
.ocr-progress-wrap { margin-top: 1rem; }
.ocr-progress-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.ocr-progress-track { width: 100%; background: var(--bg-input); border-radius: var(--r-sm); overflow: hidden; }
.ocr-progress-fill {
  width: 0%;
  height: 6px;
  background: linear-gradient(90deg, var(--accent-vivid), var(--accent-light));
  border-radius: var(--r-sm);
  transition: width 0.2s ease;
  box-shadow: 0 0 8px var(--accent-glow);
}
.ocr-output-section { margin-top: 1.5rem; }
.ocr-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ocr-output-meta { font-size: 0.85rem; color: var(--text-muted); }
.ocr-textarea {
  width: 100%;
  min-height: 220px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: none;
  box-shadow: var(--shadow-neu-pressed);
  border-radius: var(--r-md);
  padding: 0.75rem;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.9rem;
  resize: vertical;
  line-height: 1.6;
  max-width: 100%;
}
.ocr-textarea:focus {
  outline: none;
  box-shadow: var(--shadow-neu-pressed), 0 0 0 3px rgba(79,158,255,0.18);
}

/* QR options */
.qr-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.qr-option { display: flex; flex-direction: column; gap: 0.35rem; }
.qr-option label { font-weight: 500; color: var(--text-secondary); font-size: 0.875rem; }

/* Password strength */
.password-strength { margin: 0.5rem 0; font-weight: 600; font-size: 0.875rem; }

/* Sr-only input */
.sr-only-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ─── 21. Page Hero (tool pages) ───────────────────────── */
.page-hero {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 2.75rem 2rem;
  margin: 1.75rem 0;
  box-shadow: var(--shadow-neu-flat);
  text-align: center;
}
.page-hero h1 { font-size: 2rem; margin-bottom: 0.75rem; }
.page-hero p { font-size: 1.05rem; max-width: 600px; margin: 0 auto; }

/* ─── 22. Footer ───────────────────────────────────────── */
.site-footer {
  background: var(--bg-surface);
  box-shadow: 0 -6px 16px var(--neu-dark);
  margin-top: 4rem;
  padding: 3.5rem 0 1.5rem;
  width: 100%;
  position: relative;
  z-index: 1;
}
.footer-container, .footer-grid {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
}
.footer-col h4 {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.1rem;
}
.footer-col p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 400;
  transition: color 0.15s, padding-left 0.15s;
}
.footer-col a:hover { color: var(--accent); padding-left: 4px; opacity: 1; }

.social-links { display: flex; gap: 0.75rem; margin-top: 1rem; }
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: var(--bg-card);
  box-shadow: var(--shadow-neu-sm);
  border-radius: 50%;
  font-size: 1rem;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s, box-shadow 0.2s;
  padding: 0;
}
.social-links a:hover {
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-neu-flat);
}

.footer-bottom {
  text-align: center;
  padding: 1.5rem 2rem 0;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer-bottom a { color: var(--text-muted); margin: 0 0.4rem; }
.footer-bottom a:hover { color: var(--accent); }
.privacy-note { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.5rem; }

/* Visually-hidden text label (e.g. beside emoji social icons) */
.social-label {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* CTA callout box */
.cta-box {
  background: var(--bg-accent-softer);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 1.5rem 1.75rem;
  margin: 1.75rem 0;
}
.cta-box h3 { margin-bottom: 0.4rem; font-size: 1.05rem; }
.cta-box p { margin-bottom: 0.9rem; }
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: auto;
  min-width: 0;
  padding: 0.65rem 1.25rem;
  background: var(--accent-vivid);
  color: var(--text-on-accent);
  border-radius: var(--r-xl);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-neu-sm);
}
.cta-button:hover { background: var(--accent); color: var(--text-on-accent); text-decoration: none; }

/* Button group (offline/error pages) */
.button-group { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

/* Divider */
.section-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
}

/* Narrow single-column content (contact/offline pages) */
.narrow-content { max-width: 640px; margin-left: auto; margin-right: auto; }

/* Lead paragraph */
.lead { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 1.5rem; }

/* Info block (contact page) */
.detailed-info { margin-top: 1rem; }
.info-block {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-neu-sm);
}
.info-block h2 { font-size: 1.15rem; margin-bottom: 0.6rem; }

/* ─── 22b. Related Tools ───────────────────────────────── */
.related-tools-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}
.related-tools-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.9rem;
}
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.7rem;
}
.related-tool-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.8rem 0.5rem;
  background: var(--bg-card);
  box-shadow: var(--shadow-neu-sm);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  transition: box-shadow 0.15s, transform 0.15s;
  text-align: center;
}
.related-tool-link:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-neu-flat);
  color: var(--text-primary);
  transform: translateY(-2px);
  text-decoration: none;
}
.related-tool-icon {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--accent);
  background: var(--bg-accent-soft);
  padding: 0.3rem 0.55rem;
  border-radius: var(--r-sm);
}
.sign-progress-text { margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.875rem; }

/* ─── 23. Toast Notifications ──────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 2rem; right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 380px;
  pointer-events: none;
}
.toast {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 1rem 1.25rem;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-neu-lg);
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  transform: translateX(24px) scale(0.96);
  transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.show { opacity: 1; transform: none; }
.toast.removing { opacity: 0; transform: translateX(24px) scale(0.96); }
.toast.success { border-left: 3px solid #22c55e; }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.info    { border-left: 3px solid var(--accent); }
.popup-blocked-toast { display: flex; gap: 0.75rem; align-items: flex-start; }
.popup-blocked-toast .toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-icon { flex-shrink: 0; }
.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  min-width: unset !important;
  width: auto !important;
  box-shadow: none !important;
  height: auto !important;
  font-size: 1rem;
  margin-left: auto;
  flex-shrink: 0;
  line-height: 1;
}
.toast-close:hover { color: var(--text-primary); transform: none !important; background: none; }

/* ─── 24. Blog ─────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.blog-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-neu-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s, box-shadow 0.25s;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-neu-lg); text-decoration: none; color: inherit; }
.blog-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.blog-card h2, .blog-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.35;
}
.blog-card p { font-size: 0.875rem; color: var(--text-muted); margin: 0; line-height: 1.6; }
.blog-card .read-more { font-size: 0.875rem; font-weight: 600; color: var(--accent); margin-top: auto; }

/* Blog post pages */
.blog-article { max-width: 740px; margin: 0 auto; }
.blog-article h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.blog-article h2 { font-size: 1.4rem; margin: 2rem 0 0.75rem; }
.blog-article h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }

.blog-post {
  max-width: 780px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  line-height: 1.75;
  color: var(--text-primary);
}
.blog-post h1 { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 700; margin: 0 0 0.75rem; line-height: 1.25; }
.blog-post h2 { font-size: clamp(1.1rem, 3vw, 1.4rem); font-weight: 600; margin: 2rem 0 0.75rem; }
.blog-post h3 { font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.blog-post p { margin: 0 0 1rem; }
.blog-post a { color: var(--accent-light); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.blog-post a:hover { color: var(--accent); }
.blog-post code { background: var(--bg-surface); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.875em; word-break: break-all; }
.blog-post pre {
  background: var(--bg-input);
  box-shadow: var(--shadow-neu-pressed);
  border-radius: var(--r-md);
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}
.blog-post ul, .blog-post ol { padding-left: 1.5rem; margin: 0 0 1rem; }
.blog-post li { margin-bottom: 0.4rem; }
.blog-post table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.9rem; overflow-x: auto; display: block; }
.blog-post th, .blog-post td { padding: 0.6rem 0.9rem; border: 1px solid var(--border-subtle); text-align: left; }
.blog-post th { background: var(--bg-surface); font-weight: 600; }
.blog-post img { max-width: 100%; height: auto; border-radius: var(--r-md); }
.post-byline, .post-meta { color: var(--text-muted); font-size: 0.875rem; margin: 0 0 0.5rem; }

.blog-header { margin-bottom: 1.5rem; }
.blog-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.blog-category {
  background: var(--bg-accent-soft);
  color: var(--accent);
  padding: 0.2rem 0.7rem;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.blog-intro {
  font-size: 1.05rem;
  color: var(--text-secondary);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}
.blog-author { color: var(--text-muted); }
.blog-author a { color: var(--accent-light); }
.blog-date, .blog-reading-time { color: var(--text-muted); }
.blog-cta {
  background: var(--bg-accent-softer);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 1.5rem 1.75rem;
  margin: 1.75rem 0;
}
.blog-cta h3 { margin-bottom: 0.4rem; font-size: 1.05rem; }
.blog-cta p { margin-bottom: 0.9rem; }
.blog-cta a.primary,
a.primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  background: var(--accent-vivid);
  color: var(--text-on-accent);
  border-radius: var(--r-xl);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-neu-sm);
  text-decoration: none;
}
.blog-cta a.primary:hover,
a.primary:hover { background: var(--accent); color: var(--text-on-accent); text-decoration: none; }
.blog-usage-guide, .blog-footer-note {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 2.25rem;
  margin: 1.75rem 0;
  box-shadow: var(--shadow-neu-flat);
}

/* ─── 25b. Author Page ─────────────────────────────────── */
.back-btn-wrapper { margin-bottom: 1.5rem; }
.author-profile {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-neu-flat);
  max-width: 720px;
  margin: 0 auto 2rem;
}
.author-tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.author-bio p { line-height: 1.75; }

/* ─── 26. Policy Pages ─────────────────────────────────── */
.policy-section {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
}
.policy-section:last-child { border-bottom: none; margin-bottom: 0; }
.policy-section h2 { font-size: 1.3rem; margin-bottom: 0.75rem; }
.policy-section h3 { font-size: 1.05rem; margin: 1.25rem 0 0.5rem; color: var(--accent-light); }
.policy-section table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; box-shadow: var(--shadow-neu-sm); border-radius: var(--r-md); }
.policy-section table th { color: var(--text-primary); font-weight: 600; border-bottom: 1px solid var(--border-subtle); background: var(--bg-accent-softer) !important; }
.policy-section table td { color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle); }
.policy-section table th, .policy-section table td { padding: 0.65rem 1rem; text-align: left; }
.privacy-content hr, .content-section hr { display: none !important; }

/* ─── 27. Danger / Color Utilities ────────────────────── */
.danger, .danger-soft { color: var(--danger) !important; border-color: var(--danger-border) !important; }
.danger { background: var(--danger-strong) !important; color: var(--text-inverse) !important; }
.danger-soft { background: var(--danger-bg) !important; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.hidden { display: none !important; }
.warning {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-left: 3px solid var(--danger);
  color: var(--danger-strong);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
}
.toast.warning { border-left: 3px solid var(--warning); background: var(--bg-card); color: var(--text-primary); }

/* ─── 28. Animations & Scroll Reveal ──────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active { opacity: 1; transform: translateY(0); }

/* ─── 29. Custom Cursor (pointer devices) ──────────────── */
.custom-cursor {
  width: 20px; height: 20px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  position: fixed;
  left: 0; top: 0;
  margin-left: -10px; margin-top: -10px;
  pointer-events: none;
  z-index: 9999;
  transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 0 10px var(--accent-glow);
}
.custom-cursor.hover {
  width: 44px; height: 44px;
  background-color: var(--accent-glow);
  border-color: var(--accent);
}

/* ─── 30. Canvas Focus ─────────────────────────────────── */
canvas:focus-visible, .drop-zone:focus-visible {
  outline: 3px solid var(--accent-light);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--bg-root), 0 0 0 4px var(--accent-light);
}
canvas[aria-label] { display: block; }

/* ─── 31. Media Queries (all consolidated here) ─────────── */

/* ≤ 1100px: footer 2 columns */
@media (max-width: 1100px) {
  .footer-container, .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
}

/* ≤ 900px: collapse cramped 3-column inline grids (e.g. position/size/rotation selects) to 2 columns first */
@media (max-width: 900px) {
  .tool-panel [style*="grid-template-columns: 1fr 1fr 1fr"] { grid-template-columns: 1fr 1fr !important; }
}

/* ≤ 900px: collapsed inline grids on tool pages */
@media (max-width: 900px) {
  .area [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  #htmlEditorSection [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  .area [style*="display: flex; justify-content: space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.65rem !important;
  }
  .content-section .seo-meta-grid { grid-template-columns: 1fr; }
}

/* ≤ 640px: any remaining inline multi-column grid inside a tool panel collapses to a single column */
@media (max-width: 640px) {
  .tool-panel [style*="display: grid"][style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* ≤ 800px: hamburger nav */
@media (max-width: 800px) {
  .home-grid { grid-template-columns: repeat(3, 1fr); }

  .nav-toggle {
    display: flex;
    z-index: 1001;
    position: relative;
  }

  .main-nav {
    position: fixed;
    width: 100%;
    margin-left: 0;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-nav-panel);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-bottom: 1px solid var(--border-card);
    padding: 0 1.25rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), padding 0.35s cubic-bezier(0.4,0,0.2,1), box-shadow 0.35s ease;
    z-index: 999;
    box-shadow: none;
  }
  .main-nav.open {
    max-height: 420px;
    padding: 0.75rem 1.25rem 1.25rem;
    box-shadow: var(--shadow-lg);
  }
  .main-nav ul { flex-direction: column; gap: 0.2rem; padding-top: 0.5rem; }
  .main-nav a {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    border-radius: var(--r-md);
    min-height: 48px;
    font-size: 1rem;
    border: 1px solid transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
  }
  .main-nav a:hover, .main-nav a:focus {
    background: var(--bg-accent-soft);
    color: var(--accent-light);
    border-color: var(--border-card);
  }
  .main-nav a.active {
    background: var(--bg-accent-soft);
    color: var(--accent);
    border-color: var(--border-focus);
  }
  .header-container { position: relative; padding: 0 1.25rem; }
}

/* ≤ 768px: policy tables */
@media (max-width: 768px) {
  .policy-section table th, .policy-section table td { min-width: 160px; }
}

/* ≤ 700px: policy tables smaller */
@media (max-width: 700px) {
  .policy-section table th, .policy-section table td { min-width: 140px; }
}

/* ≤ 600px: 2-col grid, footer single col, hero mobile */
@media (max-width: 600px) {
  .home-grid { grid-template-columns: repeat(2, 1fr); gap: 0.875rem; }
  .footer-container, .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .app-container { padding: 0.875rem; }
  .header-container { padding: 0 1rem; }

  .tool-panel, .content-section, .premium-card {
    padding: 1.25rem;
    border-radius: var(--r-md);
  }
  .hero { padding: 2.5rem 1rem 2rem; }

  .hero-trust-row { gap: 1rem; }
  .hero-trust-item { font-size: 0.8rem; }

  .button, .download-btn, .back-btn { min-width: 100%; width: 100%; }
  .file-actions button, .nav-toggle,
  .orientation-selector button, .permissions-grid button { width: auto; min-width: auto; }

  .drop-zone { min-height: 140px; padding: 1.75rem 1rem; }

  .tool-reset-row, .tool-action-row, .organize-actions { align-items: stretch; }
  .tool-reset-row > *, .tool-action-row > *, .organize-actions > * { flex: 1 1 100%; justify-content: center; }

  .organize-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .page-thumb { min-height: 204px; }
  .page-drag-handle { width: 100%; }

  .blog-post { padding: 1rem 0.75rem 2rem; }
  .blog-post pre, .blog-post table { font-size: 0.8rem; }

  .sign-options-grid { grid-template-columns: 1fr; }

  .floating-action { font-size: 0.88rem; padding: 0.75rem 1rem; right: 0.85rem; bottom: 0.85rem; }

  .social-links a { width: 40px; height: 40px; }
}

/* ≤ 480px: single column for very small phones, hero adjustments */
@media (max-width: 480px) {
  .home-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

  .tool-icon { width: 52px; height: 52px; }
  .tool-icon svg { width: 26px; height: 26px; }
  .tool-name { font-size: 0.875rem; }
  .tool-card { padding: 1.375rem 0.75rem 1.125rem; }

  .header-container .logo a { font-size: 1.2rem; }
  .tool-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .hero h1 { font-size: 1.75rem; }
  .hero-cta { flex-direction: column; }
  .hero-cta .button { width: 100%; }
}

/* Pointer: coarse (touch devices) */
@media (pointer: coarse) {
  .custom-cursor { display: none; }
  .main-nav a { min-height: 48px; }
  .file-actions button { min-height: 40px; padding: 0 1rem; }
}

/* Desktop: hide nav backdrop */
@media (min-width: 801px) {
  .nav-backdrop { display: none !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print */
@media print {
  body { margin: 0 !important; padding: 0 !important; }
  .site-header, .site-footer, .hero-cta, .floating-action { display: none !important; }
}
