/* ============================================================
   v2.css — Arrival Flow v2 Design System
   "PeopleCoach" — Intimate Glassmorphism + Neural Canvas
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300;1,9..40,400&family=Instrument+Serif:ital@0;1&display=swap');

/* ── Design Tokens ── */
:root {
  /* Foundations — near-white with faint lavender tint */
  --bg-primary:     oklch(0.97 0.008 280);
  --bg-secondary:   oklch(0.95 0.010 280);
  --bg-elevated:    #FFFFFF;
  --bg-dark:        #F0F4F8;

  /* Glass — frosted white (handoff) */
  --glass-bg:       oklch(1 0 0 / 0.72);
  --glass-border:   oklch(0 0 0 / 0.07);
  --glass-hover:    oklch(1 0 0 / 0.88);
  --glass-active:   oklch(1 0 0 / 0.96);
  --glass-blur:     28px;

  /* Text */
  --text-primary:   oklch(0.14 0.02 280);
  --text-secondary: oklch(0.52 0.02 280);
  --text-muted:     oklch(0.62 0.01 280);
  --user-text:      oklch(0.40 0.04 280);

  /* Primary accent — lavender-purple (handoff) */
  --accent:         oklch(0.62 0.20 280);
  --accent-bright:  oklch(0.72 0.22 280);
  --accent-soft:    oklch(0.72 0.20 280 / 0.13);
  --accent-glow:    oklch(0.72 0.20 280 / 0.35);

  /* Warm lava palette — kept for canvas + glow effects */
  --accent-blue:    #00D2FF;   /* Day sky — canvas, spinner, legacy */
  --accent-teal:    #3FE8C6;   /* Minty zest — canvas */
  --accent-warm:    #FF8B8B;   /* Sun Kissed — recorder share btn */
  --accent-purple:  #A29BFE;   /* Playful violet — canvas */
  --accent-green:   #55E6C1;   /* Fresh sprout — canvas */
  --accent-red:     #FC427B;   /* Vibrant Rose — recorder */

  /* Glow effects — warm lava glows for canvas / breathe animation */
  --glow-blue:      rgba(0, 210, 255, 0.12);
  --glow-teal:      rgba(63, 232, 198, 0.12);
  --glow-warm:      rgba(255, 139, 139, 0.12);

  /* Handoff secondary palette */
  --sage:           oklch(0.62 0.14 160);
  --sage-soft:      oklch(0.72 0.12 160 / 0.13);
  --peach:          oklch(0.68 0.16 50);
  --peach-soft:     oklch(0.78 0.14 50 / 0.13);

  /* Spacing */
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      22px;
  --radius-pill:    999px;

  /* Transitions */
  --ease-out:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:    cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  overflow-x: clip; /* stronger than hidden — prevents iOS lateral bounce/overflow */
  max-width: 100vw;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  background: #000;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Thin scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: oklch(0.72 0.20 280 / 0.18); border-radius: 99px; }

/* ── App Shell ── */
#v2-app {
  position: relative;
  width: 100%;
  max-width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: clip;
  background: var(--bg-primary);
}

/* ── Ambient Canvas Background ── */
#ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ── Keyframes ── */
@keyframes breathe-ring {
  0%, 100% { transform: scale(1);    opacity: 0.6; }
  50%       { transform: scale(1.12); opacity: 1; }
}
@keyframes breathe-core {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.18); }
}
@keyframes breathe-text-fade {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%       { opacity: 1;   transform: scale(1); }
}
@keyframes nudge-right {
  0%, 100% { transform: translateX(0) translateY(-50%); }
  50%      { transform: translateX(5px) translateY(-50%); }
}
@keyframes ripple {
  0%   { transform: scale(0.8); opacity: 0.7; }
  100% { transform: scale(2.4); opacity: 0; }
}
@keyframes float-node {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-6px); }
}
@keyframes aurora-drift {
  0%   { transform: translate(0%, 0%) scale(1); }
  33%  { transform: translate(3%, -4%) scale(1.06); }
  66%  { transform: translate(-2%, 3%) scale(0.97); }
  100% { transform: translate(0%, 0%) scale(1); }
}
@keyframes aurora2 {
  0%   { transform: translate(0%, 0%) scale(1.1); }
  50%  { transform: translate(-5%, 4%) scale(1); }
  100% { transform: translate(0%, 0%) scale(1.1); }
}
@keyframes aurora3 {
  0%   { transform: translate(0%, 0%) scale(0.95); }
  40%  { transform: translate(4%, -3%) scale(1.05); }
  100% { transform: translate(0%, 0%) scale(0.95); }
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 15px var(--glow-blue); }
  50%       { box-shadow: 0 0 28px rgba(0, 210, 255, 0.18); }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0);   opacity: 0.4; }
  30%            { transform: translateY(-6px); opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes recPulse {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 0 0   rgba(220, 38, 38, 0.5); }
  50%       { transform: scale(1.1); box-shadow: 0 0 0 14px rgba(220, 38, 38, 0); }
}
@keyframes talkPulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.8); }
}

