/* ==========================================================================
   Character Counter Pro - Design System & Stylesheet
   Modern, Multi-Page SEO Power Architecture, Dark & Light Mode
   ========================================================================== */

:root {
  /* Color Palette - Dark Mode Default (High Contrast, Sleek SaaS) */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-input: #0e1526;
  --bg-input-focus: #111d35;
  --bg-toolbar: #131c31;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --border-subtle: rgba(255, 255, 255, 0.04);

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-inverted: #0f172a;

  /* Brand Accents */
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-glow: rgba(99, 102, 241, 0.25);

  --accent-emerald: #10b981;
  --accent-sky: #0ea5e9;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-violet: #8b5cf6;

  /* Status Colors */
  --status-normal: #10b981;
  --status-warning: #f59e0b;
  --status-exceeded: #ef4444;

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.15);
  --glass-blur: blur(16px);

  /* Dimensions & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --max-width: 1360px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-hover: #ffffff;
  --bg-input: #f1f5f9;
  --bg-input-focus: #ffffff;
  --bg-toolbar: #f8fafc;

  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #6366f1;
  --border-subtle: rgba(0, 0, 0, 0.04);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverted: #f8fafc;

  --accent-glow: rgba(99, 102, 241, 0.12);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.08);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent horizontal scroll on all screen sizes */
  overflow-x: clip;
  width: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  /* Prevent horizontal overflow on mobile */
  overflow-x: clip;
  width: 100%;
}

/* Global Container */
.app-container {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem 1.25rem;
  box-sizing: border-box;
}

/* Sticky Header Container (Frozen Fold on Scroll) */
.sticky-header-wrapper {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  background: rgba(11, 15, 25, 0.96) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 0.6rem 0 !important;
  margin-bottom: 1.25rem !important;
  overflow: visible !important;
}

[data-theme="light"] .sticky-header-wrapper {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  background: rgba(11, 15, 25, 0.96) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 0.6rem 0 !important;
  margin-bottom: 1.25rem !important;
  overflow: visible !important;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem 0.5rem 1.25rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px var(--accent-glow);
  transition: transform var(--transition-bounce);
}

.brand-wrapper:hover .brand-logo {
  transform: rotate(-4deg) scale(1.05);
}

.brand-text h1, .brand-text .site-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  -webkit-text-fill-color: var(--accent-primary);
}

.brand-tagline {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Language Switcher Dropdown */
.lang-dropdown-wrapper {
  position: relative;
}

.btn-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-lang:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-glow);
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  z-index: 1100;
  padding: 0.4rem;
  backdrop-filter: var(--glass-blur);
}

.lang-dropdown-menu.show {
  display: flex;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.lang-option:hover, .lang-option.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--text-primary);
  font-weight: 600;
}

/* ==========================================================================
   Outer Layout Wrapper & Desktop Skyscraper Side Ad Units (>= 1440px)
   ========================================================================== */
.site-layout-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 100vw;
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
  box-sizing: border-box;
}

/* Left and Right Desktop Skyscraper Ad Units (160x600) */
.skyscraper-ad {
  display: none;
  width: 160px;
  min-height: 600px;
  position: sticky;
  top: 90px;
  margin: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: center;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.5rem;
  flex-shrink: 0;
  z-index: 10;
  backdrop-filter: var(--glass-blur);
}

@media (min-width: 1440px) {
  .skyscraper-ad {
    display: flex;
  }
}

/* ==========================================================================
   Fold 2: 5-Category Mega-Menu Dropdown Navigation System
   ========================================================================== */
.mega-nav-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  position: relative;
  overflow: visible;
}

.mega-nav-item {
  position: relative;
}

.mega-nav-btn {
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.mega-nav-btn:hover, .mega-nav-item:hover .mega-nav-btn, .mega-nav-btn.active {
  background: var(--border-subtle);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.mega-nav-item.pinned .mega-nav-btn {
  color: var(--accent-primary);
}

/* Mega Menu Dropdown Overlay */
.mega-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 520px;
  max-width: 90vw;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 1.25rem;
  /* High z-index so it always renders on top of all page content */
  z-index: 9000;
  display: none;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  animation: megaFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  /* Prevent layout from cutting off the dropdown */
  pointer-events: auto;
}

/* Bridge the gap so hover doesn't break when moving cursor down */
.mega-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -15px; /* Cover the gap and a bit more */
  left: 0;
  right: 0;
  height: 15px;
  background: transparent;
}

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

