/* ================================================================
   SarmoTools.com — Design System
   Clean Corporate + High-Contrast Dark Mode
   ================================================================ */

/* ── CSS Variables ────────────────────────────────────────────── */
:root {
  /* Exact Colors from Demo Website */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-card: #FFFFFF;
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --accent-primary: #3B82F6;
  --accent-secondary: #8B5CF6;
  --accent-light: rgba(59, 130, 246, 0.08);
  --accent-hover: #2563EB;
  --border-color: #E2E8F0;
  --error: #EF4444;
  --success: #22C55E;
  --warning: #F59E0B;

  /* Premium Design Tokens */
  --brand-gradient: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
  --brand-gradient-hover: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
  --gradient: var(--brand-gradient);
  --gradient-hover: var(--brand-gradient-hover);
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.5);

  /* Layout & Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-premium: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
  --radius: 10px;
  --radius-lg: 20px;
  --radius-pill: 100px;

  /* Ad/Commercial */
  --ad-bg: #F1F5F9;

  --accent-rgb: 59, 130, 246;
  --gradient: var(--brand-gradient);
  --gradient-hover: var(--brand-gradient-hover);

  color-scheme: light;
}

[data-theme="dark"] {
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-card: #1E293B;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --accent-primary: #60A5FA;
  --accent-secondary: #A78BFA;
  --accent-hover: #3B82F6;
  --border-color: #334155;
  --glass-bg: rgba(30, 41, 59, 0.8);
  --glass-border: rgba(255, 255, 255, 0.05);
  --ad-bg: #1E293B;
  --accent-rgb: 96, 165, 250;
  --gradient: var(--brand-gradient);

  color-scheme: dark;
}


/* ── Reset ────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.menu-open {
  overflow: hidden;
}

main {
  flex: 1;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Layout ───────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-main {
  padding: 88px 20px 60px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

/* ── Header / Navigation ──────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.site-header.scrolled {
  height: 56px;
  background: var(--bg-primary);
  box-shadow: var(--shadow-md);
  border-bottom-color: transparent;
}

[data-theme="dark"] .site-header {
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .site-header.scrolled {
  background: #0F172A;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
  transition: height 0.4s ease;
}

.site-header.scrolled .header-inner {
  height: 56px;
}

@media (max-width: 768px) {
  .header-inner {
    height: 60px;
  }
  .site-header.scrolled .header-inner {
    height: 52px;
  }
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 900;
  text-decoration: none;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.logo span {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo:hover {
  transform: scale(1.02);
}

.logo img {
  height: 34px;
  width: auto;
  display: block;
}

.logo strong {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  -webkit-text-fill-color: var(--text-primary);
  color: var(--text-primary);
  font-weight: 800;
  margin-left: 0;
  word-spacing: 0;
}

@media (max-width: 768px) {
  .logo {
    font-size: 1.25rem;
    gap: 8px;
  }
  .logo img {
    height: 28px;
  }
}

.nav-content {
  display: flex;
  align-items: center;
  gap: 32px;
}

.mobile-nav-header {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-item {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  transition: all 0.3s ease;
  position: relative;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 2px;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--accent-light);
}

.nav-item:hover::after {
  width: 20px;
}

.nav-item.active {
  color: var(--accent-primary);
  background: var(--accent-light);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1100;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Responsive Nav */
@media (max-width: 991px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: var(--bg-primary);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 60px 20px;
    gap: 8px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1001;
    border-top: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex !important;
    visibility: hidden;
  }

  .nav-links.active {
    transform: translateX(0);
    visibility: visible;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  }

  .site-header.scrolled .nav-links {
    top: 52px;
    height: calc(100vh - 52px);
  }

  .nav-item {
    font-size: 1.1rem;
    width: 100%;
    text-align: center;
    padding: 12px;
    border-radius: 0;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.05);
    color: var(--text-primary) !important;
  }

  .nav-item:last-child {
    border-bottom: none;
  }

  .mobile-nav-header {
    display: block;
    width: 100%;
    padding: 20px 0 30px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
  }

  .mobile-nav-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-primary);
    margin-bottom: 8px;
  }

  .mobile-nav-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
  }
}