/* ── Header ── */
.v2-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Safe-area top padding for iPhone notch / Dynamic Island */
  padding-top: max(env(safe-area-inset-top, 0px), 14px);
  padding-bottom: 12px;
  padding-left: 16px;
  padding-right: 16px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: oklch(0.97 0.008 280 / 0.65);
  transition: opacity 0.4s var(--ease-out);
  gap: 8px;
}

.v2-header.dimmed {
  opacity: 0.4;
}

.v2-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 1;       /* can shrink but not collapse */
  min-width: 0;
  overflow: hidden;
}

.v2-brand-logo {
  height: 28px;
  width: 28px;
  border-radius: 6px;
  flex-shrink: 0;       /* logo image never squishes */
  object-fit: cover;
}

.v2-brand-text {
  display: flex;
  flex-direction: column;
}

.v2-brand-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.v2-brand-tagline {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.2;
  margin-top: 2px;
}

.v2-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;       /* never shrink — items always visible */
  min-width: 0;
}

/* ── User Profile (Header) ── */
.v2-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--glass-border);
  cursor: pointer;
  transition: border-color 0.2s;
  flex-shrink: 0;
}

.v2-avatar:hover {
  border-color: var(--accent-soft);
}

.v2-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v2-energy-badge {
  background: var(--accent-soft);
  border: 1px solid oklch(0.72 0.20 280 / 0.25);
  color: var(--accent);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.v2-energy-badge:hover {
  background: oklch(0.72 0.20 280 / 0.20);
}

.v2-energy-badge.low {
  color: var(--peach);
  border-color: oklch(0.68 0.16 50 / 0.30);
  background: oklch(0.78 0.14 50 / 0.10);
}

.v2-login-btn {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 6px 13px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.v2-login-btn:hover {
  background: var(--glass-hover);
  border-color: oklch(0.72 0.20 280 / 0.20);
}

/* ── Quick chips row (mode pills) ── */
.v2-quick-chips {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 8px;
  padding: 10px 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: oklch(0.97 0.008 280 / 0.45);
}
.v2-quick-chips::-webkit-scrollbar { display: none; }

/* Scroll-hint: gradient fade on right edge (no chevron text — cleaner on mobile) */
.v2-quick-chips-wrap {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  overflow: hidden;
}
.v2-quick-chips-wrap::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 48px;
  background: linear-gradient(to right, transparent, oklch(0.97 0.008 280 / 0.95) 70%);
  pointer-events: none;
  z-index: 12;
  transition: opacity 0.4s ease;
}
.v2-quick-chips-wrap.scrolled-end::after {
  opacity: 0;
}

.v2-quick-chips .v2-chip {
  white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;            /* slightly taller for better touch targets */
  min-height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 1;
  transition: all 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.v2-quick-chips .v2-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: none;
  box-shadow: none;
}

.v2-quick-chips .v2-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ── Chat Area ── */
.v2-chat-area {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 32px;
  overflow: hidden;
  transition: opacity 0.4s var(--ease-out);
}

.v2-chat-area.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Idle State — Brand Center ── */
.v2-idle-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  text-align: center;
  transition: all 0.5s var(--ease-out);
  pointer-events: none;
}

.v2-idle-center.hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.95);
}

.v2-idle-brand {
  font-family: 'Instrument Serif', serif;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.v2-idle-tagline {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Nudge ── */
.v2-nudge {
  text-align: center;
  margin-bottom: 12px;
  animation: fadeSlideUp 0.5s var(--ease-out) both;
}

.v2-nudge-text {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.v2-nudge-text:hover {
  background: var(--glass-hover);
  border-color: oklch(0.72 0.20 280 / 0.15);
}

/* ── Messages Container ── */
.v2-messages {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 0 8px;
  width: 100%;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 100%;
  scrollbar-width: thin;
}

.v2-messages::-webkit-scrollbar { width: 4px; }
.v2-messages::-webkit-scrollbar-track { background: transparent; }
.v2-messages::-webkit-scrollbar-thumb { background: oklch(0.72 0.20 280 / 0.18); border-radius: 99px; }

/* ── Message Bubble — AI ── */
.v2-msg {
  max-width: min(520px, 100%);
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
  animation: fade-up 0.45s cubic-bezier(.22,1,.36,1) both;
}

.v2-msg-ai {
  align-self: flex-start;
}

.v2-msg-user {
  align-self: flex-end;
}

.v2-msg-ai .v2-msg-content {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 16px 20px;
  box-shadow: 0 4px 32px oklch(0.62 0.20 280 / 0.07);
  overflow: visible;
}

/* Accent dot on AI bubble */
.v2-msg-ai .v2-msg-content::before {
  content: '✦';
  position: absolute;
  top: 14px;
  left: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
  font-size: 7px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 14px;
  text-align: center;
}

/* User messages — subtle tinted pill, italic */
.v2-msg-user .v2-msg-content {
  background: oklch(0.72 0.20 280 / 0.08);
  border: 1px solid oklch(0.72 0.20 280 / 0.14);
  border-radius: 18px;
  padding: 8px 14px;
  box-shadow: none;
}

.v2-msg-user .v2-msg-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 300;
  font-style: italic;
  color: var(--user-text);
  line-height: 1.65;
  text-align: right;
}

.v2-msg-icon {
  font-size: 14px;
  margin-right: 6px;
  opacity: 0.7;
}

.v2-msg-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.72;
  color: var(--text-primary);
  text-wrap: pretty;
}

.v2-msg-text p {
  margin-bottom: 8px;
}

.v2-msg-text p:last-child {
  margin-bottom: 0;
}

/* ── Action Chips (in-message) ── */
.v2-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.v2-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  user-select: none;
}

