/* ============================================================
   WrapRight Global Theme Variables
   Source of truth for all layout + visual styling decisions
   ============================================================ */

:root {
  /* BRAND COLOR (Apple-soft automotive blue) */
  --accent: #3B82F6;

  /* BASE GRAYS / SURFACES */
  /* Note: --bg and --surface are both white for consistent appearance */
  /* For dark mode, change both to same dark color (e.g., #1A1A1A) */
  --bg: #FFFFFF;
  --surface: #FFFFFF;

  /* TEXT */
  --text-primary: #0B0B0C;
  --text-secondary: #6F6F74;

  /* BORDERS & DIVIDERS */
  --border: #D4D4D8;
  --border-light: #E5E5E7;
  --border-dashed: #C5C5C9;

  /* RADIUS SYSTEM */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-round: 999px;

  /* SHADOW (Soft automotive studio feel) */
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.07);
  --shadow-medium: 0 18px 48px rgba(0, 0, 0, 0.10);
  --shadow-hover: 0 14px 35px rgba(0, 0, 0, 0.12);

  /* SPACING SCALE (8px rhythm) */
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 40px;
  --space-7: 48px;
  --space-8: 60px;

  /* TRANSITIONS */
  --transition-fast: 0.18s ease;
  --transition-medium: 0.35s ease;

  /* LAYOUT */
  --sidebar-width: 230px;
  --main-offset: 260px;

  /* DYNAMIC ALIGNMENT VARS */
  --preview-width: 70vw;
}

/* ============================================================
   Base global styling — every page inherits this
   ============================================================ */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", sans-serif;
  background: #fafafa;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ====== Landing / Global Site Header ====== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
}

.site-header--landing {
  /* keeps it aligned with the content column */
  padding: 10px 48px;
}

.site-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

/* Logo */
.site-logo-link {
  display: inline-flex;
  align-items: center;
}

.site-logo {
  height: 32px;
  /* key: keeps the logo from being huge */
  width: auto;
}

/* Nav */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.primary-nav a {
  text-decoration: none;
  color: inherit;
  padding: 4px 0;
  position: relative;
  opacity: 0.8;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: #111827;
  transition: width 0.18s ease;
}

.primary-nav a:hover {
  opacity: 1;
}

.primary-nav a:hover::after {
  width: 100%;
}

/* Right-side CTA */
.header-cta-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.2);
  color: #111827;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  border-color: rgba(17, 24, 39, 0.5);
  background: rgba(17, 24, 39, 0.03);
}

/* Black pill CTA, consistent with your existing buttons */
.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 999px;
  background: #111827;
  color: #f9fafb;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.primary-cta:hover {
  background: #020617;
  transform: translateY(-1px);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.24);
}

.primary-cta:active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

/* =========================================
   Marketing header — mobile hamburger button
   Hidden on desktop, shown on mobile via media queries below.
   ========================================= */

.mktg-hamburger {
  display: none;                    /* hidden on desktop */
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #1a1a1a;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}

.mktg-hamburger:active {
  background: rgba(0, 0, 0, 0.06);
}

/* Mobile drawer for marketing pages — reuses drawer token names with mktg- prefix
   so it never conflicts with the Designer .mobile-drawer used inside index.html.   */

.mktg-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.mktg-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mktg-drawer {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 240px;
  height: auto;
  max-height: 100vh;
  background: #fff;
  z-index: 1200;
  padding: 0 0 40px;
  overflow-y: auto;
  transform: translateX(-100%);
  pointer-events: none;
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.12);
  border-bottom-right-radius: 16px;
}

.mktg-drawer.open {
  transform: translateX(0);
  pointer-events: auto;
}

.mktg-drawer-header {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  margin-bottom: 6px;
}

.mktg-drawer-header img {
  height: 24px;
  width: auto;
  flex-shrink: 0;
}

.mktg-drawer-wordmark {
  font-size: 15px;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -0.01em;
}

.mktg-drawer-close {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #555;
  -webkit-tap-highlight-color: transparent;
}

.mktg-drawer-close:active {
  background: rgba(0, 0, 0, 0.06);
}

.mktg-drawer-section-label {
  padding: 14px 18px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
  user-select: none;
}

.mktg-drawer nav {
  padding: 4px 0;
}

.mktg-drawer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
  text-decoration: none;
  transition: background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.mktg-drawer-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.mktg-drawer-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.mktg-drawer-item:active {
  background: rgba(0, 0, 0, 0.07);
}

.mktg-drawer-item.active {
  color: #0071e3;
  font-weight: 600;
  background: rgba(0, 113, 227, 0.06);
}

.mktg-drawer-item.active svg {
  opacity: 1;
}

.mktg-drawer-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.07);
  margin: 10px 0;
}

.mktg-drawer-item--danger {
  color: #dc2626;
}

.mktg-drawer-cta {
  display: block;
  margin: 16px 20px 0;
  padding: 12px 18px;
  border-radius: 999px;
  background: #111827;
  color: #f9fafb;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* =========================================
   Mobile top bar — EJS / marketing pages
   Matches Designer/Garage pattern:
     [☰ hamburger]  [centered title]  [40px spacer]
   Used by both sidebar.ejs (source=app) and marketing_header.ejs.
   ========================================= */

/* Hidden on desktop by default */
.mktg-mobile-bar {
  display: none;
  position: fixed;           /* pinned to viewport top, matches Designer .mobile-top-bar */
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: #0071e3;
  border-bottom: none;
  z-index: 1000;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  box-shadow: 0 2px 12px rgba(0, 113, 227, 0.28);
}

/* Centered title — mirrors .mobile-top-title from index.html */
.mktg-mobile-bar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  pointer-events: none;
  white-space: nowrap;
}

/* Right-side spacer to balance the 40px hamburger on the left */
.mktg-mobile-bar-spacer {
  width: 40px;
  flex-shrink: 0;
}

/* Desktop header hidden on mobile (marketing_header.ejs gets this class) */
.mktg-desktop-header {
  /* visible by default on desktop — no rule needed */
}

@media (max-width: 768px) {
  /* Hide the full desktop site-header */
  .mktg-desktop-header {
    display: none !important;
  }

  /* Show our mobile bar */
  .mktg-mobile-bar {
    display: flex;
  }

  /* Activate the drawer + overlay */
  .mktg-drawer-overlay,
  .mktg-drawer {
    display: block;
  }
}

/* =========================================
   User Avatar & Dropdown (Premium)
   ========================================= */

.user-avatar-container {
  position: relative;
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #5C7CFA;
  /* Fallback color */
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.user-menu {
  position: absolute;
  top: 48px;
  right: 0;
  width: 220px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
  padding: 8px;
  display: none;
  /* Hidden by default */
  flex-direction: column;
  gap: 4px;
  z-index: 1000;
  transform-origin: top right;
  animation: menuOpen 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.user-menu.open {
  display: flex;
}

@keyframes menuOpen {
  from {
    opacity: 0;
    transform: scale(0.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.user-menu-item {
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.6);
}

.user-menu-item.disabled {
  color: #9CA3AF;
  cursor: default;
  pointer-events: none;
}

.user-menu-separator {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 4px 0;
}

.sidebar-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 12px 16px;
}

.sidebar-bottom-wrapper {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

.user-menu-item.logout {
  color: #EF4444;
  /* Red accent for logout */
}

.user-menu-item.logout:hover {
  background: rgba(239, 68, 68, 0.08);
}

/* Small tweak so hero isn't hidden behind sticky header */
.landing-hero {
  padding-top: 40px;
}

h1 {
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 var(--space-6) 0;
  color: var(--text-primary);
}

/* ... (Existing Customizer Header styles skipped for brevity, keeping file structure) ... */

/* ===== General layout for landing ===== */

.landing-main {
  background: #f8fafc;
  /* Ensure it takes up remaining space so footer sits at bottom */
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ===== Hero ===== */

.hero {
  padding: 80px 0 64px;
  /* Slightly more top padding */
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 64px;
}

.hero-copy {
  flex: 1;
  max-width: 540px;
}

.hero-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 16px;
}

.hero-copy h1 {
  font-size: 56px;
  /* Larger, matching Designer hero feel */
  line-height: 1.05;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 24px;
  letter-spacing: -1.5px;
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: #64748b;
  margin-bottom: 32px;
  max-width: 480px;
}

/* Hero buttons */

.hero-actions-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.primary-hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.primary-hero-cta:hover {
  background: #020617;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}

.secondary-hero-link {
  font-size: 14px;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s ease;
}

.secondary-hero-link:hover {
  color: #3b82f6;
  text-decoration: underline;
}

/* Hero image & Pill */

.hero-image-wrapper {
  flex: 1;
  position: relative;
  /* Anchor for the pill */
  display: flex;
  justify-content: center;
  max-width: 580px;
  /* Constrain width on desktop */
}

.hero-image {
  width: 100%;
  height: auto;
  max-height: 400px;
  /* Prevent it from being too tall */
  object-fit: contain;
  /* Ensure image fits nicely */
  display: block;
  border-radius: 24px;
  box-shadow:
    0 20px 40px -5px rgba(0, 0, 0, 0.08),
    0 8px 16px -6px rgba(0, 0, 0, 0.06);
  /* Soft card shadow */
  background: linear-gradient(to bottom right, #ffffff, #f8fafc);
  /* Ensure card look */
  padding: 8px;
  /* White border effect */
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* New Hero Preview Badge (Apple/OpenAI style) */
/* Premium Hero Pill (Apple/OpenAI style) */
/* Hero Floating Badge (Premium) */
.hero-floating-badge {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 20;

  display: flex;
  align-items: center;
  gap: 12px;

  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  padding: 10px 16px 10px 10px;
  border-radius: 16px;

  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 12px 24px -4px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  /* Subtle border ring */

  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-floating-badge:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 12px -1px rgba(0, 0, 0, 0.08),
    0 20px 32px -4px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}

.badge-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  color: #fff;
  flex-shrink: 0;
}

.badge-sparkle {
  width: 18px;
  height: 18px;
}

.badge-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.badge-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.badge-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.badge-value {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.01em;
}

/* =========================================
   Auto-Animating Visualizer (Hands-free)
   ========================================= */

.hero-visualizer {
  position: relative;
  width: 100%;
  max-width: 580px;
  /* Fixed aspect ratio ensures images align perfectly */
  aspect-ratio: 4/3;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 20px 40px -5px rgba(0, 0, 0, 0.08),
    0 8px 16px -6px rgba(0, 0, 0, 0.06);
  background: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.5);
  /* Premium card feel */
}

.visualizer-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.vis-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.vis-before {
  z-index: 1;
}

.vis-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow: hidden;
  /* Mask animation */
  animation: wipeLoop 5s ease-in-out infinite;
}

.vis-after {
  /* Ensure it stays aligned even inside the moving mask container */
  /* Since the container width changes, we need the image to stay fixed width */
  width: 100%;
  height: 100%;
  /* Important: The image inside the overlay must match the container dimensions */
  /* But since the overlay width animates, we need to counter-act that or use clip-path */
  /* Better approach: Use clip-path on the overlay container instead of width */
}

/* 
   Refined Approach: 
   Instead of width animation which might squash the image if not careful,
   we use clip-path on the .vis-overlay.
*/
.vis-overlay {
  animation: none;
  /* Reset */
  clip-path: inset(0 100% 0 0);
  /* Start hidden */
  animation: clipLoop 5s ease-in-out infinite;
}

.vis-scan-line {
  position: absolute;
  top: 0;
  right: 0;
  /* Attached to the leading edge of the clip */
  width: 2px;
  height: 100%;
  background: #fff;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.9);
  /* Blue glow */
  z-index: 10;
  /* The line needs to move with the clip. 
     Since clip-path doesn't move elements, we need a separate animation for the line 
     that matches the clip-path timing exactly. 
  */
  left: 0;
  right: auto;
  animation: lineLoop 5s ease-in-out infinite;
}

@keyframes clipLoop {
  0% {
    clip-path: inset(0 100% 0 0);
  }

  /* Show 0% */
  45% {
    clip-path: inset(0 0 0 0);
  }

  /* Show 100% */
  55% {
    clip-path: inset(0 0 0 0);
  }

  /* Pause */
  100% {
    clip-path: inset(0 100% 0 0);
  }

  /* Back to 0% */
}

@keyframes lineLoop {
  0% {
    left: 0%;
    opacity: 0;
  }

  5% {
    opacity: 1;
  }

  45% {
    left: 100%;
    opacity: 1;
  }

  55% {
    left: 100%;
    opacity: 1;
  }

  95% {
    opacity: 1;
  }

  100% {
    left: 0%;
    opacity: 0;
  }
}

/* Badge Updates */
.badge-value {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  /* Pure white */
  letter-spacing: 0.01em;
  background: #0f172a;
  /* Dark navy */
  padding: 4px 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-status-row {
  gap: 8px;
}

.badge-dot {
  /* Hide the standalone dot since we might put it inside the pill or keep it outside */
  /* Let's keep it outside for the design request */
  display: none;
}

/* Re-add dot inside the dark pill for the requested look */
.badge-value::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

/* Stack on smaller screens */

@media (max-width: 960px) {
  .hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 48px;
  }

  .hero-copy {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-actions-col {
    align-items: center;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-image-wrapper {
    width: 100%;
    max-width: 500px;
    margin-top: 24px;
    /* Add spacing when stacked */
  }

  .hero-floating-badge {
    display: none;
  }
}

/* Customizer Header (title + start over button) */
.customizer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 0 auto;
  padding: 72px 0 24px;
  /* Extra top spacing so Designer header doesn’t hug browser chrome */
  max-width: 1200px;
  width: 100%;
}

@media (max-width: 768px) {
  .customizer-header {
    padding-top: 40px;
  }
}

.header-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.header-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9CA3AF;
}

.designer-wrap-id {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #6B7280;
  margin: -4px 0 0;
}

.customizer-header h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

.header-subtitle {
  margin: 0 0 24px 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 600px;
}

/* Designer-specific preview container spacing */
#customizer .preview-container {
  margin-top: 24px;
}

/* Start Over Button - Soft Destructive Style */
.start-over-button {
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 85, 85, 0.70);
  /* soft red */
  cursor: pointer;
  padding: 8px 16px;
  margin-right: 24px;
  /* spacing from right edge */
  margin-top: 12px;
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
  font-family: inherit;
}

.start-over-button:hover {
  color: rgba(255, 85, 85, 1.0);
  background-color: rgba(255, 85, 85, 0.07);
  /* subtle hover */
}

h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 var(--space-4) 0;
  color: var(--text-primary);
}

h3,
h4 {
  font-weight: 600;
  margin: 0 0 var(--space-3) 0;
  color: var(--text-primary);
}

p,
label,
span {
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border-light);
  padding: var(--space-5) var(--space-4);
  position: fixed;
  height: 100vh;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 30px;
  z-index: 100;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
}