/* Theme Toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  margin-left: 4px;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--accent-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  position: absolute;
  opacity: 1;
  transition: opacity 0.2s ease;
}

[data-theme="light"] .icon-sun {
  opacity: 0;
  transform: scale(0.5) rotate(90deg);
}

[data-theme="light"] .icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

[data-theme="dark"] .icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

[data-theme="dark"] .icon-moon {
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
}

/* ── Ad Banner ────────────────────────────────────────────────── */
.ad-footer-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 64px auto 32px;
  padding: 0 20px;
  width: 100%;
  max-width: 1180px;
  clear: both;
  z-index: 10;
}

.ad-container {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ad-container:hover {
  border-color: var(--accent-primary);
  background: var(--accent-light);
}

.ad-label {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
  font-weight: 700;
}

.ad-slot {
  width: 100%;
  min-height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(var(--accent-rgb), 0.03);
  border-radius: var(--radius);
}

.ad-placeholder-text {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.6;
}

@media (min-width: 1024px) {
  .ad-slot {
    min-height: 120px;
  }
}

@media (min-width: 1024px) {
  .ad-footer-wrapper {
    min-height: 250px;
    /* Allows for taller high-paying ads on desktop */
  }
}

/* ── Breadcrumb ───────────────────────────────────────────────── */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--accent-primary);
}

.breadcrumb .sep {
  opacity: 0.4;
}

.breadcrumb strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Tool Header ──────────────────────────────────────────────── */
.tool-header {
  margin-bottom: 28px;
}

.tool-header h1 {
  font-size: 1.95rem;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.tool-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 640px;
}

/* ── Tool Workspace ───────────────────────────────────────────── */
.tool-workspace {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 10px 20px -5px rgba(0, 0, 0, 0.04);
}

@media (max-width: 768px) {
  .tool-workspace {
    padding: 24px 16px;
    border-radius: var(--radius-lg);
  }
}

[data-theme="dark"] .tool-workspace {
  background: rgba(30, 41, 59, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25), 0 10px 20px -5px rgba(0, 0, 0, 0.15);
}

/* ── Form Elements ────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);

}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

textarea.form-control {
  resize: vertical;
  min-height: 200px;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;

  border: 1px solid transparent;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
  background: var(--gradient-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ── Toolbar (row of action buttons) ─────────────────────────── */
.toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.toolbar-center {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* ── Stats Box Core Components ───────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 560px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
}

[data-theme="dark"] .stat-box {
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

/* ── Common Tool Layout Utilities ────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.card-body {
  padding: 24px;
}

.split-pane {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .split-pane {
    grid-template-columns: 1fr 1fr;
  }
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.pane-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  display: block;
}

.mono {
  font-family: 'JetBrains Mono', monospace !important;
}

.status-bar-error {
  background: #ffebe6;
  color: #bf2600;
  border: 1px solid #ff8f73;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 16px;
  display: none;

}

.status-bar-error.active {
  display: block;
}

[data-theme="dark"] .status-bar-error {
  background: #3d1000;
  color: #ff8f73;
  border-color: #ff5630;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Specialized Components ───────────────────────────────────── */
/* Strength Meter */
.strength-wrap {
  margin-top: 16px;
}

.strength-track {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
}

#strength-bar {
  height: 100%;
  width: 0;
  border-radius: 4px;

}

#strength-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Slider / Range */
input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-secondary);
  border-radius: 3px;
  outline: none;
  border: 1px solid var(--border-color);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

/* Checkbox Row */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;

}

.checkbox-row:hover {
  color: var(--accent-primary);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

hr.thin {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 20px 0;
  opacity: 0.5;
}

/* ── Homepage Hero ────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 72px 20px 56px;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.15;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 30px;
}

/* ── Tool Grid ────────────────────────────────────────────────── */
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.tool-section {
  margin-bottom: 50px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
  align-items: stretch;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;

  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  color: var(--text-primary);
  text-decoration: none;
  height: 100%;
  transition: all 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-premium);
  border-color: var(--accent-primary);
}

.tool-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;

}

.tool-card:hover .tool-icon {
  background: var(--accent-primary);
  color: white;
  transform: rotate(-5deg) scale(1.05);
}

.tool-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tool-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.tool-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Section Divider ──────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 40px 0;
}

/* ── Pre-footer Ad Slot ───────────────────────────────────────── */
/* Deprecated in favor of .ad-footer-wrapper */
.pre-footer-ad {
  display: none;
}

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  padding: 48px 20px 32px;
}

