/* ==========================================================================
   Work Reset AI - CBT Mental Coach Stylesheet
   Theme: Warm, Gentle, Healing & Professional Counseling
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Zen+Maru+Gothic:wght@400;500;700&display=swap');

/* --- Design Tokens --- */
:root {
  /* Colors */
  --bg-app: #f9f7f4;
  --bg-gradient-top: #fbf9f6;
  --bg-gradient-bottom: #f2ede6;
  
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-bg-glass: rgba(255, 255, 255, 0.78);
  --card-border: rgba(226, 220, 210, 0.65);
  --card-shadow: 0 12px 32px -4px rgba(78, 64, 52, 0.08), 0 4px 12px -2px rgba(78, 64, 52, 0.04);
  --card-shadow-hover: 0 20px 40px -4px rgba(78, 64, 52, 0.12);

  /* Primary Palette (Sage & Forest) */
  --primary-color: #436e59;
  --primary-hover: #375b49;
  --primary-light: #e8f1ec;
  --primary-glow: rgba(67, 110, 89, 0.25);

  /* Secondary & Accents */
  --accent-terracotta: #cf6f56;
  --accent-terracotta-light: #fbeee9;
  --accent-calm-blue: #5b8296;
  --accent-warm-gold: #c69255;
  --accent-gold-light: #fcf6ee;

  /* Neutrals & Text */
  --text-primary: #2c3330;
  --text-secondary: #5e6863;
  --text-muted: #8d9892;
  --text-on-primary: #ffffff;

  --border-light: #eae3da;
  --border-focus: #436e59;

  /* Typography */
  --font-family: 'Zen Maru Gothic', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-number: 'Plus Jakarta Sans', sans-serif;

  /* Radii & Transitions */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --transition-smooth: all 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Coach-specific accents keep the shared layout familiar while making the
   selected practice visible at a glance. */
body.coach-defusion {
  --primary-color: #5b7181;
  --primary-hover: #465b69;
  --primary-light: #e8f0f4;
  --primary-glow: rgba(91, 113, 129, 0.24);
  --border-focus: #5b7181;
}

body.coach-socrates {
  --primary-color: #7b6a4b;
  --primary-hover: #62543b;
  --primary-light: #f3eee4;
  --primary-glow: rgba(123, 106, 75, 0.24);
  --border-focus: #7b6a4b;
}

body.coach-separation {
  --primary-color: #9a6250;
  --primary-hover: #7b4d3f;
  --primary-light: #f7ece7;
  --primary-glow: rgba(154, 98, 80, 0.24);
  --border-focus: #9a6250;
}

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

html, body {
  height: 100%;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: linear-gradient(175deg, var(--bg-gradient-top) 0%, var(--bg-app) 50%, var(--bg-gradient-bottom) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}

/* --- Layout Container --- */
.app-container {
  display: flex;
  flex-direction: column;
  max-width: 900px;
  height: 100vh;
  margin: 0 auto;
  padding: 16px;
  position: relative;
}

@media (max-width: 768px) {
  .app-container {
    padding: 8px;
    height: 100dvh;
  }
}

/* --- Top Counselor Header --- */
.counselor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  box-shadow: var(--card-shadow);
  margin-bottom: 12px;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.counselor-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-actions,
.coach-language-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.coach-language-switch {
  color: var(--text-muted);
  font-family: var(--font-number);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.coach-language-switch .language-link {
  border-radius: 0.35rem;
  color: var(--text-secondary);
  padding: 0.2rem 0.25rem;
  text-decoration: none;
}

.coach-language-switch .language-link:hover,
.coach-language-switch .language-link:focus-visible,
.coach-language-switch .language-link[aria-current="page"] {
  background: var(--primary-light);
  color: var(--primary-color);
}

.avatar-wrapper {
  position: relative;
  width: 52px;
  height: 52px;
}

.counselor-avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--primary-light);
  box-shadow: 0 4px 12px rgba(67, 110, 89, 0.15);
}

.status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background-color: #38a169;
  border: 2px solid #ffffff;
  border-radius: var(--radius-full);
  box-shadow: 0 0 0 2px rgba(56, 161, 105, 0.2);
  animation: pulse-dot 2.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 161, 105, 0.4); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(56, 161, 105, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 161, 105, 0); }
}