.logo img {
  height: 40px;
  width: auto;
  display: block;
}

.nav-link {
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
  padding: var(--space-1) 0;
  transition: color var(--transition-fast);
}

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

.nav-link.active {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================================
   MAIN CONTENT LAYOUT
   ============================================================ */

.main {
  margin-left: var(--main-offset);
  padding: 0 var(--space-6);
  width: calc(100% - var(--main-offset));
  flex: 1;
  display: flex;
  flex-direction: column;
}

.section {
  display: none;
  flex: 1;
}

.section.active {
  display: block;
}

/* Reset hero background for non-designer sections */
.section:not(#designer) {
  background: var(--bg);
  min-height: auto;
}

/* ============================================================
   DESIGNER SECTION (Full-Width Cinematic Hero)
   ============================================================ */

#designer {
  position: relative;
  /* Stay within main container but background extends beyond */
  margin-left: 0;
  width: 100%;
  padding-top: 8vh;
  padding-bottom: 4vh;
  /* overflow: clip instead of hidden — clips visual overflow identically but does NOT
     create a scroll container, so wheel events propagate to body instead of being
     absorbed here. overflow: hidden was causing inconsistent scroll on the white
     background areas of this section. */
  overflow: clip;
  z-index: 1;
}

#designer.active {
  display: flex !important;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

/* Background layer that extends edge-to-edge behind sidebar */
#designer.active::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(ellipse 120% 110% at 50% 40%,
      transparent 0%,
      transparent 30%,
      rgba(250, 250, 250, 0.35) 65%,
      rgba(250, 250, 250, 0.88) 100%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.88) 100%),
    url('public/images/hero_landing.png') no-repeat center 38%;
  background-size: cover, cover, cover;
  background-color: #fafafa;
  background-attachment: scroll, scroll, fixed;
  z-index: -1;
  pointer-events: none;
}

/* Soft Luminous Glow Behind Card */
#designer.active::after {
  content: "";
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translate(-50%, 0);
  width: 650px;
  height: 650px;
  background: radial-gradient(circle at center,
      rgba(255, 255, 255, 0.45) 0%,
      rgba(255, 255, 255, 0.2) 35%,
      rgba(255, 255, 255, 0.05) 60%,
      transparent 75%);
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}

/* Main Alignment Frame for Designer */
.designer-align-frame {
  max-width: var(--preview-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.designer-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-5);
}

.designer-container h1 {
  text-align: center;
  margin: 0 0 var(--space-2) 0;
  font-size: 52px;
  font-weight: 300;
  letter-spacing: -0.8px;
  color: rgba(0, 0, 0, 0.88);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* ============================================================
   UPLOAD CARD (Premium Centered Design)
   ============================================================ */

.upload-card {
  position: relative;
  z-index: 20;
  width: 100%;
  max-width: 520px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  padding: 3.5rem 3.5rem 3rem 3.5rem;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.08),
    0 4px 16px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  text-align: center;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  pointer-events: auto;
}

.upload-card:hover {
  transform: scale(1.015) translateY(-3px);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.11),
    0 8px 24px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.7);
}

.upload-icon {
  color: rgba(0, 0, 0, 0.4);
  opacity: 1;
  margin-bottom: 1.25rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.upload-card:hover .upload-icon {
  color: rgba(0, 0, 0, 0.6);
  transform: translateY(-3px);
}

.upload-headline {
  font-size: 22px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.9);
  margin: 0.25rem 0 0.5rem 0;
  letter-spacing: -0.4px;
  line-height: 1.3;
}

.upload-subtitle {
  font-size: 15px;
  color: rgba(0, 0, 0, 0.55);
  margin: 0 0 2rem 0;
  font-weight: 400;
  letter-spacing: -0.1px;
}

/* ============================================================
   RESUME PREVIOUS CAR CARD
   ============================================================ */

.resume-car-card {
  position: relative;
  z-index: 19;
  width: 100%;
  max-width: 520px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.04),
    0 2px 8px rgba(0, 0, 0, 0.02);
  margin: 20px 0;
  pointer-events: auto;
  animation: resume-card-fade-in 0.4s ease;
}

@keyframes resume-card-fade-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.resume-car-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.resume-car-text {
  flex: 1;
  text-align: left;
}

.resume-car-title {
  font-size: 17px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.85);
  margin: 0 0 4px 0;
  letter-spacing: -0.3px;
}

.resume-car-subtitle {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.5);
  margin: 0;
  font-weight: 400;
}

.resume-car-thumbnail-wrapper {
  flex-shrink: 0;
  width: 140px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.04);
  background: rgba(0, 0, 0, 0.02);
}

.resume-car-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.7) brightness(0.95);
  transition: filter 0.3s ease;
}

.resume-car-card:hover .resume-car-thumbnail {
  filter: saturate(1) brightness(1);
}

.resume-car-actions {
  display: flex;
  gap: 10px;
}

.resume-car-btn {
  flex: 1;
  padding: 11px 20px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.resume-car-continue {
  background: #0071e3;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.2);
}

.resume-car-continue:hover {
  background: #0077ed;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.resume-car-continue:active {
  transform: scale(0.98);
}

.resume-car-dismiss {
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.7);
}

.resume-car-dismiss:hover {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.85);
}

.resume-car-dismiss:active {
  transform: scale(0.98);
}

@media (max-width: 640px) {
  .resume-car-card {
    padding: 16px 20px;
    border-radius: 16px;
  }

  .resume-car-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .resume-car-thumbnail-wrapper {
    width: 100%;
    height: 120px;
  }

  .resume-car-actions {
    width: 100%;
  }

  .resume-car-btn {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* ============================================================
   OR SEPARATOR
   ============================================================ */

.separator {
  position: relative;
  z-index: 15;
  width: 100%;
  max-width: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0 1.25rem 0;
  color: rgba(0, 0, 0, 0.3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
}

.separator::before,
.separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
}

.separator-text {
  padding: 0 1.25rem;
  font-size: 11px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ============================================================
   SEARCH INPUT (Premium Style)
   ============================================================ */

.search-input {
  position: relative;
  z-index: 20;
  width: 100%;
  max-width: 480px;
  padding: 14px 24px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 15px;
  font-family: inherit;
  font-weight: 400;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  background: rgba(255, 255, 255, 0.6);
  color: rgba(0, 0, 0, 0.9);
  text-align: center;
  letter-spacing: -0.1px;
  pointer-events: auto;
  box-sizing: border-box;
}

.search-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
  opacity: 1;
}

.search-input:hover {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.75);
}

.search-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

/* ============================================================
   SEARCH RESULTS GRID (Apple-Style Premium UI)
   ============================================================ */

.search-results-container {
  position: relative;
  z-index: 20;
  width: 100%;
  max-width: 900px;
  margin-top: var(--space-6);
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Error State */
.search-error {
  text-align: center;
  padding: var(--space-7);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.error-icon {
  color: rgba(239, 68, 68, 0.8);
  margin-bottom: var(--space-3);
}

.search-error h3 {
  font-size: 20px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.9);
  margin: 0 0 var(--space-2) 0;
}

.search-error p {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.6);
  line-height: 1.6;
  margin: 0;
}

.retry-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-4);
  padding: 10px 20px;
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.retry-button:hover {
  background: rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}

