/* =========================================================================
   Design tokens
   ========================================================================= */
:root {
  /* Surfaces */
  --bg-base: #08070F;
  --bg-deep: #050410;
  --surface-1: rgba(22, 20, 34, 0.72);
  --surface-2: rgba(30, 28, 44, 0.82);
  --surface-3: rgba(40, 36, 56, 0.85);
  --surface-hover: rgba(44, 40, 62, 0.88);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.10);
  --border-emphasis: rgba(255, 255, 255, 0.18);

  /* Text */
  --text-primary: #F4F1FB;
  --text-secondary: #A6A3BA;
  --text-tertiary: #6E6A85;
  --text-muted: #48445A;

  /* Brand / accents */
  --accent: #A855F7;          /* purple */
  --accent-bright: #C084FC;
  --accent-pink: #EC4899;     /* pink */
  --accent-pink-bright: #F472B6;
  --accent-dim: rgba(168, 85, 247, 0.14);
  --accent-glow: rgba(168, 85, 247, 0.35);
  --accent-pink-glow: rgba(236, 72, 153, 0.30);

  --gradient-accent: linear-gradient(135deg, #A855F7 0%, #EC4899 100%);
  --gradient-accent-bright: linear-gradient(135deg, #C084FC 0%, #F472B6 100%);
  --gradient-text: linear-gradient(135deg, #C084FC 0%, #F472B6 50%, #FB923C 100%);

  --danger: #F87171;
  --danger-bg: rgba(248, 113, 113, 0.12);

  --checker-a: #141222;
  --checker-b: #1D1A2B;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 24px 72px rgba(0,0,0,0.55);
  --shadow-glow-purple: 0 0 60px rgba(168,85,247,0.28);
  --shadow-glow-pink: 0 0 70px rgba(236,72,153,0.22);
  --shadow-cta: 0 12px 40px rgba(168,85,247,0.35), 0 4px 12px rgba(236,72,153,0.20);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 150ms;
  --dur-base: 280ms;
  --dur-slow: 600ms;
}

/* =========================================================================
   Reset
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  scroll-behavior: smooth;
}

html { scrollbar-gutter: stable; }

h1, h2, h3, h4, p { margin: 0; }

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

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* =========================================================================
   Animated background
   ========================================================================= */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% -10%, #1A0B2E 0%, transparent 55%),
    radial-gradient(ellipse at 110% 30%, #2B0B26 0%, transparent 50%),
    radial-gradient(ellipse at 50% 110%, #0E0B26 0%, transparent 55%),
    var(--bg-base);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  animation: orb-drift 28s ease-in-out infinite alternate;
}

.bg-orb-1 {
  top: -12%; left: -8%;
  width: 720px; height: 720px;
  background: radial-gradient(circle, rgba(168,85,247,0.35), transparent 70%);
}
.bg-orb-2 {
  top: 30%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(236,72,153,0.28), transparent 70%);
  animation-delay: -9s;
}
.bg-orb-3 {
  bottom: -15%; left: 30%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(251,146,60,0.18), transparent 72%);
  animation-delay: -18s;
}

@keyframes orb-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(6%, -8%) scale(1.1); }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at top, black, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at top, black, transparent 75%);
}

