/* ═══════════════════════════════════════════════════════════════
   BeforeAfter888 v1.0.2 — Theme-Inherit UI
   Inherits site fonts, colors, backgrounds.
   Only adds layout, spacing, animation, and UX chrome.
   ═══════════════════════════════════════════════════════════════ */

/* ── Scoped tokens — use site colors as base ─────────────────── */
#ba888-app {
  /* Accent pulls from our brand but can be overridden via shortcode attr */
  --ba-accent:  #00c9d4;
  --ba-accent-2:#008f99;
  --ba-glow:    rgba(0,201,212,.18);

  /* All UI chrome uses currentColor or transparent — NO forced colors */
  --ba-radius:  14px;
  --ba-radius-sm: 9px;
  --ba-ease:    cubic-bezier(0.22, 1, 0.36, 1);
  --ba-t:       0.26s;

  --ba-shadow:  0 2px 16px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.06);
  --ba-shadow-md: 0 6px 28px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.07);

  /* Subtle borders that work on both light and dark themes */
  --ba-border:  rgba(127,127,127,.14);
  --ba-border-strong: rgba(127,127,127,.22);

  /* Muted overlay for surface panels */
  --ba-surface: rgba(127,127,127,.05);
  --ba-surface-2: rgba(127,127,127,.09);

  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 60px;
  /* Inherit everything from the site */
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  line-height: inherit;
  -webkit-font-smoothing: antialiased;
}

/* Layout reset only — no color override */
#ba888-app *,
#ba888-app *::before,
#ba888-app *::after {
  box-sizing: border-box;
}

/* ── Reveal animation ────────────────────────────────────────── */
.ba-reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: ba-reveal var(--ba-t) var(--ba-ease) forwards;
}
@keyframes ba-reveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Hero ────────────────────────────────────────────────────── */
.ba-hero {
  text-align: center;
  padding: 40px 20px 32px;
}
.ba-logo {
  max-height: 44px;
  margin-bottom: 18px;
  object-fit: contain;
}
/* Title inherits site heading styles */
.ba-hero__title {
  font-size: clamp(1.55rem, 3.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 12px;
  line-height: 1.18;
  /* No color override — inherits site heading color */
}
.ba-hero__sub {
  font-size: 1rem;
  opacity: .7;
  margin: 0 0 22px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}
.ba-trust {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.ba-trust li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .55;
  padding: 4px 12px;
  border: 1px solid var(--ba-border-strong);
  border-radius: 20px;
}
.ba-trust-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ba-accent);
  flex-shrink: 0;
}

/* ── Workspace: 35% image / 65% chat ────────────────────────── */
.ba-workspace {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}

/* Split activates after upload */
.ba-workspace.ba-split {
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
}

/* Image column: compact, left-anchored */
.ba-workspace__image {
  width: 100%;
}
.ba-workspace.ba-split .ba-workspace__image {
  flex: 0 0 260px;
  width: 260px;
  max-width: 35%;
}

/* Chat column: takes all remaining space */
.ba-workspace__chat {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 640px) {
  .ba-workspace.ba-split {
    flex-direction: column;
  }
  .ba-workspace.ba-split .ba-workspace__image {
    flex: none;
    width: 100%;
    max-width: 100%;
  }
}

/* ── Image stage ─────────────────────────────────────────────── */
.ba-upload-progress-bar {
  height: 3px;
  background: var(--ba-border-strong);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.ba-upload-progress-fill {
  height: 100%;
  width: 0;
  background: var(--ba-accent);
  transition: width .15s linear;
  border-radius: 2px;
}

.ba-image-stage {
  position: relative;
  border-radius: var(--ba-radius);
  overflow: hidden;
  border: 1px solid var(--ba-border-strong);
  background: var(--ba-surface);
  aspect-ratio: 3/4;  /* portrait — suits interior photos */
}
.ba-workspace.ba-split .ba-image-stage {
  aspect-ratio: 3/4;
}
.ba-stage-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: ba-zoom-in .4s var(--ba-ease) both;
}
@keyframes ba-zoom-in {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: scale(1); }
}

.ba-upload-error {
  margin-top: 8px;
  padding: 9px 13px;
  background: rgba(239,68,68,.07);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: var(--ba-radius-sm);
  color: #dc2626;
  font-size: .82rem;
}