.v2-chip:hover {
  background: var(--glass-hover);
  border-color: rgba(0, 210, 255, 0.30);
  box-shadow: 0 0 16px var(--glow-blue);
  transform: translateY(-1px);
}

.v2-chip:active {
  transform: scale(0.97);
}

.v2-chip-icon {
  font-size: 15px;
}

/* ── Rich Cards (Featured, History) ── */
.v2-rich-card {
  background: var(--glass-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 18px 22px;
  margin-top: 8px;
  max-width: min(520px, 100%);
  box-shadow: 0 4px 24px oklch(0.62 0.20 280 / 0.06);
  transition: border-color 0.2s;
  animation: fade-up 0.45s cubic-bezier(.22,1,.36,1) both;
}

.v2-rich-card:hover {
  border-color: oklch(0.72 0.20 280 / 0.12);
}

.v2-rich-card-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.v2-rich-card-meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.v2-rich-card .v2-chips {
  margin-top: 8px;
}

/* ── Typing Indicator ── */
.v2-typing {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  align-self: flex-start;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  max-width: 90px;
  position: relative;
  animation: fade-up 0.3s ease both;
}

.v2-typing::before {
  content: '✦';
  position: absolute;
  top: 14px;
  left: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  font-size: 7px;
  color: white;
  line-height: 14px;
  text-align: center;
}

.v2-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 1.1s ease-in-out infinite;
}

.v2-typing-dot:nth-child(1) { animation-delay: 0s; }
.v2-typing-dot:nth-child(2) { animation-delay: 0.18s; }
.v2-typing-dot:nth-child(3) { animation-delay: 0.36s; }

/* ── Input Bar ── */
.v2-input-area {
  position: relative;
  z-index: 10;
  padding: 12px 16px max(env(safe-area-inset-bottom, 16px), 16px);
  flex-shrink: 0;
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: oklch(0.97 0.008 280 / 0.65);
}



.v2-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 6px 8px 6px 20px;
  transition: all 0.3s var(--ease-out);
  animation: breathe 4s ease-in-out infinite;
}

.v2-input-bar:focus-within {
  border-color: rgba(0, 210, 255, 0.35);
  box-shadow: 0 0 24px var(--glow-blue);
  animation: none;
}

.v2-input-icon {
  color: var(--accent);
  font-size: 18px;
  flex-shrink: 0;
  opacity: 0.6;
}

.v2-input-field {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px; /* 16px prevents iOS auto-zoom on focus */
  font-weight: 300;
  padding: 10px 0;
  min-width: 0;
}

.v2-input-field::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.v2-input-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.v2-input-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: oklch(0.72 0.20 280 / 0.20);
}

.v2-input-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.v2-send-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px var(--accent-glow);
  font-size: 18px;
  font-weight: 300;
}

.v2-send-btn:hover {
  background: var(--accent-bright);
  box-shadow: 0 4px 28px var(--accent-glow);
}

/* ── Immersive Player (State 3) ── */
.v2-player {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease-out);
  /* Frosted-light overlay — lava canvas shows through */
  background: oklch(1 0 0 / 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.v2-player.active {
  opacity: 1;
  pointer-events: auto;
}

.v2-player-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none;
}

/* ── Player header ── */
.v2-player-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(env(safe-area-inset-top, 20px), 20px) 24px 20px;
}

.v2-player-back {
  background: oklch(1 0 0 / 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid oklch(0 0 0 / 0.08);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  color: oklch(0.22 0.02 280);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.v2-player-back:hover { background: oklch(1 0 0 / 0.75); }

.v2-player-now-playing {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: oklch(0.45 0.02 280);
}

/* ── Centered content ── */
.v2-player-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 40px;
  gap: 0;
  text-align: center;
}

/* Title — large serif, shows session name then live caption */
.v2-player-caption {
  font-family: 'Instrument Serif', serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.25;
  color: oklch(0.12 0.03 280);
  max-width: min(480px, 100%);
  width: 100%;
  margin-bottom: 8px;
  text-shadow: 0 2px 16px oklch(1 0 0 / 0.7);
}
@media (max-width: 600px) {
  .v2-player-caption { font-size: 24px; }
}

/* Phase/subtitle — small muted label */
.v2-player-phase {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: oklch(0.48 0.02 280);
  margin-bottom: 40px;
}

/* ── Playback orb ── */
.v2-player-orb {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
  flex-shrink: 0;
}

/* Ripple rings */
.v2-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: orb-ripple 3s ease-out infinite;
}