/* Loading State */
.search-loading {
  text-align: center;
  padding: var(--space-7);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-3);
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.search-loading p {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.6);
  font-weight: 500;
}

/* Results Grid */
.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* Image Card */
.search-image-card {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.04);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  animation: cardAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Stagger animation delay for cards */
.search-image-card:nth-child(1) {
  animation-delay: 0.05s;
}

.search-image-card:nth-child(2) {
  animation-delay: 0.1s;
}

.search-image-card:nth-child(3) {
  animation-delay: 0.15s;
}

.search-image-card:nth-child(4) {
  animation-delay: 0.2s;
}

.search-image-card:nth-child(5) {
  animation-delay: 0.25s;
}

.search-image-card:nth-child(6) {
  animation-delay: 0.3s;
}

.search-image-card:nth-child(7) {
  animation-delay: 0.35s;
}

.search-image-card:nth-child(8) {
  animation-delay: 0.4s;
}

.search-image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-image-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 10;
}

.search-image-card:hover img {
  transform: scale(1.05);
}

/* Selected State */
.search-image-card.selected {
  box-shadow:
    0 0 0 3px var(--accent),
    0 16px 40px rgba(59, 130, 246, 0.25);
  transform: scale(1.03);
  z-index: 15;
}

.search-image-card.selected img {
  transform: scale(1.05);
}

/* Fade other cards when one is selected */
.search-results-grid.has-selection .search-image-card:not(.selected) {
  opacity: 0.4;
  filter: grayscale(20%);
}

.search-results-grid.has-selection .search-image-card:not(.selected):hover {
  opacity: 0.7;
}

/* Skeleton Loading Card */
.skeleton-card {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(90deg,
      rgba(0, 0, 0, 0.04) 0%,
      rgba(0, 0, 0, 0.08) 50%,
      rgba(0, 0, 0, 0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* Attribution */
.card-attribution {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: white;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.search-image-card:hover .card-attribution {
  opacity: 1;
}

/* Action Buttons */
.search-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* Result Count Indicator */
.result-count {
  font-size: 13px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.6);
  letter-spacing: 0.3px;
  margin-bottom: var(--space-2);
}

/* Show More Button */
.show-more-button,
.use-image-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
}

.show-more-button {
  background: rgba(255, 255, 255, 0.85);
  color: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(20px);
}

.show-more-button:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.show-more-button:active {
  transform: translateY(0);
}

/* No More Results Message */
.no-more-results {
  font-size: 13px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.4);
  letter-spacing: 0.3px;
  margin-top: var(--space-2);
}

.use-image-button {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.use-image-button:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

/* ============================================================
   CAR PREVIEW PANE (Layered Images)
   ============================================================ */

.preview-container {
  /* Deprecated - replaced by designer-align-frame logic */
  display: none;
}

.car-preview-wrapper {
  /* Constrained max width for premium look on large screens */
  width: 100%;
  max-width: min(1200px, 90vw);
  margin: 0 auto;
  /* Fixed aspect ratio provides stable frame */
  aspect-ratio: 16 / 9;
  max-height: 70vh;
  background: transparent;
  border-radius: var(--radius-xl);
  overflow: hidden;
  /* CRITICAL: Clips zoomed image */
  position: relative;
  cursor: zoom-in;
  /* Default hint that it's zoomable */
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.15s ease, outline 0.15s ease;
  /* No frame in normal state */
  border: none;
  box-shadow: none;
  outline: 0px solid transparent;
}

/* Active Zoom Mode */
.car-preview-wrapper.zoom-mode {
  cursor: default;
  /* Logic handles grab/grabbing */
  /* Very subtle outline to indicate active zoom area */
  outline: 1px solid rgba(0, 0, 0, 0.06);
  outline-offset: -1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.car-preview-wrapper.can-pan {
  cursor: grab;
}

.car-preview-wrapper.grabbing {
  cursor: grabbing;
}

/* The inner container that ACTUALLY scales */
.car-preview-inner {
  position: relative;
  /* Fill the wrapper to provide proper bounds */
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  /* Will be controlled by JS transform: scale() translate() */
  will-change: transform;
  /* Smooth transition for reset, but rigid for pan/zoom to avoid lag?
     Actually standard 'ease' is fine for reset, but might lag on drag.
     We'll handle transition in JS or use a class for animating resets. */
  transition: transform 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* When dragging, disable transition for instant response */
.car-preview-inner.no-transition {
  transition: none !important;
}

.car-preview {
  /* Natural sizing with max constraints relative to parent container */
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  display: block;
  /* Absolute positioning with centering for both before/after */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Soft rounded corners on the image itself */
  border-radius: var(--radius-xl);
}

.car-preview.after {
  z-index: 1;
  opacity: 1;
}

.car-preview.before {
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* UI Overlay container */
.overlay-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* Let clicks pass through to image */
  z-index: 10;
}

/* Controls (pointer-events: auto to re-enable clicking) */
/* Compare Toggle (Gallery Style Match) */
.compare-toggle {
  pointer-events: auto;
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  /* Glassy translucent effect matching Gallery */
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  /* Removed subtle border to match Gallery exactly, or keep consistent with theme? Gallery has border: none */
  outline: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  z-index: 20;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  color: #374151;
  /* Match gallery icon color */
}

.compare-toggle:hover {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transform: translateX(-50%) translateY(-1px);
}

.compare-toggle:active {
  transform: translateX(-50%) scale(0.94);
}

.compare-toggle svg {
  display: block;
  /* Ensure SVG is visible */
  width: 18px;
  /* Slightly larger for main view */
  height: 18px;
  color: currentColor;
  pointer-events: none;
}

/* Remove old span styling */
.compare-toggle span {
  display: none;
}



.compare-toggle:active {
  transform: translateX(-50%) scale(0.95);
  /* Click press effect */
  background: #f5f5f7;
}

/* Removed old .compare-dot styles as we now use an icon/text */

/* Reset Zoom Button Position Fix */
.reset-zoom-btn {
  pointer-events: auto;
  position: absolute;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  opacity: 0;
  /* Hidden by default until zoomed */
  transform: scale(0.9);
  transition: all 0.2s ease;
}

.reset-zoom-btn.visible {
  opacity: 1;
  transform: scale(1);
}

.reset-zoom-btn:hover {
  background: #f5f5f7;
  transform: scale(1.05);
}

/* Hint Overlay */
.zoom-hint-overlay {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.zoom-hint-overlay.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Zoom Mode Label (Corner) */
.zoom-mode-label {
  position: absolute;
  top: 24px;
  left: 24px;
  background: rgba(59, 130, 246, 0.9);
  color: white;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.2s ease;
}

.zoom-mode-label.visible {
  opacity: 1;
  transform: translateY(0);
}

.ba-btn.active {
  background: var(--accent);
  color: white;
}

.ba-btn:not(.active):hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.03);
}

.preview-hint {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================================
   OVERLAY UI (Compare Toggle & Zoom Instructions)
   ============================================================ */

.car-preview-wrapper,
.modal-preview-wrapper {
  position: relative;
}

.overlay-ui {
  position: absolute;
  pointer-events: none;
  z-index: 12;
}

/* Designer context: limit to image height */
.car-preview-wrapper .overlay-ui {
  top: 0;
  left: 0;
  right: 0;
  height: 400px;
}

/* Modal context: fill entire preview */
.modal-preview-wrapper .overlay-ui {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Compare icon pill: top-center */
.compare-toggle {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
  z-index: 14;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.compare-toggle:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.compare-toggle:active {
  transform: translateX(-50%) scale(0.95);
}

/* Zoom instructions: bottom-center for designer, vertically centered for modal */
.zoom-instructions {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  pointer-events: none;
  padding: 6px 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 12px;
  color: #374151;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  opacity: 1;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: 13;
}

/* Modal context: center vertically and horizontally */
.modal-preview-wrapper .zoom-instructions {
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
}

.zoom-instructions.is-hidden {
  opacity: 0;
  visibility: hidden;
}

/* ============================================================
   FLOATING ACTION BAR
   ============================================================ */

.floating-action-bar,
.modal-floating-action-bar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
  z-index: 15;
}

.floating-action-bar {
  bottom: 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 24px;
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.floating-action-bar:hover {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.floating-action-bar .btn-pill {
  margin: 0;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
}

.modal-floating-action-bar {
  bottom: 24px;
}

/* Action Buttons (legacy - keeping for compatibility) */
.action-buttons {
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-4);
  justify-content: center;
}

.action-buttons .btn-primary,
.action-buttons .btn-secondary {
  margin: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-primary {
  margin-top: var(--space-5);
  padding: var(--space-3) 36px;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  border: none;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  font-family: inherit;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  padding: 10px 20px;
  background: var(--surface);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--transition-fast);
  font-family: inherit;
}

.btn-secondary:hover {
  background: var(--bg);
}

/* ============================================================
   GARAGE GRID & CARDS
   ============================================================ */

.garage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 380px));
  gap: 26px;
  margin-top: var(--space-6);
  max-width: none;
  width: 100%;
  justify-content: start;
}

.garage-grid.large {
  grid-template-columns: repeat(auto-fill, minmax(300px, 380px));
}

.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 0;
  box-shadow: var(--shadow-soft);
  position: relative;
  cursor: pointer;
  text-align: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card:hover .delete-btn {
  opacity: 1;
}

.card-img {
  max-width: 550px;
  height: auto;
  aspect-ratio: 16/9;
  margin: var(--space-3) auto;
  border-radius: 14px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  padding: 0 var(--space-3) var(--space-3);
}

.hover-actions {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--space-1) 14px;
  border-radius: 10px;
  display: flex;
  gap: var(--space-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.card:hover .hover-actions {
  opacity: 1;
  pointer-events: auto;
}

.hover-actions button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  padding: 4px 8px;
}

.hover-actions button:hover {
  text-decoration: underline;
}

.hover-actions button.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ============================================================
   PROFILE SECTION
   ============================================================ */

.profile-content {
  max-width: 600px;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: var(--space-5) 0;
}

.feature-list li {
  padding: var(--space-2) 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}

.feature-list li:last-child {
  border-bottom: none;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-center {
  text-align: center;
}

.surface {
  background: var(--surface);
  border-radius: var(--radius-lg);
}

.shadow-soft {
  box-shadow: var(--shadow-soft);
}

.shadow-medium {
  box-shadow: var(--shadow-medium);
}

.glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* ============================================================
   SWATCH PICKER COMPONENT (BOTTOM SHEET)
   ============================================================ */

.swatch-component {
  position: relative;
  background: var(--surface);
  padding: 8px var(--space-6) var(--space-6);
  margin-top: clamp(18px, 3vh, 48px);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  opacity: 0;
  overscroll-behavior: contain;
}

.swatch-component.open {
  max-height: 1400px;
  opacity: 1;
  overflow-y: auto;
  overflow-x: visible;
}

/* Brand Selector (Primary) */
.brand-selector-wrapper {
  padding: 0;
  margin-bottom: 20px;
}

.brand-selector {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  align-items: center;
}

.brand-option {
  cursor: pointer;
  padding: var(--space-2);
  transition: all var(--transition-fast);
  position: relative;
  height: 56px;
  width: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid transparent;
}

.brand-option img {
  width: 98px;
  height: auto;
  display: block;
  object-fit: contain;
  filter: grayscale(100%) opacity(0.6);
  transition: filter var(--transition-fast);
}

.brand-option:hover img {
  filter: grayscale(40%) opacity(0.85);
}

.brand-option.active {
  border-bottom-color: rgba(0, 0, 0, 0.15);
}

.brand-option.active img {
  filter: grayscale(0%) opacity(1.0);
}

/* Finish Selector (Secondary) */
.finish-selector-wrapper {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  padding: 12px 0;
}

.orb-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  min-height: 120px;
  position: relative;
  z-index: 10;
  flex-wrap: wrap;
}

.orb {
  width: 118px;
  height: 118px;
  border-radius: var(--radius-round);
  background: radial-gradient(circle at 24% 20%, #ffffff 0%, #dfe1e4 75%);
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.15);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
  text-align: center;
  line-height: 1.2;
  padding: 0 10px;
}

.orb:hover {
  transform: translateY(-2px);
}

.orb.active {
  transform: translateY(-3px);
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.18), 0 0 0 4px rgba(59, 130, 246, 0.14);
}

/* Panel */
.panel-wrapper {
  position: relative;
}

.panel {
  background: var(--surface);
  border-radius: 32px;
  overflow: hidden;
  min-height: 500px;
  display: flex;
  gap: 0;
}

.panel-pointer {
  position: absolute;
  top: -18px;
  width: 34px;
  height: 34px;
  background: #fff;
  transform: rotate(45deg);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  transition: left 0.25s ease;
  z-index: 15;
}

.panel-pointer::after {
  content: "";
  position: absolute;
  inset: 15px -12px -36px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
  transform: rotate(-45deg);
  pointer-events: none;
}

/* Swatches Grid Side */
.swatches-side {
  flex: 1.25 1 0;
  padding: 28px;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.swatches-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.swatches-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.swatches-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.swatches-count {
  font-size: 13px;
  color: rgba(15, 23, 42, 0.48);
}


.swatches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(182px, 1fr));
  gap: 14px 18px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 8px;
}

.swatches-grid.centered-row {
  grid-template-columns: repeat(auto-fit, 182px);
  justify-content: center;
}

.swatch-card {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 14px 25px rgba(15, 23, 42, 0.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  border: 2px solid transparent;
  min-height: 150px;
}

.swatch-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.12);
}