/* ── Chat panel ──────────────────────────────────────────────── */
.ba-chat-panel {
  border: 1px solid var(--ba-border-strong);
  border-radius: var(--ba-radius);
  box-shadow: var(--ba-shadow),
              0 0 0 1px var(--ba-accent),
              0 0 28px rgba(0,201,212,.18),
              0 0 60px rgba(0,201,212,.08);
  background: var(--ba-surface);
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

/* Header */
.ba-chat-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ba-border);
  background: var(--ba-surface-2);
}
.ba-chat-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ba-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  color: #fff;
  flex-shrink: 0;
}
.ba-chat-info { flex: 1; min-width: 0; }
.ba-chat-info strong {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.3;
}
.ba-chat-subtitle {
  font-size: .72rem;
  opacity: .5;
}
.ba-chat-online {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  opacity: .55;
  flex-shrink: 0;
}
.ba-online-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

/* Messages */
.ba-chat-messages {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 220px;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.ba-chat-messages::-webkit-scrollbar { width: 4px; }
.ba-chat-messages::-webkit-scrollbar-thumb {
  background: var(--ba-border-strong);
  border-radius: 2px;
}

.ba-msg {
  display: flex;
  flex-direction: row;
  gap: 8px;
  animation: ba-msg-in .22s var(--ba-ease) both;
  min-width: 0;
}
@keyframes ba-msg-in {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ba-msg--assistant { align-self: flex-start; max-width: 86%; }
.ba-msg--user      { align-self: flex-end; flex-direction: row-reverse; max-width: 78%; }

.ba-msg__avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 700;
  flex-shrink: 0; margin-top: 1px;
}
.ba-msg--assistant .ba-msg__avatar {
  background: var(--ba-accent);
  color: #fff;
}
.ba-msg--user .ba-msg__avatar {
  background: var(--ba-surface-2);
  border: 1px solid var(--ba-border-strong);
  font-size: .58rem;
  opacity: .6;
}

.ba-msg__bubble {
  display: block;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: .875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}
.ba-msg--assistant .ba-msg__bubble {
  background: var(--ba-surface-2);
  border: 1px solid var(--ba-border);
  border-bottom-left-radius: 4px;
}
.ba-msg--user .ba-msg__bubble {
  background: var(--ba-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 10px var(--ba-glow);
}

/* Upload CTA button inside chat */
.ba-chat-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 8px 16px;
  background: transparent;
  border: 1.5px solid var(--ba-accent);
  border-radius: var(--ba-radius-sm);
  color: var(--ba-accent);
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--ba-t) var(--ba-ease);
}
.ba-chat-upload-btn:hover {
  background: var(--ba-accent);
  color: #fff;
}

/* Typing */
.ba-typing { padding: 4px 18px 2px; flex-shrink: 0; }
.ba-typing-dots {
  display: inline-flex; gap: 4px;
  padding: 7px 11px;
  background: var(--ba-surface-2);
  border: 1px solid var(--ba-border);
  border-radius: 10px;
  border-bottom-left-radius: 3px;
}
.ba-typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .35;
  animation: ba-bounce 1.2s infinite;
}
.ba-typing-dots span:nth-child(2) { animation-delay: .2s; }
.ba-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes ba-bounce {
  0%, 80%, 100% { transform: scale(.7); opacity: .3; }
  40%            { transform: scale(1.1); opacity: .8; }
}

/* Input row */
.ba-chat-footer {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--ba-border);
  background: var(--ba-surface-2);
  align-items: flex-end;  /* buttons pin to bottom as textarea grows */
  flex-shrink: 0;
}
.ba-chat-input {
  flex: 1; min-width: 0;
  padding: 9px 14px;
  background: transparent;
  border: 1px solid var(--ba-border-strong);
  border-radius: var(--ba-radius-sm);
  font-family: inherit;
  font-size: .875rem;
  line-height: 1.5;
  color: inherit;
  outline: none;
  transition: border-color var(--ba-t), box-shadow var(--ba-t);
  /* Auto-grow textarea — JS sets height; CSS only sets the baseline */
  resize: none;            /* hide manual drag handle */
  overflow-y: hidden;      /* JS manages scroll; hidden until max-rows hit */
  min-height: 38px;        /* 1 row: matches original input height */
  max-height: calc(1.5em * 7 + 18px);  /* 7 rows × line-height + padding */
  display: block;          /* textarea defaults to inline */
}
.ba-chat-input.ba-chat-input--overflow {
  overflow-y: auto;        /* scrollbar appears once max-height is reached */
}
.ba-chat-input:focus {
  border-color: var(--ba-accent);
  box-shadow: 0 0 0 3px var(--ba-glow);
}
.ba-chat-input:disabled { opacity: .45; cursor: not-allowed; }