/* Show on hover (desktop) AND on .show class (JS click toggle) */
.mega-nav-item:hover .mega-dropdown-menu,
.mega-nav-item:focus-within .mega-dropdown-menu,
.mega-dropdown-menu.show {
  display: block;
}

/* Ensure nav items never clip their dropdown children */
.mega-nav-item {
  position: relative;
  /* Keep z-index context open for child dropdown */
  isolation: isolate;
}

.mega-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 0.85rem;
}

.mega-dropdown-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mega-columns-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
}

.mega-tool-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.81rem;
  font-weight: 500;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.mega-tool-link:hover {
  background: rgba(99, 102, 241, 0.14);
  color: var(--text-primary);
  transform: translateX(2px);
}

.mega-tool-link.pinned-item {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #ffffff;
  font-weight: 700;
}

.pinned-badge {
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Dual Ad Row (Below Fold 4 Core Tool Area): 728x90 on left + 300x250 on right */
.dual-ad-row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  margin: 1.5rem 0;
  align-items: stretch;
}

.dual-ad-left {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem;
}

.dual-ad-right {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem;
}

@media (max-width: 900px) {
  .dual-ad-row {
    grid-template-columns: 1fr;
  }
  .dual-ad-right {
    min-height: 150px;
  }
}

/* Tool Navigation Links (Top Bar & Secondary Sub-Bars) */
.tools-nav-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.75rem;
  backdrop-filter: var(--glass-blur);
}

.nav-tool-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-tool-link:hover {
  background: var(--border-subtle);
  color: var(--text-primary);
}

.nav-tool-link.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Base Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  text-decoration: none;
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-icon {
  padding: 0.55rem;
  border-radius: var(--radius-md);
}

.btn-danger-ghost {
  color: var(--accent-rose);
}
.btn-danger-ghost:hover {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.3);
}

/* Breadcrumbs */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumb-nav a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb-nav a:hover {
  color: var(--accent-primary);
}

/* AdSense Slot Placeholders (High RPM Responsive Layouts) */
.ad-slot-container {
  margin: 1.25rem 0;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow: hidden;
}

.ad-slot-leaderboard {
  min-height: 90px;
  width: 100%;
}

.ad-slot-sidebar {
  min-height: 250px;
  width: 100%;
}

/* Primary Live Dashboard Stats Grid (Hero Section) */
.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.stat-card-hero {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.stat-card-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  transition: background var(--transition-normal);
}

.stat-card-hero:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.stat-card-hero.accent-primary::before { background: var(--accent-gradient); }
.stat-card-hero.accent-sky::before { background: var(--accent-sky); }
.stat-card-hero.accent-emerald::before { background: var(--accent-emerald); }
.stat-card-hero.accent-violet::before { background: var(--accent-violet); }
.stat-card-hero.accent-amber::before { background: var(--accent-amber); }
.stat-card-hero.accent-rose::before { background: var(--accent-rose); }

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.stat-icon-pill {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-subtle);
  color: var(--text-secondary);
}

.stat-value {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.stat-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Main Workspace Grid (Editor + Sidebar Tabs) */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* Editor Container */
.editor-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition-fast);
}

.editor-container:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Editor Toolbar */
.editor-toolbar {
  background: var(--bg-toolbar);
  border-bottom: 1px solid var(--border-color);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tool-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.tool-btn:hover {
  background: var(--border-subtle);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.tool-btn.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border-color: rgba(99, 102, 241, 0.3);
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 0.2rem;
}

/* Main Textarea */
.textarea-wrapper {
  position: relative;
  width: 100%;
}

.main-textarea {
  width: 100%;
  min-height: 380px;
  max-height: 800px;
  padding: 1.25rem 1.25rem 2.5rem 1.25rem;
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-input);
  border: none;
  outline: none;
  resize: vertical;
  transition: background-color var(--transition-normal);
}

.main-textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