.swatch-card.active {
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 18px 38px rgba(59, 130, 246, 0.28);
}

.swatch-thumb {
  width: 100%;
  height: 110px;
  flex-shrink: 0;
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  border-radius: 16px 16px 0 0;
}

.swatch-name {
  padding: 9px 12px 12px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.15;
  word-break: break-word;
}

/* Empty State Placeholders */
.empty-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(182px, 1fr));
  gap: 14px 18px;
}

.empty-swatch {
  background: var(--bg);
  border-radius: 18px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border-light);
}

.empty-message {
  text-align: center;
  padding: var(--space-7) var(--space-4);
  color: var(--text-secondary);
  font-size: 14px;
}

/* Selected Swatch Side */
.selected-side {
  width: 330px;
  border-left: 1px solid rgba(15, 23, 42, 0.04);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* No Selection State */
.no-selection-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-4);
}

.empty-icon {
  font-size: 48px;
  color: rgba(15, 23, 42, 0.15);
}

.empty-text {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

/* Selected Detail */
.selected-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 60px; /* Prevent footer clipping of precheck panel */
}

.selected-header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.selected-brand-logo {
  height: 24px;
  object-fit: contain;
}

.selected-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.selected-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.2;
}

.selected-meta {
  font-size: 11px;
  color: rgba(15, 23, 42, 0.45);
}

.selected-thumb {
  width: 100%;
  height: 160px;
  border-radius: 18px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-apply {
  width: 100%;
  margin: 0;
}

/* Scrollbar */
.swatches-grid::-webkit-scrollbar {
  width: 5px;
}

.swatches-grid::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-round);
}

/* Placeholder Content */
.placeholder-content {
  padding: var(--space-7) var(--space-4);
  text-align: center;
  color: var(--text-secondary);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
}

.modal.open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 98vw;
  height: 95vh;
  max-width: none;
  max-height: none;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  font-size: 28px;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
  font-family: inherit;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: rotate(90deg);
}

.modal-preview-wrapper {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  background: transparent;
  border-radius: var(--radius-lg);
  overflow: visible;
  position: relative;
  cursor: default;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-preview-wrapper.can-pan {
  cursor: grab;
}

.modal-preview-wrapper.grabbing {
  cursor: grabbing;
}

.modal-preview-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  transition: transform 0.2s ease;
}

.modal-preview-container {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  position: relative;
  background: white;
  overflow: visible;
}

.modal-preview-frame {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.modal-preview-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background-size and background-position set via inline styles in openGarageModal() */
  background-repeat: no-repeat;
  transition: opacity 300ms ease;
  will-change: opacity;
  pointer-events: none;
}

.modal-preview-bg.after {
  opacity: 1;
  z-index: 1;
}

.modal-preview-bg.before {
  opacity: 0;
  z-index: 2;
}

.modal-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.modal-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
}

/* Pill-style buttons */
.btn-pill {
  border-radius: var(--radius-round);
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-pill.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
}

.btn-pill.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
}

.btn-pill.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  cursor: pointer;
}

.btn-pill.btn-secondary:hover {
  background: var(--bg);
  transform: translateY(-1px);
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  min-width: 280px;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(245, 245, 245, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.08);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #27C281;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toast-message {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.toast-action {
  background: none;
  border: none;
  color: #3A7BFC;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: text-decoration 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.toast-action:hover {
  text-decoration: underline;
}

/* ============================================================
   JOBS NAV BADGE
   Shared across designer.html, garage.html, index.html, sidebar.ejs
   ============================================================ */

.nav-link.jobs-nav-link { position: relative; }

.jobs-nav-badge {
  position: absolute;
  top: -5px;
  right: -12px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

.jobs-mobile-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ============================================================
   DELETE BUTTON (Garage Cards)
   ============================================================ */

.delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6B6B6B;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.25s ease;
  z-index: 10;
  border: none;
  padding: 0;
}

.delete-btn:hover {
  transform: scale(1.12);
  color: #D9534F;
}

/* Delete Toast (bottom-right) */
.delete-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(245, 245, 245, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.08);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  pointer-events: none;
}

.delete-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.delete-toast-message {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.delete-toast-undo {
  background: none;
  border: none;
  color: #3A7BFC;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: text-decoration 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.delete-toast-undo:hover {
  text-decoration: underline;
}

/* ============================================================
   SITE FOOTER (Premium - Apple/Tesla Style)
   ============================================================ */

.site-footer {
  position: relative;
  width: 100%;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1.25rem 0;
  margin-top: auto;
  z-index: 10;
  flex-shrink: 0;
}

.footer-content {
  margin-left: var(--main-offset);
  width: calc(100% - var(--main-offset));
  padding: 0 var(--space-6);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-6);
}

.footer-copyright {
  font-size: 13px;
  color: #9CA3AF;
  font-weight: 400;
  letter-spacing: -0.1px;
  text-align: left;
  justify-self: start;
}

.footer-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  justify-self: center;
}

.footer-brand-logo {
  width: 140px;
  height: auto;
  opacity: 0.45;
  display: block;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
  justify-self: end;
}

.footer-links a {
  font-size: 13px;
  color: #9CA3AF;
  text-decoration: none;
  font-weight: 400;
  letter-spacing: -0.1px;
  transition: color 0.2s ease;
  position: relative;
}

.footer-links a:hover {
  color: #4B5563;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #4B5563;
  transition: width 0.2s ease;
}

.footer-links a:hover::after {
  width: 100%;
}

/* Responsive */
@media (min-width: 2560px) {

  /* Ultra-ultrawide (2K/4K) - maintain edge-to-edge coverage */
  #designer.active::before {
    background-position: center, center, center 35%;
  }

  .upload-card {
    max-width: 580px;
  }

  .designer-container h1 {
    font-size: 56px;
  }
}

@media (min-width: 1920px) and (max-width: 2559px) {

  /* Ultrawide screens - full coverage */
  #designer.active::before {
    background-position: center, center, center 38%;
  }

  .upload-card {
    max-width: 560px;
  }
}

@media (max-width: 1440px) {
  #designer.active::before {
    background-position: center, center, center 40%;
  }

  .designer-container h1 {
    font-size: 46px;
  }
}

@media (max-width: 1080px) {
  :root {
    --preview-width: 90vw;
  }

  .panel {
    flex-direction: column;
  }

  .selected-side {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(15, 23, 42, 0.04);
    flex-direction: row;
    align-items: center;
    gap: 18px;
  }

  .selected-thumb {
    max-width: 220px;
  }

  .preview-container {
    max-width: var(--preview-width);
  }

  .swatch-component {
    left: 0;
  }

  /* Hero section adjustments */
  #designer {
    padding-top: 10vh;
  }

  #designer.active::before {
    background-position: center, center, center 42%;
  }

  .designer-container h1 {
    font-size: 40px;
  }

  .upload-card {
    max-width: 90%;
    padding: 3rem 2.5rem;
  }
}

@media (max-width: 768px) {
  #designer {
    padding-top: 8vh;
  }

  #designer.active::before {
    background-position: center, center, center 45%;
  }

  .designer-container h1 {
    font-size: 36px;
    letter-spacing: -0.5px;
  }

  .upload-card {
    max-width: 92%;
    padding: 2.5rem 2rem;
  }

  .upload-headline {
    font-size: 20px;
  }

  /* Hide sidebar on mobile, show hamburger menu instead */
  .sidebar {
    transform: translateX(-100%);
  }

  /* Footer stacks vertically on mobile */
  .footer-content {
    margin-left: 0;
    width: 100%;
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .footer-copyright {
    text-align: center;
    justify-self: center;
  }

  .footer-logo {
    order: 2;
  }

  .footer-links {
    gap: var(--space-3);
    justify-content: center;
    justify-self: center;
    order: 3;
  }

  .footer-brand-logo {
    width: 120px;
  }
}

