:root {
  --primary: #FF6B35;
  --primary-light: #FF8F5E;
  --primary-dark: #E55A2B;
  --bg: #FFF9F5;
  --bg-card: #FFFFFF;
  --bg-input: #F5F0EB;
  --bg-message-user: #FF6B35;
  --bg-message-coach: #FFF0E8;
  --text: #2D2016;
  --text-muted: #8C7A6B;
  --border: #E8DDD4;
  --success: #22C55E;
  --danger: #EF4444;
  --radius: 14px;
  --radius-sm: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  overflow: hidden;
}

/* ===== LANDING ===== */
.landing {
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.landing-content {
  max-width: 680px;
  width: 100%;
}

.logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  color: white;
  margin-bottom: 16px;
  box-shadow: 0 8px 32px rgba(255, 107, 53, 0.25);
}

.logo h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #fff, #FFB088);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 16px;
  margin-top: 8px;
}

/* Interface toggle */
.interface-toggle {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  max-width: 240px;
  margin-left: auto;
  margin-right: auto;
}

.toggle-btn {
  flex: 1;
  padding: 10px 20px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.toggle-btn:hover:not(.active) {
  color: var(--text);
}

.mode-section h2 {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Free input on landing */
.free-input-area {
  margin-bottom: 20px;
}

.free-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 6px 6px 16px;
  transition: border-color 0.15s;
}

.free-input-wrapper:focus-within {
  border-color: var(--primary);
}

.free-input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  resize: none;
  outline: none;
  max-height: 120px;
  padding: 8px 0;
  line-height: 1.4;
}

.free-input-wrapper textarea::placeholder {
  color: var(--text-muted);
}

/* Free voice button on landing */
.free-voice-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border: none;
  border-radius: var(--radius);
  color: white;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

.free-voice-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255, 107, 53, 0.4);
}

.free-voice-btn:active {
  transform: translateY(0);
}

.or-divider {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  opacity: 0.6;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  color: var(--text);
  font-family: inherit;
}

.mode-card:hover {
  border-color: var(--primary);
  background: #FFF0E8;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.15);
}

.mode-emoji {
  font-size: 28px;
  line-height: 1;
}

.mode-title {
  font-size: 15px;
  font-weight: 700;
}

.mode-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== SHARED HEADER ===== */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.back-btn,
.reset-btn,
.header-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
  flex-shrink: 0;
}

.back-btn:hover,
.reset-btn:hover,
.header-action-btn:hover {
  background: var(--bg-input);
  color: var(--text);
}

.reset-btn {
  margin-left: 0;
}

.header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.coach-avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.header-info h2 {
  font-size: 15px;
  font-weight: 700;
}

.mode-label {
  font-size: 11.5px;
  color: var(--primary-light);
  font-weight: 500;
}

.voice-label {
  color: var(--success);
}

