/* ==========================================================================
   HUZIKIT CSS MINIFIER — STRICT RESPONSIVE STYLESHEET
   Mobile-First Architecture | Zero Page Horizontal Overflow
   ========================================================================== */

/* --- 1. CSS VARIABLES & LOCKED BRAND PALETTE --- */
:root {
  --ink: #15132b;
  --ink-soft: #4d4a6b;
  --ink-faint: #8985a8;
  --bg: #fcfbff;
  --bg-soft: #f4f2ff;
  --line: #e7e4f6;
  --line-soft: #f0eefb;
  --primary: #4f46e5;
  --primary-dark: #3b33c4;
  --primary-light: #eeebff;
  --accent: #7c3aed;
  --white: #ffffff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --danger: #ef4444;

  --font-display:
    "Lexend", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:
    "JetBrains Mono", "Fira Code", Menlo, Monaco, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 3px rgba(21, 19, 43, 0.05);
  --shadow-md: 0 4px 16px rgba(21, 19, 43, 0.06);
  --shadow-lg: 0 10px 30px rgba(79, 70, 229, 0.08);

  --header-height: 72px;
}

/* --- 2. RESET & FOUNDATIONAL RESPONSIVE RULES --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Temporary scroll lock for modal/mobile menu without changing overflow-x */
body.menu-open,
body.modal-open {
  touch-action: none;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- 3. RESPONSIVE CONTAINER --- */
.container {
  width: min(100% - 32px, 1200px);
  margin-inline: auto;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 480px) {
  .container {
    width: min(100% - 24px, 1200px);
  }
}

/* --- 4. SKIP LINK & ACCESSIBILITY --- */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  background: var(--primary);
  color: var(--white);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

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

/* --- 5. NAVBAR & HEADER --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 251, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  width: 100%;
  max-width: 100%;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 16px;
  min-width: 0;
}

/* Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  flex-shrink: 0;
  user-select: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  flex-shrink: 0;
}

.brand-icon svg {
  width: 20px;
  height: 20px;
}

/* Desktop Navigation */
.desktop-nav {
  display: none;
}

@media (min-width: 1024px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto 0 24px;
    min-width: 0;
  }
}

.nav-item {
  position: relative;
}

.nav-link,
.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.nav-link:hover,
.dropdown-trigger:hover,
.dropdown-trigger[aria-expanded="true"] {
  color: var(--primary);
  background-color: var(--bg-soft);
}

.dropdown-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.nav-item:hover .dropdown-chevron,
.dropdown-trigger[aria-expanded="true"] .dropdown-chevron {
  transform: rotate(180deg);
}

/* Dropdown Menu (Desktop) */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 8px;
  margin-top: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  border-radius: 6px;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
  white-space: nowrap;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--primary-light);
  color: var(--primary);
}

.dropdown-item.active {
  background-color: var(--bg-soft);
  color: var(--primary);
  font-weight: 600;
}

.active-pill {
  font-size: 10px;
  font-weight: 700;
  background: var(--primary);
  color: var(--white);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

/* Nav Actions (Search + Hamburger) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 42px;
}

.search-trigger-btn:hover {
  border-color: var(--primary);
  background: var(--white);
  color: var(--primary);
}

.search-trigger-btn svg {
  width: 16px;
  height: 16px;
}

.search-kbd {
  display: none;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink-faint);
  margin-left: 4px;
}

@media (min-width: 768px) {
  .search-kbd {
    display: inline-flex;
  }
}

/* Mobile Hamburger Button */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 0;
  gap: 5px;
  z-index: 150;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

@media (min-width: 1024px) {
  .hamburger-btn {
    display: none;
  }
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background-color: var(--ink);
  border-radius: 2px;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

/* Hamburger active 'X' animation */
.hamburger-btn[aria-expanded="true"] .line-top {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn[aria-expanded="true"] .line-mid {
  opacity: 0;
}

.hamburger-btn[aria-expanded="true"] .line-bot {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- 6. MOBILE NAVIGATION DRAWER / ACCORDIONS --- */
.mobile-nav-drawer {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 20px 16px 36px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 90;
  display: none;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 100%;
}

.mobile-nav-drawer.active {
  display: flex;
}

.mobile-search-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  min-height: 48px;
}

.mobile-categories {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.mobile-acc-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
}

.mobile-acc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  min-height: 48px;
}

.mobile-acc-trigger svg {
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.mobile-acc-item.open .mobile-acc-trigger svg {
  transform: rotate(180deg);
  color: var(--primary);
}

.mobile-acc-content {
  display: none;
  padding: 4px 12px 12px;
  background: var(--white);
  border-top: 1px solid var(--line-soft);
  flex-direction: column;
  gap: 2px;
}

.mobile-acc-item.open .mobile-acc-content {
  display: flex;
}

.mobile-tool-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink-soft);
  border-radius: 6px;
  min-height: 44px;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.mobile-tool-link:hover,
.mobile-tool-link:focus,
.mobile-tool-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.mobile-direct-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.mobile-direct-link {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  border-radius: var(--radius-sm);
  display: block;
}

.mobile-direct-link:hover {
  color: var(--primary);
  background: var(--bg-soft);
}

/* --- 7. BREADCRUMB --- */
.breadcrumb-bar {
  padding: 16px 0 8px;
  width: 100%;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-faint);
}

.breadcrumb-list a {
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

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

.breadcrumb-separator {
  color: var(--ink-faint);
  user-select: none;
}

.breadcrumb-current {
  color: var(--primary);
  font-weight: 600;
}

/* --- 8. HERO SECTION --- */
.hero-section {
  padding: 24px 0 40px;
  width: 100%;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
  min-width: 0;
}

@media (min-width: 992px) {
  .hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px;
  }
}

.hero-content {
  min-width: 0;
  max-width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
  border: 1px solid rgba(79, 70, 229, 0.15);
  max-width: 100%;
  white-space: nowrap;
}

.hero-badge svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 46px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 16px;
  overflow-wrap: break-word;
}