@keyframes orb-ripple {
  0%   { transform: scale(0.75); opacity: 0.7; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* Core — gradient circle with play/pause button */
.v2-player-playbtn {
  position: relative;
  z-index: 2;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle, var(--accent-bright), var(--sage) 140%);
  box-shadow: 0 0 60px var(--accent-glow);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: orb-breathe 3.5s ease-in-out infinite;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.v2-player-playbtn:hover { transform: scale(1.06); }

@keyframes orb-breathe {
  0%, 100% { box-shadow: 0 0 40px var(--accent-glow); transform: scale(1); }
  50%       { box-shadow: 0 0 80px var(--accent-glow); transform: scale(1.04); }
}

/* ── Progress wrap ── */
.v2-player-progress-wrap {
  width: 100%;
  max-width: 320px;
  margin-bottom: 28px;
}

.v2-player-progress {
  width: 100%;
  height: 3px;
  background: oklch(0 0 0 / 0.12);
  border-radius: var(--radius-pill);
  overflow: visible;
  cursor: pointer;
  position: relative;
  margin-bottom: 8px;
}

.v2-player-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 0.3s linear;
  position: relative;
}

/* Dot handle at end of fill */
.v2-player-progress-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.v2-player-time {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: oklch(0.45 0.02 280);
  font-variant-numeric: tabular-nums;
  display: block;
  text-align: center;
}

/* ── Pull quote ── */
.v2-player-cue {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 17px;
  color: oklch(0.42 0.02 280);
  line-height: 1.75;
  max-width: 360px;
  text-shadow: 0 1px 8px oklch(1 0 0 / 0.5);
}

/* ── Bottom controls bar ── */
.v2-player-controls {
  position: relative;
  z-index: 2;
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.v2-player-bar {
  display: flex;
  justify-content: center;
}

.v2-player-close {
  background: oklch(1 0 0 / 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid oklch(0 0 0 / 0.08);
  border-radius: var(--radius-pill);
  padding: 8px 22px;
  color: oklch(0.30 0.02 280);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.v2-player-close:hover { background: oklch(1 0 0 / 0.78); }

/* ── Recorder UI ── */
.v2-recorder-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-bottom: 12px;
}

.v2-recorder-btn {
  background: oklch(1 0 0 / 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid oklch(0 0 0 / 0.08);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  color: oklch(0.25 0.02 280);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.v2-recorder-btn:hover {
  background: oklch(1 0 0 / 0.75);
}

.v2-recorder-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-red);
  transition: transform 0.2s;
}

.v2-recorder-btn.recording {
  border-color: oklch(0.60 0.22 25 / 0.40);
  background: oklch(0.60 0.22 25 / 0.15);
}

.v2-recorder-btn.recording .v2-recorder-dot {
  animation: recPulse 1.5s infinite;
}

.v2-recorder-timer {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #fff;
  display: none;
}

/* ── Login Overlay ── */
.v2-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: oklch(0.10 0.025 280 / 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.v2-login-overlay.active {
  display: flex;
  opacity: 1;
}

.v2-login-box {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 24px 64px oklch(0 0 0 / 0.25);
}

.v2-login-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.v2-login-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.v2-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  background: #fff;
  color: #333;
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.v2-google-btn:hover {
  transform: scale(1.02);
}

.v2-login-close {
  margin-top: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
}

.v2-login-close:hover {
  color: var(--text-secondary);
}

/* ── Status / Generating ── */
.v2-status {
  text-align: center;
  padding: 8px;
}

.v2-status-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--accent-blue);
  background: rgba(245, 166, 35, 0.08);
  border: 1px solid rgba(245, 166, 35, 0.15);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  animation: fadeSlideUp 0.3s var(--ease-out) both;
}

.v2-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(245, 166, 35, 0.30);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Player active: hide chrome ── */
body.v2-player-active .v2-header,
body.v2-player-active .v2-quick-chips-wrap,
body.v2-player-active .v2-input-area,
body.v2-player-active .v2-footer {
  display: none !important;
}

body.v2-fullscreen-active {
  overflow: hidden !important;
}

body.v2-fullscreen-active .v2-header,
body.v2-fullscreen-active .v2-quick-chips-wrap,
body.v2-fullscreen-active .v2-input-area {
  display: none !important;
}

body.v2-fullscreen-active .v2-msg {
  transform: none !important;
  animation: none !important;
}

/* ── Pattern Card Fullscreen ── */
.v2-pattern-card.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  margin: 0;
  border-radius: 0;
  height: 100vh;
  width: 100vw;
  max-width: none;
  background: var(--bg-dark);
}

.v2-pattern-card.fullscreen .v2-glass-panel {
  height: calc(100vh - 120px) !important;
  border-radius: 0;
  border: none;
}

.v2-pattern-card.fullscreen .v2-pattern-themes {
  padding: 0 20px;
}

.v2-pattern-card.fullscreen > :not(.v2-pattern-canvas-wrap):not(.v2-pattern-expand-btn) {
  display: none !important;
}

.v2-pattern-card.fullscreen .v2-glass-panel {
  height: 100vh !important;
  border-radius: 0;
  border: none;
}

.v2-pattern-expand-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: oklch(0 0 0 / 0.40);
  backdrop-filter: blur(8px);
  border: 1px solid oklch(1 0 0 / 0.15);
  border-radius: 8px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3000;
  transition: all 0.2s;
}

