/* Sheepdog - Main CSS Foundation V2 - Figma Design System Applied */

/* Import canonical orb styles */
@import url('orb.css');

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

* {
  margin: 0;
  padding: 0;
}

/* ============================================
   DESIGN TOKENS (from Figma)
   ============================================ */
:root {
  /* Brand Colors */
  --brand-50: #DAF1DB;
  --brand-100: #C5E2C6;
  --brand-500: #44A148;
  --brand-gradient: linear-gradient(to bottom, #6DBB70, #43A047);
  --brand-secondary-hover: #409E38;

  /* Background Colors */
  --bg-primary: #FFFFFF;
  --bg-primary-hover: #FAFAFA;

  /* Text Colors */
  --text-primary-900: #1A2718;
  --text-tertiary-600: #536255;
  --text-quaternary-500: #838D7F;
  --text-white: #FFFFFF;

  /* Border Colors */
  --border-primary: #DAF1DB;
  --border-secondary: #E9EAEB;
  --border-brand: #9E77ED;

  /* Semantic Colors */
  --color-error: #F04438;
  --color-orange: #F38744;
  --color-yellow: #FFC869;

  /* Vibe Card Colors (from Figma) */
  --vibe-green-bg: #DAF1DB;
  --vibe-purple-bg: #E3E4F8;
  --vibe-purple-500: #8084E4;
  --vibe-yellow-bg: #FFEED1;
  --vibe-yellow-500: #FFC869;
  --title-text: #06343A;

  /* Tinted Card Backgrounds (from Figma 37974:17695 Preferences) */
  --tint-blue: #EFF4F9;
  --tint-teal: #F0F8F7;
  --tint-purple: #F8F2F8;
  --tint-indigo: #F2F3FC;
  --tint-orange: #F8F3EC;

  /* Chip Colors (from Figma interest chips) */
  --chip-selected-bg: #DAF1DB;
  --chip-selected-border: #A9D4AB;
  --chip-unselected-border: #E9E9EB;
  --chip-icon-fill: #44A148;

  /* Display Font Sizes */
  --display-xs: 24px;
  --leading-display-xs: 32px;

  /* Typography */
  --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Font Sizes */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 18px;

  /* Line Heights */
  --leading-xs: 18px;
  --leading-sm: 20px;
  --leading-md: 24px;
  --leading-lg: 28px;

  /* Spacing */
  --spacing-none: 0px;
  --spacing-xs: 4px;
  --spacing-sm: 6px;
  --spacing-md: 8px;
  --spacing-lg: 12px;
  --spacing-xl: 16px;
  --spacing-2xl: 20px;
  --spacing-3xl: 24px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-4xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0px 5px 2px rgba(10, 13, 18, 0.05);
  --shadow-md: 0px 4px 6px rgba(10, 13, 18, 0.1), 0px 2px 4px rgba(10, 13, 18, 0.06);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* === Legacy aliases (for existing code that references old vars) === */
  --primary-green: var(--brand-500);
  --primary-green-light: #6DBB70;
  --primary-green-dark: #43A047;
  --primary-green-bg: var(--brand-50);
  --text-secondary: var(--text-tertiary-600);
  --border-color: var(--border-secondary);
  --bg-secondary: var(--bg-primary-hover);
}

/* ============================================
   GOOGLE FONTS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* ============================================
   BASE STYLES
   ============================================ */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary-900);
  background-color: var(--bg-primary-hover);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3 {
  margin-bottom: 0.5em;
  font-weight: 600;
  color: var(--text-primary-900);
}

h1 { font-size: var(--text-lg); line-height: var(--leading-lg); }
h2 { font-size: var(--text-md); line-height: var(--leading-md); }
h3 { font-size: var(--text-sm); line-height: var(--leading-sm); }

p {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--text-tertiary-600);
}

code {
  font-family: 'Courier New', monospace;
  background: var(--brand-50);
  color: var(--brand-500);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
}

/* ============================================
   HAPTIC FEEDBACK
   ============================================ */
@keyframes haptic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.97); }
}

.haptic-touch:active {
  animation: haptic 0.1s ease;
}

/* ============================================
   CTA TEXT INPUT COMPONENT
   ============================================ */