/* ===== CHAT (text) ===== */
.chat-container {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: var(--radius);
  line-height: 1.55;
  font-size: 14px;
  animation: msgIn 0.25s ease;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.message.coach {
  align-self: flex-start;
  background: var(--bg-message-coach);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.message.user {
  align-self: flex-end;
  background: var(--bg-message-user);
  border-bottom-right-radius: 4px;
}

.message.coach strong,
.message.coach b {
  color: var(--primary-light);
}

/* Markdown rendering in chat messages */
.message ul, .message ol {
  margin: 6px 0 6px 8px;
  padding-left: 16px;
}
.message li {
  margin-bottom: 3px;
  line-height: 1.5;
}
.message code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.message .chat-heading {
  display: block;
  font-size: 14px;
  margin: 8px 0 4px;
}
.message .chat-heading:first-child {
  margin-top: 0;
}
.message .chat-p {
  margin: 0 0 2px;
  line-height: 1.5;
}
.message .chat-p:last-child {
  margin-bottom: 0;
}
.message .chat-paragraph-break {
  height: 8px;
}
.message .chat-hr {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.1);
  margin: 10px 0;
}

.typing-indicator {
  align-self: flex-start;
  padding: 12px 20px;
  background: var(--bg-message-coach);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 5px;
  animation: msgIn 0.2s ease;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: bounce 1.2s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Input */
.chat-input-area {
  padding: 12px 20px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* History read-only bar */
.chat-history-bar {
  padding: 12px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.history-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-bar-label {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.history-continue-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.history-continue-btn:hover {
  background: var(--primary-light);
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 6px 6px 16px;
  transition: border-color 0.15s;
}

.input-wrapper:focus-within {
  border-color: var(--primary);
}

textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  resize: none;
  outline: none;
  max-height: 120px;
  padding: 8px 0;
  line-height: 1.4;
}

textarea::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

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

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  opacity: 0.6;
}

/* ===== LOGIN OVERLAY ===== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-box {
  text-align: center;
  width: 90%;
  max-width: 340px;
}

.login-box h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.login-box > p,
.login-box > div > p:first-child {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form input[type="password"],
.login-form input[type="email"],
.login-form input[type="text"] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}

.login-form input[type="password"]:focus,
.login-form input[type="email"]:focus,
.login-form input[type="text"]:focus {
  border-color: var(--primary);
}

.auth-toggle {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-toggle a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

.login-submit {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.login-submit:hover {
  background: var(--primary-dark);
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

.login-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-submit .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

/* Remember me */
.remember-me-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.remember-me-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Password strength */
.password-strength {
  display: flex;
  align-items: center;
  gap: 8px;
}

.strength-bars {
  display: flex;
  gap: 4px;
  flex: 1;
}

.strength-bar {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.2s;
}

.strength-bar.active-weak { background: var(--danger); }
.strength-bar.active-fair { background: #F59E0B; }
.strength-bar.active-good { background: #3B82F6; }
.strength-bar.active-strong { background: var(--success); }

.strength-label {
  font-size: 11px;
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

.strength-label.weak { color: var(--danger); }
.strength-label.fair { color: #F59E0B; }
.strength-label.good { color: #3B82F6; }
.strength-label.strong { color: var(--success); }

/* Profile email */
.profile-email {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: -2px;
}

/* Session expiry modal */
.session-expiry-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 20, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  animation: fadeIn 0.2s ease;
}

.session-expiry-box {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  max-width: 340px;
  width: 90%;
}

.session-expiry-box h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.session-expiry-box p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.session-expiry-box button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.session-expiry-box button:hover {
  background: var(--primary-dark);
}

/* Auth transition */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.login-overlay {
  transition: opacity 0.3s ease;
}

.login-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Welcome toast */
.welcome-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  z-index: 9000;
  box-shadow: 0 8px 32px rgba(255, 107, 53, 0.4);
  animation: slideDown 0.4s ease, fadeOut 0.4s ease 3.6s forwards;
  white-space: nowrap;
}

@keyframes slideDown {
  from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

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

/* ===== ONBOARDING ===== */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 20, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8000;
  padding: 24px;
  overflow-y: auto;
}

.onboarding-box {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  animation: msgIn 0.3s ease;
}

.onboarding-box h2 {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.onboarding-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.onboarding-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.onboarding-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.field-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 11px;
}

.onboarding-field input,
.onboarding-field select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.onboarding-field input:focus,
.onboarding-field select:focus {
  border-color: var(--primary);
}

.onboarding-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238888A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.onboarding-field input::placeholder {
  color: var(--text-muted);
}

.onboarding-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ob-chip {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.ob-chip:hover {
  border-color: var(--primary);
  color: var(--text);
}

.ob-chip.selected {
  background: rgba(255, 107, 53, 0.2);
  border-color: var(--primary);
  color: var(--primary-light);
}

.onboarding-submit {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}

.onboarding-submit:hover {
  background: var(--primary-dark);
}

.onboarding-skip {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}

.onboarding-skip:hover {
  color: var(--text);
}

/* Profile badge */
.profile-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-greeting {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-light);
}

.profile-edit-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.profile-edit-btn:hover {
  border-color: var(--primary);
  color: var(--text);
  background: rgba(255, 107, 53, 0.08);
}

/* ===== VOICE INTERFACE ===== */
.voice-container {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.voice-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 20px;
  overflow: hidden;
}

/* Orb */
.voice-orb-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.voice-orb {
  width: 160px;
  height: 160px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-core {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: white;
  z-index: 2;
  transition: all 0.3s;
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
  transition: all 0.3s;
}

.ring-1 { width: 100px; height: 100px; }
.ring-2 { width: 125px; height: 125px; }
.ring-3 { width: 155px; height: 155px; }

/* Orb states */
.voice-orb.idle .orb-core {
  box-shadow: 0 0 30px rgba(255, 107, 53, 0.2);
}

.voice-orb.connected .orb-core {
  box-shadow: 0 0 40px rgba(255, 107, 53, 0.3);
}

.voice-orb.connected .ring-1 {
  opacity: 0.3;
  animation: pulse 2s ease-in-out infinite;
}

.voice-orb.listening .orb-core {
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  box-shadow: 0 0 50px rgba(255, 107, 53, 0.4);
}

.voice-orb.listening .ring-1 {
  opacity: 0.5;
  border-color: var(--primary-light);
  animation: pulse 1.5s ease-in-out infinite;
}

.voice-orb.listening .ring-2 {
  opacity: 0.3;
  border-color: var(--primary-light);
  animation: pulse 1.5s ease-in-out infinite 0.3s;
}

.voice-orb.speaking .orb-core {
  background: linear-gradient(135deg, #34D399, #6ee7b7);
  box-shadow: 0 0 60px rgba(52, 211, 153, 0.4);
}

.voice-orb.speaking .ring-1 {
  opacity: 0.6;
  border-color: var(--success);
  animation: pulse 0.8s ease-in-out infinite;
}

.voice-orb.speaking .ring-2 {
  opacity: 0.4;
  border-color: var(--success);
  animation: pulse 0.8s ease-in-out infinite 0.15s;
}

.voice-orb.speaking .ring-3 {
  opacity: 0.2;
  border-color: var(--success);
  animation: pulse 0.8s ease-in-out infinite 0.3s;
}

/* Reconnecting state */
.voice-orb.reconnecting .orb-core {
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  box-shadow: 0 0 50px rgba(251, 191, 36, 0.35);
  animation: reconnectPulse 1.2s ease-in-out infinite;
}

.voice-orb.reconnecting .ring-1 {
  opacity: 0.4;
  border-color: #FBBF24;
  animation: pulse 1s ease-in-out infinite;
}

.voice-orb.reconnecting .ring-2 {
  opacity: 0.2;
  border-color: #FBBF24;
  animation: pulse 1s ease-in-out infinite 0.2s;
}

@keyframes reconnectPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.2; }
  50% { transform: scale(1.08); opacity: 0.5; }
}

.voice-status {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
  min-height: 20px;
}

.voice-timer {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  text-align: center;
  margin-top: 4px;
  opacity: 0.85;
}

/* Transcript */
.voice-transcript {
  width: 100%;
  max-width: 600px;
  max-height: 200px;
  overflow-y: auto;
  padding: 0 16px;
}

.transcript-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.transcript-msg {
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 10px;
  animation: msgIn 0.2s ease;
  max-width: 90%;
}

.transcript-msg.user {
  align-self: flex-end;
  background: rgba(255, 107, 53, 0.2);
  color: #FFB088;
  border: 1px solid rgba(255, 107, 53, 0.3);
}

.transcript-msg.coach {
  align-self: flex-start;
  background: rgba(52, 211, 153, 0.1);
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.transcript-msg.partial {
  opacity: 0.5;
  font-style: italic;
}

/* Voice controls */
.voice-controls {
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.voice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: white;
}

.voice-btn.connect {
  background: var(--primary);
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

.voice-btn.connect:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255, 107, 53, 0.4);
}

.voice-btn.disconnect {
  background: var(--danger);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.voice-btn.disconnect:hover {
  background: #DC2626;
}

.voice-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===== Debug Overlay ===== */
.debug-overlay {
  position: absolute;
  top: 60px;
  right: 12px;
  z-index: 100;
  animation: debugIn 0.15s ease;
}

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

.debug-panel {
  width: 360px;
  padding: 14px 16px;
  background: rgba(20, 20, 30, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.debug-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.debug-close {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
}

.debug-close:hover {
  background: var(--bg-input);
  color: var(--text);
}

.debug-log-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.debug-log {
  height: 80px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-muted);
}

.debug-log::-webkit-scrollbar { width: 4px; }
.debug-log::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* VU meter */
.vu-meter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vu-label,
.vad-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 80px;
  flex-shrink: 0;
}

.vu-meter {
  flex: 1;
  height: 18px;
  background: var(--bg-input);
  border-radius: 9px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}

.vu-meter-bar {
  height: 100%;
  width: 0%;
  border-radius: 9px;
  background: linear-gradient(90deg, #34D399 0%, #FBBF24 60%, #EF4444 90%);
  transition: width 0.08s linear;
}

.vu-threshold-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: white;
  opacity: 0.9;
  left: 50%;
  transition: left 0.15s;
  box-shadow: 0 0 4px rgba(255,255,255,0.5);
}

.vu-value,
.vad-value {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* Sliders */
.vad-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vad-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  outline: none;
  border: 1px solid var(--border);
}

.vad-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--primary-light);
  box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.vad-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--primary-light);
  box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

/* ===== READ LIST ===== */
.readlist-trigger {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.readlist-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.readlist-btn:hover {
  border-color: var(--primary);
  color: var(--text);
  background: rgba(255, 107, 53, 0.08);
}

.readlist-count {
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* Readlist panel / drawer */
.readlist-panel {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  justify-content: flex-end;
}

.readlist-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.readlist-drawer {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  animation: drawerIn 0.2s ease;
  overflow: hidden;
}

@keyframes drawerIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.readlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}

.readlist-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.readlist-add {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.readlist-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.readlist-input-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.readlist-input-row input:focus {
  border-color: var(--primary);
}

.readlist-input-row input::placeholder {
  color: var(--text-muted);
}

.readlist-status {
  font-size: 12px;
  margin-top: 8px;
  font-weight: 500;
}

.readlist-status.loading {
  color: var(--primary-light);
}

.readlist-status.error {
  color: var(--danger);
}

.readlist-status.success {
  color: var(--success);
}

.readlist-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.readlist-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 40px 20px;
  line-height: 1.5;
}

.readlist-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: msgIn 0.2s ease;
}

.readlist-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.readlist-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}

.readlist-domain {
  color: var(--primary-light);
  font-weight: 600;
}

.readlist-date {
  color: var(--text-muted);
}

.readlist-delete {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
}

.readlist-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.readlist-summary {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.readlist-summary strong {
  color: var(--primary-light);
}

.readlist-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.readlist-link:hover {
  color: var(--primary-light);
}

/* ===== PROACTIVE TRAINING PLAN ===== */
.training-plan {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.12) 0%, rgba(255, 107, 53, 0.04) 100%);
  border: 1px solid rgba(255, 107, 53, 0.3);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  animation: msgIn 0.4s ease;
}

.training-plan-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.training-plan-icon {
  font-size: 28px;
  line-height: 1;
}

.training-plan-greeting {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.training-plan-body {
  margin-bottom: 16px;
}

.training-recap {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.training-weak-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.weak-area-pill {
  font-size: 11px;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 3px 10px;
  border-radius: 12px;
}

.training-proposal {
  background: rgba(255, 107, 53, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.training-proposal-topic {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 4px;
}

.training-proposal-reason {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.training-plan-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.training-plan-cta:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.training-plan-cta:active {
  transform: translateY(0);
}

.training-streak {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.streak-icon {
  font-size: 14px;
}

/* ===== SPACED LEARNING ===== */
.spaced-learning {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.10) 0%, rgba(52, 211, 153, 0.03) 100%);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
  animation: msgIn 0.4s ease;
}

.spaced-learning-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.spaced-learning-icon {
  font-size: 26px;
  line-height: 1;
}

.spaced-learning-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.spaced-learning-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.spaced-topics-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spaced-topic-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(52, 211, 153, 0.06);
  border: 1px solid rgba(52, 211, 153, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: border-color 0.15s;
}

.spaced-topic-card:hover {
  border-color: rgba(52, 211, 153, 0.35);
}

.spaced-topic-card.overdue {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.06);
}

.spaced-topic-info {
  flex: 1;
  min-width: 0;
}

.spaced-topic-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.spaced-topic-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.spaced-topic-level {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-shrink: 0;
}

.spaced-level-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.spaced-level-dot.filled {
  background: var(--success);
}

.spaced-topic-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.spaced-btn-review {
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.spaced-btn-review:hover {
  background: rgba(52, 211, 153, 0.2);
}

.spaced-btn-practice {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-light);
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.25);
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.spaced-btn-practice:hover {
  background: rgba(255, 107, 53, 0.2);
}

.spaced-upcoming {
  margin-top: 10px;
  border-top: 1px solid rgba(52, 211, 153, 0.12);
  padding-top: 8px;
}

.spaced-toggle-upcoming {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}

.spaced-toggle-upcoming:hover {
  color: var(--text);
}

.spaced-upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.spaced-upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
}

.spaced-upcoming-topic {
  font-weight: 500;
}

.spaced-upcoming-date {
  font-size: 11px;
  opacity: 0.7;
}

/* ===== CONVERSATION HISTORY ===== */
.history-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.history-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: center;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  animation: msgIn 0.2s ease;
}

.history-card:hover {
  border-color: rgba(255, 107, 53, 0.4);
  background: rgba(255, 107, 53, 0.05);
}

.history-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.history-emoji {
  font-size: 14px;
  line-height: 1;
}

.history-mode {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-light);
}

.history-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.history-msgs {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 6px;
}

.history-summary {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Session status badges */
.session-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.session-badge-incomplete {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.session-badge-incomplete:hover {
  background: rgba(245, 158, 11, 0.25);
  transform: scale(1.05);
}

.history-card-incomplete {
  border-color: rgba(245, 158, 11, 0.25);
  cursor: pointer;
}

.history-card-incomplete:hover {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.05);
}

/* Resume separator between old and new messages */
.resume-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.resume-separator::before,
.resume-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.resume-separator span {
  white-space: nowrap;
  padding: 2px 10px;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 8px;
  color: #f59e0b;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

/* Markdown-like formatting in messages */
.message h3 {
  margin: 4px 0;
  font-size: 14px;
}

.message ul, .message ol {
  padding-left: 18px;
  margin: 4px 0;
}

.message li {
  margin: 2px 0;
}

.message code {
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}

/* Scrollbar */
.messages::-webkit-scrollbar,
.voice-transcript::-webkit-scrollbar {
  width: 6px;
}
.messages::-webkit-scrollbar-track,
.voice-transcript::-webkit-scrollbar-track {
  background: transparent;
}
.messages::-webkit-scrollbar-thumb,
.voice-transcript::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* Mobile */
@media (max-width: 600px) {
  .landing {
    padding: 16px;
    align-items: flex-start;
    padding-top: 40px;
  }

  .logo h1 {
    font-size: 32px;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 90%;
  }

  .chat-header {
    padding: 10px 14px;
  }

  .messages {
    padding: 14px;
  }

  .chat-input-area {
    padding: 10px 14px 14px;
  }

  .voice-orb {
    width: 140px;
    height: 140px;
  }

  .orb-core {
    width: 70px;
    height: 70px;
    font-size: 24px;
  }

  .ring-1 { width: 90px; height: 90px; }
  .ring-2 { width: 112px; height: 112px; }
  .ring-3 { width: 136px; height: 136px; }

  .debug-overlay {
    right: 8px;
    left: 8px;
  }

  .debug-panel {
    width: 100%;
  }
}

/* ===== CRM VOCALE ===== */

.mode-card-crm {
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.06));
}

.mode-card-crm:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.10));
}