/* =========================================================================
   Utility — gradient text
   ========================================================================= */
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* =========================================================================
   Nav
   ========================================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 16px 0;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: rgba(8, 7, 15, 0.55);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.nav-brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(168,85,247,0.18), rgba(236,72,153,0.18));
  border: 1px solid rgba(168,85,247,0.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.nav-brand-mark svg { width: 18px; height: 18px; }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 14px;
  border-radius: var(--r-sm);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.nav-links a:hover {
  color: var(--text-primary);
  background: var(--surface-1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--text-secondary);
  backdrop-filter: blur(12px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: status-pulse 2s ease-in-out infinite;
}
.brand-status.is-loading .status-dot { background: #E0B35C; box-shadow: 0 0 10px rgba(224,179,92,0.5); }
.brand-status.is-working .status-dot { background: #F472B6; box-shadow: 0 0 10px var(--accent-pink-glow); }

@keyframes status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* =========================================================================
   Section shell
   ========================================================================= */
.section { padding: 80px 0; }

.section-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

.section-header {
  max-width: 680px;
  margin-bottom: 56px;
}
.section-header-centered {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-eyebrow {
  display: inline-block;
  padding: 5px 12px;
  background: linear-gradient(135deg, rgba(168,85,247,0.14), rgba(236,72,153,0.10));
  border: 1px solid rgba(168,85,247,0.22);
  border-radius: var(--r-pill);
  color: var(--accent-bright);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.section h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.55;
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  padding: 56px 0 80px;
}

.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--r-pill);
  font-size: 12.5px;
  color: var(--text-secondary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: status-pulse 2s ease-in-out infinite;
}

.hero h1 {
  margin: 22px 0 20px;
  font-size: clamp(40px, 5.4vw, 68px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.55;
  max-width: 540px;
  margin-bottom: 32px;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.hero-social {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-avatars {
  display: flex;
}
.hero-avatars > span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: hsl(var(--h, 280), 60%, 55%);
  background: linear-gradient(135deg, hsl(var(--h, 280), 60%, 65%), hsl(var(--h, 280), 60%, 45%));
  border: 2px solid var(--bg-base);
  margin-left: -6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.hero-avatars > span:first-child { margin-left: 0; }

.hero-social-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
}
.hero-social-text .stars {
  color: #F59E0B;
  letter-spacing: 1px;
  font-size: 11px;
}
.hero-social-text > span:last-child {
  color: var(--text-tertiary);
}

/* =========================================================================
   Compare slider (before/after)
   ========================================================================= */
.hero-demo {
  position: relative;
}

.compare {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border-default);
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(168,85,247,0.15),
    var(--shadow-glow-purple);
  cursor: ew-resize;
  user-select: none;
  --pos: 50%;
  background: #0C0B18;
}

.compare-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.compare-before { z-index: 1; }
.compare-after {
  z-index: 2;
  /* Checker pattern through the transparent cutout so the "after" reads as transparent */
  background-color: var(--checker-a);
  background-image:
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-b) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-b) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  z-index: 3;
  transform: translateX(-50%);
  pointer-events: none;
}

.handle-bar {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.95) 0%,
    rgba(255,255,255,1) 50%,
    rgba(255,255,255,0.95) 100%);
  box-shadow:
    0 0 12px rgba(192, 132, 252, 0.5),
    0 0 4px rgba(255,255,255,0.8);
}

.handle-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: var(--gradient-accent);
  box-shadow:
    0 8px 32px rgba(168,85,247,0.5),
    0 2px 8px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.25);
  display: grid;
  place-items: center;
  color: white;
  pointer-events: all;
  cursor: grab;
  transition: transform 180ms var(--ease-out);
}
.handle-knob:hover { transform: scale(1.08); }
.handle-knob:active { cursor: grabbing; transform: scale(0.96); }
.handle-knob svg { width: 22px; height: 22px; }

.compare-tag {
  position: absolute;
  top: 16px;
  padding: 6px 12px;
  background: rgba(8, 7, 15, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-primary);
  pointer-events: none;
  z-index: 4;
}
.compare-tag-before { right: 16px; }
.compare-tag-after { left: 16px; }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: none;
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition:
    transform 120ms var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn svg { width: 16px; height: 16px; }

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
  border-radius: var(--r-md);
}

.btn-gradient {
  background: var(--gradient-accent);
  color: white;
  box-shadow: var(--shadow-cta);
  position: relative;
}
.btn-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--gradient-accent-bright);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.btn-gradient > * { position: relative; z-index: 1; }
.btn-gradient:hover::before { opacity: 1; }
.btn-gradient:disabled {
  background: var(--surface-2);
  color: var(--text-tertiary);
  box-shadow: none;
  cursor: not-allowed;
}
.btn-gradient:disabled::before { display: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-emphasis);
}

.btn-link {
  background: transparent;
  color: var(--text-secondary);
  padding: 11px 14px;
}
.btn-link:hover { color: var(--text-primary); }

.btn-sm {
  padding: 7px 14px;
  font-size: 12.5px;
  gap: 6px;
}
.btn-sm svg { width: 14px; height: 14px; }
.btn-square {
  padding: 7px 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.3);
}
.btn-danger:hover {
  background: var(--danger-bg);
  border-color: rgba(248,113,113,0.5);
}