.cta-text-input {
  background: var(--bg-primary-hover);
  border: 2px solid var(--border-secondary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  font-size: var(--text-lg);
  font-family: var(--font-primary);
  text-align: center;
  font-weight: 600;
  color: var(--text-primary-900);
  transition: all var(--transition-fast);
  -webkit-appearance: none;
  width: 100%;
}

.cta-text-input:focus {
  outline: none;
  background: var(--bg-primary);
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(68, 161, 72, 0.15);
}

.cta-text-input::placeholder {
  color: var(--text-quaternary-500);
  font-weight: 400;
}

/* CTA Code Input Variant */
.cta-code-input {
  letter-spacing: 2px;
  text-transform: uppercase;
}

.cta-code-input::placeholder {
  letter-spacing: 1px;
}

/* ============================================
   CTA DROPDOWN
   ============================================ */
.cta-dropdown {
  background: var(--bg-primary-hover);
  border: 2px solid var(--border-secondary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl) 48px var(--spacing-xl) var(--spacing-xl);
  font-size: var(--text-lg);
  font-family: var(--font-primary);
  text-align: center;
  font-weight: 600;
  color: var(--text-primary-900);
  transition: all var(--transition-fast);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23838D7F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 24px;
}

.cta-dropdown:focus {
  outline: none;
  background-color: var(--bg-primary);
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(68, 161, 72, 0.15);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2344A148' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

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

/* ============================================
   REGULAR DROPDOWN
   ============================================ */
.dropdown {
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg) 36px var(--spacing-lg) var(--spacing-lg);
  font-size: var(--text-md);
  font-family: var(--font-primary);
  font-weight: 500;
  color: var(--text-primary-900);
  transition: all var(--transition-fast);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23838D7F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 20px;
}

.dropdown:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 2px rgba(68, 161, 72, 0.15);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2344A148' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.dropdown:hover {
  border-color: var(--brand-100);
  background-color: var(--bg-primary-hover);
}

.dropdown option {
  font-weight: 500;
}

/* ============================================
   ANIMATION UTILITIES
   ============================================ */
.animate-in {
  animation: slideUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.delay-1 { animation-delay: 0.1s; animation-fill-mode: both; }
.delay-2 { animation-delay: 0.2s; animation-fill-mode: both; }
.delay-3 { animation-delay: 0.3s; animation-fill-mode: both; }
.delay-4 { animation-delay: 0.4s; animation-fill-mode: both; }

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

.fade-away {
  animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); }
}

.zoom-out {
  animation: zoomOut 0.5s ease-out forwards;
}

@keyframes zoomOut {
  from { transform: scale(1); }
  to { transform: scale(1.05); opacity: 0.8; }
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 0 0 0 rgba(68, 161, 72, 0.4);
    border-color: var(--brand-500);
  }
  50% {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 0 0 10px rgba(68, 161, 72, 0);
    border-color: var(--brand-500);
  }
  100% {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 0 0 0 rgba(68, 161, 72, 0.4);
    border-color: var(--brand-500);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.transitioning-out {
  overflow: hidden;
}

.transitioning-out::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(68, 161, 72, 0.02) 50%,
    rgba(68, 161, 72, 0.05) 100%);
  pointer-events: none;
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

/* Form Group — labeled field with description */
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-group .description {
  font-size: var(--text-sm);
  color: var(--text-tertiary-600);
  margin-bottom: 0.5rem;
}

form input,
form textarea,
form select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border-secondary);
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  font-family: var(--font-primary);
}

form input:focus,
form textarea:focus,
form select:focus {
  outline: none;
  border-color: var(--brand-500);
}

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

/* Form Actions — button row at bottom of forms */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 1rem;
}

.btn-save {
  padding: 12px 32px;
  background: var(--brand-500);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-save:hover {
  background: var(--primary-green-dark);
}

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

.btn-cancel {
  padding: 12px 32px;
  background: transparent;
  color: var(--text-tertiary-600);
  border: 2px solid var(--border-secondary);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

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

/* Regular text input (non-CTA) */
.text-input {
  width: 100%;
  padding: var(--spacing-lg) var(--spacing-xl);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  font-family: var(--font-primary);
  color: var(--text-primary-900);
  background: var(--bg-primary);
  transition: all var(--transition-fast);
}

.text-input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(68, 161, 72, 0.1);
}

.text-input::placeholder {
  color: var(--text-quaternary-500);
}

/* Textarea */
.textarea {
  width: 100%;
  min-height: 200px;
  padding: var(--spacing-lg);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  color: var(--text-primary-900);
  resize: vertical;
}

.textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(68, 161, 72, 0.1);
}

