/* ==========================================================================
   HUZIKIT.COM — PREMIUM IMAGE RESIZER STYLESHEET
   Strict Color System: Purple, Violet, Indigo & Refined Neutrals
   Fonts: Lexend (Headings), Inter (Body)
   Zero Horizontal Overflow at All Breakpoints (320px - 1920px)
   ========================================================================== */

:root {
  /* Huzikit Strict Brand Palette */
  --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;
  --accent-light: #f5f0ff;

  --white: #ffffff;

  /* Functional State Accents (Kept in purple/plum/rose tints) */
  --success: #059669;
  --success-light: #ecfdf5;
  --danger: #dc2626;
  --danger-light: #fef2f2;

  /* Typography */
  --font-heading:
    "Lexend", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Elevations */
  --shadow-xs: 0 1px 2px rgba(21, 19, 43, 0.05);
  --shadow-sm:
    0 2px 6px rgba(79, 70, 229, 0.06), 0 1px 2px rgba(21, 19, 43, 0.04);
  --shadow-md:
    0 6px 18px rgba(79, 70, 229, 0.08), 0 2px 6px rgba(21, 19, 43, 0.04);
  --shadow-lg:
    0 14px 34px rgba(79, 70, 229, 0.12), 0 4px 12px rgba(21, 19, 43, 0.05);
  --shadow-purple-glow: 0 0 25px rgba(124, 58, 237, 0.18);

  /* Layout Constants */
  --header-height: 70px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

/* --------------------------------------------------------------------------
   RESET & BASE STYLES
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  overflow-x: hidden;
  min-width: 100;
}
html {
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  color: var(--accent);
}

ul,
ol {
  list-style: none;
}

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

/* Global Container */
.page-container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  min-width: 0;
}

@media (min-width: 640px) {
  .page-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .page-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* --------------------------------------------------------------------------
   HEADER & NAVBAR
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(252, 251, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}

.nav-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 640px) {
  .nav-container {
    padding: 0 1.5rem;
  }
}

/* Brand Logo */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  flex-shrink: 0;
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.28);
}

.logo-dot {
  color: var(--accent);
}

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

@media (min-width: 992px) {
  .desktop-nav {
    display: block;
  }

  .nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .nav-item {
    position: relative;
  }

  .nav-link,
  .dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.925rem;
    font-weight: 500;
    color: var(--ink-soft);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    white-space: nowrap;
  }

  .nav-link:hover,
  .dropdown-trigger:hover,
  .dropdown-trigger.active-category {
    color: var(--primary);
    background-color: var(--primary-light);
  }

  .dropdown-trigger .dropdown-icon {
    transition: transform 0.2s ease;
  }

  .has-dropdown:hover .dropdown-trigger .dropdown-icon,
  .has-dropdown:focus-within .dropdown-trigger .dropdown-icon {
    transform: rotate(180deg);
  }

  /* Dropdown Menus */
  .dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 230px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.15rem;
    z-index: 110;
  }

  .has-dropdown:hover .dropdown-menu,
  .has-dropdown:focus-within .dropdown-menu {
    display: flex;
  }

  .dropdown-link {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink-soft);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.15s ease;
  }

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

  .dropdown-link.current-page {
    color: var(--primary);
    background-color: var(--primary-light);
    font-weight: 600;
  }
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background-color: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  font-size: 0.875rem;
  transition: all 0.18s ease;
}

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

.search-kbd {
  display: none;
  font-size: 0.75rem;
  font-family: monospace;
  padding: 0.15rem 0.4rem;
  background-color: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-faint);
}

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

/* Mobile Toggle Hamburger */
.mobile-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink);
}

@media (min-width: 992px) {
  .mobile-toggle {
    display: none;
  }
}

.hamburger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