.v2-pattern-expand-btn:hover {
  background: oklch(1 0 0 / 0.10);
  transform: scale(1.05);
}

/* ── Mobile Adjustments ── */
@media (max-width: 600px) {
  .v2-header {
    padding-top: max(env(safe-area-inset-top, 0px), 10px);
    padding-bottom: 10px;
    padding-left: 14px;
    padding-right: 14px;
  }

  /* Right buttons never get squeezed off-screen */
  .v2-header-right {
    flex-shrink: 0;
    gap: 6px;
  }

  /* On mobile, hide the settings text badge ("English · Ash")
     This frees up precious header real estate. */
  .v2-settings-badge {
    display: none !important;
  }

  /* Energy badge: compact on mobile */
  .v2-energy-badge {
    font-size: 11px;
    padding: 4px 9px;
  }

  .v2-quick-chips {
    padding: 8px 14px;
    padding-right: 40px; /* room for scroll hint chevron */
    gap: 6px;
  }

  .v2-chat-area {
    padding: 0 14px;
  }

  .v2-input-area {
    padding-left: 12px;
    padding-right: 12px;
  }

  .v2-msg {
    max-width: 92%;
  }

  .v2-msg-ai .v2-msg-content {
    padding: 13px 16px;
  }

  .v2-idle-brand {
    font-size: 26px;
  }

  .v2-chips {
    gap: 6px;
  }

  .v2-chip {
    padding: 8px 13px;
    font-size: 12px;
  }

  /* Rich cards full-width on mobile */
  .v2-rich-card {
    max-width: 100%;
    padding: 14px 16px;
  }

  /* Reduce orb size for smaller screens */
  .v2-player-orb {
    width: clamp(140px, 50vw, 200px);
    height: clamp(140px, 50vw, 200px);
  }

  .v2-player-caption {
    font-size: 22px;
    padding: 0 8px;
  }

  .v2-player-content {
    padding: 0 20px;
  }
}

/* ════════════════════════════════════════
   Toolbar: Help, Settings buttons
   ════════════════════════════════════════ */

.v2-help-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.v2-help-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: oklch(0.72 0.20 280 / 0.20);
  transform: translateY(-1px);
}

.v2-avatar {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: visible;
  cursor: pointer;
  border: 1px solid var(--glass-border);
}

.v2-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.v2-avatar-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 120px;
  padding: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px oklch(0 0 0 / 0.12);
  z-index: 50;
}

.v2-profile-area {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(var(--glass-blur));
}