.footer-grid {
  max-width: 1180px;
  margin: 0 auto 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr;
  gap: 32px;
  scroll-margin-top: 100px;
}

#search-container {
  scroll-margin-top: 160px;
  /* 64 (header) + 96 (1 inch) */
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.footer-brand-col .logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  background: var(--brand-gradient) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  color: var(--accent-primary);
  letter-spacing: -0.3px;
}

.footer-brand-col .logo-text strong {
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  color: var(--text-primary) !important;
  margin-left: 2px;
}

.footer-brand-col p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 320px;
}

.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.footer-col a {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 10px;

}

.footer-col a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  max-width: 1180px;
  margin: 0 auto;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.footer-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* ── Toast Notifications ───────────────────────────────────────── */

/* ── Toast Notifications ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  padding: 14px 20px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  background: var(--success);
  color: white;
}

.toast-error .toast-icon {
  background: var(--error);
  color: white;
}

.toast-info .toast-icon {
  background: var(--accent-primary);
  color: white;
}

.toast-warning .toast-icon {
  background: var(--warning);
  color: white;
}

.toast-msg {
  font-size: 0.9rem;
  font-weight: 500;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateX(10px) scale(0.9);
  }
}

/* ── Utility ──────────────────────────────────────────────────── */
.brand-blue {
  background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Diff Viewer */
.diff-output {
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
  line-height: 1.6;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow-x: auto;
  background: var(--bg-secondary);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.diff-row {
  display: flex;
  padding: 1px 0;
}

.diff-same {
  background: transparent;
  color: var(--text-secondary);
}

.diff-removed {
  background: #ffebe6;
  color: #bf2600;
}

.diff-added {
  background: #e3fcef;
  color: #006644;
}

[data-theme="dark"] .diff-removed {
  background: rgba(191, 38, 0, 0.15);
  color: #ff8f73;
}

[data-theme="dark"] .diff-added {
  background: rgba(0, 102, 68, 0.15);
  color: #79f2c0;
}

/* ── Tool Article Section ─────────────────────────────────────── */
.tool-article {
  max-width: 1180px;
  margin: 40px auto 80px;
  padding: 0 20px;
  line-height: 1.7;
  color: var(--text-primary);
}

.tool-article-inner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 60px;
  box-shadow: var(--shadow-sm);
}

.tool-article h2 {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

.tool-article h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 32px 0 16px;
  color: var(--text-primary);
}

.tool-article p {
  margin-bottom: 20px;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.tool-article ul,
.tool-article ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.tool-article li {
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.tool-article strong {
  color: var(--text-primary);
  font-weight: 600;
}

.tool-article code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  color: var(--accent-primary);
}

@media (max-width: 768px) {
  .tool-article-inner {
    padding: 40px 24px;
  }

  .tool-article h2 {
    font-size: 1.5rem;
  }
}


.diff-ln {
  min-width: 48px;
  padding: 2px 12px;
  color: var(--text-secondary);
  opacity: .5;
  user-select: none;
  border-right: 1px solid var(--border-color);
  text-align: right;
  font-size: 0.75rem;
}

.diff-content {
  padding: 2px 14px;
  flex: 1;
  white-space: pre;
}

.diff-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
  opacity: 0.6;
}

.diff-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  min-height: 28px;
}

#diff-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* Markdown Preview Specifics */
.md-preview-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

.md-preview-output {
  padding: 32px;
  min-height: 500px;
  line-height: 1.8;
  font-size: 1rem;
  color: var(--text-primary);
}

.md-preview-output h1,
.md-preview-output h2,
.md-preview-output h3 {

  padding-bottom: .3em;
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  letter-spacing: -0.02em;
}

.md-preview-output code {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .9em;
}