/* ============================================================
   MODAL PREVIEW POSITIONING FIX
   Positioning is applied via inline styles in openGarageModal()
   See index.html lines 1147-1154 for adjustment values
   ============================================================ */

/* ============================================================
   CONTACT SECTION STYLES
   ============================================================ */

:root {
  --glass-surface: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: 20px;
  --input-bg: rgba(255, 255, 255, 0.5);
  --input-focus-bg: rgba(255, 255, 255, 0.9);
}

.contact-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-8) var(--space-4);
  position: relative;
  width: 100%;
}

/* Background Ambient Glow */
.ambient-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
}

/* Header Section */
.contact-header {
  text-align: center;
  max-width: 700px;
  margin-bottom: 60px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards;
}

.contact-header h1 {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #1d1d1f 0%, #424245 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.contact-header p {
  font-size: 24px;
  line-height: 1.4;
  color: #86868b;
  font-weight: 400;
}

/* Grid Layout */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  max-width: 1000px;
  width: 100%;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.2s;
}

/* Form Card (Glass) */
.contact-form-card {
  background: var(--glass-surface);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 48px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
}

/* Pill Selector */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-label {
  cursor: pointer;
  margin-bottom: 0;
}

.pill-label input {
  display: none;
}

.pill-label span {
  display: inline-block;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.pill-label input:checked+span {
  background: #FFFFFF;
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.pill-label:hover span {
  border-color: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.02);
}

.pill-label input:checked:hover span {
  background: #FFFFFF;
  border-color: #2563eb;
  color: #2563eb;
}

.form-group {
  margin-bottom: 24px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #86868b;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 16px;
  font-size: 17px;
  color: #1d1d1f;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
  background: var(--input-focus-bg);
  border-color: #0071e3;
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.submit-btn {
  background: #0071e3;
  color: white;
  border: none;
  border-radius: 99px;
  padding: 14px 32px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.submit-btn:hover {
  background: #0077ed;
  transform: scale(1.02);
  box-shadow: 0 10px 20px rgba(0, 113, 227, 0.2);
}

.submit-btn:active {
  transform: scale(0.98);
}

/* Info Side */
.info-card {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 20px;
}

.info-item h3 {
  font-size: 20px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 8px;
}

.info-item p {
  font-size: 17px;
  line-height: 1.5;
  color: #515154;
}

.info-link {
  color: #0071e3;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.info-link:hover {
  text-decoration: underline;
}

/* Success Message Overlay */
.success-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.success-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: #34c759;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 16px;
  box-shadow: 0 10px 20px rgba(52, 199, 89, 0.3);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .contact-header h1 {
    font-size: 40px;
  }
}

/* ============================================================
   GLOBAL UTILITIES
   ============================================================ */
html {
  scroll-behavior: smooth;
}

/* ============================================================
   NEW GARAGE STYLES (From garage_mockup.html)
   ============================================================ */

.garage-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px;
}

/* Header */
.garage-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 60px;
  position: relative;
  text-align: center;
}

.garage-title h1 {
  font-size: 48px;
  font-weight: 700;
  margin: 0 0 8px 0;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #1d1d1f 0%, #424245 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.garage-stats {
  font-size: 15px;
  font-weight: 600;
  color: #86868b;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.garage-subtitle {
  font-size: 20px;
  color: #515154;
  max-width: 600px;
  line-height: 1.5;
}

.header-actions {
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

@media (max-width: 768px) {
  .header-actions {
    position: static;
    margin-top: 24px;
  }
}

.view-options {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.8);
  padding: 4px;
  border-radius: 10px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.view-btn {
  padding: 6px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  color: #86868b;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-btn.active {
  background: #fff;
  color: #1d1d1f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-new-wrap {
  background: #1d1d1f;
  color: white;
  border: none;
  border-radius: 99px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-new-wrap:hover {
  background: #333;
  transform: translateY(-1px);
}

/* Grid */
.garage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
  width: 100%;
  margin-top: 64px;
}

/* Card */
.garage-card {
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Image Area */
.card-image-wrapper {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card-image {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.6s ease;
}

/* Overlay Actions (Apple-style glass overlay on hover) */
.card-overlay {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1d1d1f;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-delete {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
  color: #86868b;
}

@media (hover: hover) and (pointer: fine) {
  .garage-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  }

  .garage-card:hover .card-image {
    transform: scale(1.03);
  }

  .garage-card:hover .card-overlay {
    opacity: 1;
    transform: translateY(0);
  }

  .action-btn:hover {
    background: #0071e3;
    color: white;
    border-color: #0071e3;
    transform: scale(1.1);
  }

  .garage-card:hover .card-delete {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }

  .card-delete:hover {
    background: #fff;
    color: #ff3b30;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
}

/* On touch devices, don't make the first tap activate parent-card hover styles.
   Keep image actions directly available instead, so the explicit
   "Edit in Designer" button behaves like the working list-view pencil action. */
@media (hover: none) and (pointer: coarse) {
  .card-overlay {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .card-delete {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

/* Content Area */
.card-content {
  padding: 24px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 4px;
}

.card-meta {
  font-size: 14px;
  color: #86868b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.garage-card .color-dot,
.card-meta .color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: inline-block;
  margin-right: 6px;
  background-size: cover;
  background-position: right bottom;
}

/* Primary Action Button */
.card-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

.btn-secondary {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-primary-ghost {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0, 113, 227, 0.1);
  color: #0071e3;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .btn-secondary:hover {
    background: #f5f5f7;
    border-color: #d1d1d6;
  }

  .btn-primary-ghost:hover {
    background: rgba(0, 113, 227, 0.15);
  }
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 100px 0;
  color: #86868b;
}

/* ==================================================================
   PREVIEW MODAL
   ================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  /* REMOVED: backdrop-filter: blur(10px) - expensive blur caused ~500ms delay */
  /* REMOVED: -webkit-backdrop-filter: blur(10px) - expensive blur caused ~500ms delay */
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease; /* Reduced from 0.3s to 0.15s for instant feel */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #fff;
  width: 100%;
  max-width: 1300px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: scale(0.95) translateY(10px);
  transition: all 0.15s ease; /* Reduced from 0.4s to 0.15s for instant modal open */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-overlay.visible .modal-card {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
}

/* Title block stretches to fill available space; close button alone on the far right */
.modal-title-group {
  flex: 1;
  min-width: 0;
}

.modal-title-text {
  min-width: 0;
}

.modal-title-group h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: #1d1d1f;
}

.modal-subtitle {
  font-size: 15px;
  color: #86868b;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Hide the color dot in the modal header — it adds an undesirable indent before the subtitle text */
.modal-subtitle .color-dot {
  display: none;
}

/* Wrap ID row: ID text on the left, favorite star pinned to the right */
.modal-wrap-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.modal-wrap-id {
  font-size: 15px;
  color: #86868b;
  user-select: text;
}

/* On mobile the star is absolutely positioned; collapse the row to a plain block */
@media (max-width: 768px) {
  .modal-wrap-id-row {
    display: block;
  }
}

.modal-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1d1d1f;
  transition: all 0.2s ease;
  box-shadow: none;
}

.modal-close:hover {
  background: #e5e5e7;
  transform: none;
}

/* Modal Body */
.modal-body {
  padding: 32px;
  overflow-y: auto;
}

/* Preview Container (Hero + Thumbnail) */
.preview-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 24px;
  display: flex;
  justify-content: center;
}

.preview-hero {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  transition: filter 0.3s ease;
}

.preview-thumbnail {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 200px;
  height: 125px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
  z-index: 10;
}

.preview-thumbnail:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.4);
}

.preview-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 0.3s ease;
}

.panel-label {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
  z-index: 2;
  pointer-events: none;
}

/* ==========================================
   DELETE CONFIRMATION MODAL
   ========================================== */
.confirm-dialog {
  background: white;
  width: 90%;
  max-width: 320px;
  border-radius: 28px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  transform: scale(1);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.confirm-title {
  margin: 24px 0 12px;
  font-size: 19px;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -0.01em;
}

.confirm-body {
  margin: 0 0 32px;
  font-size: 15px;
  line-height: 1.4;
  color: #86868b;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.confirm-button {
  flex: 1;
  height: 44px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.confirm-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.4);
}

.confirm-button--secondary {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #1d1d1f;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.confirm-button--secondary:hover {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
}

.confirm-button--danger {
  background: #ff3b30;
  border: none;
  color: white;
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.25);
}

.confirm-button--danger:hover {
  background: #d73329;
  box-shadow: 0 6px 16px rgba(255, 59, 48, 0.35);
}

.confirm-button--danger:active {
  transform: scale(0.98);
}

@media (max-width: 480px) {
  .confirm-actions {
    flex-direction: column;
  }

  .confirm-button {
    width: 100%;
  }

  .confirm-body {
    margin-bottom: 24px;
  }
}

/* ==========================================
   CAR INFO MODAL (Name Your Car)
   ========================================== */
.car-info-dialog {
  background: #ffffff;
  width: 90%;
  max-width: 360px;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  position: relative;
}

/* When parent modal-overlay has display: flex, this positions to right */
#carInfoModal {
  justify-content: flex-end;
  align-items: center;
  padding-right: 80px;
}

#carInfoModal.visible .car-info-dialog {
  transform: scale(1) translateY(0);
}

.car-info-title {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.car-info-subtitle {
  margin: 0 0 24px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #86868b;
}

.car-info-form {
  margin-bottom: 24px;
}

.car-info-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #1d1d1f;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.car-info-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 15px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: #ffffff;
  color: #1d1d1f;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
}

.car-info-input::placeholder {
  color: #c7c7cc;
}

.car-info-input:hover {
  border-color: rgba(0, 0, 0, 0.18);
}

.car-info-input:focus {
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.car-info-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.car-info-button {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  border: none;
  font-family: inherit;
}

.car-info-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.4);
}