.hero-title-accent {
  color: var(--primary);
}

.hero-description {
  font-size: clamp(15px, 1.8vw, 17px);
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 24px;
  max-width: 580px;
}

.hero-quick-features {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.quick-pill svg {
  width: 14px;
  height: 14px;
  color: var(--success);
}

/* 3D Visual Card */
.hero-visual-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  perspective: 1000px;
}

.visual-3d-stage {
  position: relative;
  width: clamp(260px, 90vw, 420px);
  height: 280px;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transition: transform 0.3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .visual-3d-stage {
    transform: none !important;
    transition: none !important;
  }
}

.card-layer {
  position: absolute;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  padding: 16px;
  background: var(--white);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  min-width: 0;
  max-width: 92%;
}

.card-layer-back {
  width: 90%;
  height: 220px;
  top: 10px;
  left: 5%;
  transform: translateZ(-30px) rotate(-4deg);
  background: var(--bg-soft);
  border-color: var(--line);
  opacity: 0.85;
}

.card-layer-front {
  width: 94%;
  height: 230px;
  top: 25px;
  left: 3%;
  transform: translateZ(20px) rotate(2deg);
  background: var(--white);
  border: 1px solid rgba(79, 70, 229, 0.2);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.code-mock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.mock-dots {
  display: flex;
  gap: 5px;
}

.mock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

.mock-dot:nth-child(1) {
  background: #fda4af;
}
.mock-dot:nth-child(2) {
  background: #fde047;
}
.mock-dot:nth-child(3) {
  background: #86efac;
}

.code-mock-body {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-soft);
  overflow: hidden;
  padding: 8px 0;
}

.code-line-dim {
  color: var(--ink-faint);
}
.code-prop {
  color: var(--primary);
}
.code-val {
  color: var(--accent);
}

.code-mock-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-soft);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
}

.footer-stat-badge {
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- 9. CSS MINIFIER WORKSPACE --- */
.workspace-section {
  padding: 0 0 48px;
  width: 100%;
}

.workspace-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(16px, 3vw, 28px);
  min-width: 0;
  max-width: 100%;
}

/* Toolbar Controls */
.toolbar-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  min-width: 0;
}

.mode-selector-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  max-width: 100%;
}

.mode-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-height: 38px;
}

.mode-btn:hover {
  color: var(--ink);
}

.mode-btn.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.toolbar-toggles {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 38px;
}

.settings-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.settings-btn svg {
  width: 15px;
  height: 15px;
}

/* Custom Settings Drawer */
.custom-settings-panel {
  display: none;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  animation: fadeIn 0.2s ease;
}

.custom-settings-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.custom-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

/* Workspace Editors Grid */
.editors-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 900px) {
  .editors-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}

.editor-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.editor-panel:focus-within {
  border-color: var(--primary);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  min-width: 0;
  gap: 8px;
}

.panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  white-space: nowrap;
}

.panel-size-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--white);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
}

.icon-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--white);
}

.icon-btn svg {
  width: 14px;
  height: 14px;
}

/* Code Areas */
.code-area-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--white);
}

.code-textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 280px;
  height: 320px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  border: none;
  outline: none;
  resize: vertical;
  overflow-x: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  tab-size: 2;
}

@media (max-width: 640px) {
  .code-textarea {
    height: 240px;
    min-height: 200px;
    padding: 12px;
    font-size: 12px;
  }
}

.code-textarea:focus {
  outline: none;
}

.drag-overlay {
  position: absolute;
  inset: 0;
  background: rgba(79, 70, 229, 0.08);
  border: 2px dashed var(--primary);
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 15px;
  pointer-events: none;
}

.drag-overlay.active {
  display: flex;
}