.ba-send-btn {
  width: 36px; height: 36px;
  border-radius: var(--ba-radius-sm);
  background: var(--ba-accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity var(--ba-t);
  box-shadow: 0 2px 8px var(--ba-glow);
}
.ba-send-btn:hover { opacity: .85; }
.ba-send-btn:disabled { opacity: .38; cursor: not-allowed; }

/* Generate CTA */
.ba-generate-row {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--ba-border);
  text-align: center;
  flex-shrink: 0;
}
.ba-generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: var(--ba-accent);
  color: #fff;
  border: none;
  border-radius: var(--ba-radius-sm);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ba-t) var(--ba-ease);
  box-shadow: 0 3px 14px var(--ba-glow);
}
.ba-generate-btn:hover { opacity: .9; transform: translateY(-1px); }
.ba-generate-btn:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.ba-generate-hint { font-size: .72rem; opacity: .45; margin: 6px 0 0; }

/* ── Generating ──────────────────────────────────────────────── */
.ba-generating-card {
  border: 1px solid var(--ba-border-strong);
  border-radius: var(--ba-radius);
  box-shadow: var(--ba-shadow);
  background: var(--ba-surface);
  padding: 48px 24px 40px;
  text-align: center;
  margin-bottom: 12px;
}
.ba-generating-ring {
  width: 64px; height: 64px;
  position: relative;
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
}
.ba-generating-ring svg {
  position: absolute; inset: 0;
  animation: ba-spin 1.8s linear infinite;
}
@keyframes ba-spin { to { transform: rotate(360deg); } }
.ba-generating-ring > span {
  font-size: 1rem; color: var(--ba-accent);
  animation: ba-pulse 2s ease-in-out infinite;
  position: relative; z-index: 1;
}
@keyframes ba-pulse {
  0%, 100% { opacity: .5; transform: scale(.93); }
  50%       { opacity: 1; transform: scale(1.07); }
}
.ba-generating-card h3 { font-size: 1rem; font-weight: 700; margin: 0 0 5px; }
.ba-generating-card p  { font-size: .82rem; opacity: .5; margin: 0 0 20px; }
.ba-stage-pills { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.ba-stage-pills span {
  font-size: .68rem; padding: 3px 11px;
  border-radius: 20px; border: 1px solid var(--ba-border-strong);
  opacity: .45; letter-spacing: .05em; text-transform: uppercase;
  transition: all var(--ba-t);
}
.ba-stage-pills span.active {
  background: var(--ba-accent); border-color: var(--ba-accent);
  color: #fff; opacity: 1; box-shadow: 0 2px 8px var(--ba-glow);
}

/* ── Result + Slider ─────────────────────────────────────────── */
.ba-result-card {
  border: 1px solid var(--ba-border-strong);
  border-radius: var(--ba-radius);
  box-shadow: var(--ba-shadow);
  background: var(--ba-surface);
  overflow: hidden;
  margin-bottom: 12px;
}
.ba-result-header {
  padding: 16px 20px 13px;
  border-bottom: 1px solid var(--ba-border);
}
.ba-result-header h2 { font-size: 1rem; font-weight: 700; margin: 0 0 2px; }
.ba-result-header p  { font-size: .75rem; opacity: .45; margin: 0; }

.ba-slider {
  position: relative; width: 100%; height: 460px; overflow: hidden;
  cursor: ew-resize; background: #000;
  user-select: none; touch-action: pan-y;
  /* Height overridden by JS to match actual image aspect ratio */
}
/* BASE LAYER: before — static, always fully visible */
.ba-slider__before {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
/* TOP LAYER: after — revealed from the right via clip-path */
/* clip-path: inset(0 0 0 X%) shows the right portion (after) */
/* Slider JS sets clip-path: inset(0 0 0 pct%) in real-time */
.ba-slider__after {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
  clip-path: inset(0 0 0 50%);  /* default: left=BEFORE, right=AFTER at 50/50 */
}
.ba-slider__divider {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; background: rgba(255,255,255,.9);
  box-shadow: 0 0 8px rgba(0,0,0,.45);
  transform: translateX(-50%); z-index: 4; pointer-events: none;
}
.ba-slider__handle {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center; color: #111;
}
.ba-slider__label {
  position: absolute; top: 10px; z-index: 5;
  background: rgba(0,0,0,.55); color: rgba(255,255,255,.9);
  font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  padding: 3px 9px; border-radius: 4px; pointer-events: none;
}
.ba-slider__label--before { left: 10px; }
.ba-slider__label--after  { right: 10px; }
.ba-watermark-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 3; pointer-events: none;
}
.ba-watermark-overlay span {
  background: rgba(0,0,0,.35); color: rgba(255,255,255,.7);
  font-size: .65rem; font-weight: 700; letter-spacing: .07em;
  padding: 4px 12px; border-radius: 4px; transform: rotate(-18deg);
}
.ba-concept-preview {
  padding: 16px 20px; border-top: 1px solid var(--ba-border);
  display: flex; gap: 12px; align-items: flex-start;
}
.ba-concept-mark { color: var(--ba-accent); font-size: .85rem; flex-shrink: 0; margin-top: 2px; }
.ba-concept-preview p { font-size: .875rem; opacity: .7; margin: 0; line-height: 1.7; font-style: italic; }

.ba-report-preview { position: relative; min-height: 80px; padding: 16px 20px; border-top: 1px solid var(--ba-border); }
.ba-report-preview.ba-blurred #ba-report-inner { filter: blur(7px); pointer-events: none; user-select: none; max-height: 100px; overflow: hidden; }
.ba-blur-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(to bottom, rgba(255,255,255,.1) 0%, rgba(255,255,255,.95) 55%);
  padding: 20px; border-radius: 0 0 var(--ba-radius) var(--ba-radius);
}
/* Dark theme fallback for blur overlay */
@media (prefers-color-scheme: dark) {
  .ba-blur-overlay { background: linear-gradient(to bottom, rgba(0,0,0,.1) 0%, rgba(15,15,15,.95) 55%); }
}
.ba-blur-cta { text-align: center; max-width: 280px; }
.ba-lock-icon {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--ba-border-strong);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px; opacity: .6;
}
.ba-blur-cta strong { display: block; font-size: .9rem; font-weight: 700; margin-bottom: 5px; }
.ba-blur-cta p { font-size: .78rem; opacity: .6; margin: 0; line-height: 1.55; }