.v2-logout-btn {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

/* On mobile: hide the "Sign Out" text, show only the avatar */
@media (max-width: 600px) {
  .v2-logout-btn {
    display: none;
  }
  .v2-profile-area {
    padding: 2px;
    background: transparent;
    border-color: transparent;
    gap: 0;
  }
}

/* ── Onboarding Box ── */
.v2-onboarding-slides {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  width: 100%;
}

.v2-onboarding-box {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 40px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px oklch(0 0 0 / 0.20);
  animation: fadeSlideUp 0.4s var(--ease-spring);
}

.v2-onboarding-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.v2-onboarding-slide {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.v2-onboarding-slide.active {
  display: flex;
  animation: fadeIn 0.4s ease;
}

.v2-onboarding-slide.exiting {
  display: none;
}

.v2-onboarding-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.v2-onboarding-step {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.v2-onboarding-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.v2-onboarding-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.v2-onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.v2-onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--glass-border);
  transition: all 0.3s;
}

.v2-onboarding-dot.active {
  background: var(--accent);
  width: 20px;
  border-radius: var(--radius-pill);
}

/* ── Upgrade Modal ── */
.v2-currency-selector {
  display: flex;
  gap: 8px;
  background: oklch(0 0 0 / 0.06);
  border: 1px solid oklch(0 0 0 / 0.10);
  padding: 4px;
  border-radius: var(--radius-pill);
  margin: 20px auto 0;
  width: fit-content;
}

.v2-currency-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  border-radius: var(--radius-pill);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.v2-currency-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.v2-price-display {
  font-family: 'DM Sans', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 24px 0 12px;
}

.v2-benefit-list {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.v2-benefit-item {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Info Icon & Tooltip ── */
.v2-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s, transform 0.2s;
  user-select: none;
}

.v2-info-icon:hover {
  opacity: 1;
  transform: scale(1.1);
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.v2-info-tooltip {
  display: none;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  padding: 16px;
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-top: 15px;
  text-align: center;
  box-shadow: 0 8px 32px oklch(0 0 0 / 0.08);
  animation: fadeSlideUp 0.3s var(--ease-out);
}

.v2-info-tooltip.active {
  display: block;
}

/* ── Onboarding Progress ── */
.v2-onboarding-progress {
  height: 4px;
  background: var(--glass-border);
  border-radius: var(--radius-pill);
  margin: 20px 0;
  overflow: hidden;
  width: 100%;
}

.v2-onboarding-progress-bar {
  height: 100%;
  width: 33%;
  background: var(--accent-blue);
  box-shadow: 0 0 12px var(--glow-blue);
  transition: width 0.4s var(--ease-spring);
}

/* ════════════════════════════════════════
   Settings Drawer
   ════════════════════════════════════════ */

.v2-settings-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--accent-soft);
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.v2-settings-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: oklch(0.72 0.20 280 / 0.20);
  transform: translateY(-1px) rotate(40deg);
}

.v2-settings-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: oklch(0.10 0.025 280 / 0.25);
  backdrop-filter: blur(3px);
  z-index: 200;
}

.v2-settings-backdrop.active {
  display: block;
}

.v2-settings-panel {
  position: fixed;
  top: 0;
  right: -380px;
  width: 310px;
  max-width: 92vw;
  height: 100%;
  background: oklch(0.98 0.008 280 / 0.97);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-left: 1px solid var(--glass-border);
  box-shadow: -12px 0 40px oklch(0 0 0 / 0.10);
  z-index: 201;
  transition: right 0.35s var(--ease-spring);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.v2-settings-panel.active {
  right: 0;
}

.v2-settings-inner {
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100%;
}

.v2-settings-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.v2-settings-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.v2-settings-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s;
}

.v2-settings-close:hover {
  background: oklch(0.60 0.22 25 / 0.08);
  color: var(--accent-red);
}

.v2-settings-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex: 1;
}

.v2-settings-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.v2-settings-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.v2-settings-select {
  width: 100%;
  padding: 10px 32px 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  box-sizing: border-box;
}

.v2-settings-select:focus {
  border-color: var(--accent);
}

/* ── Voice grid ── */
.v2-voice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.v2-voice-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  gap: 3px;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
}

.v2-voice-tile:hover {
  border-color: oklch(0.72 0.20 280 / 0.40);
  background: var(--accent-soft);
}

.v2-voice-tile.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px oklch(0.72 0.20 280 / 0.15);
}

.v2-voice-tile-icon  { font-size: 20px; line-height: 1; }
.v2-voice-tile-name  { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.v2-voice-tile-desc  { font-size: 10px; color: var(--text-muted); line-height: 1.3; }

/* ── Duration grid ── */
.v2-duration-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.v2-duration-tile {
  padding: 9px 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  background: transparent;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.v2-duration-tile:hover {
  border-color: oklch(0.72 0.20 280 / 0.40);
  color: var(--accent);
}

.v2-duration-tile.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 2px oklch(0.72 0.20 280 / 0.15);
}

/* ── Save button ── */
.v2-settings-save {
  padding: 13px 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: auto;
  width: 100%;
  box-shadow: 0 4px 24px var(--accent-glow);
}

.v2-settings-save:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
}

/* ── Settings badge ── */
.v2-settings-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: oklch(0 0 0 / 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: none;
}

.v2-settings-badge.visible {
  display: inline-flex;
  align-items: center;
}

.v2-settings-badge:hover {
  background: var(--accent-soft);
  border-color: oklch(0.72 0.20 280 / 0.30);
  color: var(--accent);
}

/* ── History delete chip ── */
.v2-chip.v2-chip-danger {
  border-color: oklch(0.60 0.22 25 / 0.30);
  color: var(--accent-red);
}

.v2-chip.v2-chip-danger:hover {
  background: oklch(0.60 0.22 25 / 0.10);
  border-color: oklch(0.60 0.22 25 / 0.60);
}

/* ── Sarvam single-voice info ── */
.v2-voice-sarvam-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}

/* ── Talk Mode button ── */
.v2-talk-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  height: 34px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.2s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.v2-talk-btn:hover {
  border-color: oklch(0.72 0.20 280 / 0.50);
  color: var(--accent);
  background: var(--accent-soft);
}

.v2-talk-btn.active {
  background: oklch(0.62 0.14 160 / 0.12);
  border-color: var(--sage);
  color: var(--sage);
  box-shadow: 0 0 0 3px oklch(0.62 0.14 160 / 0.18);
}