/* =========================================================================
   Features section
   ========================================================================= */
.features-section { padding: 60px 0 80px; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.feature-card {
  padding: 28px 24px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition:
    transform var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    background var(--dur-base) var(--ease-out);
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(168,85,247,0.35);
  background: var(--surface-2);
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--accent-dim), rgba(236,72,153,0.10));
  border: 1px solid rgba(168,85,247,0.22);
  color: var(--accent-bright);
  margin-bottom: 18px;
}
.feature-icon svg { width: 22px; height: 22px; }

.feature-card h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: -0.005em;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.55;
}

/* =========================================================================
   Upload section (the actual tool)
   ========================================================================= */
.upload-section { padding: 40px 0 80px; }

/* Tool-only mode: no nav, no landing — center tool, minimal chrome. */
body.tool-only .upload-section { padding: 32px 0 120px; }
body.tool-only .section-inner { max-width: 880px; }

.app-switch {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 14px 18px 0;
  background: linear-gradient(180deg, rgba(8, 7, 15, 0.92), rgba(8, 7, 15, 0));
}

.app-switch-inner {
  width: fit-content;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-md);
}

.app-switch-btn {
  border: 0;
  border-radius: calc(var(--r-md) - 4px);
  padding: 9px 16px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.app-switch-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.app-switch-btn.is-active {
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--accent-dim), rgba(236,72,153,0.08));
  box-shadow: 0 0 0 1px rgba(168,85,247,0.30);
}

.upload-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dropzone {
  position: relative;
  padding: 56px 32px;
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--r-xl);
  cursor: pointer;
  overflow: hidden;
  transition:
    transform var(--dur-base) var(--ease-out),
    background var(--dur-base) var(--ease-out);
}

.dropzone-border {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect width='100%25' height='100%25' fill='none' stroke='%23A855F7' stroke-opacity='0.22' stroke-width='2' stroke-dasharray='10 8' rx='28' ry='28'/%3E%3C/svg%3E");
  transition: opacity var(--dur-base) var(--ease-out);
}

.dropzone:hover, .dropzone:focus-visible {
  background: var(--surface-2);
  transform: translateY(-1px);
}

.dropzone.is-dragover {
  background: linear-gradient(135deg, var(--accent-dim), rgba(236,72,153,0.06));
  transform: scale(1.008);
  box-shadow: var(--shadow-glow-purple);
}
.dropzone.is-dragover .dropzone-border {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect width='100%25' height='100%25' fill='none' stroke='%23C084FC' stroke-width='2' stroke-dasharray='14 6' rx='28' ry='28'/%3E%3C/svg%3E");
  animation: dash-drift 0.8s linear infinite;
}

@keyframes dash-drift {
  to { background-position: 20px 0; }
}

.dropzone-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  pointer-events: none;
}
.dropzone-content .btn { pointer-events: auto; }

.dropzone-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(236,72,153,0.06));
  border: 1px solid rgba(168,85,247,0.22);
  color: var(--accent-bright);
  margin-bottom: 4px;
}
.dropzone-icon svg { width: 26px; height: 26px; }

.dropzone h3 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.dropzone-hint {
  color: var(--text-tertiary);
  font-size: 13px;
  margin-bottom: 6px;
}

.dropzone-paste {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 6px;
}
.dropzone-paste kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
  color: var(--text-secondary);
}

/* =========================================================================
   Options — segmented, chips, sliders
   ========================================================================= */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  backdrop-filter: blur(12px);
  gap: 2px;
}