/* Editor Status Bar Footer */
.editor-status-bar {
  background: var(--bg-toolbar);
  border-top: 1px solid var(--border-color);
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-left, .status-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

/* Secondary Tools Row (Case Converter, Cleanups) */
.quick-tools-row {
  margin-top: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.quick-tools-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.case-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.case-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.case-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Detailed Analytics Cards Section Below Editor */
.detailed-analytics-section {
  margin-top: 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Compact Basic Counters Grid (Directly Below Editor) */
.compact-basic-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.stat-card-compact {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.stat-card-compact:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
  background: var(--bg-card-hover);
}

.stat-card-compact .stat-compact-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}

.stat-card-compact .stat-compact-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.stat-card-compact .stat-compact-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-card-compact .stat-compact-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.1rem;
}

/* Collapsible Detailed Breakdown Accordion */
.breakdown-accordion-wrapper {
  margin-top: 1rem;
}

.accordion-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.accordion-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

.accordion-toggle-btn .accordion-icon {
  transition: transform var(--transition-normal);
  font-size: 0.85rem;
}

.accordion-content {
  max-height: 1500px;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.3s ease;
  opacity: 1;
  margin-top: 0.85rem;
}

.accordion-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

/* Mega Tools Directory Grid Section */
.tools-directory-section {
  margin-top: 3rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.directory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.directory-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.directory-search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  min-width: 260px;
}

.directory-search-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  width: 100%;
}

.category-columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.category-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.category-block-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.category-tool-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.category-tool-links li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.45rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.category-tool-links li a:hover {
  background: var(--border-subtle);
  color: var(--accent-primary);
  transform: translateX(3px);
}

.category-tool-links li a .tool-badge-new {
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-full);
}

/* Legal & Compliance Pages Styling */
.legal-page-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 0 3rem 0;
}

.legal-header {
  margin-bottom: 2rem;
  text-align: center;
}

.legal-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.legal-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  line-height: 1.7;
}

.legal-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.5rem 0 0.6rem 0;
}

.legal-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.legal-card ul {
  padding-left: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.legal-card ul li {
  margin-bottom: 0.4rem;
}

.contact-card-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-email-link {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-decoration: none;
}

.contact-email-link:hover {
  text-decoration: underline;
}
  color: var(--text-secondary);
}

.dense-metric-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.dense-metric-val {
  font-size: 1.35rem;
  font-weight: 800;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* Sidebar Platforms & Tools Column */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Card Container */
.sidebar-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Platform Meter Card Items */
.platform-meter-item {
  padding: 0.9rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
  transition: all var(--transition-fast);
}

.platform-meter-item:last-child {
  margin-bottom: 0;
}

.platform-meter-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.platform-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.platform-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.platform-brand-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.platform-counter {
  font-size: 0.82rem;
  font-weight: 700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.platform-counter .limit-total {
  color: var(--text-muted);
  font-weight: 500;
}

/* Progress Bar */
.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 200ms ease, background-color var(--transition-fast);
}

.progress-bar-fill.normal { background: var(--status-normal); }
.progress-bar-fill.warning { background: var(--status-warning); }
.progress-bar-fill.exceeded { background: var(--status-exceeded); }

.platform-meta-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.platform-badge.normal {
  background: rgba(16, 185, 129, 0.12);
  color: var(--status-normal);
}
.platform-badge.warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--status-warning);
}
.platform-badge.exceeded {
  background: rgba(239, 68, 68, 0.12);
  color: var(--status-exceeded);
}

/* SMS Encoding Badge */
.sms-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

/* Keyword Density Table */
.keywords-table-wrapper {
  max-height: 260px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.keywords-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.keywords-table th {
  background: var(--bg-toolbar);
  padding: 0.5rem 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border-color);
}

.keywords-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.keywords-table tr:hover td {
  background: var(--border-subtle);
}

.keyword-density-bar-bg {
  width: 60px;
  height: 5px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.4rem;
}

.keyword-density-bar-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
}

/* ==========================================================================
   SEO Content & Article Sections (Rich Google & AI Engine Content)
   ========================================================================== */

.seo-content-section {
  margin-top: 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-sm);
  line-height: 1.75;
}

.seo-content-section h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.seo-content-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
}

.seo-content-section p {
  color: var(--text-secondary);
  margin-bottom: 1.1rem;
  font-size: 0.95rem;
}

.seo-content-section ul, .seo-content-section ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.seo-content-section li {
  margin-bottom: 0.4rem;
}

/* SEO Data Tables */
.seo-table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.seo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.seo-table th {
  background: var(--bg-toolbar);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

.seo-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.seo-table tr:hover td {
  background: var(--border-subtle);
}

/* FAQ Accordion */
.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.faq-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
}