.textarea::placeholder {
  color: var(--text-quaternary-500);
}

/* Range/Slider input */
.range-input {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border-secondary);
  outline: none;
  appearance: none;
  cursor: pointer;
}

.range-input::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-500);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 8px rgba(68, 161, 72, 0.1);
}

.range-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-500);
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.range-input::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 8px rgba(68, 161, 72, 0.1);
}

/* Range label wrapper */
.range-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-tertiary-600);
}

/* ============================================
   UTILITY COMPONENTS
   ============================================ */

/* Code/Log display */
.code-display {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: var(--text-primary-900);
  color: #86efac;
  padding: var(--spacing-xl);
  border-radius: var(--radius-md);
  overflow: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  line-height: 1.5;
}

.code-display.light {
  background: var(--bg-primary-hover);
  color: var(--text-primary-900);
  border: 1px solid var(--border-secondary);
}

/* Status Display Component */
.status-display {
  padding: var(--spacing-xl);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.status-disconnected {
  background: #FEE2E2;
  color: #991B1B;
}

.status-connecting {
  background: var(--brand-50);
  color: var(--brand-500);
  animation: pulse 1.5s infinite;
}

.status-connected {
  background: var(--brand-50);
  color: #166534;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Status Indicator */
.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.status-indicator.connected {
  background: var(--brand-500);
  animation: blink 2s infinite;
}

.status-indicator.disconnected {
  background: var(--color-error);
}

.status-indicator.connecting {
  background: var(--brand-500);
  animation: blink 0.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Grid utilities */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--spacing-lg);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
}

@media (max-width: 480px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Companion Abstract Orb Styles (global) */
.header-companion-orb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: headerOrbPulse 3s ease-in-out infinite;
}

.header-companion-orb.calm-blue {
  background: radial-gradient(circle at 30% 30%, #7dd3fc, #0284c7);
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.5);
}

.header-companion-orb.soft-green {
  background: radial-gradient(circle at 30% 30%, #86efac, var(--brand-500));
  box-shadow: 0 0 12px rgba(68, 161, 72, 0.5);
}

.header-companion-orb.warm-amber {
  background: radial-gradient(circle at 30% 30%, #fcd34d, #d97706);
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.5);
}

.header-companion-orb.gentle-purple {
  background: radial-gradient(circle at 30% 30%, #c4b5fd, #7c3aed);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
}

@keyframes headerOrbPulse {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.05);
    filter: brightness(1.1);
  }
}

/* ============================================
   SCREEN FRAME (mobile preview container)
   ============================================ */
.screen-frame {
  position: relative;
  width: 375px;
  max-width: 100%;
  min-height: 812px;
  margin: 0 auto;
  border-radius: 40px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  background: var(--bg-primary);
}

/* ============================================
   SKY BACKGROUND
   ============================================ */
.sky-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #E8F5E9 0%, #F1F8E9 30%, #FFFFFF 60%);
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sky-bg__clouds {
  position: absolute;
  top: 10%;
  left: 0;
  right: 0;
  height: 100px;
  opacity: 0.3;
}

.sky-bg__cloud {
  position: absolute;
  width: 120px;
  height: 40px;
  background: white;
  border-radius: 20px;
  opacity: 0.6;
}

.sky-bg__cloud::before,
.sky-bg__cloud::after {
  content: '';
  position: absolute;
  background: white;
  border-radius: 50%;
}

.sky-bg__cloud::before {
  width: 50px;
  height: 50px;
  top: -20px;
  left: 20px;
}

.sky-bg__cloud::after {
  width: 36px;
  height: 36px;
  top: -12px;
  left: 55px;
}

.sky-bg__cloud--1 {
  top: 20px;
  left: 5%;
}

.sky-bg__cloud--2 {
  top: 50px;
  right: 5%;
  left: auto;
  width: 90px;
  height: 30px;
  opacity: 0.4;
}

.sky-bg__hills {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
}

.sky-bg__hill {
  position: absolute;
  bottom: 0;
  border-radius: 50% 50% 0 0;
}

.sky-bg__hill--1 {
  width: 160%;
  height: 80px;
  left: -30%;
  background: #C5E2C6;
  opacity: 0.5;
}

.sky-bg__hill--2 {
  width: 140%;
  height: 60px;
  left: -20%;
  background: #9DC89F;
  opacity: 0.4;
}

.sky-bg__hill--3 {
  width: 120%;
  height: 45px;
  left: -10%;
  background: #7BB97E;
  opacity: 0.35;
}

/* ============================================
   SCREEN HEADER (back arrow + logo)
   ============================================ */
.screen-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 16px 20px;
}