.md-preview-output blockquote {
  border-left: 4px solid var(--accent-primary);
  padding: 12px 24px;
  margin: 20px 0;
  color: var(--text-secondary);
  background: var(--accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.md-preview-output a {
  color: var(--accent-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;

}

.md-preview-output a:hover {
  border-bottom-color: var(--accent-primary);
}

.md-preview-output ul,
.md-preview-output ol {
  padding-left: 1.5em;
  margin: 16px 0;
}

.md-preview-output img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Box Shadow Specifics */
.shadow-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 900px) {
  .shadow-layout {
    grid-template-columns: 320px 1fr;
  }
}

.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.preview-stage {
  min-height: 320px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02);
}

.shadow-box {
  width: 160px;
  height: 160px;
  background: white;
  border-radius: var(--radius-lg);

}

[data-theme="dark"] .preview-stage {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .shadow-box {
  background: #1e293b;
}

/* Case Converter Specifics */
.case-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.case-buttons .btn {
  flex: 1;
  min-width: 140px;
  padding: 12px 16px;
}

/* Base Converter Specifics */
.base-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 600px) {
  .base-grid {
    grid-template-columns: 1fr;
  }
}

.base-box label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}

.base-tag {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--accent-light);
  color: var(--accent-primary);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── Long-form Article Styles (SEO) ─────────────────────────── */
.article-wrap {
  margin-top: 60px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 48px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

[data-theme="dark"] .article-wrap {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(10px);
}

.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-content h2 {
  font-size: 2rem;
  margin: 40px 0 20px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.article-content h3 {
  font-size: 1.5rem;
  margin: 30px 0 15px;
  color: var(--accent-primary);
}

.article-content p {
  margin-bottom: 24px;
}

.article-content ul,
.article-content ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 12px;
}

.article-content code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95em;
  border: 1px solid var(--border-color);
}

.article-content .highlight-box {
  background: var(--accent-light);
  border-left: 4px solid var(--accent-primary);
  padding: 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 32px 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
}

.article-content th,
.article-content td {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.article-content th {
  background: var(--bg-secondary);
  font-weight: 700;
}

@media (max-width: 768px) {
  .article-wrap {
    padding: 24px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* ── Utility ──────────────────────────────────────────────────── */

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.1rem;
  }


  .nav-links a.active,
  .nav-links .theme-toggle {
    display: flex;
  }

  .tool-workspace {
    padding: 18px;
  }

  .header-inner {
    height: 56px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.7rem;
  }

  .preview-stage {
    background: white;
    border-radius: var(--radius-lg);
  }
}

[data-theme="dark"] .preview-stage {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .shadow-box {
  background: #1e293b;
}

/* Case Converter Specifics */
.case-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.case-buttons .btn {
  flex: 1;
  min-width: 140px;
  padding: 12px 16px;
}

/* Base Converter Specifics */
.base-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 600px) {
  .base-grid {
    grid-template-columns: 1fr;
  }
}

.base-box label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}

.base-tag {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--accent-light);
  color: var(--accent-primary);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── Long-form Article Styles (SEO) ─────────────────────────── */
.article-wrap {
  margin-top: 60px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 48px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

[data-theme="dark"] .article-wrap {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(10px);
}

.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-content h2 {
  font-size: 2rem;
  margin: 40px 0 20px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.article-content h3 {
  font-size: 1.5rem;
  margin: 30px 0 15px;
  color: var(--accent-primary);
}

.article-content p {
  margin-bottom: 24px;
}

.article-content ul,
.article-content ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 12px;
}

.article-content code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95em;
  border: 1px solid var(--border-color);
}

.article-content .highlight-box {
  background: var(--accent-light);
  border-left: 4px solid var(--accent-primary);
  padding: 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 32px 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
}

.article-content th,
.article-content td {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.article-content th {
  background: var(--bg-secondary);
  font-weight: 700;
}

@media (max-width: 768px) {
  .article-wrap {
    padding: 24px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* ── Utility ──────────────────────────────────────────────────── */

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.1rem;
  }


  .nav-links a.active,
  .nav-links .theme-toggle {
    display: flex;
  }

  .tool-workspace {
    padding: 18px;
  }

  .header-inner {
    height: 56px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.7rem;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Marquee Animation ────────────────────────────────────────── */
.trust-strip {
  width: 100%;
  overflow: hidden;
  margin-top: 192px;
  /* Approx 2 inches */
  padding: 14px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 10;
}

.marquee-content {
  display: flex;
  white-space: nowrap;
  gap: 60px;
  animation: marquee-scroll 30s linear infinite;
  width: max-content;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(calc(-50% - 30px));
  }

  100% {
    transform: translateX(0);
  }
}

/* -- Search Bar ------------------------------------------------- */
.hero-search-wrapper {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-search-input {
  width: 100%;
  padding: 18px 24px 18px 54px;
  font-size: 1.15rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  outline: none;
}

.hero-search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-light);
}

.hero-search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
  pointer-events: none;
}