/* ── Lead card ───────────────────────────────────────────────── */
.ba-lead-card {
  border: 1px solid var(--ba-border-strong);
  border-radius: var(--ba-radius);
  box-shadow: var(--ba-shadow);
  background: var(--ba-surface);
  overflow: hidden;
  margin-bottom: 12px;
}
.ba-lead-header {
  text-align: center; padding: 26px 24px 20px;
  border-bottom: 1px solid var(--ba-border);
}
.ba-lead-glyph { color: var(--ba-accent); font-size: 1.2rem; margin-bottom: 9px; }
.ba-lead-header h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 6px; }
.ba-lead-header p  { font-size: .83rem; opacity: .6; margin: 0; }

.ba-lead-form { padding: 20px 20px 22px; }
.ba-field { margin-bottom: 13px; }
.ba-field label {
  display: block; font-size: .72rem; font-weight: 600;
  opacity: .55; letter-spacing: .06em;
  text-transform: uppercase; margin-bottom: 6px;
}
.ba-field-input {
  width: 100%; padding: 9px 13px;
  background: transparent;
  border: 1px solid var(--ba-border-strong);
  border-radius: var(--ba-radius-sm);
  font-family: inherit; font-size: .875rem; color: inherit;
  outline: none; transition: border-color var(--ba-t), box-shadow var(--ba-t);
}
.ba-field-input:focus { border-color: var(--ba-accent); box-shadow: 0 0 0 3px var(--ba-glow); }
.ba-required { color: var(--ba-accent); margin-left: 2px; }
.ba-optional  { opacity: .45; font-weight: 400; text-transform: none; }
.ba-field--check { margin-top: 4px; margin-bottom: 14px; }
.ba-check-label {
  display: flex !important; align-items: flex-start; gap: 9px;
  font-size: .82rem !important; cursor: pointer;
  font-weight: 400 !important; text-transform: none !important;
  letter-spacing: 0 !important; line-height: 1.5; opacity: .7;
}
.ba-check-label input[type="checkbox"] { width: 15px; height: 15px; margin-top: 2px; flex-shrink: 0; accent-color: var(--ba-accent); }
.ba-field-error {
  background: rgba(239,68,68,.06); border: 1px solid rgba(239,68,68,.18);
  color: #dc2626; border-radius: var(--ba-radius-sm);
  padding: 9px 13px; font-size: .82rem; margin-bottom: 11px;
}