.counselor-info {
  display: flex;
  flex-direction: column;
}

.counselor-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.counselor-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.counselor-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary-color);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.counselor-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reset-session-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.reset-session-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}

.reset-session-btn:focus-visible {
  outline: 3px solid var(--primary-glow);
  outline-offset: 2px;
}

/* --- CBT Progress Bar --- */
.progress-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px -2px rgba(78, 64, 52, 0.04);
  flex-shrink: 0;
}

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

.progress-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-counter {
  font-family: var(--font-number);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary-color);
  background: var(--primary-light);
  padding: 1px 8px;
  border-radius: var(--radius-full);
}

.progress-track {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  position: relative;
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.step-bar-segment {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background-color: var(--border-light);
  transition: var(--transition-smooth);
}

.step-node.completed .step-bar-segment {
  background-color: var(--primary-color);
}

.step-node.active .step-bar-segment {
  background: linear-gradient(90deg, var(--primary-color), #7bb598);
  box-shadow: 0 0 8px var(--primary-glow);
  animation: pulse-bar 2s infinite ease-in-out;
}

@keyframes pulse-bar {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.6; }
}

.step-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.step-node.active .step-label {
  color: var(--primary-color);
  font-weight: 700;
}

.step-node.completed .step-label {
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .step-label {
    display: none;
  }
  .progress-card {
    padding: 8px 12px;
  }
}

/* --- Chat Container --- */
.chat-window {
  flex: 1;
  background: var(--card-bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

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

/* Custom Scrollbar */
.messages-list::-webkit-scrollbar {
  width: 6px;
}
.messages-list::-webkit-scrollbar-track {
  background: transparent;
}
.messages-list::-webkit-scrollbar-thumb {
  background: rgba(141, 152, 146, 0.3);
  border-radius: 4px;
}
.messages-list::-webkit-scrollbar-thumb:hover {
  background: rgba(141, 152, 146, 0.5);
}

/* --- Message Bubbles --- */
.message-row {
  display: flex;
  gap: 12px;
  max-width: 86%;
  animation: message-fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes message-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-row.counselor {
  align-self: flex-start;
}

.message-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--card-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.msg-bubble-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.msg-bubble {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 0.94rem;
  line-height: 1.7;
  word-break: break-word;
  position: relative;
}

.msg-action-container {
  display: flex;
  width: 100%;
  max-width: 100%;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(67, 110, 89, 0.2);
}

.inline-breathe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  padding: 9px 16px;
  border: 1px solid rgba(67, 110, 89, 0.28);
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary-color);
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.inline-breathe-btn svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.inline-breathe-btn:hover {
  background: #d9e9df;
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(67, 110, 89, 0.18);
}

.inline-breathe-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(67, 110, 89, 0.14);
}

.inline-breathe-btn:focus-visible {
  outline: 3px solid var(--primary-glow);
  outline-offset: 2px;
}

.counselor .msg-bubble {
  background: #ffffff;
  color: var(--text-primary);
  border-top-left-radius: 4px;
  border: 1px solid rgba(230, 224, 215, 0.8);
  box-shadow: 0 4px 14px -2px rgba(78, 64, 52, 0.05);
}

.user .msg-bubble {
  background: var(--primary-color);
  color: #ffffff;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(67, 110, 89, 0.22);
}

.msg-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  align-self: flex-end;
  margin-top: 2px;
}

.user .msg-time {
  align-self: flex-start;
}

/* Crisis Guardrail Alert Card */
.crisis-alert-card {
  background: #fff8f6;
  border: 1.5px solid #f1b3a3;
  border-radius: var(--radius-md);
  padding: 16px;
  color: #8c2a16;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(207, 111, 86, 0.12);
}

.crisis-alert-card h4 {
  font-size: 0.96rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.crisis-alert-card ul {
  list-style: none;
  margin-top: 8px;
}

.crisis-alert-card li {
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.crisis-alert-card a {
  color: #c53030;
  font-weight: 700;
  text-decoration: underline;
}

/* Summary Sheet Card (CBT Phase 7) */
.summary-sheet {
  background: linear-gradient(145deg, #ffffff 0%, #f6f9f7 100%);
  border: 1.5px solid #a3c9b7;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 12px;
  box-shadow: 0 8px 24px -4px rgba(67, 110, 89, 0.14);
}

.summary-sheet-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #d1e3da;
}

.summary-sheet-header h3 {
  font-size: 1.05rem;
  color: var(--primary-color);
  font-weight: 700;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

.summary-item {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.summary-item.full-width {
  grid-column: 1 / -1;
  background: var(--primary-light);
  border-color: #b7dac9;
}

.summary-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.summary-item.full-width .summary-label {
  color: var(--primary-color);
}

.summary-value {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* Typing Indicator */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 12px 18px;
  background: #ffffff;
  border-radius: 18px;
  border-top-left-radius: 4px;
  border: 1px solid rgba(230, 224, 215, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.4;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* --- Suggestion / Quick Chips --- */
.quick-replies-container {
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  border-top: 1px solid rgba(230, 224, 215, 0.6);
  background: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.quick-replies-container::-webkit-scrollbar {
  height: 4px;
}
.quick-replies-container::-webkit-scrollbar-thumb {
  background: rgba(141, 152, 146, 0.2);
  border-radius: 2px;
}

.quick-chip {
  background: #ffffff;
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quick-chip:hover {
  background: var(--primary-light);
  color: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

/* --- Input Area --- */
.input-panel {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.input-box-wrapper {
  flex: 1;
  position: relative;
  background: var(--bg-app);
  border: 1.5px solid var(--card-border);
  border-radius: 20px;
  padding: 8px 14px;
  transition: var(--transition-smooth);
}

.input-box-wrapper:focus-within {
  border-color: var(--border-focus);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.chat-input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-family);
  font-size: 0.94rem;
  color: var(--text-primary);
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  display: block;
}

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

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-spring);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(67, 110, 89, 0.25);
}

.send-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: scale(1.06);
  box-shadow: 0 6px 16px rgba(67, 110, 89, 0.35);
}

.send-btn:disabled {
  background: var(--text-muted);
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.send-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ==========================================================================
   Onboarding Overlay & Breathing Guide Styles
   ========================================================================== */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(38, 44, 41, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 16px;
  overflow-y: auto;
}

.onboarding-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.onboarding-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 24px 60px -8px rgba(35, 45, 40, 0.28), 0 8px 24px -4px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(226, 220, 210, 0.8);
  transform: scale(0.95);
  transition: var(--transition-spring);
  position: relative;
  display: flex;
  flex-direction: column;
}

.onboarding-overlay.active .onboarding-card {
  transform: scale(1);
}

/* Onboarding Header */
.onboarding-header {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.onboarding-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.onboarding-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(67, 110, 89, 0.2);
  display: block;
}

.onboarding-header-text {
  display: flex;
  flex-direction: column;
}

.onboarding-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary-color);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 4px;
}

.onboarding-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.onboarding-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

/* Onboarding Intro & Disclaimer */
.onboarding-intro {
  margin-bottom: 20px;
  text-align: left;
}

.onboarding-intro-desc {
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0 0 10px 0;
}

.onboarding-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  background: #fbf9f6;
  border-left: 3px solid #dcd5cc;
  padding: 8px 12px;
  border-radius: 4px;
  margin: 0;
}

/* Breathing Area Panel */
.onboarding-breathing-panel {
  background: #faf8f5;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  margin-bottom: 20px;
  position: relative;
}

.breathing-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}

.breathing-cycle {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-color);
  background: var(--primary-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.breathing-countdown {
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-number);
  color: var(--text-secondary);
}

.breathing-circle-container {
  width: 170px;
  height: 170px;
  margin: 0 auto 16px auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breathing-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, #7cb598 0%, #436e59 100%);
  box-shadow: 0 0 32px rgba(67, 110, 89, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 1s ease;
}

.breathing-circle-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px dashed rgba(67, 110, 89, 0.3);
}

.breathing-text {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.05rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.breathing-instructions {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  min-height: 2.8em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Status / Loading / Error Area */
.onboarding-status-area {
  margin-bottom: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.onboarding-status-area:empty {
  display: none;
}

.status-loading-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--primary-color);
  font-weight: 600;
  padding: 10px;
  background: var(--primary-light);
  border-radius: var(--radius-md);
}

.status-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(67, 110, 89, 0.25);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.status-error-box {
  background: #fdf2f0;
  border: 1px solid #f5c6cb;
  color: #a83232;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-error-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-retry {
  background: #a83232;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-retry:hover {
  opacity: 0.9;
}

/* Actions Button Group */
.onboarding-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-primary-action {
  width: 100%;
  padding: 13px 20px;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(67, 110, 89, 0.28);
}

.btn-primary-action:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

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

.btn-success-action {
  width: 100%;
  padding: 14px 20px;
  background: #2e7d56;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 6px 18px rgba(46, 125, 86, 0.35);
  animation: pulse-attention 2s infinite ease-in-out;
}

@keyframes pulse-attention {
  0%, 100% {
    box-shadow: 0 6px 18px rgba(46, 125, 86, 0.35);
  }
  50% {
    box-shadow: 0 8px 24px rgba(46, 125, 86, 0.6);
  }
}

.btn-success-action:hover:not(:disabled) {
  background: #246445;
  transform: translateY(-1px);
}

.btn-success-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  animation: none;
}

.btn-secondary-action {
  width: 100%;
  padding: 11px 18px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-action:hover:not(:disabled) {
  background: #f7f5f2;
  color: var(--text-primary);
  border-color: #dcd5cc;
}

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

.btn-dev-mode {
  width: 100%;
  padding: 8px 12px;
  background: #f1f3f5;
  color: #555e68;
  border: 1px dashed #ced4da;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.btn-dev-mode:hover:not(:disabled) {
  background: #e9ecef;
  color: #212529;
  border-color: #adb5bd;
}

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

/* Background inactivity during onboarding */
body.onboarding-open .app-container {
  filter: blur(1px);
  pointer-events: none;
  user-select: none;
}

/* Accessibility Focus Visible */
.btn-primary-action:focus-visible,
.btn-success-action:focus-visible,
.btn-secondary-action:focus-visible,
.btn-dev-mode:focus-visible,
.btn-retry:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .onboarding-card {
    transition: none !important;
    transform: none !important;
  }
  .breathing-circle {
    transition: none !important;
    transform: none !important;
  }
  .btn-success-action {
    animation: none !important;
  }
  .status-spinner {
    animation: none !important;
    border-top-color: var(--primary-color);
  }
}

/* Responsive adjustments for mobile */
@media (max-width: 480px) {
  .onboarding-card {
    padding: 24px 18px;
    border-radius: var(--radius-lg);
  }
  .onboarding-avatar {
    width: 50px;
    height: 50px;
  }
  .onboarding-title {
    font-size: 1.15rem;
  }

  .counselor-header {
    align-items: flex-start;
    padding: 10px 12px;
  }

  .header-actions {
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .breathing-circle-container {
    width: 150px;
    height: 150px;
  }
  .breathing-circle {
    width: 96px;
    height: 96px;
  }
}