.screen-header__back {
  width: 22px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-header__back svg {
  width: 22px;
  height: 22px;
  stroke: var(--title-text);
  stroke-width: 2;
  fill: none;
}

.screen-header__logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: 0 auto;
}

.screen-header__logo-icon {
  width: 30px;
  height: 30px;
}

.screen-header__logo-text {
  height: 18px;
  width: auto;
}

/* Fallback text when logo SVG is not exported yet */
.screen-header__logo-text-fallback {
  font-family: var(--font-primary);
  font-size: var(--text-lg, 18px);
  font-weight: 600;
  color: var(--brand-500);
}

/* ============================================
   SCREEN CONTENT (title + subtitle + body)
   ============================================ */
.screen-content {
  position: relative;
  z-index: 1;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.screen-content__title {
  font-size: var(--display-xs);
  font-weight: 600;
  line-height: var(--leading-display-xs);
  color: var(--text-primary-900);
  margin: 0;
}

.screen-content__subtitle {
  font-size: var(--text-md);
  font-weight: 400;
  line-height: var(--leading-md);
  color: var(--text-tertiary-600);
  margin: 0;
  margin-top: var(--spacing-xs);
}

/* ============================================
   VIBE CARD (selection card with icon + radio)
   ============================================ */
.vibe-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-lg);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.vibe-card:active {
  transform: scale(0.98);
}

.vibe-card__clouds {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  pointer-events: none;
  opacity: 0.6;
}

.vibe-card__bird {
  position: absolute;
  width: 12px;
  height: 6px;
  pointer-events: none;
}

/* Position 4 birds across the card */
.vibe-card__bird:nth-of-type(2) {
  top: 38px;
  right: 170px;
  transform: rotate(-15deg) scale(1.25);
}

.vibe-card__bird:nth-of-type(3) {
  top: 48px;
  right: 75px;
}

.vibe-card__bird:nth-of-type(4) {
  top: 18px;
  right: 40px;
}

.vibe-card__bird:nth-of-type(5) {
  top: 14px;
  right: 65px;
  transform: scale(0.8);
}

.vibe-card--selected {
  box-shadow: var(--shadow-xs);
}

.vibe-card--green.vibe-card--selected {
  box-shadow: var(--shadow-xs), 0 0 0 2px #A9D4AB;
}

.vibe-card--purple.vibe-card--selected {
  box-shadow: var(--shadow-xs), 0 0 0 2px #B8BAE8;
}

.vibe-card--yellow.vibe-card--selected {
  box-shadow: var(--shadow-xs), 0 0 0 2px #E8D4A8;
}

/* Card background wave decoration */
.vibe-card__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.vibe-card__bg svg,
.vibe-card__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Vibe color themes */
.vibe-card--green {
  background: var(--vibe-green-bg);
}

.vibe-card--purple {
  background: var(--vibe-purple-bg);
}

.vibe-card--yellow {
  background: var(--vibe-yellow-bg);
}

/* Card content layout */
.vibe-card__icon {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.vibe-card__icon img,
.vibe-card__icon svg {
  width: 100%;
  height: 100%;
}

.vibe-card__icon--lg {
  width: 40px;
  height: 40px;
}

.vibe-card__info {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-none);
  flex: 1;
  min-width: 0;
}