/* --------------------------------------------------------------------------
   MOBILE DRAWER NAVIGATION
   -------------------------------------------------------------------------- */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 340px;
  background-color: var(--white);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(21, 19, 43, 0.45);
  backdrop-filter: blur(4px);
  z-index: 990;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.drawer-header {
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.drawer-close {
  padding: 0.5rem;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
}

.drawer-close:hover {
  background-color: var(--bg-soft);
  color: var(--ink);
}

.drawer-search-box {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}

.drawer-search-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background-color: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.drawer-nav {
  padding: 1rem 0;
}

.mobile-acc-group {
  border-bottom: 1px solid var(--line-soft);
}

.mobile-acc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.mobile-acc-trigger .dropdown-icon {
  transition: transform 0.2s ease;
}

.mobile-acc-trigger[aria-expanded="true"] .dropdown-icon {
  transform: rotate(180deg);
}

.mobile-acc-content {
  display: none;
  background-color: var(--bg);
  padding: 0.35rem 0;
}

.mobile-acc-content.show {
  display: block;
}

.mobile-nav-link {
  display: block;
  padding: 0.55rem 1.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.mobile-nav-link:hover,
.mobile-nav-link.current-page {
  color: var(--primary);
  background-color: var(--primary-light);
  font-weight: 600;
}

.drawer-standalone-links {
  padding: 0.5rem 0;
}

/* --------------------------------------------------------------------------
   BREADCRUMBS
   -------------------------------------------------------------------------- */
.breadcrumb-container {
  padding-top: 1.25rem;
  padding-bottom: 0.5rem;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.breadcrumb-item a {
  color: var(--ink-soft);
}

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

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

/* --------------------------------------------------------------------------
   HERO SECTION & 3D TRANSFORMATION
   -------------------------------------------------------------------------- */
.hero-section {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}

@media (min-width: 992px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 3rem;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background-color: var(--accent-light);
  border: 1px solid var(--line);
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero-lead {
  font-size: clamp(0.975rem, 1.8vw, 1.1rem);
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 1.5rem;
  max-width: 620px;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.highlight-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.highlight-item svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* 3D Visual Stage */
.hero-visual {
  width: 100%;
  display: flex;
  justify-content: center;
}

.perspective-stage {
  perspective: 1000px;
  width: 100%;
  max-width: 380px;
}

.card-3d-scene {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}

@media (min-width: 768px) {
  .card-3d-scene {
    transform: rotateX(6deg) rotateY(-8deg);
  }

  .card-3d-scene:hover {
    transform: rotateX(0deg) rotateY(0deg);
  }
}

.visual-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: box-shadow 0.3s ease;
}

.card-resized {
  border-color: var(--accent);
  box-shadow: var(--shadow-purple-glow), var(--shadow-md);
}

.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.tag-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-soft);
  color: var(--ink-soft);
}

.tag-badge.brand-badge {
  background-color: var(--accent-light);
  color: var(--accent);
}

.res-badge {
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.res-badge.accent-res {
  color: var(--accent);
  font-weight: 700;
}

.card-preview-art {
  height: 80px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-gradient-orig {
  background: linear-gradient(135deg, #4d4a6b 0%, #15132b 100%);
}

.bg-gradient-opt {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.art-grid-lines {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.2) 1px,
    transparent 1px
  );
  background-size: 12px 12px;
}

.art-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  position: relative;
  z-index: 1;
}

.smaller-circle {
  width: 32px;
  height: 32px;
  border-color: rgba(255, 255, 255, 0.8);
}

.card-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
  font-size: 0.775rem;
  color: var(--ink-faint);
  min-width: 0;
}

.card-footer-info span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.size-text {
  font-weight: 600;
  color: var(--ink-soft);
}

.savings-text {
  color: var(--accent);
  font-weight: 700;
}

.visual-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.connector-line {
  flex: 1;
  height: 1px;
  background-color: var(--line);
}

.connector-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  background-color: var(--primary-light);
  border: 1px solid var(--line);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

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

/* --------------------------------------------------------------------------
   BUTTONS & CONTROLS SYSTEM
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.18s ease;
  white-space: nowrap;
  user-select: none;
}

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

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

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

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

.btn-ghost {
  color: var(--ink-soft);
  padding: 0.65rem 0.85rem;
}

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

.btn-danger-ghost {
  color: var(--danger);
}

.btn-danger-ghost:hover:not(:disabled) {
  background-color: var(--danger-light);
  color: var(--danger);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.825rem;
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* --------------------------------------------------------------------------
   UPLOAD CARD (IDLE, DRAG-OVER, PROCESSING)
   -------------------------------------------------------------------------- */
.tool-section {
  padding-bottom: 3.5rem;
}

.upload-card {
  background: var(--white);
  border: 2px dashed var(--line);
  border-radius: var(--radius-xl);
  padding: 2.5rem 1rem;
  text-align: center;
  transition: all 0.22s ease;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  outline: none;
}

@media (min-width: 640px) {
  .upload-card {
    padding: 3.5rem 2rem;
  }
}

.upload-card:hover,
.upload-card:focus-visible {
  border-color: var(--primary);
  background-color: var(--bg-soft);
  box-shadow: var(--shadow-md);
}

.upload-card.drag-over {
  border-color: var(--accent);
  background-color: var(--accent-light);
  transform: scale(1.01);
  box-shadow: var(--shadow-purple-glow);
}

.upload-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary);
  margin-bottom: 1.25rem;
  transition: transform 0.2s ease;
}