.faq-question {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.faq-answer {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Speech & Voice Dictation Control Banner */
.voice-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  color: var(--accent-rose);
  font-size: 0.85rem;
  font-weight: 600;
}

.voice-banner.active {
  display: flex;
  animation: pulse 1.5s infinite;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(20px);
  opacity: 0;
  transition: all var(--transition-bounce);
  pointer-events: auto;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.toast-success {
  border-left: 4px solid var(--accent-emerald);
}

.toast.toast-info {
  border-left: 4px solid var(--accent-sky);
}

/* ==========================================================================
   Tool-Specific First-Fold UI Components (Calculators, Image Tools, Dev Tools)
   ========================================================================== */

/* First-Fold Sidebar Action Grid (Prominent Buttons next to Textbox) */
.sidebar-action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.sidebar-tool-action-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
  text-align: center;
}

.sidebar-tool-action-btn:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--accent-primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.sidebar-tool-action-btn.primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.sidebar-tool-action-btn.primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* Calculator Form & Live Output Styles */
.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  backdrop-filter: var(--glass-blur);
}

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

.calc-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.calc-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.calc-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.calc-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.calc-result-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  text-align: center;
}

.calc-result-box.highlight {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.08);
}

.calc-result-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.calc-result-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.calc-result-box.highlight .calc-result-value {
  color: var(--accent-emerald);
}

/* Image Tool & Dropzone Styles */
.image-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 1.25rem;
}

.image-dropzone:hover, .image-dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.image-preview-wrapper {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.preview-canvas {
  max-width: 100%;
  max-height: 380px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  background: #ffffff;
}

.preset-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.preset-pill-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-pill-btn:hover, .preset-pill-btn.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* Goal Progress Bar */
.goal-progress-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
  margin: 0.6rem 0;
  border: 1px solid var(--border-color);
}

.goal-progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
}

/* Footer Section & Deep SEO Internal Links Grid */
.footer {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.footer-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-column h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
}

.footer-column ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-column a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color var(--transition-fast);
}

.footer-column a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .app-container {
    padding: 1rem 0.75rem 2rem 0.75rem;
  }
  .hero-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-value {
    font-size: 1.65rem;
  }
  .main-textarea {
    min-height: 280px;
  }
  .quick-tools-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .tools-nav-bar {
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.4rem;
  }
}

@media (max-width: 480px) {
  .hero-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Fold 5 — Related Tools Section ("You Might Also Need")
   ========================================================================== */
.related-tools-section {
  margin: 2.5rem 0 1.5rem 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.5rem;
}

.related-tools-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.related-tools-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.related-tool-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.related-tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.related-tool-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.related-tool-icon {
  font-size: 1.25rem;
}

.related-tool-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.related-tool-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   5-Category Footer with "+ Read More" Client-Side Expand
   ========================================================================== */
.footer-5col-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  padding: 2.5rem 0 2rem 0;
  border-top: 1px solid var(--border-color);
}

@media (max-width: 1024px) {
  .footer-5col-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .footer-5col-grid {
    grid-template-columns: 1fr;
  }
}

.footer-category-col h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.footer-tool-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-tool-list li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
  display: inline-block;
}

.footer-tool-list li a:hover {
  color: var(--accent-primary);
  transform: translateX(2px);
}

.footer-extra-links {
  display: none;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.footer-extra-links.expanded {
  display: flex;
  animation: megaFadeIn 0.2s ease-out;
}

.footer-readmore-btn {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.35rem 0;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.footer-readmore-btn:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Image Color Picker Components
   ========================================================================== */
.color-picker-canvas-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 480px;
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
}

.color-history-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.color-history-item {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.color-history-item:hover {
  transform: scale(1.15);
  border-color: #ffffff;
}

/* Custom Eyedropper / Color-Picker Cursor on Canvas */
.color-picker-canvas-wrapper canvas,
#color-canvas {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%2338BDF8' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m14 7 3 3-9.5 9.5a2.12 2.12 0 0 1-3-3L14 7z'/%3E%3Cpath d='M12 9l3 3'/%3E%3Cpath d='M17.5 3.5a2.12 2.12 0 0 1 3 3L19 8l-4-4 1.5-1.5z'/%3E%3C/svg%3E") 0 24, crosshair !important;
}

/* Audio Notification Toggles for Countdown Timer */
.audio-toggle-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
}

.audio-toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.audio-toggle-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--accent-emerald);
}


/* ============================================================
   Google Translate — Hide intrusive toolbar banner silently.
   Translation still works; only the ugly bar is hidden.
   ============================================================ */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
body > .skiptranslate { display: none !important; }
body { top: 0 !important; position: static !important; }
#google_translate_element { display: none !important; }
.goog-te-gadget { display: none !important; }
font.translated-ltr, font.translated-rtl { line-height: inherit !important; }