.vibe-card__title {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: var(--leading-lg);
  color: var(--title-text);
  margin: 0;
}

.vibe-card__desc {
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: var(--leading-sm);
  color: var(--title-text);
  margin: 0;
}

/* Radio check indicator */
.vibe-card__radio {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.vibe-card__radio-default,
.vibe-card__radio-checked {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  transition: opacity var(--transition-fast);
}

.vibe-card__radio-default {
  opacity: 1;
}

.vibe-card__radio-checked {
  opacity: 0;
}

.vibe-card--selected .vibe-card__radio-default {
  opacity: 0;
}

.vibe-card--selected .vibe-card__radio-checked {
  opacity: 1;
}

/* ============================================
   SCREEN FOOTER (CTA + page dots)
   ============================================ */
.screen-footer {
  position: absolute;
  bottom: 40px;
  left: 20px;
  right: 20px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xl);
}

/* CTA Button (gradient, Figma spec) */
.cta-button-v2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  width: 100%;
  height: 48px;
  padding: var(--spacing-lg) var(--spacing-2xl);
  background: var(--brand-gradient);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs),
    inset 0 -2px 0 rgba(10, 13, 18, 0.14),
    inset 0 0 0 0 rgba(10, 13, 18, 0.24);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.cta-button-v2:active {
  transform: scale(0.98);
}

.cta-button-v2__label {
  font-family: var(--font-primary);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: var(--leading-md);
  color: var(--text-white);
}

.cta-button-v2__icon {
  width: 22px;
  height: 22px;
}

.cta-button-v2:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.cta-button-v2__icon svg {
  width: 100%;
  height: 100%;
  stroke: white;
  stroke-width: 2;
  fill: none;
}

/* Page indicator dots */
.page-dots {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.page-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--brand-100);
  opacity: 0.5;
  transition: all var(--transition-fast);
}

.page-dot--active {
  width: 36px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  opacity: 1;
}

/* ============================================
   TOGGLE SWITCH — on/off slider
   ============================================ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

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

.toggle-switch__slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 28px;
}

.toggle-switch__slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-switch__slider {
  background-color: var(--brand-500);
}

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

/* ============================================
   SELECTION CARD — label wrapping hidden radio + styled card
   Used for: personality pickers, emoji grids, radio groups
   ============================================ */
.select-card {
  cursor: pointer;
}

.select-card input[type="radio"],
.select-card input[type="checkbox"] {
  display: none;
}

.select-card__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: white;
  border: 2px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.select-card input:checked + .select-card__body {
  border-color: var(--brand-500);
  background: var(--brand-50);
}

.select-card__body:hover {
  border-color: var(--brand-500);
}

/* Horizontal layout variant (preview + text side-by-side) */
.select-card__body--row {
  flex-direction: row;
  text-align: left;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

/* Lift on hover variant */
.select-card__body--lift:hover {
  transform: translateY(-2px);
}

/* Minimum height variant for tile grids */
.select-card__body--tile {
  min-height: 60px;
  justify-content: center;
}

.select-card__icon {
  width: 36px;
  height: 36px;
  margin-bottom: 0.25rem;
}

.select-card__preview {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.select-card__title {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary-900);
}

.select-card__desc {
  display: none;
}

.select-card__display {
  width: 48px;
  height: 48px;
}

/* Selection Card Grid */
.select-card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.select-card-grid > .select-card {
  flex: 1;
}

/* Fixed-width tiles (for emoji/icon grids with many items) */
.select-card-grid--tiles > * {
  flex: 0 0 calc(25% - 0.375rem);
  max-width: calc(25% - 0.375rem);
}

/* Inline row (non-wrapping horizontal) */
.select-card-grid--row {
  flex-wrap: nowrap;
  gap: 1rem;
}

/* ============================================
   ACTION TILE — dashed-border trigger (upload, "more", add)
   ============================================ */
.action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: white;
  border: 2px dashed var(--border-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  min-height: 60px;
  cursor: pointer;
}

.action-tile:hover {
  border-color: var(--brand-500);
  background: var(--bg-primary-hover);
}

.action-tile__icon {
  width: 28px;
  height: 28px;
}

.action-tile__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: center;
  margin-top: 2px;
}