.car-info-button--secondary {
  background: #f5f5f7;
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.car-info-button--secondary:hover {
  background: #e8e8ed;
  border-color: rgba(0, 0, 0, 0.1);
}

.car-info-button--secondary:active {
  transform: scale(0.98);
}

.car-info-button--primary {
  background: #0071e3;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
}

.car-info-button--primary:hover:not(:disabled) {
  background: #0077ed;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.4);
}

.car-info-button--primary:active:not(:disabled) {
  transform: scale(0.98);
}

.car-info-button--primary:disabled {
  background: #c7c7cc;
  color: #ffffff;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

@media (max-width: 480px) {
  #carInfoModal {
    padding-right: 20px;
    padding-left: 20px;
    justify-content: center;
  }

  .car-info-dialog {
    max-width: 340px;
  }
}

.thumbnail-label {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(4px);
  z-index: 2;
  pointer-events: none;
}

@media (max-width: 768px) {
  .preview-thumbnail {
    width: 140px;
    bottom: 12px;
    right: 12px;
  }
}

/* Modal Actions */
.modal-actions {
  display: flex;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-modal-primary {
  background: #0071e3;
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-primary:hover {
  background: #0077ed;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.btn-modal-secondary {
  background: white;
  color: #1d1d1f;
  border: 1px solid #d2d2d7;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-modal-secondary:hover {
  border-color: #86868b;
  background: #fafafa;
}

.btn-modal-tertiary {
  background: transparent;
  color: #86868b;
  border: none;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 500;
  cursor: not-allowed;
  margin-left: auto;
}

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

  .modal-actions {
    flex-direction: column;
  }

  .btn-modal-tertiary {
    margin-left: 0;
    text-align: center;
  }
}

/* Garage Section Background */
#garage {
  background-color: #F5F5F7;
  min-height: 100vh;
}

/* ============================================================
   GARAGE LIST VIEW
   ============================================================ */


/* ============================================================
   GARAGE LIST VIEW
   ============================================================ */

.garage-list-container {
  display: none;
  /* Hidden by default */
  flex-direction: column;
  gap: 4px;
  /* Tighter gap for higher density */
  margin-top: 24px;
  width: 100%;
  max-width: 1200px;
}

.garage-list-container.active {
  display: flex;
}

.garage-list-row {
  display: flex;
  align-items: center;
  background: white;
  padding: 6px 16px;
  /* Minimal padding */
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.03);
  height: 56px;
  /* Target ~20 rows/screen */
  position: relative;
  /* For menu positioning */
}

.garage-list-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  background-color: #fafafa;
  z-index: 1;
}

/* Left: Thumbnail */
.list-thumbnail {
  width: 64px;
  /* Smaller thumbnail */
  height: 40px;
  border-radius: 4px;
  background-color: #eee;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  margin-right: 16px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Middle: Info */
.list-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  /* Very tight text spacing */
  overflow: hidden;
}

.list-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.list-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Color Dot Indicator */
.garage-list-row .color-dot,
.list-subtitle .color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ccc;
  /* Default fallback */
  flex-shrink: 0;
  margin-right: 0;
  border: none;
  /* Override global .color-dot border */
  background-size: cover;
  background-position: center;
}

.list-meta {
  font-size: 11px;
  /* Smaller meta */
  color: #9CA3AF;
  font-weight: 400;
  margin-left: 4px;
}

/* Right: Actions */
.list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Even spacing */
  margin-left: 16px;
}

.action-icon-btn {
  width: 28px;
  /* Smaller touch target */
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #86868b;
  /* Low contrast grey */
  transition: all 0.15s ease;
  background: transparent;
  border: none;
  cursor: pointer;
}

.action-icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

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

/* Star specific styles */
.star-btn.active {
  color: #F59E0B;
}

.star-btn.active svg {
  fill: currentColor;
}

/* Overflow Menu */
.overflow-menu {
  position: absolute;
  top: 40px;
  right: 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 6px;
  min-width: 180px;
  z-index: 100;
  display: none;
  /* Hidden by default */
  flex-direction: column;
  gap: 2px;
}

.overflow-menu.visible {
  display: flex;
}

.menu-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.menu-item:hover {
  background: #F5F5F7;
}

.menu-item.destructive {
  color: #FF3B30;
}

.menu-item.destructive:hover {
  background: rgba(255, 59, 48, 0.1);
}

/* ===== General layout for landing ===== */

.landing-main {
  background: #f8fafc;
  /* Ensure it takes up remaining space so footer sits at bottom */
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ===== Hero ===== */

.hero {
  padding: 80px 0 64px;
  /* Slightly more top padding */
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 64px;
}

.hero-copy {
  flex: 1;
  max-width: 540px;
}

.hero-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 16px;
}

.hero-copy h1 {
  font-size: 56px;
  /* Larger, matching Designer hero feel */
  line-height: 1.05;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 24px;
  letter-spacing: -1.5px;
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: #64748b;
  margin-bottom: 32px;
  max-width: 480px;
}

/* Hero buttons */

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.primary-hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.primary-hero-cta:hover {
  background: #020617;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}

.secondary-hero-cta {
  font-size: 15px;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.secondary-hero-cta:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.05);
}

/* Hero image & Pill */

.hero-image-wrapper {
  flex: 1;
  position: relative;
  /* Anchor for the pill */
  display: flex;
  justify-content: center;
}

.hero-image {
  width: 100%;
  max-width: 580px;
  height: auto;
  border-radius: 24px;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  /* Soft card shadow */
  background: #fff;
  /* Ensure card look */
  padding: 8px;
  /* White border effect */
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* AI preview pill - Positioned over the image */
.ai-preview-pill {
  position: absolute;
  top: -24px;
  /* Overlap top edge */
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 999px;
  background: #ffffff;
  padding: 6px 6px 6px 16px;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
  min-width: 320px;
}

.ai-preview-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-thumbnail {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ai-preview-left span {
  font-size: 13px;
  font-weight: 500;
  color: #334155;
}

.ai-preview-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 500;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

/* Stack on smaller screens */

@media (max-width: 960px) {
  .hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 48px;
  }

  .hero-copy {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-image-wrapper {
    width: 100%;
    max-width: 500px;
  }
}

/* ===== How it fits section ===== */

.how-it-fits {
  padding: 40px 0 96px;
}

.how-it-fits-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
}

.how-it-fits-inner h2 {
  font-size: 32px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.how-it-fits-subtitle {
  color: #64748b;
  font-size: 18px;
  margin-bottom: 48px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.how-it-fits-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  text-align: left;
}

.how-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 32px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.how-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.05),
    0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

.how-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: #3b82f6;
  margin-bottom: 20px;
}

.how-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #0f172a;
}

.how-card p {
  font-size: 15px;
  line-height: 1.6;
  color: #64748b;
}

.how-link {
  display: inline-block;
  margin-top: 40px;
  font-size: 16px;
  font-weight: 500;
  color: #3b82f6;
  text-decoration: none;
}

.how-link:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .how-it-fits-grid {
    grid-template-columns: 1fr;
  }
}

/* BEGIN sidebar avatar dropdown CSS */
.sidebar-account {
  padding-top: 16px;
  position: relative;
}

.sidebar-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sidebar-avatar:hover {
  background: rgba(0, 0, 0, 0.04);
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #5C7CFA;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.user-avatar-container {
  position: relative;
}

.sidebar-account .user-avatar-container .user-menu {
  position: absolute;
  top: auto;
  right: auto;
  bottom: 100%;
  left: 0;
  margin-bottom: 8px;
  width: 220px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 1000;
  transform-origin: bottom left;
  animation: menuPopUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes menuPopUp {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(4px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.sidebar-account .user-avatar-container .user-menu.open {
  display: flex;
}

/* END sidebar avatar dropdown CSS */

/* ============================================================
   CUSTOM STUDIO PACKS - Brand & Category Styles
   ============================================================ */

/* Hide diamond indicator globally */
.panel-pointer {
  display: none !important;
}

/* Custom brand option (text-based with spark icon) */
.brand-option.brand-option-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.brand-option.brand-option-text .custom-spark-icon {
  color: rgba(0, 0, 0, 0.35);
  transition: color var(--transition-fast);
  flex-shrink: 0;
}

.brand-option.brand-option-text .brand-text {
  font-size: 18px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.4);
  letter-spacing: -0.3px;
  transition: color var(--transition-fast);
}

.brand-option.brand-option-text:hover .custom-spark-icon {
  color: rgba(0, 0, 0, 0.55);
}

.brand-option.brand-option-text:hover .brand-text {
  color: rgba(0, 0, 0, 0.65);
}

/* Active state with accent color for spark icon */
.brand-option.brand-option-text.active .custom-spark-icon {
  color: #7C5CFF;
}

.brand-option.brand-option-text.active .brand-text {
  color: #7C5CFF;
}

/* ============================================================
   SWATCH SEARCH ROW (Centered on car image axis)
   ============================================================ */

/* Container to center search row matching car image (70% max-width, auto margins) */
.swatch-search-container {
  max-width: 70%;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.swatch-search-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
  width: auto;
}

.swatch-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 280px;
}

.swatch-search-wrapper .search-icon {
  position: absolute;
  left: 14px;
  color: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.swatch-search-input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 40px;
  border-radius: 21px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.02);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s ease;
}

.swatch-search-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.swatch-search-input:focus {
  border-color: rgba(0, 0, 0, 0.2);
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 13px;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.search-clear-btn:hover {
  background: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.7);
}

.swatch-count-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

/* Custom Studio header with search */
.custom-studio-top-row {
  margin-bottom: 8px;
}

/* Custom search group - inherits positioning from parent */
.custom-search-container {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.custom-search-group {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  width: auto;
}

.custom-search-wrapper {
  width: 220px;
}

/* Hide pill rows during active search */
.finish-selector-wrapper.search-hidden,
.custom-category-wrapper.search-hidden {
  display: none !important;
}

/* Dimmed state for pills during search */
.orb.search-dimmed,
.custom-category-pill.search-dimmed {
  opacity: 0.4;
  pointer-events: none;
}

/* Custom category wrapper - aligned with brand row */
.custom-category-wrapper {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  padding: 12px 0;
}

/* Search wrapper - centered with brands/pills */
.search-wrapper-centered {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 20px;
  padding: 8px 0;
}

.search-row-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 540px;
}

/* Custom category pill row - with filters and actions */
.custom-category-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  position: relative;
  z-index: 10;
  flex-wrap: wrap;
}

/* Filters group (category pills) */
.custom-filters-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Actions group (Upload, Create with AI) */
.custom-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
}

/* Premium category pills */
.custom-category-pill {
  padding: 11px 22px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.custom-category-pill:hover {
  background: #fff;
  color: var(--text-primary);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.custom-category-pill.active {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.2);
  transform: translateY(-1px);
}

/* Action pills (Upload, Create with AI) */
.custom-action-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.custom-action-pill svg {
  flex-shrink: 0;
}

.custom-action-pill span {
  white-space: nowrap;
}

/* Upload action pill */
.upload-action-pill {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.12);
  color: var(--accent);
}

.upload-action-pill:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

/* Create with AI action pill */
.ai-action-pill {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.06), rgba(59, 130, 246, 0.06));
  border: 1px solid rgba(147, 51, 234, 0.12);
  color: #7c3aed;
}

.ai-action-pill:hover {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(59, 130, 246, 0.1));
  border-color: rgba(147, 51, 234, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.15);
}

/* Custom Studio Header - aligned via designer-align-frame */
.custom-header-wrapper {
  width: 100%;
  margin-top: clamp(12px, 2.5vh, 32px);
  text-align: center;
  margin-bottom: 16px;
}

.custom-header-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.custom-header-subtitle {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.75;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0;
}