.crm-section {
  margin-top: 24px;
}

.crm-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.crm-deals-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crm-deal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.crm-deal-card:hover {
  background: var(--bg-input);
  border-color: rgba(59, 130, 246, 0.3);
}

.crm-deal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.crm-deal-company {
  font-weight: 600;
  font-size: 14px;
}

.crm-deal-stage {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  color: #fff;
  white-space: nowrap;
}

.crm-deal-details {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.crm-deal-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.crm-deal-next {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

.crm-deal-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.crm-deal-date,
.crm-deal-interactions {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* CRM Detail Panel */

.crm-detail-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}

.crm-detail-panel.hidden {
  display: none;
}

.crm-drawer {
  max-height: 100dvh;
  overflow-y: auto;
}

.crm-detail-content {
  padding: 16px;
}

.crm-detail-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.crm-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.crm-detail-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 100px;
}

.crm-detail-row > span:last-child {
  font-size: 13px;
  text-align: right;
}

.crm-value-highlight {
  font-weight: 700;
  color: var(--success);
}

.crm-history-section {
  margin-top: 8px;
}

.crm-history-section h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.crm-history-entry {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.crm-history-entry:last-child {
  border-bottom: none;
}

.crm-history-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.crm-history-summary {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 6px;
}

.crm-history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.crm-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.crm-tag-warn {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.crm-history-note {
  font-size: 12px;
  margin-bottom: 2px;
}

.crm-good {
  color: var(--success);
}

.crm-improve {
  color: #fbbf24;
}

.crm-delete-btn {
  margin-top: 20px;
  width: 100%;
  padding: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.crm-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ===== AUDIO ANALYSIS ===== */

.audio-analysis-section {
  margin-top: 28px;
}

.audio-analysis-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.audio-analysis-icon {
  font-size: 28px;
  line-height: 1;
}

.audio-analysis-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.audio-analysis-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* Drop zone */
.audio-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.audio-drop-zone:hover,
.audio-drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(255, 107, 53, 0.05);
}

.audio-drop-zone svg {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.drop-zone-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.audio-file-label {
  display: inline-block;
}

.audio-file-btn {
  display: inline-block;
  padding: 8px 20px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.audio-file-btn:hover {
  background: var(--primary-light);
}

.drop-zone-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  opacity: 0.7;
}

/* Upload progress */
.audio-upload-progress {
  margin-top: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.upload-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.upload-filename {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.upload-status {
  font-size: 11px;
  color: var(--primary-light);
  font-weight: 500;
}

.upload-status.error {
  color: var(--danger);
}

.upload-status.done {
  color: var(--success);
}

.upload-progress-bar {
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

.upload-progress-fill.indeterminate {
  width: 30%;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); width: 30%; }
  50% { transform: translateX(150%); width: 30%; }
  100% { transform: translateX(-100%); width: 30%; }
}

/* Analysis cards list */
.audio-analyses-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.audio-analysis-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.audio-analysis-card:hover {
  border-color: var(--primary);
  background: rgba(255, 107, 53, 0.04);
}

.audio-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.audio-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-card-score {
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  min-width: 32px;
  text-align: center;
}

.audio-card-score.score-high {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.audio-card-score.score-mid {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.audio-card-score.score-low {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.audio-card-summary {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.audio-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.audio-card-duration {
  opacity: 0.7;
}

/* Analysis detail panel */
.audio-detail-panel {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200;
}

.audio-detail-drawer {
  max-width: 560px;
}

.audio-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.analysis-section {
  margin-bottom: 20px;
}

.analysis-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.analysis-score-big {
  text-align: center;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
}

.analysis-score-number {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}

.analysis-score-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.analysis-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.analysis-list li {
  font-size: 13px;
  color: var(--text);
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  line-height: 1.4;
}

.analysis-list li:last-child {
  border-bottom: none;
}

.analysis-list li::before {
  margin-right: 6px;
}

.analysis-list.strengths li::before { content: '\2713'; color: #22c55e; }
.analysis-list.objections li::before { content: '\26A0'; color: #f59e0b; }
.analysis-list.improvements li::before { content: '\279C'; color: #3b82f6; }
.analysis-list.suggestions li::before { content: '\1F4A1'; }

.analysis-tone {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  background: var(--bg-input);
  padding: 12px;
  border-radius: var(--radius-sm);
}

.analysis-moment {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.analysis-moment-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
}

.analysis-moment-eval {
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
}

.analysis-moment-eval.positivo {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.analysis-moment-eval.negativo {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.analysis-moment-eval.neutro {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.analysis-moment-suggestion {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
}

.analysis-transcript-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  width: 100%;
  text-align: center;
}

.analysis-transcript-toggle:hover {
  border-color: var(--primary);
  color: var(--text);
}

/* (transcript-text styles moved to bottom with audio refinement) */

.analysis-coach-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 8px;
}

.analysis-coach-btn:hover {
  opacity: 0.9;
}

.analysis-delete-btn {
  margin-top: 12px;
  width: 100%;
  padding: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.analysis-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Upload cancel button */
.upload-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-cancel-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.upload-cancel-btn:hover {
  color: var(--danger);
}

.upload-status.processing {
  color: #f59e0b;
}

/* Drop zone uploading state */
.audio-drop-zone.uploading {
  opacity: 0.5;
  pointer-events: none;
}

/* Audio player in detail panel */
.analysis-audio-player {
  margin-bottom: 20px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.audio-player-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.analysis-audio-el {
  width: 100%;
  height: 36px;
  border-radius: 8px;
  outline: none;
}

/* Style audio controls for dark theme (webkit) */
.analysis-audio-el::-webkit-media-controls-panel {
  background: var(--bg-card);
}

/* Has-audio indicator on cards */
.audio-card-has-audio {
  font-size: 12px;
  opacity: 0.6;
}

/* Transcript paragraphs */
.transcript-paragraph {
  margin-bottom: 12px;
  line-height: 1.7;
  font-size: 12px;
  color: var(--text-muted);
}

.transcript-paragraph:last-child {
  margin-bottom: 0;
}

.transcript-empty {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.6;
  font-style: italic;
}

.analysis-transcript-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
  padding: 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  scroll-behavior: smooth;
}

/* ===== NOTIFICATIONS SECTION ===== */

.notifications-section {
  margin-top: 28px;
}

.notifications-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.notifications-icon {
  font-size: 28px;
  line-height: 1;
}

.notifications-title {
  font-size: 16px;
  font-weight: 700;
}

.notifications-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  position: relative;
  transition: background 0.15s;
}

.notif-card:hover {
  background: var(--bg-input);
}

.notif-card.unread {
  border-left: 3px solid var(--primary);
}

.notif-type-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
}

.notif-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.notif-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.7;
}

.notif-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
  margin-left: 6px;
}

.notif-badge-digest { background: #2563eb33; color: #60a5fa; }
.notif-badge-session { background: #16a34a33; color: #4ade80; }
.notif-badge-spaced { background: #d9770633; color: #fbbf24; }

.notif-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.notif-delete-btn:hover {
  opacity: 1;
  color: var(--danger);
}

.notif-empty {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 16px 0;
}

/* ===== WHATSAPP SETTINGS PANEL ===== */

.whatsapp-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.whatsapp-drawer {
  max-width: 420px;
}

.whatsapp-settings-content {
  padding: 16px;
  overflow-y: auto;
  max-height: calc(100dvh - 60px);
}

.whatsapp-info {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.whatsapp-info em {
  color: #fbbf24;
  font-style: normal;
}

.ws-field {
  margin-bottom: 16px;
}

.ws-field > label:not(.ws-toggle-label) {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.ws-field input[type="tel"],
.ws-field input[type="time"] {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.ws-field input[type="time"] {
  width: auto;
}

.ws-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.ws-toggle-label input[type="checkbox"] {
  display: none;
}

.ws-toggle-switch {
  width: 38px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.ws-toggle-switch::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.ws-toggle-label input:checked + .ws-toggle-switch {
  background: var(--primary);
}

.ws-toggle-label input:checked + .ws-toggle-switch::after {
  transform: translateX(16px);
}

.ws-sub-field {
  margin-top: 8px;
  margin-left: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.ws-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-left: 48px;
}

.ws-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

.ws-section-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.ws-save-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

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

.ws-save-status {
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
  color: var(--success);
}

.ws-test-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ws-test-btn {
  flex: 1;
  min-width: 140px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.ws-test-btn:hover {
  background: var(--bg-card);
  border-color: var(--primary);
}