.ba-submit-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 20px;
  background: var(--ba-accent); color: #fff; border: none;
  border-radius: var(--ba-radius-sm); font-family: inherit; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: all var(--ba-t) var(--ba-ease);
  box-shadow: 0 3px 14px var(--ba-glow);
}
.ba-submit-btn:hover { opacity: .88; transform: translateY(-1px); }
.ba-submit-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.ba-lead-privacy {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: .72rem; opacity: .4; margin: 8px 0 0;
}

/* ── Success ─────────────────────────────────────────────────── */
.ba-success-card {
  border: 1px solid var(--ba-border-strong);
  border-radius: var(--ba-radius);
  box-shadow: var(--ba-shadow);
  background: var(--ba-surface);
  overflow: hidden; margin-bottom: 12px;
}
.ba-success-inner {
  text-align: center; padding: 36px 24px 24px;
  border-bottom: 1px solid var(--ba-border);
}
.ba-success-glyph { color: var(--ba-accent); font-size: 1.6rem; margin-bottom: 10px; }
.ba-success-inner h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 7px; }
.ba-success-inner p  { opacity: .65; font-size: .875rem; margin: 0; }
.ba-unlocked-result { padding: 18px 20px; }
.ba-unlocked-result img { border-radius: var(--ba-radius-sm); max-width: 100%; box-shadow: var(--ba-shadow-md); }

/* ── Report ──────────────────────────────────────────────────── */
.ba-report { font-size: .875rem; opacity: .8; line-height: 1.75; }
.ba-report h2 {
  font-size: .8rem; font-weight: 700; margin: 16px 0 5px;
  padding-bottom: 5px; border-bottom: 1px solid var(--ba-border);
  letter-spacing: .05em; text-transform: uppercase; opacity: 1;
}
.ba-report p  { margin: 0 0 8px; }
.ba-report ol, .ba-report ul { margin: 0 0 10px; padding-left: 18px; }
.ba-report li { margin-bottom: 4px; }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #ba888-app      { padding: 0 12px 40px; }
  .ba-hero        { padding: 32px 8px 22px; }
  .ba-chat-messages { max-height: 220px; }
  .ba-generating-card { padding: 36px 16px 30px; }
}

/* ── Shimmer loader (FIX 3) ──────────────────────────────────── */
/* Applied to .ba-image-stage while AI is generating */
@keyframes ba-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.ba-image-stage.ba-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    90deg,
    rgba(127,127,127,.0)   0%,
    rgba(127,127,127,.12) 40%,
    rgba(127,127,127,.22) 50%,
    rgba(127,127,127,.12) 60%,
    rgba(127,127,127,.0)  100%
  );
  background-size: 200% 100%;
  animation: ba-shimmer 1.6s ease-in-out infinite;
}
/* Blur the original image during generation */
.ba-image-stage.ba-shimmer .ba-stage-img {
  filter: blur(6px) brightness(.85);
  transition: filter .3s ease;
}
/* Generating label on top of blurred image */
.ba-image-stage.ba-shimmer::before {
  content: 'Generating…';
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .6;
}

/* ═══════════════════════════════════════════════════════════════
   BeforeAfter888 — Interaction Polish v1.0.3
   ═══════════════════════════════════════════════════════════════ */

/* ── Timing tokens ───────────────────────────────────────────── */
#ba888-app {
  --ba-dur-fast:   180ms;
  --ba-dur-base:   280ms;
  --ba-dur-slow:   420ms;
  --ba-dur-sweep:  900ms;
  --ba-ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --ba-ease-in:    cubic-bezier(0.4, 0, 1, 1);
  --ba-ease-spring:cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── 1. Page load: workspace fades up ───────────────────────── */
#ba888-app {
  animation: ba-app-in var(--ba-dur-slow) var(--ba-ease-out) both;
}
@keyframes ba-app-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 2. Chat: message entrance ──────────────────────────────── */
.ba-msg {
  animation: ba-msg-in var(--ba-dur-base) var(--ba-ease-out) both;
}
@keyframes ba-msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Each new message slightly delayed from previous */
.ba-msg:nth-child(2) { animation-delay: 30ms; }
.ba-msg:nth-child(3) { animation-delay: 60ms; }