.seg-item { position: relative; cursor: pointer; user-select: none; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item > span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 7px 14px;
  border-radius: calc(var(--r-md) - 3px);
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.2;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.seg-item:hover > span { color: var(--text-primary); }
.seg-label { font-weight: 500; }
.seg-sub { font-size: 10.5px; color: var(--text-muted); letter-spacing: 0.01em; }
.seg-item:has(input:checked) > span {
  background: linear-gradient(135deg, var(--accent-dim), rgba(236,72,153,0.06));
  color: var(--text-primary);
  box-shadow: 0 0 0 1px rgba(168,85,247,0.35), 0 4px 12px rgba(168,85,247,0.20);
}
.seg-item:has(input:checked) .seg-sub { color: var(--accent-bright); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  user-select: none;
  backdrop-filter: blur(12px);
}
.chip:hover {
  background: var(--surface-hover);
  border-color: var(--border-default);
  color: var(--text-primary);
}

.chip-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.chip-visual { display: inline-flex; align-items: center; gap: 8px; }
.chip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all var(--dur-fast) var(--ease-out);
  flex-shrink: 0;
}
.chip-toggle input:checked ~ .chip-visual .chip-dot {
  background: var(--accent-bright);
  box-shadow: 0 0 8px var(--accent-glow);
}
.chip-toggle:has(input:checked) {
  border-color: rgba(168,85,247,0.35);
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--accent-dim), rgba(236,72,153,0.04));
}

.chip-slider {
  gap: 12px;
  padding: 7px 14px 7px 16px;
  flex: 1 1 240px;
  min-width: 220px;
}
.chip-slider .slider-label { font-size: 12px; color: var(--text-tertiary); }
.chip-slider output {
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  font-size: 12.5px;
  min-width: 40px;
  text-align: right;
}

.chip-slider input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  height: 2px;
  background: var(--border-default);
  border-radius: var(--r-pill);
  cursor: pointer;
  margin: 0;
}
.chip-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gradient-accent);
  box-shadow: 0 0 0 2px rgba(168,85,247,0.25), 0 2px 8px rgba(168,85,247,0.35);
  cursor: grab;
  transition: transform var(--dur-fast) var(--ease-out);
}
.chip-slider input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
.chip-slider input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.2); cursor: grabbing; }
.chip-slider input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-bright);
  border: none;
  box-shadow: 0 0 0 2px rgba(168,85,247,0.25);
  cursor: grab;
}

/* Number inputs used for Rows / Cols in the emote collage row. */
.chip-number {
  gap: 10px;
  padding: 7px 14px;
  flex: 0 0 auto;
}
.chip-number .slider-label { font-size: 12px; color: var(--text-tertiary); }
.chip-number input[type="number"] {
  width: 56px;
  padding: 4px 6px;
  text-align: center;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  outline: none;
  -moz-appearance: textfield;
}
.chip-number input[type="number"]::-webkit-outer-spin-button,
.chip-number input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.chip-number input[type="number"]:focus {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 2px rgba(168,85,247,0.25);
}

/* Collage-Splitter section — groups Rows/Cols/Inset with an explanatory hint. */
.options-emote-section {
  margin-top: 4px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(168,85,247,0.06), rgba(236,72,153,0.03));
  border: 1px solid rgba(168,85,247,0.22);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.options-section-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.options-section-hint strong {
  color: var(--accent-bright);
  font-weight: 600;
}
/* Wide toggle chip that spans a full row, used for the skip-BG option. */
.chip-toggle-wide {
  width: 100%;
  padding: 10px 14px;
  align-items: flex-start;
}
.chip-toggle-wide .chip-visual {
  align-items: flex-start;
  line-height: 1.4;
}
.chip-sub {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 400;
}

/* =========================================================================
   Model loading card
   ========================================================================= */
.model-card {
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fade-slide-in 400ms var(--ease-out);
}

.model-card-header { display: flex; align-items: center; gap: 14px; }
.model-card-header h3 { font-size: 15px; font-weight: 500; margin-bottom: 2px; }
.model-card-header p { font-size: 12.5px; color: var(--text-tertiary); }

.model-pulse {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  flex-shrink: 0;
  position: relative;
}
.model-pulse span {
  position: absolute;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-glow);
  animation: pulse-ring 1.8s cubic-bezier(0.2,0,0.3,1) infinite;
}
.model-pulse span:nth-child(2) { animation-delay: 0.6s; background: var(--accent-pink-glow); }
.model-pulse span:nth-child(3) { animation-delay: 1.2s; }

@keyframes pulse-ring {
  0% { transform: scale(0.3); opacity: 0.9; }
  80%, 100% { transform: scale(1.4); opacity: 0; }
}