.action-tile__label--accent {
  color: var(--brand-500);
}

.action-tile__label--muted {
  color: var(--text-tertiary-600);
}

/* Mini icon grid inside "More" action tile */
.action-tile__icons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 28px;
  height: 28px;
}

.action-tile__icons-grid img {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

/* ============================================
   IMAGE CARD — uploaded image preview with delete
   ============================================ */
.image-card {
  position: relative;
}

.image-card__preview {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.image-card__delete {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  background: var(--color-error);
  color: white;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid white;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all var(--transition-fast);
}

.image-card__delete:hover {
  background: #c0392b;
  transform: scale(1.1);
}

/* ============================================
   VOICE INPUT — recording UI with status + transcript
   ============================================ */
.voice-input {
  display: none;
  padding: 1rem;
  background: var(--bg-primary-hover);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.voice-input.active {
  display: block;
}

.voice-input__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.voice-input__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary-600);
}

.voice-input__dot.active {
  background: var(--brand-500);
  animation: pulse 1.5s ease-in-out infinite;
}

.voice-input__display {
  min-height: 60px;
  max-height: 150px;
  overflow-y: auto;
  padding: 0.75rem;
  background: white;
  border: 2px solid var(--border-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  font-size: var(--text-sm);
}

.voice-input__controls {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ============================================
   GRID-8 UTILITY (emoji picker, icon grids)
   ============================================ */
.grid-8 {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
}

@media (max-width: 600px) {
  .grid-8 {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ============================================
   PICKER OPTION — selectable tile in a dense grid
   ============================================ */
.picker-option {
  font-size: 2rem;
  padding: 0.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}

.picker-option:hover {
  background: var(--bg-primary-hover);
  border-color: var(--brand-500);
  transform: scale(1.1);
}

/* ============================================
   ICON INLINE — SVG icons inside text/buttons
   ============================================ */
.icon-inline {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.15em;
}

/* ============================================
   INSET PILL TOGGLE — segmented control
   Two or more options in a recessed track.
   Selected option gets a filled pill background.
   Uses squared corners (radius-md) per Figma.
   ============================================ */
.inset-pill-toggle {
  display: inline-flex;
  position: relative;
  background: #EAECF0;
  border: 1px solid #EAECF0;
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

/* Sliding indicator — positioned by JS via CSS custom properties */
.inset-pill-toggle__slider {
  position: absolute;
  top: 3px;
  left: var(--slider-left, 3px);
  width: var(--slider-width, 50%);
  height: calc(100% - 6px);
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: left 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              width 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  z-index: 0;
}

.inset-pill-toggle__option {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 6px;
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-tertiary-600);
  cursor: pointer;
  transition: color var(--transition-fast), font-weight var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1;
}

.inset-pill-toggle__option:hover {
  color: var(--text-primary-900);
}

.inset-pill-toggle__option.active {
  color: var(--text-primary-900);
  font-weight: 600;
}

.inset-pill-toggle__option img {
  width: 20px;
  height: 20px;
}

/* ============================================
   SECTION PANEL — bordered card for form sections
   White background, rounded corners, subtle border.
   Use to group related form fields into visual cards.
   ============================================ */
.section-panel {
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
}

/* Card title — first label child acts as the panel heading */
.section-panel > label {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: var(--leading-lg);
  color: var(--title-text);
  margin: 0;
}

/* ============================================
   EXPANDABLE CARD — collapsible settings panel
   Green-tinted header that toggles content visibility.
   Uses brand-50 background with gear icon + chevron.
   ============================================ */
.expandable-card {
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.expandable-card__header {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-xl) var(--spacing-2xl);
  background: var(--brand-50);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.expandable-card__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.expandable-card__title {
  flex: 1;
  font-family: var(--font-primary);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary-900);
}

.expandable-card__chevron {
  font-size: var(--text-md);
  color: var(--text-tertiary-600);
  transition: transform var(--transition-fast);
}

.expandable-card.open .expandable-card__chevron {
  transform: rotate(180deg);
}

.expandable-card__body {
  display: none;
  padding: var(--spacing-2xl);
  background: var(--bg-primary);
}

.expandable-card.open .expandable-card__body {
  display: flex;
  flex-direction: column;
}