/* Typing indicator — smooth fade */
.ba-typing {
  transition: opacity var(--ba-dur-fast) ease;
}

/* ── 3. Upload: workspace layout transition ──────────────────── */
.ba-workspace {
  transition: all var(--ba-dur-slow) var(--ba-ease-out);
}
/* Image stage entrance */
.ba-image-stage {
  transition: box-shadow var(--ba-dur-base) ease;
}
.ba-image-stage:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
}
.ba-stage-img {
  animation: ba-img-in var(--ba-dur-slow) var(--ba-ease-out) both;
}
@keyframes ba-img-in {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── 4. Generate: button press + states ─────────────────────── */
.ba-generate-btn {
  transition: opacity var(--ba-dur-fast) ease,
              transform var(--ba-dur-fast) var(--ba-ease-spring),
              box-shadow var(--ba-dur-base) ease;
  will-change: transform;
}
.ba-generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}
.ba-generate-btn:active:not(:disabled),
.ba-generate-btn.ba-btn-pressed {
  transform: scale(0.97) translateY(0) !important;
  opacity: .85;
}

/* Generate row slide-in */
.ba-generate-row.ba-slide-up {
  animation: ba-slide-up var(--ba-dur-slow) var(--ba-ease-out) both;
}
@keyframes ba-slide-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 4. Shimmer state on image during generation ────────────── */
.ba-image-stage {
  overflow: hidden; /* ensure shimmer clips */
}
.ba-image-stage.ba-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,.09) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: ba-shimmer-sweep 1.5s ease-in-out infinite;
}
@keyframes ba-shimmer-sweep {
  0%   { background-position: 150% center; }
  100% { background-position: -50% center; }
}
.ba-image-stage.ba-shimmer .ba-stage-img {
  filter: blur(5px) brightness(.8);
  transition: filter var(--ba-dur-slow) ease;
}
.ba-image-stage.ba-shimmer::before {
  content: 'Designing your space…';
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  opacity: .65;
}

/* ── 5. Result card entrance ─────────────────────────────────── */
.ba-result-card.ba-reveal {
  animation: ba-reveal var(--ba-dur-slow) var(--ba-ease-out) both;
}

/* Concept text fades in slightly after card */
.ba-concept-preview {
  animation: ba-reveal var(--ba-dur-slow) var(--ba-ease-out) 120ms both;
  opacity: 0;
}
.ba-result-card.ba-reveal .ba-concept-preview {
  opacity: 1;
}

/* ── 6. Slider: handle glow + smooth transitions ─────────────── */
.ba-slider__divider {
  /* No CSS transition on left — RAF handles it for no jitter */
}
.ba-slider__before-pane {
  /* No CSS transition on width — RAF handles it */
}
.ba-slider__handle {
  transition: transform var(--ba-dur-fast) var(--ba-ease-spring),
              box-shadow var(--ba-dur-base) ease;
}
.ba-slider:hover .ba-slider__handle,
.ba-slider:active .ba-slider__handle {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 0 0 4px rgba(255,255,255,.25),
              0 4px 20px rgba(0,0,0,.4);
}
.ba-slider:active .ba-slider__handle {
  transform: translate(-50%, -50%) scale(0.96);
}
/* Slider cursor feedback */
.ba-slider {
  cursor: ew-resize;
}
.ba-slider:active {
  cursor: grabbing;
}

/* ── Send button interaction ─────────────────────────────────── */
.ba-send-btn {
  transition: opacity var(--ba-dur-fast) ease,
              transform var(--ba-dur-fast) var(--ba-ease-spring),
              box-shadow var(--ba-dur-base) ease;
}
.ba-send-btn:hover:not(:disabled)  { transform: scale(1.06); }
.ba-send-btn:active:not(:disabled) { transform: scale(0.93); }

/* ── Upload button interaction ───────────────────────────────── */
.ba-chat-upload-btn {
  transition: background var(--ba-dur-fast) ease,
              color var(--ba-dur-fast) ease,
              transform var(--ba-dur-fast) var(--ba-ease-spring),
              box-shadow var(--ba-dur-base) ease;
}
.ba-chat-upload-btn:hover  { transform: translateY(-1px); }
.ba-chat-upload-btn:active { transform: scale(0.96); }