.progress-track {
  position: relative;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-accent);
  border-radius: inherit;
  transition: width 200ms linear;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 14px var(--accent-glow);
}

.progress-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
  animation: shimmer 1.8s ease-in-out infinite;
  z-index: 2;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* =========================================================================
   Results grid — cards
   ========================================================================= */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.results:empty { display: none; }

.card {
  position: relative;
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  overflow: hidden;
  transition:
    transform var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
  animation: fade-slide-in 400ms var(--ease-out) both;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(168,85,247,0.30);
  box-shadow: var(--shadow-md);
}

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

.card-preview {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: var(--checker-a);
  background-image:
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-b) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-b) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.card-preview img {
  max-width: 94%;
  max-height: 94%;
  object-fit: contain;
}

.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  text-align: center;
  background: rgba(8, 7, 15, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text-primary);
  font-size: 13px;
}

.card-overlay.is-error {
  background: rgba(40, 8, 8, 0.82);
  color: #FFBDB3;
}

.card-overlay.is-idle .overlay-spinner,
.card-overlay.is-idle .overlay-bar { display: none; }

.overlay-bar {
  position: relative;
  width: 80%;
  max-width: 180px;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.overlay-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--accent-bright) 50%, transparent 100%);
  animation: bar-slide 1.4s ease-in-out infinite;
}

@keyframes bar-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.overlay-spinner {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  border-top-color: var(--accent-bright);
  animation: spin 0.9s linear infinite;
}

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

.card-meta { padding: 12px 14px 4px; min-width: 0; }
.card-filename-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-bottom: 2px;
}
.card-filename {
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.card-rename {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-tertiary, #888);
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: opacity 0.12s, color 0.12s, background 0.12s;
}
.card-rename:hover { opacity: 1; color: var(--text-primary, #fff); background: rgba(255,255,255,0.08); }
.card-rename svg { width: 13px; height: 13px; }
.card-dims {
  color: var(--text-tertiary);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.card-emote-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 0 12px;
  background: rgba(168,85,247,0.06);
  border: 1px solid rgba(168,85,247,0.18);
  border-radius: 10px;
  font-size: 12px;
}
.card-emote-row .emote-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}
.card-emote-row .emote-field span {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card-emote-row .emote-field input[type="number"] {
  width: 46px;
  padding: 3px 5px;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  outline: none;
  -moz-appearance: textfield;
}
.card-emote-row .emote-field input[type="number"]::-webkit-outer-spin-button,
.card-emote-row .emote-field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.card-emote-row .emote-field input[type="number"]:focus {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 2px rgba(168,85,247,0.25);
}
.card-emote-row .emote-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  margin-left: auto;
}
.card-emote-row .emote-toggle input[type="checkbox"] {
  accent-color: var(--accent-bright);
  cursor: pointer;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 12px;
}
.card-actions .btn[data-action="variant"] { flex: 0 1 auto; padding: 7px 10px; }
.card-actions .btn[data-action="split"] { flex: 0 1 auto; padding: 7px 10px; }
.card-actions .btn[data-action="autotwitch"] { flex: 1 1 100%; order: 1; }
.card-actions .btn[data-action="download"] { flex: 1; }
.card-actions .btn[data-action="retry"] { flex: 1 1 100%; order: 2; }
.card-actions .btn { flex: 1; }

.card-remove {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(8, 7, 15, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 3;
  transition: all var(--dur-fast) var(--ease-out);
}
.card-remove:hover {
  background: var(--danger-bg);
  border-color: rgba(248,113,113,0.4);
  color: var(--danger);
}

.card-settings-pill {
  position: absolute;
  top: 8px; left: 8px;
  padding: 3px 8px;
  background: rgba(8, 7, 15, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  pointer-events: none;
}
.card:hover .card-settings-pill {
  opacity: 1;
  transform: translateY(0);
}

.card.is-processing::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(168,85,247,0.10) 50%, transparent 100%);
  animation: scan 2.4s linear infinite;
  z-index: 2;
}

@keyframes scan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* =========================================================================
   How-it-works steps
   ========================================================================= */
.how-section { padding: 80px 0; }

.steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 20px;
  align-items: stretch;
}

.step-card {
  padding: 32px 28px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.step-card h3 {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.step-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.step-num {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 18px;
}

.step-arrow {
  align-self: center;
  color: var(--accent-bright);
  opacity: 0.5;
}
.step-arrow svg { width: 36px; height: 36px; }

/* =========================================================================
   Final CTA
   ========================================================================= */
.cta-section { padding-bottom: 140px; }

.cta-card {
  background:
    radial-gradient(circle at 20% 20%, rgba(168,85,247,0.22), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(236,72,153,0.22), transparent 50%),
    var(--surface-2);
  border: 1px solid rgba(168,85,247,0.28);
  border-radius: var(--r-2xl);
  padding: 64px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow-purple);
}
.cta-card h2 { margin-bottom: 12px; }
.cta-card p { color: var(--text-secondary); font-size: 16px; margin-bottom: 28px; }

/* =========================================================================
   Toast notifications
   ========================================================================= */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(420px, calc(100% - 48px));
}

.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--border-emphasis);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.4;
  min-width: 260px;
  transform: translateX(24px);
  opacity: 0;
  transition:
    transform 320ms var(--ease-out),
    opacity 280ms var(--ease-out);
}
.toast.is-visible { transform: translateX(0); opacity: 1; }