.v2-talk-btn.active .v2-talk-label::before {
  content: '● ';
  font-size: 9px;
  animation: talkPulse 1.2s ease-in-out infinite;
  display: inline-block;
}

/* ── Admin Footer ── */
.v2-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 20px 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.55;
  flex-shrink: 0;
  z-index: 10;
}
.v2-footer-link {
  cursor: pointer;
  text-decoration: underline;
  transition: opacity 0.2s;
}
.v2-footer-link:hover { opacity: 0.9; }
.v2-footer-sep { opacity: 0.5; }

/* ── Admin Reports Modal ── */
.v2-reports-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.50);
  backdrop-filter: blur(4px);
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
.v2-reports-overlay.active { display: flex; }

.v2-reports-box {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  width: min(700px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  box-shadow: 0 24px 64px oklch(0 0 0 / 0.20);
}
.v2-reports-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.v2-reports-header h2 {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.v2-reports-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0 4px;
}
.v2-reports-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
}
.v2-reports-tab {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.v2-reports-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.v2-report-panel { display: none; }
.v2-report-panel.active { display: block; }
.v2-report-loading {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  padding: 20px 0;
}

.v2-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.v2-stat-card {
  background: oklch(0 0 0 / 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
}
.v2-stat-val {
  font-family: 'DM Sans', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.v2-stat-lbl {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.v2-chart-wrap { margin-bottom: 16px; }
.v2-chart-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.v2-chart-canvas { display: block; }
.v2-genre-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.v2-gbadge {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  background: oklch(0 0 0 / 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
}

/* ============================================================
   Recording Overlay — Reaction (9:16 split-screen)
   ============================================================ */

.v2-rec-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: oklch(0 0 0 / 0.92);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding-top: max(env(safe-area-inset-top, 0px), 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.v2-rec-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.v2-rec-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 360px;
  padding: 0 16px 24px;
}

.v2-rec-preview {
  width: 100%;
  max-width: 320px;
  max-height: 52svh;
  aspect-ratio: 9 / 16;
  border-radius: 20px;
  object-fit: cover;
  background: #000;
  box-shadow: 0 8px 40px oklch(0 0 0 / 0.60);
}

#v2-rec-close {
  position: absolute;
  top: 0;
  right: 16px;
  background: oklch(1 0 0 / 0.15);
  border: none;
  color: #fff;
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}
#v2-rec-close:hover { background: oklch(1 0 0 / 0.30); }

#v2-rec-timer {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: oklch(0.60 0.22 25 / 0.85);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
  z-index: 10;
}

.v2-rec-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.v2-rec-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid oklch(1 0 0 / 0.50);
  background: var(--accent-red);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s var(--ease-spring), background 0.2s;
  box-shadow: 0 0 0 0 oklch(0.60 0.22 25 / 0.40);
}
.v2-rec-btn:hover { transform: scale(1.07); }
.v2-rec-btn.recording {
  background: oklch(0.52 0.25 25);
  animation: recPulse 1.2s ease-in-out infinite;
}

#v2-rec-mic-btn {
  background: oklch(1 0 0 / 0.12);
  border: 1px solid oklch(1 0 0 / 0.25);
  color: oklch(1 0 0 / 0.85);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.2s;
}
#v2-rec-mic-btn:hover { background: oklch(1 0 0 / 0.22); }
#v2-rec-mic-btn.active {
  background: oklch(0.62 0.14 160 / 0.25);
  border-color: var(--sage);
  color: #fff;
}

#v2-rec-post {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
#v2-rec-share-btn,
#v2-rec-save-btn,
#v2-rec-retake-btn {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
#v2-rec-share-btn  { background: var(--accent-warm); color: #fff; }
#v2-rec-save-btn   { background: oklch(1 0 0 / 0.15); color: #fff; border: 1px solid oklch(1 0 0 / 0.30); }
#v2-rec-retake-btn { background: oklch(1 0 0 / 0.08); color: oklch(1 0 0 / 0.70); border: 1px solid oklch(1 0 0 / 0.15); }
#v2-rec-share-btn:hover,
#v2-rec-save-btn:hover,
#v2-rec-retake-btn:hover { opacity: 0.85; transform: translateY(-1px); }

.v2-rec-hint {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: oklch(1 0 0 / 0.45);
  text-align: center;
}

/* ── Rating widget (Did this land?) ───────────────────────── */
.v2-rec-rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.v2-rec-rating-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: oklch(1 0 0 / 0.50);
  letter-spacing: 0.02em;
}
.v2-rec-stars {
  display: flex;
  gap: 4px;
}
.v2-rec-star {
  background: none;
  border: none;
  font-size: 22px;
  color: oklch(1 0 0 / 0.25);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  transition: color 0.12s, transform 0.1s;
}
.v2-rec-star:hover,
.v2-rec-star.active {
  color: oklch(0.82 0.18 80); /* warm gold */
  transform: scale(1.15);
}