/* ── Submit button interaction ───────────────────────────────── */
.ba-submit-btn {
  transition: opacity var(--ba-dur-fast) ease,
              transform var(--ba-dur-fast) var(--ba-ease-spring),
              box-shadow var(--ba-dur-base) ease;
}
.ba-submit-btn:hover:not(:disabled)  { transform: translateY(-2px); }
.ba-submit-btn:active:not(:disabled) { transform: scale(0.97); }

/* ── Lead / success card entrance ────────────────────────────── */
.ba-lead-card.ba-reveal,
.ba-success-card.ba-reveal {
  animation: ba-reveal var(--ba-dur-slow) var(--ba-ease-out) both;
}

/* ── Generating card entrance / exit ─────────────────────────── */
.ba-generating-card {
  animation: ba-reveal var(--ba-dur-base) var(--ba-ease-out) both;
}

/* ── Focus ring — consistent across all inputs ───────────────── */
.ba-chat-input:focus,
.ba-field-input:focus {
  outline: none;
  border-color: var(--ba-accent);
  box-shadow: 0 0 0 3px var(--ba-glow);
  transition: border-color var(--ba-dur-fast) ease,
              box-shadow var(--ba-dur-fast) ease;
}

/* ── Attach button (replaces left panel upload) ──────────────── */
.ba-attach-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--ba-radius-sm);
  background: transparent;
  border: 1px solid var(--ba-border-strong);
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: .55;
  transition: opacity var(--ba-dur-fast) ease,
              border-color var(--ba-dur-fast) ease,
              color var(--ba-dur-fast) ease,
              transform var(--ba-dur-fast) var(--ba-ease-spring);
}
.ba-attach-btn:hover {
  opacity: 1;
  border-color: var(--ba-accent);
  color: var(--ba-accent);
  transform: scale(1.07);
}
.ba-attach-btn:active {
  transform: scale(0.93);
}
/* Uploading state — pulse animation */
.ba-attach-btn.ba-uploading {
  opacity: 1;
  border-color: var(--ba-accent);
  color: var(--ba-accent);
  animation: ba-attach-pulse 1s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ba-attach-pulse {
  0%, 100% { opacity: .6; }
  50%       { opacity: 1; }
}

/* ── Photo thumbnail in user message bubble ──────────────────── */
.ba-msg__bubble--photo {
  padding: 5px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}
.ba-msg-thumbnail {
  display: block;
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border-bottom-right-radius: 3px;
  box-shadow: 0 3px 14px rgba(0,0,0,.15);
  animation: ba-img-in 0.35s var(--ba-ease-out) both;
}

/* ── Thumbnail upload state ──────────────────────────────────── */
.ba-thumb-wrap {
  position: relative;
  display: inline-block;
  border-radius: 10px;
  border-bottom-right-radius: 3px;
  overflow: hidden;
  line-height: 0;
}
.ba-msg-thumbnail {
  display: block;
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border-bottom-right-radius: 3px;
  box-shadow: 0 3px 14px rgba(0,0,0,.15);
  animation: ba-img-in 0.35s var(--ba-ease-out, ease) both;
  transition: filter .3s ease;
}
.ba-msg-thumbnail--uploading {
  filter: brightness(.7) blur(1px);
}

/* Shimmer overlay during upload */
.ba-thumb-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,.18) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: ba-thumb-shimmer 1.4s ease-in-out infinite;
  border-radius: inherit;
  pointer-events: none;
}
@keyframes ba-thumb-shimmer {
  0%   { background-position: 150% center; }
  100% { background-position: -50% center; }
}