/* ==========================================================================
   COMPREHENSIVE MOBILE RESPONSIVE SYSTEM
   Covers: Header, Mega-Nav hamburger, Workspace, Toolbar, Cards, Footer
   ========================================================================== */

/* ── Hamburger button (hidden on desktop) ──────────────────────────────────── */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 8px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.hamburger-btn:hover { border-color: var(--accent-primary); }
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile mega-nav drawer ─────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Header: single row with logo + lang + theme + hamburger */
  .sticky-header-wrapper {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  background: rgba(11, 15, 25, 0.96) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 0.6rem 0 !important;
  margin-bottom: 1.25rem !important;
  overflow: visible !important;
}
  .header {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.4rem !important;
    padding: 0.5rem 0.75rem !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    box-sizing: border-box !important;
    justify-content: space-between !important;
  }
  .brand-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    text-decoration: none !important;
  }
  .brand-logo {
    display: block !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    flex: 0 0 34px !important;
  }
  .brand-text {
    display: block !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  .brand-text h1,
  .brand-text .site-title {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.025em !important;
    background: var(--accent-gradient) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: var(--accent-primary) !important; /* Fallback if background-clip is unsupported */
    display: inline-block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 170px !important;
    vertical-align: middle !important;
  }
  .brand-tagline { display: none !important; }
  .brand-badge { display: none !important; }

  .header-actions {
    gap: 0.3rem !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    flex-shrink: 0 !important;
    align-items: center !important;
  }

  /* Language button: show globe icon only on mobile to save space */
  .btn-lang #current-lang-label,
  .btn-lang span:last-child {
    display: none !important;
  }
  .btn-lang {
    padding: 0.45rem 0.6rem !important;
    font-size: 1rem !important;
    min-width: 0 !important;
  }

  /* Theme toggle button compact */
  .btn.btn-icon {
    padding: 0.45rem 0.55rem !important;
    min-width: 0;
  }

  /* Show hamburger on mobile */
  .hamburger-btn { display: flex; }

  /* Mobile navigation drawer */
  .mega-nav-bar {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-color);
    max-height: 75vh;
    overflow-y: auto;
  }
  .mega-nav-bar.mobile-open {
    display: flex;
  }

  /* Make each nav item full-width */
  .mega-nav-item {
    width: 100%;
  }
  .mega-nav-btn {
    width: 100%;
    justify-content: space-between;
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0 !important;
  }

  /* Mobile dropdown: full width, not absolute */
  .mega-dropdown-menu {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    border-left: 3px solid var(--accent-primary) !important;
    margin: 0 !important;
    padding: 0.5rem 0.5rem 0.5rem 1rem !important;
    background: rgba(99, 102, 241, 0.05) !important;
    animation: none !important;
  }
  .mega-dropdown-header { display: none; }
  .mega-columns-grid {
    grid-template-columns: 1fr !important;
    gap: 0.25rem !important;
  }
  .mega-tool-link {
    padding: 0.55rem 0.5rem !important;
    font-size: 0.84rem !important;
  }

  /* Workspace: single column on mobile */
  .workspace-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Editor toolbar: wrapping on mobile */
  .editor-toolbar {
    padding: 0.5rem 0.75rem !important;
    gap: 0.35rem !important;
    flex-wrap: wrap !important;
  }
  .toolbar-group {
    gap: 0.3rem !important;
    flex-wrap: wrap !important;
  }
  .tool-btn {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.55rem !important;
  }

  /* Main textarea */
  .main-textarea {
    min-height: 220px !important;
    font-size: 0.95rem !important;
  }

  /* Hero stats 2-col on mobile */
  .hero-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
  }
  .stat-value { font-size: 1.5rem !important; }

  /* Compact stat cards */
  .compact-basic-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  /* Calculator inputs full width */
  .calc-card { padding: 1rem !important; }
  .calc-input { font-size: 0.9rem !important; }
  .calc-result-grid { grid-template-columns: 1fr !important; }

  /* Sidebar cards stack below on mobile */
  .sidebar-panel { width: 100% !important; }
  .sidebar-action-grid { grid-template-columns: 1fr 1fr !important; }

  /* Page title */
  .page-main-heading { font-size: 1.4rem !important; }
  .page-subheading   { font-size: 0.85rem !important; }

  /* Breadcrumb smaller */
  .breadcrumb-nav { font-size: 0.78rem !important; }

  /* Related tools 1 col */
  .related-tools-grid { grid-template-columns: 1fr !important; }

  /* Footer */
  .footer-5col-grid { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
  .footer-nav-grid  { grid-template-columns: 1fr !important; gap: 1.5rem !important; }

  /* Hide desktop skyscraper ads */
  .skyscraper-ad { display: none !important; }

  /* Ad slots stack */
  .ad-slot-leaderboard { min-height: 60px !important; }
  .dual-ad-row { grid-template-columns: 1fr !important; }

  /* Tables scroll horizontally */
  .seo-table-wrapper { overflow-x: auto !important; }

  /* Page title banner padding */
  .page-title-banner { padding: 1rem 0 0.5rem 0 !important; }

  /* Language dropdown full-width on mobile */
  .lang-dropdown-menu {
    right: auto !important;
    left: 0 !important;
    width: 200px !important;
  }

  /* Tool cards in index grid */
  .tools-directory-grid {
    grid-template-columns: 1fr !important;
  }
  .tool-card-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ── Extra-small phones (< 480px) ────────────────────────────────────────── */
@media (max-width: 480px) {
  .hero-stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .compact-basic-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .sidebar-action-grid { grid-template-columns: 1fr !important; }
  .footer-5col-grid    { grid-template-columns: 1fr !important; }
  .footer-nav-grid     { grid-template-columns: 1fr !important; }
  .tool-card-grid      { grid-template-columns: 1fr !important; }
  .page-main-heading   { font-size: 1.25rem !important; }
  .brand-logo          { width: 30px !important; height: 30px !important; min-width: 30px !important; flex: 0 0 30px !important; }
  .brand-text h1,
  .brand-text .site-title { font-size: 0.88rem !important; max-width: 135px !important; }
  .app-container       { padding: 0.75rem 0.6rem 2rem 0.6rem !important; }
}

/* ==========================================================================
   Toolsfy-Style Design System & Layout Overhaul
   Compact strip header, unboxed status stream, side skyscraper ads,
   and unified boxed tool cards grid.
   ========================================================================== */

/* Hide top ad slot placeholders completely */
.ad-slot-leaderboard,
.dual-ad-row {
  display: none !important;
}

/* ── 2. Simplified Line-by-Line Status & Analysis Stream ───────────────────── */
.status-stream-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.status-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.65rem;
  margin-bottom: 0.65rem;
}