.upload-card:hover .upload-icon-wrap {
  transform: translateY(-3px);
}

.upload-heading {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.upload-sub {
  font-size: 0.95rem;
  color: var(--ink-soft);
  max-width: 500px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

.upload-button-wrapper {
  margin-bottom: 1.25rem;
}

.btn-upload-cta {
  pointer-events: auto;
}

.upload-privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   WORKSPACE CARD (TOOLBAR & WORKSPACE GRID)
   -------------------------------------------------------------------------- */
.workspace-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  margin-top: 1.5rem;
  overflow: hidden;
}

.workspace-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background-color: var(--bg-soft);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .workspace-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
  }
}

.queue-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.queue-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.queue-count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: 9999px;
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Batch Progress Bar */
.batch-progress-box {
  padding: 0.75rem 1.25rem;
  background-color: var(--accent-light);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 768px) {
  .batch-progress-box {
    padding: 0.75rem 1.5rem;
  }
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  background-color: rgba(124, 58, 237, 0.15);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 9999px;
  transition: width 0.25s ease;
}

/* Workspace Grid: Controls + Preview */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.25rem;
}

@media (min-width: 1024px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    padding: 1.5rem;
    gap: 2rem;
  }
}

/* --------------------------------------------------------------------------
   CONTROLS PANEL (LEFT COLUMN)
   -------------------------------------------------------------------------- */
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.panel-section-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.section-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.825rem;
  font-weight: 700;
}

.panel-section-title h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.panel-divider {
  height: 1px;
  background-color: var(--line);
  margin: 0.25rem 0;
}

/* Mode Tabs */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.25rem;
  background-color: var(--bg-soft);
  border-radius: var(--radius-md);
}

.tab-btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.tab-btn.active {
  background-color: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

/* Input Fields */
.dimensions-input-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  align-items: flex-end;
}

@media (min-width: 480px) {
  .dimensions-input-group {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.5rem;
  }
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.input-field label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit input,
.input-field input[type="number"],
.input-field input[type="text"] {
  width: 100%;
  padding: 0.65rem 2.25rem 0.65rem 0.75rem;
  background-color: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  transition: all 0.18s ease;
  min-width: 0;
}

.input-with-unit input:focus,
.input-field input:focus,
.styled-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.unit-tag {
  position: absolute;
  right: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-faint);
  pointer-events: none;
}

/* Lock Button */
.lock-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding-bottom: 0.35rem;
}

.lock-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background-color: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-faint);
  transition: all 0.18s ease;
}

.lock-toggle .icon-unlocked {
  display: block;
}

.lock-toggle .icon-locked {
  display: none;
}

.lock-toggle.locked {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.lock-toggle.locked .icon-locked {
  display: block;
}

.lock-toggle.locked .icon-unlocked {
  display: none;
}

.lock-status-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-faint);
  white-space: nowrap;
}

.dimension-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-micro {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 0.25rem 0.5rem;
  background-color: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

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

/* Presets Grid */
.presets-section {
  margin-top: 1rem;
}

.presets-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.presets-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.preset-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.35rem 0.6rem;
  background-color: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: left;
  transition: all 0.15s ease;
  min-width: 0;
}

.preset-chip:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.preset-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.preset-res {
  font-size: 0.675rem;
  font-family: monospace;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* Percentage Tab */
.percentage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.percent-chip {
  padding: 0.5rem 0.85rem;
  background-color: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}

.percent-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.percent-chip.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.custom-percent-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.custom-percent-wrap label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.percent-input-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  max-width: 260px;
}