/* Inline progress bar at bottom of thumbnail */
.ba-thumb-progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(0,0,0,.25);
  pointer-events: none;
}
.ba-thumb-progress-fill {
  height: 100%;
  width: 0;
  background: var(--ba-accent, #00c9d4);
  transition: width .2s linear;
  border-radius: 0 2px 0 0;
}

/* "Uploading…" label centered on thumbnail */
.ba-thumb-status {
  position: absolute;
  bottom: 8px;
  left: 0; right: 0;
  text-align: center;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: rgba(255,255,255,.9);
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* Bubble variant for photo */
.ba-msg__bubble--photo {
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* ── Generate button: unconfigured state ────────────────────── */
.ba-generate-btn.ba-btn-unconfigured {
  background: transparent !important;
  border: 1.5px dashed var(--ba-border-strong) !important;
  color: inherit !important;
  opacity: .55 !important;
  box-shadow: none !important;
  font-size: .8rem !important;
  cursor: not-allowed !important;
}


/* ── Loading state — blurred image + shimmer + centered progress text ───────── */
.ba-loading-wrap {
  display: none;
  width: 100%;
  margin: 0;           /* no margin — fits exactly in page flow */
  padding: 0;
}
.ba-loading-img-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  /* height driven purely by the img inside — NO fixed height, NO aspect-ratio override */
  line-height: 0;      /* collapse inline spacing under image */
}
/* Image: natural aspect ratio — display block, auto height */
.ba-loading-img {
  display: block;
  width: 100%;
  height: auto;        /* CRITICAL: natural ratio, NOT forced square */
  max-height: 75vh;    /* prevent full-viewport blowout */
  object-fit: contain; /* show full image, no crop */
  filter: blur(8px);   /* darker blur */
  opacity: 0.7;        /* darker overall */
  transition: filter 0.6s ease, opacity 0.6s ease;
}
.ba-loading-img.ba-loading-revealed {
  filter: none;
  opacity: 1;
}
/* Dark overlay on top of blur — makes text readable */
.ba-loading-dark-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.ba-loading-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.0)  20%,
    rgba(255,255,255,0.12) 50%,
    rgba(255,255,255,0.0)  80%
  );
  animation: ba-shimmer-sweep 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ba-shimmer-sweep {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(110%); }
}
/* Progress text: absolutely centered over image */
.ba-loading-steps {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 0 20px;
  gap: 16px;
}
.ba-loading-step-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ba-accent, #00bcd4);
  letter-spacing: .04em;
  text-align: center;
  /* Strong shadow on dark overlay — always readable */
  text-shadow:
    0 0 24px rgba(0,0,0,0.9),
    0 2px 8px rgba(0,0,0,0.8),
    0 0 2px rgba(0,0,0,1);
  animation: ba-step-fade 0.5s ease;
  line-height: 1.5;
}
@keyframes ba-step-fade {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
/* ── Generation progress bar ──────────────────────────────────────────────── */
.ba-loading-progress-track {
  width: min(280px, 80%);
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  overflow: hidden;
}
.ba-loading-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--ba-accent, #0ea5e9);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 0 8px var(--ba-accent, #0ea5e9);
}

/* Lead modal active state — card floats above loading overlay */
.ba-lead-modal-active {
  position: relative;
  z-index: 10;
}

/* ── Full Design Report Styles ─────────────────────────────────────────────── */
.ba-report {
  font-family: inherit;
  color: var(--ba-text, #1a1a1a);
  line-height: 1.7;
}
.ba-report__section {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ba-border, #e8e8e8);
}
.ba-report__section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.ba-report__heading {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ba-accent, #00bcd4);
  margin: 0 0 10px;
}
.ba-report p {
  margin: 0 0 8px;
  font-size: .88rem;
}
.ba-report ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ba-report ul li {
  font-size: .86rem;
  padding: 3px 0 3px 14px;
  position: relative;
}
.ba-report ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--ba-accent, #00bcd4);
  font-weight: 700;
}
.ba-report strong {
  font-weight: 700;
  color: var(--ba-text, #1a1a1a);
}

/* ── On-demand Report Button ────────────────────────────────────────────────── */
.ba-report-cta {
  padding: 24px 0 8px;
  text-align: center;
}
.ba-report-generate-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px;
  background: var(--ba-accent, #00bcd4);
  color: #fff;
  font-size: .88rem; font-weight: 700; letter-spacing: .04em;
  border: none; border-radius: 8px;
  cursor: pointer;
  transition: opacity .2s ease, transform .15s ease;
}
.ba-report-generate-btn:hover  { opacity: .88; }
.ba-report-generate-btn:active { transform: scale(.97); }
.ba-report-hint {
  margin: 10px 0 0;
  font-size: .75rem;
  color: var(--ba-text-muted, #999);
}
.ba-report-loading-state {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 20px 0;
  font-size: .84rem;
  color: var(--ba-text-muted, #888);
}
.ba-report-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--ba-border, #ddd);
  border-top-color: var(--ba-accent, #00bcd4);
  border-radius: 50%;
  animation: ba-spin .7s linear infinite;
}
@keyframes ba-spin { to { transform: rotate(360deg); } }