/* Middle Execution Toolbar */
.primary-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 0 10px;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
  min-height: 46px;
  max-width: 100%;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg-soft);
  color: var(--ink);
  border-color: var(--line);
}

.btn-secondary:hover {
  background: var(--white);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline {
  background: var(--white);
  color: var(--ink-soft);
  border-color: var(--line);
}

.btn-outline:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.btn-danger {
  background: var(--white);
  color: var(--danger);
  border-color: var(--line);
}

.btn-danger:hover {
  background: #fee2e2;
  border-color: var(--danger);
}

/* Notification Banner */
.status-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  width: 100%;
}

.status-banner.show {
  display: flex;
}

.status-banner.success {
  background: var(--success-light);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.status-banner.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* --- 10. STATISTICS CARDS --- */
.stats-section {
  padding: 0 0 40px;
  width: 100%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-header svg {
  width: 14px;
  height: 14px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  overflow-wrap: break-word;
}

.stat-value.highlight-saved {
  color: var(--success);
}

.stat-subtext {
  font-size: 12px;
  color: var(--ink-soft);
}

/* --- 11. CSS ANALYZER SECTION --- */
.analyzer-section {
  padding: 0 0 48px;
  width: 100%;
}

.analyzer-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 3vw, 24px);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
}

.analyzer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.analyzer-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.analyzer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 12px;
}

.analyzer-item {
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.analyzer-label {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
}

.analyzer-count {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* --- 12. EDUCATIONAL CONTENT (SEO / GEO) --- */
.content-section {
  padding: 0 0 56px;
  width: 100%;
}

.article-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 44px);
  box-shadow: var(--shadow-sm);
  line-height: 1.75;
  color: var(--ink-soft);
}

.article-card h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: var(--ink);
  margin: 40px 0 16px;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

.article-card h2:first-child {
  margin-top: 0;
}

.article-card h3 {
  font-family: var(--font-display);
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 700;
  color: var(--ink);
  margin: 28px 0 12px;
  overflow-wrap: break-word;
}

.article-card p {
  margin: 0 0 18px;
}

.article-card ul,
.article-card ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.article-card li {
  margin-bottom: 8px;
}

.callout-box {
  background: var(--bg-soft);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 24px 0;
}

.callout-box p {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
}

/* Comparison Table (Responsive) */
.table-responsive-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
  min-width: 480px;
}

.comparison-table th,
.comparison-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.comparison-table th {
  background: var(--bg-soft);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

/* --- 13. FAQ ACCORDION SECTION --- */
.faq-section {
  padding: 0 0 56px;
  width: 100%;
}

.section-header-center {
  text-align: center;
  margin-bottom: 32px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--ink-soft);
  font-size: 16px;
  margin: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}

.faq-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
  overflow: hidden;
}

.faq-card:hover {
  border-color: var(--primary);
}

.faq-question-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: transparent;
  border: none;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  gap: 12px;
  min-height: 52px;
}

.faq-icon {
  width: 20px;
  height: 20px;
  color: var(--ink-faint);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.faq-card.open .faq-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  display: none;
  padding: 0 20px 20px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

.faq-card.open .faq-answer {
  display: block;
}

/* --- 14. RELATED TOOLS SECTION --- */
.related-tools-section {
  padding: 0 0 60px;
  width: 100%;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.tool-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-card-icon svg {
  width: 20px;
  height: 20px;
}

.tool-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.tool-card-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

/* --- 15. GLOBAL SEARCH MODAL --- */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(21, 19, 43, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(20px, 8vh, 80px) 12px 20px;
}

.search-modal-backdrop.active {
  display: flex;
}

.search-modal-dialog {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(21, 19, 43, 0.18);
  width: min(580px, calc(100vw - 24px));
  max-width: 100%;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalEnter 0.2s ease-out;
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.search-input-wrap svg {
  width: 20px;
  height: 20px;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  width: 100%;
}

.search-close-btn {
  background: var(--bg-soft);
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
}

.search-results-list {
  padding: 8px;
  overflow-y: auto;
  max-height: 380px;
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-result-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.search-result-item a:hover,
.search-result-item.selected a {
  background: var(--primary-light);
  color: var(--primary);
}

.search-result-category {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.search-no-results {
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 14px;
}

.search-footer {
  padding: 10px 16px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-faint);
}

/* --- 16. FOOTER --- */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding: 56px 0 32px;
  width: 100%;
  max-width: 100%;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  margin-bottom: 48px;
  min-width: 0;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
  }
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.footer-bio {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
  max-width: 320px;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  transition: color 0.15s ease;
  width: fit-content;
}

.footer-social-link:hover {
  color: var(--primary);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.footer-col-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links-list a {
  font-size: 14px;
  color: var(--ink-soft);
  transition: color 0.15s ease;
  overflow-wrap: break-word;
}

.footer-links-list a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    text-align: left;
  }
}

.footer-tagline {
  color: var(--ink-soft);
  font-weight: 500;
}