.percent-input-box input {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-weight: 600;
  width: 100%;
}

/* Switches List (Toggles) */
.switches-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.switch-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.switch-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.switch-sub {
  font-size: 0.775rem;
  color: var(--ink-faint);
  line-height: 1.4;
}

/* Toggle Switch Slider */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--line);
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 9999px;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--white);
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.max-bounds-box {
  background-color: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Output Format & Quality */
.format-quality-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.styled-select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  background-color: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}

.quality-slider-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-header label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.quality-value-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.styled-range {
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: var(--line);
  outline: none;
  -webkit-appearance: none;
  accent-color: var(--primary);
}

.styled-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(79, 70, 229, 0.4);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.725rem;
  color: var(--ink-faint);
}

.quality-note {
  font-size: 0.775rem;
  color: var(--accent);
  line-height: 1.4;
  margin-top: 0.25rem;
}

.bg-color-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.color-swatch {
  width: 44px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.color-hex-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field-help-text {
  font-size: 0.75rem;
  color: var(--ink-faint);
  line-height: 1.4;
}

.panel-footer-actions {
  margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   PREVIEW & QUEUE (RIGHT COLUMN)
   -------------------------------------------------------------------------- */
.preview-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comparison-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

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

.comp-title-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.comparison-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comp-status-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  background-color: var(--bg-soft);
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
}

.comp-status-tag.completed {
  background-color: var(--success-light);
  color: var(--success);
}

.comp-status-tag.processing {
  background-color: var(--accent-light);
  color: var(--accent);
}

.comp-status-tag.failed {
  background-color: var(--danger-light);
  color: var(--danger);
}

/* Comparison Body: Original vs Resized */
.comparison-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

@media (min-width: 480px) {
  .comparison-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.comp-side {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  min-width: 0;
}

.comp-side.output-side {
  border-color: var(--accent);
  background-color: var(--accent-light);
}

.side-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.675rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background-color: var(--white);
  color: var(--ink-soft);
}

.side-badge.brand-badge {
  background-color: var(--accent);
  color: var(--white);
}

.preview-frame {
  width: 100%;
  height: 160px;
  background: repeating-conic-gradient(#f0eefb 0% 25%, #ffffff 0% 50%) 50% /
    16px 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.775rem;
}

.side-stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.775rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  color: var(--ink-faint);
}

.stat-value {
  font-weight: 600;
  color: var(--ink);
  font-family: monospace;
}

.stat-value.highlight-val {
  color: var(--accent);
  font-weight: 700;
}

.badge-savings {
  font-weight: 700;
  color: var(--success);
}

/* Queue List Container */
.queue-list-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.queue-list-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background-color: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-list-header h5 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.queue-sub-hint {
  font-size: 0.725rem;
  color: var(--ink-faint);
}

.queue-items-container {
  display: flex;
  flex-direction: column;
  max-height: 380px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Queue Row Item (Zero Overflow, mobile-first stacking) */
.queue-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 0.15s ease;
  cursor: pointer;
  min-width: 0;
}

@media (min-width: 640px) {
  .queue-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
}

.queue-row:hover {
  background-color: var(--bg-soft);
}

.queue-row.selected {
  background-color: var(--primary-light);
  border-left: 3px solid var(--primary);
}

.queue-thumb-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.queue-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: repeating-conic-gradient(#f0eefb 0% 25%, #ffffff 0% 50%) 50% / 8px
    8px;
  border: 1px solid var(--line);
  object-fit: cover;
  flex-shrink: 0;
}

.queue-file-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.queue-file-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.queue-file-sub {
  font-size: 0.725rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.queue-file-sub span {
  white-space: nowrap;
}

.queue-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .queue-row-actions {
    justify-content: flex-end;
  }
}

.status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-soft);
  color: var(--ink-soft);
  white-space: nowrap;
}

.status-badge.ready {
  background-color: var(--bg-soft);
  color: var(--ink-soft);
}

.status-badge.processing {
  background-color: var(--accent-light);
  color: var(--accent);
}

.status-badge.completed {
  background-color: var(--success-light);
  color: var(--success);
}

.status-badge.failed {
  background-color: var(--danger-light);
  color: var(--danger);
}