.custom-studio-title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-studio-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
}

.custom-studio-subtitle {
  font-size: 14px;
  color: rgba(15, 23, 42, 0.55);
  line-height: 1.4;
  margin-bottom: 16px;
}

/* Upload Pattern Card */
.upload-pattern-card {
  background: rgba(59, 130, 246, 0.04);
  border: 2px dashed rgba(59, 130, 246, 0.25);
  cursor: pointer;
}

.upload-pattern-card:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.4);
}

.upload-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
}

.upload-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: all var(--transition-fast);
}

.upload-pattern-card:hover .upload-icon-wrapper {
  background: rgba(59, 130, 246, 0.15);
  transform: scale(1.05);
}

.upload-label {
  color: var(--accent);
  font-weight: 500;
}

/* Custom pattern card thumbnail styling */
.custom-pattern-thumb {
  background-size: cover;
  background-position: center;
  background-repeat: repeat;
}

/* Custom pattern card styling */
.custom-pattern-card {
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.custom-pattern-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
}

.custom-pattern-card.active {
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.25);
}

/* Custom swatch detail panel polish */
.selected-detail .selected-thumb.custom-pattern-preview {
  border-radius: 20px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* AI Pattern Generator Modal */
.ai-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  /* REMOVED: backdrop-filter: blur(4px) - expensive blur caused delay */
  /* REMOVED: -webkit-backdrop-filter: blur(4px) - expensive blur caused delay */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ai-modal-backdrop.visible {
  opacity: 1;
}

.ai-modal {
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.15s ease; /* Reduced from 0.25s to 0.15s for instant modal open */
}

.ai-modal-backdrop.visible .ai-modal {
  transform: translateY(0) scale(1);
}

.ai-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.ai-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(59, 130, 246, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c3aed;
}

.ai-modal-header h3 {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.ai-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.ai-modal-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}

.ai-modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.coming-soon-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(147, 51, 234, 0.1);
  color: #7c3aed;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-modal-input {
  width: 100%;
  height: 100px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.02);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-secondary);
  resize: none;
  margin-bottom: 16px;
}

.ai-modal-input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.ai-modal-generate {
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

/* ============================================================
   UNIFIED SEARCH BAR
   ============================================================ */
.unified-search-container {
  width: 100%;
  max-width: 360px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.unified-search-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.unified-search-input {
  width: 100%;
  height: 44px;
  padding: 0 40px;
  /* Space for icon and clear btn */
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.unified-search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.unified-search-wrapper .search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-secondary);
  pointer-events: none;
}

.unified-search-wrapper .search-clear-btn {
  position: absolute;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: rgba(15, 23, 42, 0.1);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.unified-search-wrapper .search-clear-btn:hover {
  background: rgba(15, 23, 42, 0.2);
  color: var(--text-primary);
}

#unifiedSwatchCount {
  /* Right-aligned inline count */
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  opacity: 0.7;
  white-space: nowrap;
}

.ai-modal-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-modal-generate:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
}

/* END Custom Studio Packs styles */

/* ============================================================
   COLOR PRECHECK PANEL
   ============================================================ */
.precheck-panel {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  animation: slideInPrecheck 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

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

.precheck-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.precheck-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.precheck-badge.loading {
  background: rgba(0, 122, 255, 0.1);
  color: #007AFF;
}

.precheck-badge.none {
  background: rgba(52, 199, 89, 0.1);
  color: #34C759;
}

.precheck-badge.warn {
  background: rgba(255, 149, 0, 0.1);
  color: #FF9500;
}

.precheck-badge.strong-warn {
  background: rgba(255, 59, 48, 0.1);
  color: #FF3B30;
}

.precheck-badge.error {
  background: rgba(142, 142, 147, 0.1);
  color: #8E8E93;
}

.precheck-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.precheck-reason {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.precheck-timing {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

/* Loading state with subtle animation */
.precheck-badge.loading::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spinPrecheck 0.6s linear infinite;
}

@keyframes spinPrecheck {
  to {
    transform: rotate(360deg);
  }
}

/* Expanded warning view */
.precheck-warning {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

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

.precheck-warning-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.precheck-warning-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.precheck-warning-reason {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.precheck-warning-disclaimer {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  opacity: 0.8;
  font-style: italic;
}

.precheck-warning-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-warning-primary,
.btn-warning-secondary,
.btn-warning-tertiary {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-warning-primary {
  background: var(--accent);
  color: white;
}

.btn-warning-primary:hover {
  background: #2563EB;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-warning-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-warning-secondary:hover {
  background: #f5f5f5;
  border-color: var(--accent);
}

.btn-warning-tertiary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.btn-warning-tertiary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Debug details */
.precheck-debug {
  margin-top: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  font-size: 12px;
}

.precheck-debug summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  user-select: none;
}

.precheck-debug summary:hover {
  color: var(--accent);
}

.precheck-debug-content {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.debug-row {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.debug-row strong {
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 4px;
}

/* Flash highlight animation for search bar */
@keyframes flashHighlight {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    border-color: var(--border);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    border-color: var(--accent);
  }
}

.flash-highlight {
  animation: flashHighlight 1.5s ease-in-out;
}

/* ============================================================
   STRONG_WARN MODAL GATE
   ============================================================ */

.strong-warn-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.strong-warn-modal {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 480px;
  width: 90%;
  padding: 32px;
  animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.strong-warn-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.strong-warn-modal-body {
  margin-bottom: 24px;
}

.strong-warn-reason {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.strong-warn-modal-actions {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

.btn-modal-primary,
.btn-modal-secondary {
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 180ms ease;
}

.btn-modal-primary {
  background: var(--accent);
  color: white;
}

.btn-modal-primary:hover {
  background: #4169E1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-modal-secondary {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.btn-modal-secondary:hover {
  background: rgba(0, 0, 0, 0.08);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* ============================================================
   COMPACT SIDEBAR — low viewport height fallback
   Breakpoint: max-height: 900px
   Hamburger button appears near top-right of sidebar.
   Panel exposes the same account/status/actions as the
   bottom avatar area — no new permissions, same content.
   ============================================================ */

/* Button: hidden by default, shown only in compact mode */
.sidebar-compact-btn {
  display: none;
  position: absolute;
  top: 38px;
  right: 12px;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  z-index: 110;
  flex-shrink: 0;
}

.sidebar-compact-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.sidebar-compact-btn[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.07);
  color: var(--text-primary);
}

/* Panel: always hidden until activated in compact mode */
.sidebar-compact-panel {
  display: none;
}

/* Compact mode: activate at max-height 900px */
@media (max-height: 900px) {
  .sidebar-compact-btn {
    display: flex;
  }

  .sidebar-compact-panel {
    position: absolute;
    /* 32px padding-top + 40px logo height */
    top: 72px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    z-index: 105;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
    animation: scPanelIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .sidebar-compact-panel.open {
    display: block;
  }

  /* Hide hamburger when the bottom account section is still within the viewport */
  .sidebar.sidebar-acct-visible .sidebar-compact-btn {
    display: none !important;
  }
}

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

/* Panel interior styles */
.sc-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 10px;
}

.sc-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #5C7CFA;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.sc-identity-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.sc-plan-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sc-plan-text {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}

.sc-plan-text .admin-suffix {
  font-style: italic;
  opacity: 0.75;
  font-weight: 400;
  margin-left: 3px;
}

/* ── Sidebar account card: main panel admin suffix ─────────────── */
/* auth-ui.js injects into .sidebar-plan-text (full-width panel).  */
.sidebar-plan-text .admin-suffix {
  font-style: italic;
  font-weight: 400;
  color: #9ca3af;
  margin-left: 3px;
}

/* ── Sidebar account card: yellow info bubble ───────────────────── */
.sidebar-plan-info-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f59e0b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 120ms;
  user-select: none;
  line-height: 1;
}
.sidebar-plan-info-icon:hover { background: #d97706; }

/* ── Sidebar account card: plan text base ───────────────────────── */
.sidebar-plan-text {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
}

/* ── Sidebar account card: low balance warning lines ────────────── */
.sidebar-plan-warning-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-plan-warning-primary {
  font-size: 12px;
  color: #B45309;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.sidebar-plan-warning-secondary {
  font-size: 11px;
  color: #B45309;
  font-weight: 400;
  opacity: 0.8;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.sc-warning-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 16px 8px;
}

.sc-warning-primary {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.sc-warning-secondary {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.8;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

/* Status card: dark background so the tooltip HTML (white text) renders correctly */
.sc-status {
  margin: 0 12px 8px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.88);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.sc-sep {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 4px 0;
}

.sc-link {
  display: block;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  text-decoration: none;
  transition: background 0.15s ease;
  cursor: pointer;
}

.sc-link:hover {
  background: rgba(0, 0, 0, 0.04);
}

.sc-logout {
  color: #EF4444;
}

.sc-logout:hover {
  background: rgba(239, 68, 68, 0.08);
}

/* ================================================================
   MOBILE DESIGNER MVP — Phase 1
  Activation:
  - small mobile widths (max-width 600px)
  - real phones in landscape (coarse pointer + no hover + landscape + short height)
   Scope: designer + customizer sections only.
  Desktop/laptop behavior stays unchanged because those devices do not match
  the coarse-pointer + no-hover phone-landscape query.
   ================================================================ */

/* ── Mobile top app bar (hidden on desktop) ──────────────────────── */

.mobile-top-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: #0071e3;
  border-bottom: none;
  z-index: 200;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-shadow: 0 2px 12px rgba(0, 113, 227, 0.28);
}

.mobile-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.mobile-hamburger:active {
  background: rgba(255, 255, 255, 0.15);
}

.mobile-top-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  white-space: nowrap;
}

/* Dark navy button — high contrast against the blue header */
.mobile-apply-btn {
  height: 34px;
  padding: 0 16px;
  border-radius: 17px;
  border: none;
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.mobile-apply-btn:disabled {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.45);
  cursor: default;
}

.mobile-apply-btn:not(:disabled):active {
  background: #1e293b;
}

/* ── Mobile drawer (slide-in nav sheet) ──────────────────────────── */

.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.mobile-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 240px;
  height: auto;
  max-height: 100vh;
  background: #fff;
  z-index: 300;
  padding: 0 0 40px;
  overflow-y: auto;
  transform: translateX(-100%);
  pointer-events: none;
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.12);
  border-bottom-right-radius: 16px;
}

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

.mobile-drawer-header {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  margin-bottom: 6px;
}

.mobile-drawer-header img {
  height: 24px;
  width: auto;
  flex-shrink: 0;
}

.mobile-drawer-wordmark {
  font-size: 15px;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -0.01em;
}

.mobile-drawer-section-label {
  padding: 14px 18px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
  user-select: none;
}

.mobile-drawer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: 15px;
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease;
  border-radius: 0;
}

.mobile-drawer-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.mobile-drawer-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.mobile-drawer-item:active {
  background: rgba(0, 0, 0, 0.07);
}

.mobile-drawer-item.active-section {
  color: #0071e3;
  font-weight: 600;
  background: rgba(0, 113, 227, 0.06);
}

.mobile-drawer-item.active-section svg {
  opacity: 1;
}

.mobile-drawer-item--danger {
  color: #dc2626;
}

.mobile-drawer-item--action {
  color: #1a1a1a;
}

.mobile-drawer-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.07);
  margin: 10px 0;
}

/* ── Mobile upload state (shown in #designer on mobile) ──────────── */

.mobile-upload-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 52px);
  /* Shift content upward so the logo sits higher in the viewport */
  padding: 0 24px 40px;
  padding-top: 0;
  margin-top: -12vh;
  text-align: center;
}

.mobile-upload-logo img {
  height: 96px;
  width: auto;
  margin-bottom: 32px;
  opacity: 0.9;
}

.mobile-upload-tagline {
  font-size: 22px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
  margin: 0 0 32px;
  max-width: 270px;
}

.mobile-choose-photo-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 36px;
  height: 54px;
  border-radius: 27px;
  background: #2563eb;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.32);
  margin-bottom: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
  width: 100%;
  justify-content: center;
}