.tool-card.hidden {
  display: none !important;
}

.section-wrap.hidden {
  display: none !important;
}

#no-results {
  display: none;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 1.2rem;
  width: 100%;
  grid-column: 1 / -1;
}

#no-results.visible {
  display: block;
}

/* ── Box Shadow Pro Specialized Styles ─────────────────────────── */
.shadow-engine {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 1100px) {
  .shadow-engine {
    grid-template-columns: 1fr;
  }
}

/* Layer Manager */
.layer-manager {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 100px;
}

.manager-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.manager-header h3 {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.layer-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.layer-item {
  background: var(--bg-secondary);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.layer-item:hover {
  background: var(--bg-card);
  border-color: var(--border-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.layer-item.active {
  background: var(--bg-card);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-light);
}

.layer-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.layer-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-primary);
  text-transform: uppercase;
}

.layer-details {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-layer-op {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-layer-op:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.universal-controls {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.universal-controls h3 {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Controls Panel */
.controls-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.controls-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 600px) {
  .controls-grid {
    grid-template-columns: 1fr;
  }
}

.val {
  float: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent-primary);
}

/* Preview Panel */
.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.preview-stage {
  height: 340px;
  background: #f8fafc;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.02);
}

.preview-box {
  width: 140px;
  height: 140px;
  background: #fff;
  border-radius: 24px;
  transition: border-radius 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  z-index: 5;
  will-change: transform, box-shadow;
}

/* Export Section */
.export-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--accent-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.code-container {
  position: relative;
  background: #1e293b;
  border-radius: var(--radius);
  padding: 20px;
  overflow: hidden;
}

.code-container pre {
  margin: 0;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.btn-copy {
  margin-top: 16px;
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Presets */
.presets-section {
  margin-top: 60px;
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.preset-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.preset-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.preset-preview {
  width: 60px;
  height: 60px;
  background: #fff;
  border-radius: 8px;
}

.preset-card span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Long Article Enhancements */
.long-article {
  margin-top: 80px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}



.long-article section {
  margin-bottom: 60px;
}

.long-article h2 {
  font-size: 2rem;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.long-article h3 {
  font-size: 1.4rem;
  margin: 32px 0 16px;
}

.long-article p {
  margin-bottom: 20px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.long-article ul,
.long-article ol {
  margin-bottom: 24px;
  padding-left: 20px;
  color: var(--text-secondary);
}

.long-article li {
  margin-bottom: 10px;
  line-height: 1.7;
}

.did-you-know,
.tip-box {
  background: var(--accent-light);
  border-left: 4px solid var(--accent-primary);
  padding: 24px;
  border-radius: 0 12px 12px 0;
  margin: 40px 0;
}

.did-you-know strong,
.tip-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-primary);
}

/* Custom inputs */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 5px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-primary);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.color-input-wrapper {
  position: relative;
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

input[type="color"] {
  position: absolute;
  top: -10px;
  left: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  border: none;
  cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-switch input {
  display: none;
}

.toggle-switch .slider {
  width: 40px;
  height: 20px;
  background: var(--border-color);
  border-radius: 20px;
  position: relative;
  transition: 0.3s;
}

.toggle-switch .slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: 0.3s;
}

.toggle-switch input:checked+.slider {
  background: var(--accent-primary);
}

.toggle-switch input:checked+.slider::before {
  transform: translateX(20px);
}

.layer-hidden {
  opacity: 0.5;
  filter: grayscale(1);
}

.toggle-visibility {
  font-size: 1.1rem;
}

/* Light Source Controller */
.light-handle {
  position: absolute;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
  left: 30px;
  top: 30px;
}

.light-handle:active {
  cursor: grabbing;
  transform: scale(1.1);
}

.light-icon {
  font-size: 1.2rem;
}

.visualizer-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
}

.axis {
  position: absolute;
  background: var(--text-primary);
}

.x-axis {
  width: 100%;
  height: 1px;
  top: 50%;
}

.y-axis {
  height: 100%;
  width: 1px;
  left: 50%;
}

.badge-new {
  font-size: 0.7rem;
  background: var(--accent-secondary);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 10px;
  text-transform: uppercase;
  animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ctrl-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent-primary);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Toast Notification System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.toast-msg {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.toast-success .toast-icon {
  background: var(--accent-primary);
}

.toast-error .toast-icon {
  background: #ef4444;
}

.toast-warning .toast-icon {
  background: #f59e0b;
  color: #fff;
}

@keyframes slideIn {
  from {
    transform: translateX(100%) scale(0.9);
    opacity: 0;
  }

  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 500px) {
  .universal-controls .controls-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Universal Mobile Optimization ──────────────────────────── */

/* Prevent horizontal scroll on all devices */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Base resets for mobile */
@media (max-width: 768px) {
  .page-main {
    padding-top: 72px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Increase touch targets for mobile */
  .btn,
  .form-control,
  input[type="text"],
  input[type="number"],
  select,
  textarea {
    min-height: 48px;
    /* Target size for optimal touch */
    font-size: 16px;
    /* Prevents auto-zoom in iOS Safari */
  }

  /* Flex wraps for toolbars */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar .btn {
    width: 100%;
    margin-bottom: 8px;
    justify-content: center;
  }

  /* OVERRIDE INLINE STYLES FOR MOBILE COMPATIBILITY */
  .tool-workspace div[style*="grid-template-columns"]:not([style*="auto-fit"]):not([style*="auto-fill"]) {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .tool-workspace div[style*="display: flex"]:not([style*="column"]) {
    flex-wrap: wrap !important;
  }

  .split-pane,
  .studio-grid,
  .shadow-engine,
  .app-grid,
  .main-grid,
  .studio-layout,
  .workspace-main,
  .workspace-grid {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .tool-workspace {
    padding: 24px 16px;
    border-radius: 12px;
  }

  .pane-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Ad scaling */
  .ad-footer-wrapper {
    margin: 32px auto 20px;
    padding: 0 16px;
  }

  /* Prevent Fixed Width Blowouts */
  .tool-workspace * {
    max-width: 100% !important;
    box-sizing: border-box !important;
    word-wrap: break-word !important;
  }

  .tool-workspace div,
  .tool-workspace section {
    min-width: 0 !important;
  }

  .tool-workspace [style*="min-width:"] {
    min-width: 0 !important;
  }

  /* Font adjustments */
  .tool-header h1 {
    font-size: 1.6rem;
  }

  .tool-header p {
    font-size: 0.95rem;
  }

  .footer-grid {
    gap: 24px;
    padding: 10px;
  }

  /* Native Table scroll */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .toast-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
    align-items: center;
  }

  .toast {
    min-width: 100%;
  }

  /* Tool Cards */
  .tool-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .tool-icon {
    margin-bottom: 12px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Avoid overflowing padding */
  .tool-article-inner {
    padding: 24px 16px;
  }

  .checkbox-row,
  .toggle-switch,
  .form-group {
    width: 100%;
  }

  .diff-output,
  pre {
    font-size: 0.75rem;
  }

  .code-container {
    padding: 16px;
  }

  .preview-stage {
    min-height: 240px;
  }
}

/* ==========================================================================
   Global Responsive Fixes for All Tool Layouts (Inline Overrides)
   ========================================================================== */
@media (max-width: 991px) {
  /* Prevent horizontal scrolling */
  body {
    overflow-x: hidden;
  }

  /* Override hardcoded inline studio layouts to stack vertically */
  .studio-layout[style*="grid-template-columns"],
  .workspace-main[style*="grid-template-columns"],
  .tool-workspace > div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
  }

  /* Make sure sidebars and inputs fill full width on mobile */
  .config-sidebar,
  .workspace-main {
    width: 100% !important;
  }

  /* Responsive inner grids (like 1fr 1fr button rows) */
  .config-sidebar div[style*="grid-template-columns: 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  /* Fix stats grids with inline columns */
  .stats-grid[style*="grid-template-columns"],
  [class*="stats"][style*="grid-template-columns"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }
  
  /* Scale down tool headers for mobile */
  .tool-header h1 {
    font-size: 1.5rem !important;
  }
  .tool-header p {
    font-size: 0.9rem !important;
  }
}

@media (max-width: 560px) {
  /* On very small mobile screens, stack stats grids to 1 column */
  .stats-grid[style*="grid-template-columns"],
  [class*="stats"][style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Ensure large code blocks don't break layout */
  textarea.form-control.mono {
    font-size: 0.85rem !important;
  }
}