.btn-remove-row {
  color: var(--ink-faint);
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.btn-remove-row:hover {
  color: var(--danger);
  background-color: var(--danger-light);
}

/* --------------------------------------------------------------------------
   GEO / AI SEARCH ANSWER-FIRST SECTION
   -------------------------------------------------------------------------- */
.quick-answers-section {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
  background-color: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.qa-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .qa-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
  }
}

.qa-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.qa-question {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.qa-answer {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

.qa-steps {
  list-style: decimal inside;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* --------------------------------------------------------------------------
   EDUCATIONAL CONTENT (1200+ WORDS ARTICLE)
   -------------------------------------------------------------------------- */
.educational-content-section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.content-container {
  max-width: 900px;
}

.article-lead-block {
  margin-bottom: 2.5rem;
}

.article-lead-block h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 0.85rem;
}

.article-lead-block p {
  font-size: 1.05rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.longform-article h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.longform-article p {
  font-size: 0.975rem;
  color: var(--ink-soft);
  line-height: 1.75;
  margin-bottom: 1.15rem;
}

.formula-box {
  background-color: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.content-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
  min-width: 540px;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}

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

.data-table td {
  color: var(--ink-soft);
}

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

.article-list {
  list-style: disc inside;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   FAQ ACCORDION
   -------------------------------------------------------------------------- */
.faq-section {
  padding-top: 3.5rem;
  padding-bottom: 4.5rem;
  background-color: var(--bg-soft);
  border-top: 1px solid var(--line);
}

.faq-accordion {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.faq-item:focus-within,
.faq-item:hover {
  border-color: var(--primary);
}

.faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.25rem;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  gap: 1rem;
}

.faq-icon {
  flex-shrink: 0;
  color: var(--ink-faint);
  transition:
    transform 0.22s ease,
    color 0.2s ease;
}

.faq-trigger[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-panel {
  border-top: 1px solid var(--line-soft);
}

.faq-body {
  padding: 1rem 1.25rem 1.25rem;
  font-size: 0.925rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--white);
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.footer-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

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

@media (min-width: 992px) {
  .footer-container {
    grid-template-columns:
      minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr)
      minmax(0, 1fr);
  }
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

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

.footer-social {
  margin-top: 0.5rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

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

.footer-links-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-col-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.footer-link-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link-list a {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.footer-link-list a:hover,
.footer-link-list a.footer-current {
  color: var(--primary);
  font-weight: 500;
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
  background-color: var(--bg);
}

.footer-bottom-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-faint);
  text-align: center;
}

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

/* --------------------------------------------------------------------------
   GLOBAL SEARCH MODAL
   -------------------------------------------------------------------------- */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(21, 19, 43, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1rem 2rem;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.search-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.search-dialog {
  width: 100%;
  max-width: 620px;
  background-color: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(-12px);
  transition: transform 0.22s ease;
  max-height: 80vh;
}

.search-modal-backdrop.open .search-dialog {
  transform: translateY(0);
}

.search-dialog-header {
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

.search-modal-icon {
  color: var(--ink-faint);
  flex-shrink: 0;
}

.search-modal-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  outline: none;
}

.search-clear-btn {
  color: var(--ink-faint);
  padding: 0.25rem;
}

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

.search-close-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-faint);
  padding: 0.25rem 0.5rem;
  background-color: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

/* Category Filter Pills */
.search-filter-pills {
  display: flex;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  background-color: var(--bg);
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.filter-pill {
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--ink-soft);
  background-color: var(--white);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: all 0.15s ease;
}

.filter-pill.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* Results List */
.search-results-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  transition: background-color 0.15s ease;
  gap: 1rem;
}

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

.result-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.result-title {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--ink);
}

.result-desc {
  font-size: 0.775rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-category-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  background-color: var(--bg-soft);
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.search-no-results {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.9rem;
}

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

.search-dialog-footer kbd {
  background-color: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.1rem 0.3rem;
  font-family: monospace;
}

/* --------------------------------------------------------------------------
   TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
.toast-region {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 3rem);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  background-color: var(--ink);
  color: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  animation: toastSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-success {
  background-color: #065f46;
}

.toast.toast-error {
  background-color: #991b1b;
}

.toast.toast-warning {
  background-color: #92400e;
}

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