.toast-icon {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
}
.toast-icon svg { width: 14px; height: 14px; }

.toast-info .toast-icon { background: rgba(106,152,180,0.18); color: #9CC4D9; }
.toast-success .toast-icon { background: rgba(168,85,247,0.20); color: var(--accent-bright); }
.toast-warn .toast-icon { background: rgba(224,179,92,0.20); color: #E0B35C; }
.toast-error .toast-icon { background: rgba(248,113,113,0.22); color: #FBA594; }

.toast-message { min-width: 0; word-break: break-word; }

.toast-close {
  width: 22px; height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all var(--dur-fast) var(--ease-out);
}
.toast-close:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.toast-close svg { width: 10px; height: 10px; }

/* =========================================================================
   Bulk action bar
   ========================================================================= */
.bulk-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 0);
  padding: 8px 8px 8px 18px;
  background: var(--surface-2);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-emphasis);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 50;
  max-width: calc(100% - 32px);
  animation: bulk-in 400ms var(--ease-out);
}
@keyframes bulk-in {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.bulk-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.bulk-icon {
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  color: var(--accent-bright);
}
.bulk-icon svg { width: 14px; height: 14px; }
.bulk-actions { display: inline-flex; gap: 6px; align-items: center; }
.bulk-bar .btn { padding: 9px 14px; font-size: 13px; }
.bulk-pack-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  margin-right: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
}
.bulk-pack-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary, #aaa);
}
.bulk-pack-field input {
  width: 42px;
  padding: 5px 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: inherit;
}
.bulk-pack-field input:focus { outline: 1px solid var(--accent-bright, #8b5cf6); border-color: transparent; }
.bulk-pack-x { color: var(--text-tertiary, #888); font-size: 12px; }

/* =========================================================================
   Twitch chat generator
   ========================================================================= */
.chat-view .bulk-bar { display: none !important; }

.chat-section {
  padding: 32px 0 110px;
}

body.tool-only .chat-section .section-inner,
.chat-section .section-inner {
  max-width: 1280px;
}

.chat-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.chat-controls {
  position: sticky;
  top: 74px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.chat-control-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-control-block h2 {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: 0;
}

.chat-muted {
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.45;
}

.chat-upload-btn {
  width: 100%;
}

.chat-field {
  display: grid;
  grid-template-columns: 1fr 74px;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

.chat-field input {
  min-width: 0;
  padding: 8px 9px;
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.chat-field input:focus {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 2px rgba(168,85,247,0.22);
  outline: none;
}

.chat-emote-strip {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}

.chat-emote-strip img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 7px;
  background: rgba(0,0,0,0.18);
}

.chat-emote-strip span {
  color: var(--text-tertiary);
  font-size: 12px;
}

.chat-progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  border-radius: var(--r-pill);
}

.chat-progress > div {
  width: 0%;
  height: 100%;
  background: var(--gradient-accent);
  transition: width 120ms var(--ease-out);
}

.chat-preview-wrap {
  min-width: 0;
  overflow: hidden;
  padding: 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 1032px;
}

.chat-preview-stage {
  width: 1000px;
  height: 1000px;
  flex: 0 0 1000px;
  transform: scale(var(--chat-preview-scale, 1));
  transform-origin: top center;
}

.chat-container {
  width: 1000px;
  height: 1000px;
  min-width: 1000px;
  max-width: 1000px;
  min-height: 1000px;
  max-height: 1000px;
  flex: 0 0 1000px;
  margin: 0 auto;
  background: #18181b;
  color: #efeff1;
  display: flex;
  flex-direction: column;
  font-family: "Inter", "Roobert", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.chat-header {
  height: 50px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #2a2a2d;
  flex-shrink: 0;
}

.chat-title {
  flex: 1;
  text-align: center;
  color: #efeff1;
  font-size: 18px;
  font-weight: 600;
}

.chat-icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #efeff1;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

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

.chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  background: #18181b;
}

.chat-body::-webkit-scrollbar {
  display: none;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  padding: 10px 14px 6px;
}

.welcome-msg {
  color: #efeff1;
  font-size: 17px;
  padding: 4px 4px 10px;
}

.msg {
  padding: 4px;
  color: #efeff1;
  font-size: 17px;
  line-height: 1.5;
  word-wrap: break-word;
}

.msg .user {
  font-weight: 700;
  margin-right: 2px;
}

.msg .colon {
  color: #efeff1;
  margin-right: 4px;
}

.msg img {
  height: 38px;
  width: auto;
  vertical-align: middle;
  margin: -3px 1px;
}

.chat-footer {
  padding: 12px 12px 14px;
  border-top: 1px solid #2a2a2d;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.chat-input-row {
  background: #3a3a3d;
  border: 1px solid #3a3a3d;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  gap: 8px;
}

.input-emote {
  height: 30px;
  width: 30px;
  object-fit: contain;
  flex-shrink: 0;
}

.chat-input {
  background: transparent;
  border: none;
  color: #adadb8;
  font-size: 17px;
  flex: 1;
  padding: 4px 0;
  line-height: 1.4;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-footer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.chat-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #efeff1;
  font-size: 17px;
}

.bits-icon {
  width: 22px;
  height: 22px;
}

.monkey-emote {
  height: 24px;
  width: 24px;
  object-fit: contain;
}

.infinity {
  font-size: 18px;
  color: #efeff1;
}

.send-btn {
  background: #9147ff;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 7px 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* =========================================================================
   Utilities
   ========================================================================= */
.hidden { display: none !important; }

.build-tag {
  position: fixed;
  bottom: 8px;
  left: 8px;
  padding: 3px 8px;
  font-size: 10px;
  font-family: ui-monospace, Menlo, monospace;
  color: var(--text-muted);
  background: rgba(8, 7, 15, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  opacity: 0.6;
  pointer-events: none;
  z-index: 10;
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-demo { max-width: 600px; margin: 0 auto; width: 100%; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .chat-shell { grid-template-columns: 1fr; }
  .chat-controls { position: static; }
  .steps {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .step-arrow { transform: rotate(90deg); }
}

@media (max-width: 640px) {
  .section { padding: 60px 0; }
  .section-inner { padding: 0 18px; }
  .nav-inner { padding: 0 18px; }
  .nav-links { display: none; }
  .hero { padding: 40px 0 56px; }
  .hero-inner { padding: 0 18px; }
  .hero h1 { font-size: 38px; }
  .hero-sub { font-size: 15px; }
  .features-grid { grid-template-columns: 1fr; }
  .dropzone { padding: 40px 20px; }
  .results { grid-template-columns: 1fr 1fr; gap: 10px; }
  .app-switch { padding-top: 10px; }
  .app-switch-inner { width: 100%; }
  .app-switch-btn { flex: 1; padding-inline: 10px; }
  .chat-preview-wrap { padding: 10px; }
  .cta-card { padding: 44px 24px; }
  .bulk-bar {
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--r-lg);
    left: 12px; right: 12px;
    transform: none;
    padding: 12px;
  }
  .bulk-actions { justify-content: space-between; }
  .bulk-actions .btn { flex: 1; }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