.mobile-choose-photo-btn:active {
  background: #1d4ed8;
}

.mobile-upload-hint {
  font-size: 13px;
  color: #9ca3af;
  margin: 0;
  max-width: 240px;
  line-height: 1.5;
}

/* ── Mobile action card (groups upload CTA + search) ─────────────── */

.mobile-action-card {
  width: 100%;
  max-width: 340px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 20px 20px 18px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.07),
    0 1px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-bottom: 16px;
}

.mobile-action-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}

.mobile-action-or-line {
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
}

.mobile-action-or-text {
  font-size: 12px;
  font-weight: 500;
  color: #9ca3af;
  letter-spacing: 0.05em;
}

.mobile-search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.mobile-search-icon {
  position: absolute;
  left: 13px;
  color: #9ca3af;
  pointer-events: none;
  flex-shrink: 0;
}

.mobile-search-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 40px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 13px;
  background: #f9fafb;
  font-size: 15px;
  color: #111827;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
  box-sizing: border-box;
  font-family: inherit;
}

.mobile-search-input:focus {
  border-color: #2563eb;
  background: #ffffff;
}

.mobile-search-input::placeholder {
  color: #9ca3af;
}

.mobile-search-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mobile-search-hint {
  font-size: 12px;
  color: #9ca3af;
  margin: 9px 0 0;
  text-align: center;
  line-height: 1.4;
}

.mobile-search-results-anchor {
  width: 100%;
  max-width: 340px;
}

/* ── Mobile search sticky action bar ────────────────────────────── */
/* Fixed to viewport bottom; appears when a search result is tapped. */

.mobile-search-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  /* Respect iPhone home-indicator safe area */
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.09);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.09);
  /* Only visible on mobile — hidden above 768px via inline style set by JS */
}

.mobile-search-sticky-cancel {
  flex: 1;
  height: 50px;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  border-radius: 13px;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease;
  font-family: inherit;
}

.mobile-search-sticky-cancel:active {
  background: rgba(0, 0, 0, 0.05);
}

.mobile-search-sticky-use {
  flex: 2;
  height: 50px;
  border: none;
  border-radius: 13px;
  background: #2563eb;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease;
  font-family: inherit;
}

.mobile-search-sticky-use:active {
  background: #1d4ed8;
}

.mobile-search-sticky-use:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Mobile resume car card ──────────────────────────────────────── */

.mobile-resume-car-card {
  width: 100%;
  max-width: 340px;
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  padding: 16px 18px 14px;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.07),
    0 1px 4px rgba(0, 0, 0, 0.04);
  animation: resume-card-fade-in 0.35s ease;
  text-align: left;
}

.mobile-resume-car-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mobile-resume-car-text {
  flex: 1;
  min-width: 0;
}

.mobile-resume-car-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 3px 0;
  letter-spacing: -0.2px;
}

.mobile-resume-car-subtitle {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.45);
  margin: 0;
  font-weight: 400;
}

.mobile-resume-car-thumbnail {
  width: 84px;
  height: 56px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  filter: saturate(0.8) brightness(0.96);
}

.mobile-resume-car-actions {
  display: flex;
  gap: 10px;
}

.mobile-resume-btn {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.mobile-resume-continue {
  background: #2563eb;
  color: #fff;
}

.mobile-resume-continue:active {
  background: #1d4ed8;
}

.mobile-resume-dismiss {
  background: rgba(0, 0, 0, 0.06);
  color: #374151;
}

.mobile-resume-dismiss:active {
  background: rgba(0, 0, 0, 0.1);
}

/* ── Mobile customizer additions ─────────────────────────────────── */

.mobile-vehicle-name {
  display: none;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  text-align: center;
  padding: 6px 16px 0;
}

.mobile-selected-badge {
  display: none;
  font-size: 13px;
  color: #374151;
  padding: 7px 16px;
  background: #f9fafb;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* ================================================================
  Activate all mobile overrides for:
  - narrow mobile viewports
  - actual phones rotated to landscape
  ================================================================ */

@media (max-width: 600px), (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {

  /* ── Global layout: remove sidebar and its offset ── */

  .sidebar {
    display: none !important;
  }

  .main {
    margin-left: 0 !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body {
    padding-top: 52px;
  }

  /* Let the mobile shell consume the full landscape viewport while still
     respecting iPhone safe areas on the left/right edges. */
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Show mobile-only chrome */
  .mobile-top-bar {
    display: flex;
    padding-left: calc(12px + env(safe-area-inset-left, 0px));
    padding-right: calc(12px + env(safe-area-inset-right, 0px));
  }

  .mobile-drawer-overlay,
  .mobile-drawer {
    display: block;
  }

  /* ── #designer: upload state ── */

  #designer {
    padding-top: 0 !important;
    overflow: visible !important;
    min-height: auto !important;
  }

  #designer.active {
    display: block !important;
    align-items: unset !important;
    justify-content: unset !important;
  }

  /* Hide desktop upload elements */
  .designer-container {
    display: none !important;
  }

  /* Show mobile upload state */
  .mobile-upload-state {
    display: flex;
  }

  /* ── #customizer: loaded car state ── */

  /* Hide desktop header (New Wrap is in drawer) */
  .customizer-header {
    display: none !important;
  }

  /* Remove frame padding */
  .designer-align-frame {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 8px max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    align-items: stretch;
  }

  /* Compact car preview */
  .car-preview-wrapper {
    width: 100% !important;
    max-width: none !important;
    max-height: 220px !important;
    min-height: 160px !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }

  /* Show mobile vehicle name below preview */
  .mobile-vehicle-name {
    display: block;
  }

  /* Show mobile selected swatch badge */
  .mobile-selected-badge {
    display: block;
  }

  /* Swatch component: remove slide-in animation, full-width flow */
  .swatch-component,
  .swatch-component.open {
    margin-top: 0 !important;
    padding: 10px max(12px, env(safe-area-inset-right, 0px)) 32px max(12px, env(safe-area-inset-left, 0px)) !important;
    max-height: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    transition: none !important;
  }

  /* Brand selector: compact tab row */
  .brand-selector-wrapper {
    margin-bottom: 10px !important;
  }

  .brand-selector {
    gap: 0 !important;
    justify-content: stretch !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.09);
  }

  .brand-option {
    flex: 1 !important;
    height: 54px !important;
    width: auto !important;
    padding: 8px 6px !important;
    border-bottom: 2px solid transparent;
    border-radius: 0 !important;
  }

  .brand-option img {
    width: auto !important;
    max-width: 88px !important;
    height: 28px !important;
    object-fit: contain;
  }

  .brand-option-text {
    font-size: 13px !important;
  }

  .brand-text {
    font-size: 13px !important;
    line-height: 1.2;
    white-space: nowrap;
  }

  /* Finish orbs: wrapped rows, no horizontal scroll */
  .finish-selector-wrapper {
    margin-bottom: 10px !important;
    padding: 4px 0 !important;
  }

  .orb-row {
    gap: 10px !important;
    min-height: unset !important;
    flex-wrap: wrap !important;          /* wrap into rows instead of scrolling */
    overflow-x: visible !important;
    overflow-y: visible !important;
    justify-content: center !important;  /* center-balance wrapped rows */
    padding: 6px 4px 8px !important;
  }

  .orb {
    width: 70px !important;
    height: 70px !important;
    flex-shrink: 0 !important;
    font-size: 11px !important;
  }

  .orb-label {
    font-size: 11px !important;
    margin-top: 5px !important;
  }

  /* Custom category pills: wrapped rows, no horizontal scroll */
  .custom-category-wrapper {
    margin-bottom: 10px !important;
  }

  .custom-category-row {
    gap: 8px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    padding: 4px 0 !important;
  }

  /* The inner filters group must also wrap */
  .custom-filters-group {
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: center !important;
  }

  /* Actions row (Upload + Create with AI) on its own line */
  .custom-actions-group {
    width: 100% !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left: none !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
    padding-top: 10px !important;
    justify-content: center !important;
    gap: 10px !important;
  }

  .custom-category-pill {
    padding: 7px 13px !important;
    font-size: 12.5px !important;
  }

  /* Hide search bar (Phase 1: no mobile search) */
  .search-wrapper-centered {
    display: none !important;
  }

  /* Panel: remove pointer caret, full width */
  .panel-pointer {
    display: none !important;
  }

  .panel-wrapper {
    margin-top: 10px !important;
  }

  .panel {
    border-radius: 16px !important;
    min-height: auto !important;
    flex-direction: column !important;
  }

  /* Swatches side: full width */
  .swatches-side {
    padding: 14px 12px !important;
    min-height: auto !important;
    gap: 10px !important;
    flex: unset !important;
    width: 100%;
  }

  /* 2-column swatch grid */
  .swatches-grid,
  .swatches-grid.centered-row {
    grid-template-columns: repeat(2, 1fr) !important;
    max-height: none !important;
    overflow-y: visible !important;
    padding-right: 0 !important;
    gap: 10px 10px !important;
  }

  /* Hide right panel (Apply button is in top bar; detail is shown as badge) */
  .selected-side {
    display: none !important;
  }

  /* Hide vehicle info hover button (info is shown as mobile-vehicle-name text) */
  .vehicle-info-btn {
    display: none !important;
  }

  /* Hide desktop-only zoom chrome on mobile */
  .zoom-hint-overlay,
  #zoomModeLabel,
  .reset-zoom-btn {
    display: none !important;
  }

  /* Upload car modal: full-screen on mobile */
  .car-upload-modal-overlay {
    align-items: flex-end;
  }

  .car-upload-modal {
    border-radius: 20px 20px 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

}