.status-stream-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-stream-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.status-stream-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  transition: background var(--transition-fast);
  border-bottom: 1px dashed var(--border-subtle);
}

.status-row:last-child {
  border-bottom: none;
}

.status-row:hover {
  background: rgba(99, 102, 241, 0.06);
}

.status-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.status-icon {
  font-size: 0.95rem;
  width: 20px;
  text-align: center;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.status-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono, monospace);
}

/* Status Color Badges: Green (Good) -> Amber (Warning) -> Red (Bad) */
.status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.status-badge-green,
.platform-badge.normal,
.platform-badge.valid {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.status-badge-amber,
.platform-badge.warning {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.status-badge-red,
.platform-badge.exceeded {
  background: rgba(244, 63, 94, 0.14) !important;
  color: #f43f5e !important;
  border: 1px solid rgba(244, 63, 94, 0.3) !important;
}

/* ── 3. Unified Boxed Tool Cards Grid (Toolsfy Style) ───────────────────────── */
.tools-directory-container {
  margin: 2rem 0 1.5rem 0;
}

.tools-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.tf-tool-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.15rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.6rem;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.tf-tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.06);
  box-shadow: var(--shadow-md), 0 0 15px rgba(99, 102, 241, 0.12);
}

.tf-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tf-card-icon {
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.12);
}

.tf-card-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--border-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.tf-card-body h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.tf-card-body p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tf-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-top: 0.2rem;
}

.tf-card-arrow {
  transition: transform var(--transition-fast);
}

.tf-tool-card:hover .tf-card-arrow {
  transform: translateX(4px);
}


/* Consistent Spacing for Page Banner, Workspace Grid, & Sidebar Card Header */
.page-title-banner {
  margin-bottom: 1.25rem !important;
  padding: 0.25rem 0 !important;
}

.page-main-heading {
  font-size: 1.85rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
  color: var(--text-primary) !important;
  margin-bottom: 0.35rem !important;
}

.page-subheading {
  font-size: 0.92rem !important;
  color: var(--text-secondary) !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  margin-bottom: 0 !important;
}

.sidebar-card-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-bottom: 0.75rem !important;
  margin-bottom: 0.85rem !important;
  border-bottom: 1px solid var(--border-color) !important;
}