/* ── Email gate ──────────────────────────────────────────── */
.gate-shell {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.gate-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 36px;
  max-width: 460px;
  width: 100%;
  text-align: center;
}
.gate-logo {
  height: 80px;
  width: auto;
  margin: 0 auto 12px;
  display: block;
}
.gate-card .eyebrow {
  display: inline-block;
  background: var(--red-light);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.gate-card h1 {
  font-size: 28px;
  margin-bottom: 10px;
  line-height: 1.15;
}
.gate-card .gate-sub {
  color: var(--gray-600);
  font-size: 15px;
  margin-bottom: 26px;
  line-height: 1.55;
}
.gate-card form { text-align: left; }
.gate-card .field { margin-bottom: 14px; }
.gate-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-100);
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
}

/* Builder layout — chat on left, profile + heist on right */

.builder-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 28px;
}

@media (max-width: 980px) {
  .builder-shell {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.chat-pane {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
  min-height: 500px;
}

.chat-intro {
  margin-bottom: 20px;
}

.mode-toggle {
  display: inline-flex;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  padding: 4px;
  margin-top: 16px;
}
.mode-toggle button {
  background: transparent;
  border: none;
  color: var(--gray-600);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mode-toggle button.active {
  background: var(--red);
  color: var(--white);
}

.paste-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.paste-card .textarea {
  min-height: 240px;
  font-family: inherit;
  line-height: 1.55;
}
.chat-intro h1 {
  font-size: 32px;
  margin: 6px 0 6px;
}
.chat-intro .eyebrow {
  display: inline-block;
  background: var(--red-light);
  padding: 4px 10px;
  border-radius: 999px;
}

.chat-log {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.chat-bubble {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: bubble-in 0.18s ease-out;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  flex-shrink: 0;
}
.chat-avatar.coach { background: var(--red); color: white; }
.chat-avatar.user { background: var(--gray-200); color: var(--gray-700); }

.chat-content {
  flex: 1;
  min-width: 0;
  line-height: 1.55;
  font-size: 15px;
  color: var(--gray-800);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-content strong { color: var(--gray-900); }
.chat-content em { color: var(--gray-700); font-style: italic; }
.chat-content code {
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'DM Sans', monospace;
}

.chat-bubble.user .chat-content {
  background: var(--gray-100);
  padding: 12px 16px;
  border-radius: 14px;
  border-top-left-radius: 4px;
}

.typing-cursor {
  display: inline-block;
  width: 6px;
  height: 16px;
  background: var(--red);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 0.9s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.chat-thinking {
  display: inline-flex; gap: 4px; align-items: center;
  padding-top: 6px;
}
.chat-thinking span {
  width: 6px; height: 6px;
  background: var(--gray-400);
  border-radius: 50%;
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.chat-thinking span:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking span:nth-child(3) { animation-delay: 0.4s; }

.starter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}
.starter-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 4px;
}
.starter-chip {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.starter-chip:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
}

.chat-input-row {
  display: flex; gap: 8px;
  margin-top: 16px;
  align-items: flex-end;
}
.chat-input-row .textarea {
  flex: 1;
  min-height: 56px;
  max-height: 200px;
  resize: none;
}
.chat-input-row .btn {
  padding: 14px 22px;
  height: 56px;
}

.chat-foot {
  margin-top: 8px;
}

/* ── Side pane ─────────────────────────────────────────────── */
.side-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-empty {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.side-empty h3 { margin-bottom: 6px; font-size: 18px; }
.side-empty p { margin-bottom: 20px; }
.side-steps {
  display: flex; flex-direction: column; gap: 10px;
}
.step-dot {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: var(--gray-500);
}
.step-dot .num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-500);
  font-weight: 800; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.step-dot.active .num { background: var(--red); color: white; }
.step-dot.active { color: var(--gray-900); font-weight: 600; }

.side-profile {
  background: var(--white);
  border: 2px solid var(--red);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-md);
}
.side-profile h2 {
  font-size: 20px;
  margin-bottom: 4px;
}
.side-profile .avatar-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: -0.02em;
}
.side-profile .avatar-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.side-profile .avatar-image-loading {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  background: var(--gray-100);
  border: 1px dashed var(--gray-300);
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.side-profile .quick-bio {
  color: var(--gray-700);
  font-style: italic;
  margin: 12px 0 18px;
  padding: 12px 14px;
  background: var(--red-light);
  border-radius: var(--radius);
  font-size: 14px;
}
.profile-section {
  margin-bottom: 14px;
}
.profile-section h4 {
  font-size: 11px;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  margin-bottom: 6px;
}
.profile-section .row {
  font-size: 14px;
  margin-bottom: 3px;
  color: var(--gray-700);
}
.profile-section .row strong { color: var(--gray-900); margin-right: 4px; }
.profile-section ul { list-style: none; padding: 0; margin: 0; }
.profile-section li {
  font-size: 14px;
  padding: 3px 0 3px 18px;
  position: relative;
  color: var(--gray-700);
}
.profile-section li::before {
  content: '→';
  position: absolute; left: 0;
  color: var(--red);
  font-weight: 700;
}

.profile-actions {
  margin-top: 18px;
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* ── Free heist module ─────────────────────────────────────── */
.side-heist {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.side-heist .heist-eyebrow {
  font-size: 11px;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  margin-bottom: 6px;
}
.side-heist h3 { font-size: 18px; margin-bottom: 8px; }
.side-heist p { color: var(--gray-500); font-size: 14px; margin-bottom: 14px; }

.heist-result {
  margin-top: 14px;
}
.heist-result h4 {
  font-size: 12px; color: var(--red);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 800;
  margin-bottom: 8px;
}
.heist-result .variation {
  background: var(--cream);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.heist-result .variation .title-line {
  font-weight: 700; color: var(--gray-900);
  font-size: 14px;
  margin-bottom: 4px;
}
.heist-result .variation .desc {
  font-size: 13px; color: var(--gray-600);
}

.anon-ideas-list {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 8px;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 4px;
}
.anon-idea {
  background: var(--cream);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 14px;
}

/* ── Save / signup modal ────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fade-in 0.2s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-card .close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none;
  font-size: 22px;
  color: var(--gray-400);
  cursor: pointer;
}
.modal-card h2 { margin-bottom: 6px; font-size: 22px; }
.modal-card .subtitle { color: var(--gray-500); margin-bottom: 22px; }

.upsell-banner {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, var(--red-light), white);
  border: 1px solid var(--red);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  flex-wrap: wrap;
}
.upsell-banner .copy h4 { font-size: 15px; margin-bottom: 4px; }
.upsell-banner .copy p { font-size: 13px; color: var(--gray-600); margin: 0; }

/* Mobile tweaks — chat pane goes back to auto height when stacked */
@media (max-width: 980px) {
  .chat-pane { height: auto; min-height: auto; }
  .chat-log { min-height: 320px; max-height: 60vh; }
}
@media (max-width: 720px) {
  .builder-shell { padding: 16px 16px 60px; }
}