/* ── Template Performance admin tab ──────────────────────── */
.v2-tp-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.v2-tp-run-btn {
  background: var(--accent-primary, oklch(0.65 0.22 280));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 13px;
  cursor: pointer;
}
.v2-tp-run-btn:disabled { opacity: 0.5; cursor: default; }
.v2-tp-run-status { font-size: 12px; color: oklch(0.6 0 0); }
.v2-tp-meta { font-size: 12px; color: oklch(0.55 0 0); margin-bottom: 12px; }
.v2-tp-empty { color: oklch(0.55 0 0); font-size: 13px; }
.v2-tp-group { margin-bottom: 24px; }
.v2-tp-group-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  color: oklch(0.45 0 0);
}
.v2-tp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.v2-tp-table th {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid oklch(0.88 0 0);
  font-weight: 600;
  color: oklch(0.45 0 0);
}
.v2-tp-table td {
  padding: 5px 8px;
  border-bottom: 1px solid oklch(0.94 0 0);
}
.v2-tp-conf-ok td { background: oklch(0.97 0.04 145 / 0.4); }
.v2-tp-conf-low td { background: transparent; }
.v2-tp-conf-ok.v2-tp-conf-ok td:last-child { color: oklch(0.45 0.15 145); font-weight: 600; }
.v2-tp-conf-low td:last-child { color: oklch(0.6 0 0); }
.v2-tp-themes-title {
  font-size: 13px;
  font-weight: 600;
  margin: 20px 0 10px;
  color: oklch(0.45 0 0);
}
.v2-tp-theme {
  background: oklch(0.97 0 0);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 12px;
}
.v2-tp-theme ul { margin: 6px 0 0 16px; padding: 0; color: oklch(0.45 0 0); }
.v2-tp-theme-count { font-weight: normal; color: oklch(0.6 0 0); }

/* ============================================================
   Admin Screen-Record Bar (inside player header)
   ============================================================ */

.v2-sr-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  background: oklch(0 0 0 / 0.30);
  border-radius: var(--radius-pill);
  width: fit-content;
  margin: 0;
}

.v2-sr-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid oklch(1 0 0 / 0.25);
  background: oklch(1 0 0 / 0.10);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.v2-sr-btn:hover { background: oklch(1 0 0 / 0.20); }
.v2-sr-btn.recording {
  background: oklch(0.52 0.25 25 / 0.60);
  border-color: oklch(0.52 0.25 25);
}

.v2-sr-timer {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: oklch(1 0 0 / 0.80);
  min-width: 38px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ── Morning Ritual — Planner Card ─────────────────────────────────────────── */

.ritual-planner-card {
  width: min(520px, 100%);
}

.ritual-planner-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ritual-planner-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.ritual-cost-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-glow);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  white-space: nowrap;
}

.ritual-moments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.ritual-moment-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: border-color 0.2s;
}

.ritual-moment-row:focus-within {
  border-color: var(--accent-glow);
}

.ritual-moment-fields {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
}

.ritual-moment-label {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
}

.ritual-moment-label::placeholder {
  color: var(--text-muted);
}

.ritual-moment-time {
  width: 86px;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.ritual-moment-genre {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ritual-genre-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s var(--ease-out);
  opacity: 0.45;
}

.ritual-genre-btn.active {
  opacity: 1;
  background: var(--accent-soft);
  border-color: var(--accent-glow);
  transform: scale(1.08);
}

.ritual-genre-btn:hover {
  opacity: 0.85;
}

.ritual-remove-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.ritual-remove-btn:hover {
  color: var(--text-primary);
  background: var(--bg-dark);
}

.ritual-add-btn {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
  padding: 9px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
  margin-bottom: 12px;
}

.ritual-add-btn:hover {
  border-color: var(--accent-glow);
  color: var(--accent);
  background: var(--accent-soft);
}

.ritual-generate-btn {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.ritual-generate-btn:hover:not(:disabled) {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px var(--accent-glow);
}

.ritual-generate-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Success state */

.ritual-success-note {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.ritual-success-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ritual-success-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
}

/* ── Morning Ritual — Settings ──────────────────────────────────────────────── */

.v2-settings-push-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.v2-settings-time {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  width: 110px;
}

.v2-settings-time:focus {
  border-color: var(--accent-glow);
}

.v2-settings-calendar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.v2-settings-calendar-status {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}

.v2-settings-calendar-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s;
}

.v2-settings-calendar-btn:hover {
  border-color: var(--accent-glow);
}

.v2-settings-tz-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.v2-settings-tz-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.v2-settings-tz-select {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

.v2-settings-tz-select:focus {
  border-color: var(--accent-glow);
}

.v2-settings-hint {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .ritual-moment-fields {
    flex-direction: column;
    gap: 4px;
  }

  .ritual-moment-time {
    width: 100%;
  }

  .ritual-moment-row {
    flex-wrap: wrap;
  }
}
